Expression parameters

Expression parameters are used to define dynamic values or behaviors that are evaluated when a token enters an element. These parameters are based on XPath 1.0 expressions and allow you to reference or calculate values dynamically based on the process data. Expression parameters are computed at runtime.

An expression parameter consists of an XPath 1.0 expression that can reference XML elements, perform calculations, or return values based on the data in the model.

Attribute Description
Value The XPATH expression expressed as a string.

XPath extension functions

Expression parameters can make use of XPath extension functions to enhance their functionality and flexibility. These functions allow you to perform more complex operations or add additional logic to your expressions.

The getProperty() function allows you to reference and use the value of a property parameter within an expression. This is especially useful when you want to perform conditional checks based on specific property values. For example, you could direct a process down a specific path only when a property reaches or exceeds a defined threshold:

if (getProperty('ProcessingTime') >= 100) then 'Long Process' else 'Short Process'

getProperty() is the only extension function used for setting conditions and properties. All other extension functions are designed for assigning resources to tasks.

XPath extension function Description and usage
getProperty(name) Returns the value of a property parameter.
Arguments: name — the name of the property parameter.
Return: The value of the property parameter.
Remarks: If the property parameter doesn’t exist, the function defaults to zero.
getResource(name, qty) Returns the quantity of a specific resource.
Arguments: name — the name of the resource, qty — the quantity of the resource.
Return: The quantity of the specified resource.
Remarks: This can be used to reference resources within the process.
getResourceByRoles([role, …], qty) Returns the quantity of resources based on the specified roles.
Arguments: A list of roles, qty — the quantity of resources needed.
Return: The quantity of resources assigned to the given roles.
Remarks: Useful for role-based resource allocation.
orResource([resources, …]) Selects the first collection of available resources from the list of alternative resource used for an Activity.
Arguments: A variable list of resources returned by the getResource() or getResourceByRoles() functions.
Return: Collection of resources.
Remarks: This allows alternative behavior for resource selection. The evaluation order of resources is from left to right.

Applicability

Expression parameters can be applied to the following BPMN elements:

  • Activities

  • Events

  • Sequence flows

  • Message flows

Define property parameters

Validate the simulation flow - Conditions