Events, conditions, and actions (ECA) can be added as an ECA rule to widgets to enable actions to be invoked on an XUI page. For example, you might want to add ECA rules if you want different functions to be hidden or displayed on a page depending on the selections or the data that has been entered by a user.
You can add ECA rules to widgets by using the ECA editor, which is in the Rules tab in the Properties view of widgets in the XUI editor.
The ECA editor in the XUI editor
Every ECA rule that you create must have a widget bound to it. If you create an ECA rule with a widget bound to it but you then delete the widget at a later date, the Delete Widget Confirmation window is displayed, as shown below, which asks whether you want to delete the widget. If you click Yes to delete the widget, you must then manually delete the ECA rule that was bound to the widget.
This topic describes how to configure the conditions part of an ECA rule for widgets.
A condition must be specified for every ECA rule. A condition is the part of an ECA rule that performs a logical test that causes the actions that are defined in the "Actions if true" part of the ECA editor to be carried out if it evaluates to true. If the condition part of an ECA rule evaluates to false, the actions that are defined in the "Actions if false" part of the ECA editor are carried out. For information on how to define actions in the ECA editor for an ECA rule, see Defining actions for an ECA rule.
1 Select Condition type and define the entire Condition expression according to the selected type.
ECA Condition has six kinds of Condition types, including No Condition, Widget Function, Widget Property and three Common Condition types (Expression, Global Function and Common ).
▪ No Condition: execute the true action by default.
▪ Widget Function: set the function of a widget as the logical test.
In most situations, the widget function returns a Boolean value. The system will then call either a true or a false action according to the Boolean value.
▪ Widget Property: set the property of a widget as the logical test.
This condition will return a Boolean value. The system will call true or false action according to the Boolean value.
▪ Expression: logical or relational operation defined by users.
Steps:
▪ Select one of the operators to define Expression type.
▪ Define left and right input elements according to Expression type. Click the 'browse' button on the right. In the pop-up Expression editor, select one of the supported elements and assign the value.
▪ Global function: common data manipulation, such as compare and concatenate provided by UDTT.
Steps:
▪ Expand the functions tree to select the Global function. You could use the search bar to find the Global function you want and use Description label to know better about the function. See Global functions for detailed information about the function.
▪ Define each parameter. Click the 'browse' button on the right. In the pop-up Expression editor, select one of the supported elements and assign the value.
▪ Common : common condition which has been defined by users in Condition Dictionary.
Steps:
▪ Select the Common from the List panel.
▪ Define each parameter. Click the 'browse' button on the right. In the pop-up Expression editor, select one of the supported elements and assign the value.
2 Click 'Apply value' button to save the defined condition.
Before you add actions to an ECA rule, you must add at least one event and a condition to the ECA rule. For information on how to add events to an ECA rule, see Adding events to an ECA rule. For information on how to configure conditions for an ECA rule, see Defining conditions for an ECA rule.
The action part of an ECA rule is the action that is invoked on a widget after the conditions part of an ECA rule has been evaluated. In the ECA editor, you can configure actions for situations in which the condition evaluates to true, and you can configure actions for situations in which the condition evaluates to false. The steps that are required to configure an action whether the condition is true and the condition is false are the same.
When defining ECA actions, user could either create a new action or reuse an already available Action Group. Action Group is a group of actions that have been identified as common actions and that may have been defined using a specific editor or while creating an ECA rule. For more information, see Creating Action Groups.
Procedure
1 In the Actions panel of the Rules tab of the Properties view, click the Add icon.
The "Please select a value" window opens.
2 Select either Invoke Widget Function or Set Widget Property or Invoke Action Group depending on the action that you want to be invoked.
▪ If you select Invoke Widget Function, select a widget in the Invoke Widget Function panel, and then select a function in the right panel. Click OK.
▪ If you select Set Widget Property, select a widget in the Set Widget Property panel, and then select a widget property in the right panel. Click the Browse icon of the Set Property Value field to configure a value for the property. Click OK.
▪ If you select Invoke Action Group, select an Action Group in the Invoke Action Grouppanel and click OK.
Action Groups enable users to reuse a set of actions. This section describes two ways to create Action Groups.
Often when setting an ECA rule, the user realizes that a set of Actions would be reusable. Action Group is created to simplify the process, which shares the same way of defining Actions and gets directly referenced by an ECA rule. For more information, see Defining actions for an ECA rule. One Action Group could also reference to another Action Group.
This section describes how to prompt existing Actions into Action Group for reusability.
The Actions that may be reused in another ECA can be selected and then prompted into a new Action Group.
1 In the Actions panel of the Rules tab or Action Group tab, select multiple actions from the list of actions with the help of CTRL or SHIFT.
2 Click the button to launch the creation wizard.
3 In the creation wizard, enter the Action Group name and description and configure whether to reuse Condition.
▪ Name: The name of Action Group cannot start with numbers or include space and special characters.
▪ Description: To describe the function or usage of Action Group.
▪ Reuse Condition: if there is a condition already defined in the ECA rules associated to these actions, the condition can be also copied to the new Action Group by checking the ‘Reuse Condition’ checkbox.
4 Press OK.
The Action Group is created. And the Actions selected in the Actions list is automatically replaced by the new Action Group. If the selected actions are not in sequence, then the Action Group will replace the first selected action.