IBM BPM, V8.0.1, All platforms > Measuring and improving business processes > Use business monitoring with process applications > Monitoring events
Activity monitoring events
When an execution, or instance, of an activity has entered a specific state such as ready, active, or completed, the activity state is reported in a monitoring event. In addition, you can configure process activities with simple and multi-instance looping.
Monitoring activity lifecycle events
The ACTIVITY_READY, ACTIVITY_ACTIVE, ACTIVITY_TERMINATED, and ACTIVITY_COMPLETED event types report the lifecycle states of an activity. Some of these events contain custom business data as well as default key performance indicators (KPI) data. The event types emitted for activities are described in the following table.
Event type Event description Required elements bpmnx:ACTIVITY_READY An instance of an activity is in the ready state. An activity enters the ready state when a token has arrived. This event includes custom business data (KPIs and auto-tracked fields) in the applicationData element.
- The <mon:model mon:type= "activity_type"> element describes the activity that emitted the event.
- The <mon:type> attribute indicates the type of the activity, as defined in the BPMN 2.0 schema.
For example, <mon:model mon:type="bpmn:callActivity">, or <mon:model type="bpmn:userTask">.
- The <mon:model> element describing the activity must be followed by a <mon:model> element describing the process defining the activity and the process instance from which the event was sent. It is followed by <mon:model> elements for higher level constructs, such as process applications.
- The ACTIVITY_ACTIVE event also contains the name of the user performing the activity as part of the <mon:role> element:
<mon:role mon:id="PERFORMER">
<mon:resource mon:id="1:tw_admin" >
<mon:name>Internal TW Admin user</mon:name>
</mon:resource>
</mon:role>
bpmnx:ACTIVITY_ACTIVE An instance of an activity is in the active state; required input and resources are available, and work has started. bpmnx:ACTIVITY_TERMINATED An instance of an activity has been terminated. bpmnx:ACTIVITY_COMPLETED An instance of an activity is in the completed state. This event includes custom business data (KPIs and auto-tracked fields) in the applicationData element.
bpmnx:ACTIVITY_RESOURCE_ ASSIGNED A resource, such as a user, group or organization, is associated with a task instance in a specific role. For example, the performer role designates the resource currently assigned to work on the task.
- The <mon:instance> element describes the task execution.
- The <mon:instance> element describing a task execution can contain one or more <mon:role> elements, which describe the resource roles used in the execution.
- Nested <mon:resource> elements describe each of the resources. An example is shown in the XML fragment following the table.
The namespace prefixes mon and bpmn shown in the table represent the following namespace URIs:
- xmlns:mon="http://www.ibm.com/xmlns/prod/websphere/monitoring/7.5"
- xmlns:bpmn="http://schema.omg.org/spec/BPMN/2.0"
ACTIVITY_RESOURCE_ ASSIGNED example
This example of a <mon:resource> element indicates that the user Internal TW Admin user, whose ID is tw_admin, is assigned the PERFORMER role for example 5 of the bpmn:userTask named assignOrderNumber. The activity instance ID is unique within a given process instance, which is described by the <mon:model> element that follows the <mon:resource> element.
<mon:model mon:type="bpmn:userTask" mon:id="bpdid:af46278784e183e2:-44d4289d:12ba655e3ba:-7fc0" mon:version="2064.69fdfcef-3900-47aa-817a-7960a182a48cT"> <mon:name>assignOrderNumber</mon:name> <mon:instance mon:id="5"> <mon:role mon:id="PERFORMER"> <mon:resource mon:id="tw_admin"> <mon:name>Internal TW Admin user</mon:name> </mon:resource> </mon:role> </mon:instance> </mon:model>
Example ACTIVITY_READY event
In every activity monitoring event, the <mon:model> element describing the activity is followed by a <mon:model> element that describes the process defining the activity, and the process instance from which the event was sent. An additional <mon:model> element describes the process application defining the process. In the following event example, there are three <mon:model> elements, one each for the activity, the process and the process application.
<mon:monitorEvent xmlns:mon="http://www.ibm.com/xmlns/prod/websphere/monitoring/7.5" mon:id="d12a887ef13ced21792162189" xmlns:bpmn="http://schema.omg.org/spec/BPMN/2.0" xmlns:bpmnx="http://www.ibm.com/xmlns/bpmnx/20100524/BusinessMonitoring" xmlns:ibm="http://www.ibm.com/xmlns/prod/websphere/monitoring/7.5/extensions" xmlns:wle="http://www.ibm.com/xmlns/prod/websphere/lombardi/7.5" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <mon:eventPointData> <mon:kind mon:version="2010-11-11">bpmnx:ACTIVITY_READY</mon:kind> <mon:time mon:of="occurrence">2011-02-03T10:44:15.481-05:00</mon:time> <ibm:sequenceId>13</ibm:sequenceId> <mon:model mon:type="bpmn:subProcess" mon:id="bpdid:571234bad276b9a1:-1448ee2a:12c08c263e4:-7fec" mon:version="2064.9d926c59-6511-4ee9-a0d2-4015fb19cb55"> <mon:name>Call Pong</mon:name> <mon:instance mon:id="5"/> </mon:model> <mon:model mon:type="bpmn:process" mon:id="854325da-04ea-4ea6-8664-c701b4bf3d61" mon:version="2064.9d926c59-6511-4ee9-a0d2-4015fb19cb55"> <mon:name>Ping</mon:name> <mon:documentation>The "Ping" process definition.</mon:documentation> <mon:instance mon:id="754"> <mon:state>Active</mon:state> </mon:instance> </mon:model> <mon:model mon:type="wle:processApplication" mon:id="b9e85db9-5c4d-40e7-9421-e53acb738f4e" mon:version="2064.9d926c59-6511-4ee9-a0d2-4015fb19cb55"> <mon:name>Oscillating Invocations</mon:name> <mon:documentation>Ping pong between two processes.</mon:documentation> </mon:model> <mon:correlation> <mon:ancestor mon:id="854325da-04ea-4ea6-8664-c701b4bf3d61.2064.9d926c59-6511-4ee9-a0d2-4015fb19cb55.754.5"> <mon:ancestor mon:id="854325da-04ea-4ea6-8664-c701b4bf3d61.2064.9d926c59-6511-4ee9-a0d2-4015fb19cb55.754"/> </mon:ancestor> <wle:starting-process-instance>854325da-04ea-4ea6-8664-c701b4bf3d61.2064.9d926c59-6511-4ee9-a0d2-4015fb19cb55.754 </wle:starting-process-instance> </mon:correlation> </mon:eventPointData> <mon:applicationData> <wle:tracking-point wle:time="2011-02-03T10:44:15.481-05:00" wle:name="Call Pong (PRE)" wle:id="8c263e4-7ff2bpdid571234bad276b9a1-1448ee2a12c08c263e4-7fec (PRE)" wle:version="2064.9d926c59-6511-4ee9-a0d2-4015fb19cb55" wle:groupName="at1288664978829" wle:groupId="guid:571234bad276b9a1:-1448ee2a:12c08c263e4:-7ff2" wle:groupVersion="2064.9d926c59-6511-4ee9-a0d2-4015fb19cb55"> <wle:tracked-field wle:name="levelEnteringPing" wle:id="bpdid:571234bad276b9a1:-1448ee2a:12c08c263e4:-7fc2" wle:type="xs:integer">2</wle:tracked-field> <wle:tracked-field wle:name="reportOfWhereInPing" wle:id="bpdid:571234bad276b9a1:-1448ee2a:12c08c263e4:-7fc0" wle:type="xs:string">About to call Pong with argument = 1. </wle:tracked-field> <wle:tracked-field wle:name="argumentForPong" wle:id="bpdid:571234bad276b9a1:-1448ee2a:12c08c263e4:-7fbe" wle:type="xs:integer">1</wle:tracked-field> </wle:tracking-point> </mon:applicationData> </mon:monitorEvent>
Looped activity monitoring events
You can configure simple and multi-instance looping for activities in a business process definition. Looping allows an action to be repeated a specified number of times, or until a specific condition is true. In a process definition, simple or multi-instance looped activities are identified by an indicator in the activity icon. The event types emitted for looped activities are described in the following table. These events are emitted in addition to the usual activity monitoring events, which occur for every loop iteration.
Event type Event description Required elements ACTIVITY_LOOP_ CONDITION_TRUE (Simple looping)
This event indicates that a loop condition evaluated to true. This means that the loop is not yet finished and another iteration will occur. The event is issued at each iteration of a loop if the loop condition is true. When an activity is modeled with simple looping, the required number of instances is dynamically created, up to the specified maximum number of loops. A simple-looped activity is started sequentially until the last instance of the activity has been performed.
- The <mon:model mon:type= "activity_type"> element describes the activity that emitted the event.
- The <mon:model> element describing the activity must be followed by a <mon:model> element describing the process defining the activity and the process instance from which the event was sent. It can be followed by <mon:model> elements for higher level constructs, such as process applications.
- These events include custom business data in the applicationData element.
ACTIVITY_LOOP_ CONDITION_FALSE (Simple looping)
This event indicates that a loop condition evaluated to false. This means that the loop is finished and will be exited. The event is issued after the last iteration of a loop, if the loop condition is false. ACTIVITY_PARALLEL_ INSTANCES_STARTED (Multi-instance looping)
This event is issued when multiple instances of an activity are created in parallel. The event reports the number of activity instances that have been created.
- The <mon:instance> element which corresponds to the multi-instance activity must contain a <mon:started> element. The mon:started element indicates the number of instances that have been created. The mon:started element can also contain <mon:startedId> elements, which include the identifiers of the activity instances.
ACTIVITY_TERMINATED (Multi-instance parallel)
A multi-instance, parallel activity can be configured to terminate all running instances when its flow condition evaluates to true. Each terminated instance emits an ACTIVITY_TERMINATED event.
- The <mon:model mon:type= "activity_type"> element describes the activity that emitted the event.
- The <mon:type> attribute indicates the type of the activity, as defined in the BPMN 2.0 schema.
For example, <mon:model mon:type="bpmn:callActivity">, or <mon:model type="bpmn:userTask">.
- The <mon:model> element describing the activity must be followed by a <mon:model> element describing the process defining the activity and the process instance from which the event was sent. It is followed by <mon:model> elements for higher level constructs, such as process applications.
- The ACTIVITY_ACTIVE event also contains the name of the user performing the activity as part of the <mon:role> element:
<mon:role mon:id="PERFORMER">
<mon:resource mon:id="1:tw_admin" >
<mon:name>Internal TW Admin user</mon:name>
</mon:resource>
</mon:role>
Simple-looped events occur in a specific pattern, bracketed by an ACTIVITY_READY event at the beginning, and an ACTIVITY_COMPLETED event at the end.
For example:
ACTIVITY_READY ACTIVITY_LOOP_CONDITION_FALSE ACTIVITY_LOOP_CONDITION_FALSE ACTIVITY_LOOP_CONDITION_FALSE ACTIVITY_LOOP_CONDITION_TRUE ACTIVITY_COMPLETED
Example of a simple looped activity mon:model element
<mon:model mon:type="bpmn:process" mon:id="70be5404-7f97-4d15-95c5-2e0a02357978" mon:version="2064.cf17230d-0af1-4494-82e7-e0505356a502T"> <mon:name>Loop: Simple Loop</mon:name> <mon:instance mon:id="612"> <mon:state>Active</mon:state> </mon:instance> </mon:model>
Related tasks:
Configure an activity for simple looping
Configure an activity for multi-instance looping
Related reference:
Event schema extensions
Process components and monitoring events