Search

Module: Editor

Version: 2.2.1 +

User: Developer

Object Type: Action Object

 

Description

With an Action you can perform an action on another object. The kind of Action that can be executed depends on the object that it refers to. Actions can for example be used to change the properties of an object, to execute a loop etc. Actions can also be used to 'group together' a set of other Action objects. This is useful if this set has to be executed more than once on a website. A reference to the Action is then sufficient for the whole set to be executed.

Properties

Condition

This property indicates under which condition the Action is to be executed. If nothing is entered the Action will always be executed. If a condition has been filled in, the Action will only be executed if the Condition is 'True'. The condition can be a Fixed, a Formula or a Reference to another object of type Boolean. Note that if the Action has a condition and is used as a loop, the condition will be verified before the loop will start. This means that if the condition is 'False' the entire loop is not executed. If a loop is to be constructed in which every step is depending on a condition then first an Action has to be made containing the loop and inside it a second Action containing the condition. Whether or not to execute the second Action is then determined in every step of the loop.

DebugLogMode (from version 4.1)

Indicates the level of detail of debug information that is logged when running a Futurama application (website, webservice, console application) to the trace, a logfile, a database etc. The possible values are:

  • None: no debug information is logged
  • Simple: only basic information is given
  • Extended: in addition to the information in the Simple mode the values of all the properties of the object are shown

IsPublic

Possible values are True or False. If the value is False, then the object can only be used within the document where it is created. If the value is True, then also from other Futurama documents can be referred to this object. This means that changes in the object also affect the document in which is referred to this object. If the value is True and you attempt to move or delete the object, a warning will be given. To limit these warnings to a minimum it is recommended to set IsPublic to True only when necessary.

RepeatData

An Action can be executed more than once as part of a loop. It can only refer to a UserTable, DataTable or Range. RepeatData contains a table with all the elements that need to be used in the loop. These elements are subsequently assigned to the UserVariable defined in the RepeatTarget property.

RepeatTarget

This property is used in conjunction with RepeatData. It can only refer to a UserVariable. The RepeatTarget property can be considered as the counter of a loop. During the execution of the loop it subsequently gets assigned all the values in the table defined in the RepeatData property.

TargetControl

In this property the object needs to be defined on which the Action has to be executed. This can be any object in the Futurama Document.

XmlName

The name of the object as it is shown in the source of the website. By default the XmlName is equal to the name given in the property (Name) with spaces replaced by underscores, but you are free to change it.

(Name)

The name of the object.

Comment

Here a comment can be entered. For example a short description of the object.

ID

The unique identification number of the object. This number is automatically generated by Futurama on the moment of creation. This number can be used when searching for a certain object in the Find Window. 

Examples

Example 1

In this example it is shown how an Action can be used to change the property of another object

Download

Download the Futurama Document action example1.

Description

  1. Open the XML-document which is contained in the zip-file in the Futurama Editor (Version 4.2.1 or later).
  2. The Document contains two Actions and one WebPage containing a WebPanel. In the property TargetControl of the two Actions it can be seen that the WebPanel is the target. The value of a property of the WebPanel can be changed by declaring an object within the Action and naming it identically to the name of the property that is to be changed.
  3. In the example the property Visible of the WebPanel had to be changed. Therefore a Fixed was defined named Visible in both Actions.
  4. The Type of the Fixeds has to be the same as the type of the property. Because the property Visible is a boolean, the Fixeds therefore also have to be of Type boolean.
  5. Finally the Fixeds both were assigned the value (in the Text property) that has to be passed on to the property. The Fixed in the Action "Set WebPanel visible" therefore got value True and the Fixed in the Action "Set WebPanel invisible" got value False.
  6. Test the functioning of the Actions by selecting an Action and do a rightclick. Select Debug | Execute. Verify that the property Visible of the WebPanel indeed obtains the value of the Fixed after executing an Action.
  7. Note that if the name of the object within the Action does not correspond with the name of a property of the object specified in the property TargetControl of the Action, executing the Action will result in a Warning stating that that particular property could not be set. This can be tried by changing the name of one of the Fixeds to e.g. "Visibleee" and executing the Action.
  8. The same warning occurs when the type of the object within the Action does not correspond with the type of a property of the object specified in the property TargetControl of the Action.

