Executing multiple processes in sequential/parallel manner

Hi,

I have two sample process:
Process A with 10 tasks(external task which gets executed in C# application)
and
Process B with 5 tasks(external task which gets executed in C# application)
Both of them are modeled in two different BPMN files.

I was able to deploy and start instance through the code.

I was UNABLE to execute process A first and then process B.
In the sample Camunda client project I have, all the external tasks are retrieved at once that includes tasks from both process A and B.

Am I missing something here?

Hi,

That is normal. They are independent procesess with different definitions.
If you want process B to execute after A you have several solutions. But it depends on what you really want to achieve. What is the use case for your problem? Why don’t you simply use single process definition and execute those batches sequentially?

2 Likes

I want to create multiple models(process).
for example:
Model1.bpmn has 2 external service task which prints “Task 1” and “Task 2”
Model2.bpmn has 2 external service task which prints “Task 3” and “Task 4”

  1. Run them in Parallel
    and/or
  2. Run then in sequence

I am trying to achieve this with the help of simple console application in C#.
I wanted to know how this can be achieved.
Is there a way where I can executed only tasks belonging to Model1 first and then model2 ? and also, run them in parallel

Your purpose is not perfectly clear but i will try to answer.

To make processing of tasks within processes from different models execute sequentially these options come to my mind.
You can:

  • Use message events. In process model A throw special message event after processing tasks in A saying that B can process it’s tasks. Then in process model B use message catch event before TASKS you want to execute. That way, process B will wait executing its tasks until it receives message from proecss A.
    You can use start message event to start process B when correspending message is available, or use intermediat message event before the tasks in B to wait until message is available and then continue executing Tasks in B.

  • Manual prioritisation of external tasks. You can fetch external tasks and manually sort them on your choice and execute in that order. In this case you must make sure that there is one worker or prioritisation of multiple workers doesn’t violate your requirement.

  • Like message events as above you can use Signal event. But they have differences make sure which one of them is appropriate for your use case.

1 Like