The most efficient way to model repetitive tasks in bpmn

Hi all,

I am working on a project that includes more than 50 processes. All these 50 processes share some logic, for example:

  • At any time (From any task), user must be able end the process with cancelled status code.
  • At any time (From any task), user must be able to ask for further information, in this case the process will move to another stage and wait for the needed information then resume from the last step.

So I am looking for a design strategy to follow in all my processes.
For the time being I rely on user input to move to next step, cancel or request additional information. But this approach forcing me to add connections from all tasks to the cancel event and return to applicant related task.

Is there any better approach to model this kind of tasks?
The following image describe the above approach and how it leads to many relations between tasks.

Hi @nazeer_allahham,

Are you familiar with the concept of Event Subprocesses?
They allow you to start subprocesses that are independent of the main process, and they exist as interrupting and non-interrupting.

You could add an event subprocess with an interrupting message event to hande the cancelation.
And, add one non-interrupting subprocess to ask for more information.

Read more about event-based subprocesses in our documentation:

2 Likes

Hi @StephanHaarmann.
Thank you for your response. I have checked event-based subprocesses and it was the key to solve my problem.
I am starting my subprocess by correlating a message. but to achieve the full functionality I need, I am doing the following:

  1. When the subprocess starting I am storing the parent task as variable.
  2. Before the subprocess ends I added a service task (Resubmit) that will restart the parent process from from the last step (Using Java API).

Thank you for your response.

1 Like

Based on your initial step, you should not be restarting the parent process, which will start from beginning. Instead you should be putting a gateway to go back to the step where it was requested for further info after getting the necessary details.

Hi @cpbpm,
If I got you well then this will back me again to the main problem I faced. My problem was I don’t need to put gateways in each process task to make the bpmn much less complicated. You can see the difference between the first version and second version.
Do you think there is a better way to do this?