Example 2

In this example an Action is used to create a loop which increases a number a number of times.

Download

Download the Futurama Document action example2.

Description

  1. Open the XML-document which is contained in the zip-file in the Futurama Editor (Version 4.2.1 or later).
  2. In the Document an Action can be seen which is used to run a loop. The number of times that it is supposed to run is defined by the number of elements in the table in the property RepeatData. This property refers to Range which consists of five elements. So the loop is run 5 times.
  3. As counter the UserVariable 'Counter' is defined in the property RepeatTarget. During the loop 'Counter' will be assigned the value of each element in 'Range' subsequently.
  4. During every step of the loop the ChangeValue object 'Increase Sum' within the Action is executed. This ChangeValue takes the value of the UserVariable 'Sum' and increases it by 2.
  5. Verify that the property TestValue of the UserVariable 'Sum' has value 0.
  6. Because the loop will run 5 times it is expected that after the loop the value will be 2+2+2+2+2=10.
  7. Do a rightclick on the Action and choose Debug | Execute.
  8. Verify the value of 'Sum'. The TestValue property is indeed 10.
  9. Note that if the loop is again executed the value of 10 will be the startvalue. By doing a rightclick on 'Sum' and selecting Debug | Clear Testvalues the value can be set back to 0.

Example 3

This example is an advanced version of example 1. Some objects (for example the GraphConverter) have properties containing sub properties. This example shows how to set these sub properties. Furthermore in this example is shown how to set the properties of the Series of a GraphConverter.

Download

Download the Futurama Document action example3.

Description

  1. Open the XML-document which is contained in the zip-file in the Futurama Editor (Version 5.3.2 or later).
  2. The Document contains an Action and a WebPage containing a GraphConverter. In the property TargetControl of the Action it can be seen that the GraphConverter is the target. The value of a property of the GraphConverter can be changed by declaring an object within the Action and naming it identically to the name of the property that is to be changed.
  3. In the example three kinds of properties of the GraphConverter have to be changed. This is the property Comment, sub property Visible of the property Legend and the sub property Comment within the property Series.
  4. For these properties Fixeds are defined within the Action object.
  5. The Fixed ‘Comment’ sets the property Comment of the GraphConverter. The Fixed has value ‘This is a comment’.
  6. The Fixed ‘Legend:Visible’ sets the property Visible that is a child of the property Legend. ‘:’ is used in the Fixed-name because the property is a level deeper. The Fixed has value ‘False’.
  7. The Fixed ‘series1:Comment’ within the Node ‘Series’ sets the property Comment of the member series1 within the property Series. When the property to set is within the property Series, than a Node with name ‘Series’ has to be defined within the Action. Within the Node an object has to be defined with name ‘[member]:[property]’. The Fixed has value ‘Series 1 Comment’
  8. The Type of the Fixeds has to be the same as the type of the property. The two properties Comment have type string and the property Visible has type boolean.
  9. Test the functioning of the Actions by selecting the Action and do a rightclick. Select Debug | Execute. Verify that the properties of the GraphConverter indeed obtains the value of the Fixeds after executing the Action.
  10. Note that if the name of the object within the Action does not correspond with the name of a property of the object specified in the property TargetControl of the Action, executing the Action will result in a warning stating that a particular property could not be set. This can be tried by changing the name of one of the Fixeds to e.g. "Commenttt" and executing the Action.
  11. The same warning occurs when the type of the object within the Action does not correspond with the type of a property of the object specified in the property TargetControl of the Action.

Related Topics

- UserVariable

- UserTable

- DataTable

- Range

- ChangeValue

Relevant Tutorials

- Working with Actions in Futurama: This tutorial shows how to use Actions to change the properties of an object.

- Using XSLT to display data: This tutorial shows how Actions are used when making use of XSLT to show data in a website.

- Working with Actions in Futurama: This tutorial shows how Actions can be used in conjunction with DocConverter to generate documents .

 

Updated: 2016-02-02