Development tools : XUI editor : Editing an XUI page : Editing the properties of the XUI widgets : Setting ECA rules to widgets
  
Setting ECA rules to widgets
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
This graphic is described in the surrounding text.
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 graphic is described in the surrounding text.
See
Adding events to an ECA rule
Defining conditions for an ECA rule
Defining actions for an ECA rule
Creating Action Groups
See also
Editing the properties of the XUI widgets
Adding events to an ECA rule
The event part of an ECA rule is initiated by a widget, and the event then triggers the invocation of the rule.
In the XUI editor, a list of events are available for you to select to create the event part of an ECA rule.
More than one event can be added to an ECA rule of a widget. If more than one event is added to an ECA rule, each event must have a unique name.
To add an event to an ECA rule
1 In the XUI editor, click the widget that you want to add an event to.
2 In the Properties view of the widget that you selected, click the Rules tab.
This graphic is described in the surrounding text.
3 In the Rules List panel of the Rules tab, click the Add icon.
The "Add a rule" window is opened.
This graphic is described in the surrounding text.
4 In the Name field of the "Add a rule" window, enter a name for the event, and then click the Add icon.
The "Please select an event" window opens.
This graphic is described in the surrounding text.
5 Select the widget that you are creating the ECA rule for, and then select an event. Click OK.
An event is added to the ECA rule.
After completing this task
After you add events to an ECA rule, you should define conditions for the ECA rule. See Defining conditions for an ECA rule.
See also
Setting ECA rules to widgets
Defining conditions for an ECA rule
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.
This graphic is described in the surrounding text.
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.
This graphic is described in the surrounding text.
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 graphic is described in the surrounding text.
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.
This graphic is described in the surrounding text.
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.
This graphic is described in the surrounding text.
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.
This graphic is described in the surrounding text.
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.
See also
Setting ECA rules to widgets
Defining actions for an ECA rule
Prerequisite
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.
This graphic is described in the surrounding text.
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.
This graphic is described in the surrounding text.
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 This graphic is described in the surrounding text. of the Set Property Value field to configure a value for the property. Click OK.
This graphic is described in the surrounding text.
If you select Invoke Action Group, select an Action Group in the Invoke Action Grouppanel and click OK.
This graphic is described in the surrounding text.
See also
Setting ECA rules to widgets
Creating Action Groups
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.
There are two ways to create Action Groups:
See
Creating Action Group by Action Group Editor
Prompting a set of Actions into Action Group
See also
Setting ECA rules to widgets
Creating Action Group by Action Group Editor
By Action Group Editor, you could define new Action Groups and edit them.
This section describes how to use Action Group Editor to create and configure Action Group.
Creating Action Group
1 Click Action Group tab to launch Action Group Editor.
This graphic is described in the surrounding text.
2 Press This graphic is described in the surrounding text. button to launch the creation wizard.
3 In the creation wizard, enter the Action Group name and description.
This graphic is described in the surrounding text.
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.
4 Press OK. The Action Group is created and displayed in the Action Group list.
Configuring Action Group
1 Then you can define conditions and actions for the Action Group. Set conditions for an Action Group, see Defining conditions for an ECA rule.
2 Two options are provided to set actions for an Action Group.
Define new actions: see Defining actions for an ECA rule.
Reuse existing actions: see the next step.
3 In the Actions panel of the Rules tab, select multiple actions from the list of actions with the help of CTRL or SHIFT.
4 Copy or cut the set of actions and paste it to the Actions panel of an Action Group that have been previously created.
In this way, the condition associated with these Actions, if any, would not be added into the Action Group. You should manually define it.
This graphic is described in the surrounding text.
Additionally, you can also prompt existing Actions into a Action Group and then use Action Group editor to edit that Action Group.
See also
Creating Action Groups
Prompting a set of Actions into 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 This graphic is described in the surrounding text. button to launch the creation wizard.
This graphic is described in the surrounding text.
3 In the creation wizard, enter the Action Group name and description and configure whether to reuse Condition.
This graphic is described in the surrounding text.
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.
This graphic is described in the surrounding text.
See also
Creating Action Groups