You can apply conditions to a behavior that determine if it is applied, based on the view data.
Note:
The level at which you create a behavior (at the data element level, task level, or order level) determines where you access and configure the behavior's properties. See "Creating New Behaviors" for more information.To define behavior conditions:
From the Design perspective, right-click a behavior and select Open Properties View.
The Behaviors Properties view is displayed.
Click the Conditions tab.
The Behaviors Properties view Conditions tab is displayed.
Click Add.
A new condition is displayed in the Condition field with the default name Condition. The default XPath expression true() appears in the XPath Expression field.
Select the default condition name to change the default name.
Select the default XPath expression to replace it or modify it.
Click Remove to delete a selected condition.
About Behavior Condition Properties
Behaviors Properties View Conditions Tab
You can apply conditions to any behavior to determine the conditions under which the behavior should apply. You can add conditions as XPath expressions against which the behavior can run a Boolean compare. If the Boolean compare returns true, the behavior is applied.
For example, to associate a behavior with a postal code field in a Web client to target all customers in a specific region, you might apply the condition:
../postal_code = '95419'
You can select a data node from the Order Template tab (when working in the Order editor) or from the Task Data tab (when working in a Task editor) and drag the selected data node into the XPath Expressions field to define the XPath expression. To drag a data node into the Properties view Conditions tab, press and hold the Alt key before you select and drag the data node to the XPath Expressions field.
Note:
XPath uses path expressions to select data nodes in XML documents. A path expression with a single dot (.) represents the current node. Two dots (..) represents the parent of the current node. A slash (/) represents the root node.XPath and XQuery fields are limited to 4000 characters.
When no condition is defined for the behavior, the OSM server will always apply the behavior. When you define multiple conditions for the behavior, all conditions must evaluate to true for the OSM server to apply the behavior.
Defining Constraint Behavior Condition Properties
When defining conditions for Constraint behaviors, you specify the conditions that must be satisfied to avoid triggering the behavior. If any one of the conditions defined for the Constraint behavior are not met (those that evaluate to false), the OSM server triggers the constraint and displays the appropriate message to the user, based on the severity level. If no conditions are specified, the constraint will not be triggered.
Note:
See OSM Concepts for more information about behavior default values, inheritance, and declarative syntax.Defining Behavior Condition Properties
Use the Behaviors Properties View Conditions tab to apply conditions to a behavior to determine when the behavior should apply.
The Properties view Conditions tab is common to all behaviors.
Field | Use |
---|---|
Add | Click to apply a new condition to the behavior. |
Conditions | Displays the list of conditions defined for the corresponding behavior. Select a condition to rename it. |
XPath Expression | Displays the XPath Expression that defines the logic of the corresponding condition. Select the expression to modify or remove it.
To drag a data node into the Properties view Conditions tab, press and hold the Alt key before you select and drag the data node to the XPath Expressions field. XPath and XQuery fields are limited to 4000 characters. |
Remove | Click to remove the highlighted condition. |
Defining Behavior Condition Properties