Skip to Content

Introduction

The correlation feature in SAP NetWeaver BPM differentiates between two transactions, message matching and message consumption. In process definitions that implement the conditional start pattern, all messages, which are already matched but not yet consumed will be resent to the conditional start endpoint when the process instance is terminated or completed. If there are no running instances of the process definition, one of these resent messages will start a new process instance, assuming the start condition of the process definition is fulfilled. For more detailed information, please, refer to the documentation on help.sap.com.

However, it is important to be aware of a possible loss of a resent message in certain scenarios. It is possible that the resent message is received by the web service endpoint of the message trigger but it is discarded because the start condition of the process definition is not fullfiled by the payload of the resent leftover message. This means that no process instance is started. For detailed information about monitoring discarded messages, please, see the blog about Conditional Start: Monitoring (4/7)

The following examples describe scenarios that could lead to a loss of resent messages.

Scenario 1: Start Correlation Criteria of Newly Activated Process Definition is not Fulfilled During Resent

In this scenario, two different versions, V1 and V2, of a conditional start process definition exist. Both versions of the definition use the same message trigger but have different start and correlation conditions. Figure 1 and figure 2 illustrate the start and correlation conditions of the process definition 1 and 2.

/wp-content/uploads/2013/04/fig1_198433.png
Figure 1: Process definition version V1


/wp-content/uploads/2013/04/fig2_198491.png
Figure 2: Process definition version V2


The following chronology of events causes that a resent leftover message is discarded:

  • Process definition version V1 is deployed and activated.
  • A message with the payload message/color = “red”  is sent to the endpoint. An instance of the process definition V1 is started by this message.
  • 2 messages with the payload message/color = “red” are sent to the endpoint of the message trigger.
  • The running process instance receives the messages. Both messages match the correlation condition.
  • The process definition version V2 is deployed and activated. The process definition version V1 is deactivated.
  • The task of the human activity of the process instance is completed.
  • One of the matched messages is consumed by the process instance and the process instance terminates.
  • The other leftover message is resent to the endpoint.
  • The payload of the resent message is message/color = “red” but the process start condition of process definition V2 is message/color = “blue”. Therefore, the resent message is discarded. No process instance is started.

Scenario 2: Process Start Condition is More Specific than the Correlation Condition of the Intermediate Message Event

In this scenario, there is a conditional start process definition, where the process start condition is more specific than the correlation condition of the intermediate message event. An example of such a process definition is illustrated in figure 3. 

/wp-content/uploads/2013/04/fig3_198492.png
Figure 3: Process definition where the start condition is more specific than the correlation condition.

The following chronology of events causes that a resent leftover message is discarded:

  • The conditional start process definition is deployed and activated.
  • A message with the payload message/type = “colorPencil”  AND message/color = “red” is sent to the endpoint. An instance of the process definition is started by this message.
  • 2 messages with the payload message/type = “colorPencil” AND message/color = “blue” are sent to the endpoint.
  • The running process instance receives the messages. Both messages match the correlation condition.
  • The task of the human activity of the process instance is completed.
  • One of the matched messages is consumed by the process instance and the process instance terminates.
  • The other leftover message is resent to the endpoint.
  • The payload of the resent message is message/type = “colorPencil”ANDmessage/color = “blue” but the process start condition is message/type = “colorPencil”  ANDmessage/color = “red”. Therefore, the resent message is discarded. No process instance is started.

Conclusion

When modelling conditional start patterns in process definitions, be aware of the following factors as they might cause that resent leftover messages are discarded:

  • Different correlation conditions between different versions of a conditional start process definition
  • Different conditions between the start and correlation conditions of a process definition

If some messages are inadvertently discarded during resent, examining the start and correlation conditions of the deployed process definitions. This is a good start for investigation.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply