Conversations

Conversations represent two or more related message exchanges in the same process which are correlated by the engine, for example, a conversation between a process and its clients, or between a process and its back-end service.

Conversations are used for stateful processes, which can consist of one or more operations. In a stateful process, the engine manages the state and helps correlate messages with the process; you need not correlate the state of the operations. In a stateless process, the state is managed by the job itself.

A conversation is defined within the scope of a process. Conversations are always initiated by one activity and joined by other activities. The activity that initiates a conversation generates a conversation ID. The activities that join this conversation use the generated conversation ID when exchanging messages.

Consider the Mortgage Service Provider process shown in the following figure. The Reply activity, SubmitMortgageAppOut, initiates a conversation, generates a conversation ID, then returns this ID in its reply message. The Receive activity, SubmitFinDocIn, joins the conversation initiated by the Reply activity, SubmitMortgageAppOut. When submitting the final documents, a client must use the conversation ID returned by the Reply activity. The engine uses the conversation ID to correlate messages with the process and ensures that the documents are associated with the right mortgage application.

Mortgage Service Provider Sample Using Conversations


When designing an application, better support for conversations can be achieved by defining the following:

  • Number of conversations that a process participates in.
  • Definition of the activities that are part of the same conversation.
  • Sequence of messages for each conversation.