bpmn - Query process instances based on starting message name -


env: camunda 7.4, bpmn 2.0

given process, can started multiple start message events.

  1. is possible query process instances started specific messages identified message name?
  2. if yes, how?
  3. if no, why?
  4. if not @ moment, when?

some apis incidentmessages?

that no out-of-the-box feature should easy build using process variables.

the basic steps are:

1. implement execution listener sets message name variable:

public class messagestarteventlistener implements executionlistener {    public void notify(delegateexecution execution) throws exception {     execution.setvariable("startmessage", "messagename");   } } 

note via delegateexecution#getbpmnmodelelementinstance can access bpmn element listener attached to, determine message name dynamically.

2. declare execution listener @ message start events:

<process id="executionlistenersprocess">   <startevent id="thestart">     <extensionelements>       <camunda:executionlistener           event="start" class="org.camunda.bpm.examples.bpmn.executionlistener.messagestarteventlistener" />     </extensionelements>     <messageeventdefinition ... />   </startevent>    ... </process> 

note bpmn parse listener, can add such listener programmatically every message start event in every process definition. see this example.

3. make process instance query filtering variable

runtimeservice runtimeservice = processengine.getruntimeservice(); list<processinstance> matchinginstances = runtimeservice   .createprocessinstancequery()   .variablevalueequals("startmessage", "messagename")   .list(); 

Comments

Popular posts from this blog

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -