Defining Calculate Behavior Properties

When editing order and task data in an editor, you can right-click data node behaviors and select Open Properties View to access the behavior properties.You use the Properties view tabs to model Calculate behaviors.

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 Calculate behavior properties:

  1. From the Design perspective, right-click the behavior and select Open Properties View.

    The Behaviors Properties view is displayed.

  2. Click the Calculation tab.

  3. In the XPath Expression field, enter the calculation as a mathematical expression or as an XPath expression.

    See "Calculate Behavior Properties View Calculation Tab" for more information.

  4. Click the Details tab.

    The Behaviors Properties view Details tab is displayed. The Name, Type, and Path field values are read-only, and cannot be modified on this tab. See "Defining Behavior Detail Properties" for more information about the options that you can define on this page.

  5. (Optional) Click the Conditions tab.

    Use the Conditions tab to add conditional logic to the Calculate behavior. See "Defining Behavior Condition Properties" for more information about defining conditions for behaviors.

  6. (Optional) Click the Notes tab.

    Use the Notes tab to describe the functionality or include internal documentation about the Calculate behavior.

Related Topics

Calculate Behavior Properties View Calculation Tab

About Calculate Behaviors

Working with Behaviors

About Web Client Behavior Support

About Calculate Behaviors

The Calculate behavior enables you to calculate a field's value based on a formula that references other field values. When defining Calculate behaviors on the Calculation Behaviors Properties tabs, you can use XPath expressions to support numeric operations and string concatenations. For example:

XPath Expression Result
../loopback Set the current field equal to the value found in the ../loopback field
concat('S',instance('interfacedetail')/Port) Set the current field equal to a concatenation between the letter S and the value found in the Port field that is returned by the peinterefacedetails data provider.
instance('interfacedetail')/portType Set the current field equal to the portType returned by the interfacedetail data instance provider.

See OSM Concepts for more information about behavior default values, inheritance, and declarative syntax. For more information about XPath specifications, see the World Wide Web Consortium (W3C) website at:

http://www.w3.org/TR/xpath20/

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.

Related Topics

Calculate Behavior Properties View Calculation Tab

Defining Calculate Behavior Properties

Working with Behaviors

About Web Client Behavior Support

Calculate Behavior Properties View Calculation Tab

On the Properties view Calculations tab, you can define the expression that will produce the calculation.

Field Use
XPath Expression Enter a mathematical expression or an XPath Expression.

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 Expression field to define the XPath expression. To drag a data node into the Properties view Calculation 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.


Related Topics

Defining Calculate Behavior Properties

About Calculate Behaviors

Working with Behaviors