Try OpenEdge Now
skip to main content
BP Server Developer's Guide
Working with Monitoring process : Multiple events in a single message : ObjectMessage with multiple events
 

ObjectMessage with multiple events

If you want to send a single event in an ObjectMessage, then you must create a Map object and set it to the ObjectMessage. If you want to send multiple or bulk events as part of a single message, then the ObjectMessage must contain an object of type List. Every element in this List must be an event, which will be a Map.
To send multiple or bulk events as part of one ObjectMessage:
1. Create a Map for each message containing the event payload. Refer to Table 31 for more details about event payload properties.
Table 31. Map of event payload (data) for ObjectMessage and MapMessage
Event element
Property name
Data type
Mandatory
Comment
Sender
SENDER
CHARACTER
Yes
The external system information which generates the event.
Category
CATEGORY
CHARACTER
No
This can be used by senders to group events based on functional domains. For example, Finance, CRM.
Priority
PRIORITY
CHARACTER
No
This is the priority of the operation performed in the external system. This is updated in the process flow. Possible values are CRITICAL, HIGH, MEDIUM, LOW. If not specified, then the default value MEDIUM is used.
Performer
PERFORMER
CHARACTER
No
This is considered as the instance creator. If not provided, then the BP Server bootstrap user specified during Business Process Server installation is used. For workstep events, the value is considered as the workstep performer. If not provided, then the default performer is used. For other events, the value, if provided, is ignored.
Loop counter
LOOP_COUNTER
INTEGER
No
The counter for loops or iterations. If not specified, then events cannot be processed in order. This value is used only in workstep events. It is ignored for other events.
Create time
CREATE_TIME
DATETIME-TZ
Yes
This is the current time in the external system when the event was generated. The value is specified in milliseconds.
Start time
START_TIME
DATETIME-TZ
No
This is the workstep or process instance start time. The value is specified in milliseconds. This value is used only in CREATE_INSTANCE, ACTIVATE_WORKSTEP, and COMPLETE_WORKSTEP events. it is ignored for all other events.
End time
END_TIME
DATETIME-TZ
No
This is the workstep or process instance end time. The value is specified in milliseconds. This value is used only in COMPLETE_WORKSTEP event. It is ignored for all other events.
Duration
DURATION
INT64
No
This is the workstep duration. The value is specified in seconds. This value is used only in ACTIVATE_WORKSTEP, and COMPLETE_WORKSTEP event. It is ignored for all other events. If it is passed as ACTIVATE_WORKSTEP event, then it is taken as estimated duration, whereas if it is passed as COMPLETE_WORKSTEP event, then it is taken as actual duration.
Context
CONTEXT
HashMap object
No
The external system can add any extra data to the context. To send such data, prepare a HashMap<String,String>, where 'key' and 'value' are of type java.lang.String.
Dataslot
DATASLOT
HashMap object
No
The dataslot to be updated in the process flow. The key is the dataslot name, and value is the dataslot value.
2. Create another Map for event properties. Refer to Table 32 for more details about event properties.
Table 32. Map of event properties (header) for ObjectMessage and MapMessage
Event element
Property name
Data type
Mandatory
Comment
External Instance Id
EXTERNAL_INSTANCE_ID
CHARACTER
Yes
A unique id to identify the target instance.
Process Name
PROCESS_NAME
CHARACTER
Yes
The process template name of the Business Process Server process.
Workstep Name
WORKSTEP_NAME
CHARACTER
Yes (for workstep events)
The workstep name for which the event is targeted. If operation type is ACTIVATE_WORKSTEP or COMPLETE_WORKSTEP, then it should have a proper value.
Operation Type
OPERATION_TYPE
CHARACTER
Yes
The operation to be performed in Business Process Server. Possible values: CREATE_INSTANCE, ACTIVATE_WORKSTEP, COMPLETE_WORKSTEP, UPDATE_DATASLOT
Instance Alias
INSTANCE_ALIAS
CHARACTER
No
The alias or prefix of the created instance name. If not provided, then process template name is the alias.
Email id
NOTIFY_EMAILS
CHARACTER
No
The comma separated e-mail addresses to which notification is to be sent about invalid messages.
3. Add the payload (data) Map and header (properties) Map to a Map with keys EVENT_DATA and EVENT_PROPERTIES keys respectively.
4. Add all these event Maps containing header and payload (one Map per event) to a list.
5. Set this list on the ObjectMessage. The List object must be of type List<Map<String,Map<String,Object>>>.
6. Set the boolean property BULK_MESSAGE with value as 'true' or 'false' for this message. If BP Server does not find this property or if its value is set to 'false', then BP Server handles it as a single event message otherwise it handles it as a multi-event message.