IBM BPM, V8.0.1, All platforms > Create processes in IBM Process Designer > Modeling processes > Modeling events
Modeling message events
Use a message event to represent a point in your process where an incoming message is received or where an outgoing message should be sent.
Incoming messages can originate from a message event in a process, from invoking an undercover agent in a service, from a web service created, or from a message that you post to the JMS Listener.
If you want to create web services to initiate inbound requests from external systems, see Publishing IBM BPM web services.
If you want to post a message to the JMS Listener, the Event Manager has a defined XML message structure that it must receive from an external system. See Posting a message to IBM BPM Event Manager for more information about the required message structure.
Outgoing messages can be received by a message event in a process, can be sent to call an external service, or can be received by the start event in another process or processes. To learn how to configure message events to send messages, see Use intermediate message events and message end events to send messages.
You can include the following types of message events in your BPDs:
Available types of message events Event type Implementation When to use Start event Message configured to receive (Start events can only receive messages) Use to model the start of a process if you want an incoming message event to kick off the process. A BPD can include more than one start message event. Use as the start event for an event subprocess when you want the event subprocess to be triggered upon receipt of a message.
Intermediate event Message configured to receive Use to receive a message event. Intermediate events can be attached to activities within your BPDs or they can be included in the process flow, connected with sequence flows. Intermediate event Message configured to send Use to send a message event. Intermediate events can be included in the process flow, connected with sequence flows. End event Message configured to send (End events can only send messages) Use to send a message event at the end of a path. When you create a message event, you can cut and paste or copy and paste that message event within the same BPD or from one BPD into another BPD.
Before including any type of message event in a BPD, you should be aware of the following:
- Messages can be received by any running process that contains one or more message event.
- You can configure message events to consume messages. If you do, when a message is delivered to a running process, the message is consumed by the first message event in the BPD that can accept it (as determined by the undercover agent that is attached to the message event). When a message is consumed, it will not be processed again by that message event, or any other message event in the BPD instance that can accept it, should the execution of the BPD instance loop back and reach the same message event(s). If a new instance of the message is delivered to the process instance, this message is available for consumption again and is accepted by the message event.
- Message events can be used to enable roll-forward scenarios in which the same message needs to be passed through multiple steps until it reaches the appropriate step in the process where it is to be consumed. To enable rolling a message forward through multiple message events, enable the Consume Message option only for the last message event in the chain of roll-forward message events. You can also use conditions to further control message consumption.
- Occasionally, you may need to set conditions on the processing of incoming messages. If the condition that you specify evaluates to true, the message is accepted and processing continues—otherwise, it is stopped. Because the message condition is evaluated before the message values can be passed to the input variables of the process definition, the message values are passed to the condition in a special namespace, tw.message . If the message condition evaluates to true, the values are passed from the tw.message namespace to the BPD input variables.
- Use start message events
If you want a process or event subprocess to start when a message is received, use a Start Message Event in your business process definition (BPD) or inside your event subprocess.
- Use intermediate message events to receive messages
You can include an intermediate message event in your BPD when you want to model a message event received during execution of a process.
- Use intermediate message events and message end events to send messages
You can include an intermediate message event in your BPD when you want to model a message event that is sent during execution of a process, or a message end event when you want to send a message at an end of a path.
- Use message end events
You can use a message end event when you want to send a message at an end of a path.
Related tasks:
Modeling event subprocesses