Search code examples
pythonworkflowbpmncamundafsm

from HFSM with parallel states to Camunda?


I was tasked with implementing an HFSM with parallel states and the ability to transition to multiple parallel states in Python. Unfortunately, I could not find a library that supported this. I was told to look into Camunda. I am having trouble understanding how parallel HFSM relates to Camunda? Is there any way to implement parallel HFSM in Camunda?


Solution

  • A process engine is a state machine. The process model defines the possible states (events and tasks) and allowed transitions (sequence flows). The token flow represents the state of an instance of this model. There is a concept of sub processes and parallel states/execution/multiple tokens can be achieved by using parallel gateways, inclusive gateways, and non-interrupting events. You also have multi-version enactment at runtime. Camunda would nicely cover the requirement and would do so with the ability to configure the models in a graphical, business-friendly fashion (BPMN2). However, there wouldn't be anything left to implement for you. Maybe some task worker in python. If this is an academic exercise, then the idea is probably not to make an already implemented state machine work, but to roll your own. As you do so, you will find reasons why you would not want to program your own for real-world use cases, how much easier it is to use an existing product, and how much work has gone into various features that are time-consuming to implement yourself.