This topic describes how to configure the conditions part
of an ECA rule for widgets.
Figure 1. The Condition panel
of the ECA editor
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.
As shown in
Figure 1,
the following conditions are available for selection in the
Rules tab
of the XUI editor:
No Condition
If No
Condition is selected, the systems executes the true action
by default.
Widget Function
Each widget has
a function. The
Widget Function option allows
you to specify the function that is bound to a widget. In most situations,
the widget function returns a Boolean value. The system will then
call either a true or a false action depending on the value that is
returned.
Note: If you specify a function for a widget, you must click
Apply
Value in the
Conditions panel to
bind the function to the widget.
Widget Property
The
Widget
Property option allows you to configure a condition to
the property of a widget. This condition is the same as the Widget
Function condition type, there will be a return value. This condition
will return two value types : String and Boolean. Usually, system
will call true or false action according to the Boolean value. But
now there is a string type return value, so how the system calls relative
action. Only Boolean type action existed, not String type action.
In view of this situation, the system will execute the true action
by default, once the condition return value is string type.
Note: After
you select a property in the Widget Property panel,
you must click Apply Value to configure a condition
for the widget property.

Expression
The outer operator is
arithmetic, which can include only the following operators in the
expression: addition, subtraction, multiplication and division. However,
if you select a logical operator in outer expression, logical and
arithmetic operators are displayed in the expression.
As an example, you can use an expression in the condition
part of the ECA editor if you want to create a rule in which a text
box cannot be empty when it is being filled by a user. In this example,
you would create a rule in which a text box cannot be empty by doing
the following steps:
- In the Condition drop-down list, select Expression.
- In the Left field of the Expression panel,
click the Browse icon. The "Please
select a value" window is opened.
- In the drop-down list in the "Please select a value"
window, select Widget Property. The Widget
Property panel is displayed.
- In the Widget Property panel, select the
text box widget, and then select value. Click OK.
- In the Operator drop-down list of the Expression panel,
select !=.
- In the Right field of the Expression panel,
click the Browse icon. The "Please
select a value" window is opened.
- In the drop-down list in the "Please select a value"
window, select Constant. The Constant panel
is displayed.
- In the Value field of the Constant panel,
enter an opening quotation mark ("). Click OK.
- In the Condition panel, click Apply
Value.