8: Defining a Counter (Container Operation)
Use
To determine whether all the bookings were successful or not, you want to compare the number of booking messages with the number of confirmation messages in a later step in the business process.
To do so, in the process container, define an element as a counter for the booking messages sent. Also, define a container operation that increases the count by 1 for each message sent.
Procedure
Defining a Container Element
- To define the container element in the process container, click an empty point in the editing area (ensure no block is selected).
- Define the container element for the counter as follows:
- Name: MsgCount
- Category: XSD Simple Type
- Type: xsd:integer
- Container: shows Process
Defining a Container Operation
- Insert a container operation (
) after the send step. - Enter IncreaseCount as the step name.
- To increase the MsgCount message counter by 1 each time a message is sent, define the step properties as follows:
- Double-click Target.
- In the expression editor, choose MsgCount.
- In the step properties, select Assign in the Operation field.
- Double-click Expression, and then in the expression editor choose MsgCount.
- In the step properties, select + in Operator field.
- Double-click Expression and define the constant 1:
- In the expression editor, select Constant.
- Enter the value 1.
- In the Type field, select xsd:integer.
More Information:
XSD Data Types