Monday, February 27, 2017

Event sub processes in Flowable 6

With the release of Flowable 6, we improved the support for event sub processes. In Flowable 5, the support for event sub processes is limited to the interrupting type. This means that if a signal event is triggered for an event sub process, the executions on the same scope are terminated. Let's look at a simple example process definition.

When a process instance is started, "Task 1" will be the active state of the process instance. When the signal start event of the event sub process is triggered, "Task 1" will be terminated and the event sub process is started and the current state of the process instance is "Additional task".

With Flowable 6 there's now also support for non-interrupting event sub processes. The only difference when designing the process definition is configuring the signal start event as not interrupting.
A non-interrupting start event is visually shown as a circle with a dashed line. If you would start a process instance for this process definition, again "Task 1" will be the active state of the process instance. But now, when the signal start event is triggered, "Task 1" will remain active, and an additional execution is created for the event sub process. Therefore, two user tasks will be active "Task 1" and "Additional task". 

Let's look at another example, that contains two event sub processes, one on the main process level and one nested inside a sub process.

When we deploy this process definition (as part of an app definition) to the Flowable Task application, we can test the process instance execution by clicking through the task application. Let's start a new process instance in the Flowable Task application and see "Task 1" being created. If you now query the REST API for active event subscriptions (on Tomcat with http://localhost:8080/flowable-task/process-api/runtime/event-subscriptions), you'll see the signal event from the event sub process on the main process level being available. 

We could trigger the signal start event, but let's complete "Task 1" first. Now "Sub task 1" is the active task and if you do another event subscription query, you'll see another event subscription has become active. Let's trigger the nested event sub process signal and validate if the non-interrupting behaviour works as expected.

With a REST client like Postman you can do a PUT request to http://localhost:8080/flowable-task/process-api/runtime/executions/{executionId}, with a JSON body defining the signal action and the signal event name.


In this example, the execution id is "12518". But you can look up the execution id in the event subscription query result. When this signal event is triggered, the "Additional sub task" of the event sub process should be created, while keeping the "Sub task 1" task active as well. The process diagram in the Flowable task application should look like this:

Now let's complete the "Sub task 1" task and notice that "Task 2" is not created yet. First we have to complete "Additional sub task". When both tasks have been completed, "Task 2" is created. When executing the event subscription query again, you'll see that there's only the main process level signal event remaining. The nested sub process event subscription is deleted and not available anymore. After "Task 2" is completed, the process instance is also completed and no event subscriptions are available anymore.

Non-interrupting event sub processes provide a great addition to add more flexibility to your process definitions and to be able to create additional user tasks, or execute additional service tasks, in specific use cases. With Flowable 6.0.0, non-interrupting event sub processes on the main process level are support, but with the upcoming 6.0.1 release also nested non-interrupting event sub processes will be supported in the Flowable Engine.



21 comments:

  1. Thanks you for sharing this unique useful information content with us. Really awesome work. keep on blogging
    Oracle training in btm
    Oracle Online Training
    Oracle training in chennai
    Oracle training in Bangalore

    ReplyDelete
  2. Thanks for sharing this valuable information for us!!
    Keep up the good work
    Apponix Technologies

    ReplyDelete
  3. Your website is very beautiful or Articles. I love it thank you for sharing for everyone. BPMN

    ReplyDelete
  4. Can you please provide example of event sub-process with message start event?
    sub-process should be triggered on message start event.

    ReplyDelete
  5. This post is so useful and informative.Keep updating with more information.....
    Best Python Training In Bangalore
    Python Classes In Bangalore

    ReplyDelete
  6. Thanks for sharing. I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one.
    Digital Marketing Company in Delhi
    digital marketing company in jaipur

    ReplyDelete
  7. This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting.our sclinbio.com

    ReplyDelete
  8. I thoroughly enjoyed reading your article on event sub-processes in Flowable 6. Your insightful exploration of this topic provided me with valuable insights into optimizing business processes with Flowable. The clear explanations and examples made the complex concepts more accessible.

    Moreover, while delving into the world of business process management, I couldn't help but think about the significance of upskilling in today's data-driven landscape. Imarticus Learning's Data Science Course comes to mind as an excellent opportunity for professionals looking to enhance their skills. The program's comprehensive curriculum, hands-on projects, and industry-relevant approach make it a standout choice. In an era where data science is at the forefront of innovation, Imarticus Learning seems to be paving the way for individuals to thrive in the evolving job market. Kudos to your blog for shedding light on both Flowable and valuable educational resources like Imarticus Learning's Data Science Course!

    ReplyDelete