Monday, January 11, 2016

How to Skip the BPMN instances creation with same variable state in WSO2 BPS


This post describes on how to skip the BPMN instance creation with same variable state in
WSO2 Business Process Server 3.5.1 .

Currently in the BPMN Rest API, process instance start operations are not conditional. But there are occasions, process instances  should not be initialized when ever there is a already created instance with same variables state (variable values).

This is the sample request that we use to start a process instance.



In order to make sure that only single instance is being created for an unique value, we can use the "businessKey" attribute. Although this is the most preferred way this won't work every time.

This may fails on following occasions.

  • Business key attribute value can not be updated during the run time. Therefore, If the business key is not known before the instance creation, we shall not be able to update it.
  • In the event of considering more than one variables to determine the instance state, we can't use the business key attribute.

Therefore as a solution to those issues, WSO2 Business Process Server 3.5.1 introduces a new Boolean flag "skipInstanceCreationIfExist" in the request.  By default the value of the flag is false.

This sample request can be used to start the process instance


This flags looks for the process instances with variables which have the values  defined in the process instance request. In the event of existence of any process instances with the same variables state, instance creation will be skipped. 


No comments:

Post a Comment