0
votes

How can multiple instances of the same process run beside each other without interfering one another?

I have this business process model where a base workflow needs to decide which other workflow needs to be started. This base flow will send some signals while being evaluated that will start other subprocesses. During the execution of those subprocess, some subprocesses need to wait for others to complete. Therefore I am currently using intermediate throw and catch signals to implement some kind of synchronization mechanism. The problem is whenever a certain signal is sent, all processes listening for this signal continue independent on the instance they are running on. I wish to only let those subprocesses continue when they receive a signal from the process that initially started them comparable to multi-user concurrent environments in Java EE applications.

In other words, I have two questions:

  1. what is the best approach to create this kind of synchronization mechanism to mimic multi-user concurrent environments using jBPM?
  2. How can I create multiple process instances in an isolated way? I tried to play with runtime strategies. Singleton obviously is not the desired behavior. When I use process instance, no other processes are started when the base process sends signals. The same when using case as the runtime strategy.

Since I am new to BPM I expect my approach to be entirely wrong, please feel free to suggest better approaches when applicable.

EDIT: To clarify some things, I have added screenshots of a sample model The base process This first process is started by creating a process instance and starting it using jBPM business central. The intermediate signal should trigger the subprocess below and then waits for this subprocess to complete its tasks.

The subprocess

The subprocess just waits for an amount of time and then fires a complete signal that shoul be caught by the process above.

The singleton runtime strategy results in the base process instances being triggered by any completed sub process, as expected due to the fact every process instance runs in the same context. The per_process_instance seems to trigger the subprocess but after completion, the base process does not receive the signal sent by the sub process.

1

1 Answers

0
votes

What runtime strategy are you using? By deafult jBPM uses singleton strategy. Please use per_process_instance runtime strategy to have isolation between process instances.