Search code examples
workflowbpmncamunda-modeler

How is the state of a BPMN process defined?


Assuming a BPMN process describing activities, gateways, start and end events. As follow:

Some BPMN process Each step is managed by a BPMN engine. At one point, how can we tell which is the state of the process ? Activities seem to define some state embodied as actions (e.g. evaluating request). Am I correct ?

Also, if we assume activity represents the state, how do we get a listing of next possible states if we were to navigate through a dedicated follow-up application ?

Should the process be modeled in a more workflow oriented way to express those state/actions possibilities ? I have the intuition that events could also be used to manage states and possible related actions.


Solution

  • Since I am not sure what exactly you understand as state of the process, I will try to define that first. I guess you are aware of the token concept, see a discussion in the Camunda forum:

    A token is a BPMN concept that represents a state within a process instance. It does not have any variables or any message.

    You may now define the state of the process as a statistics how many tokens at a given time are existing, and how many are currently in a given activity or event.

    This statistics can be extracted from your favorite BPMN engine (and seen e.g. in Camunda's Cockpit as little colorful bubbles). With that statistics in hand, you could in principle generate forecast on next possible states, i.e. determine scenarios how many tokens will be in the next time instance probably in each activity.