How to model process launched by message from another process?

Situation

This question is about how to document process interdependencies rather than solving particular technical BPM problem. We are still learning BPMN and the tools.

We have two processes: Collection and Video production. One of them runs continually, collects text messages from users, and from time to time (usually once a week) it makes a “snapshot” of all newly collected messages (since the last snapshot) and should launch another process to begin some further processing of those messages (sorting, preparation of a video session, transcript, translations, etc.).

#Desired Result

Since the first process (collection) effectively runs in an infinite loop, I would model it with a message-throw intermediate event or message-send task. In the second process, I wanted to start with a message start event that is triggered by the message from the Collection process…

#Problem

I was not able to draw association line between the send task or throw event in Collection and the message start/catch event in the Video production process (assuming they would be in two swimlanes in the same pool, or in two pools in the same BPMN diagram). However, it is not possible to draw association line between such objects, only process flow.

What am I doing wrong? How should I model this type of link between the two processes?

Jindra

@jvavruska are you trying to do something like this?

use_case_interprocess_messages.bpmn (7.6 KB)

2 Likes

@jvavruska
How about something like this? (assuming that your Collection is a Poll process. If its not, then you could swap out the Every minute timer for something like a Message Start Event or a Blank Start Event that would be started by an outside system. )

Hi

I found this example and its is similar to what I want to achieve, although I was wondering If I could achieve the same thing if the pools were separate BPMN processes/diagrams. So how would I be able to deploy such diagrams?

I tried it and just put each process on its own, deployed it and got the following message, which leads me to wonder if it can be done across flows.

Thank you

Yes they can be separate bpmn files. Just update all your bpmn files as part of the same deployment.

Thanks Stephen, this was very helpful.

1 Like

Is there anything else to know here about triggering one process from another via a message, when the two processes are defined in different diagrams?

I get the following error:

Cannot instantiate process definition Finswitch_Tx:1:81c81308-e65d-11e8-946a-0242ac110001: 
Error while evaluating expression: ${execution.getProcessEngineServices().getRuntimeService().createMessageCorrelation("triggerEamAllocation").correlateWithResult()}. 
Cause: org.camunda.bpm.engine.MismatchingMessageCorrelationException: Cannot correlate message 'triggerEamAllocation': 
No process definition or execution matches the parameters
  • The two processes are in different BPMN diagrams but being deployed at the same time through the REST API.
  • The message id’s and names match across the BPMN diagrams.
  • As far as I can see, the message send and receive events are setup the same as those in Stephen’s example on this post.

Any help would be much appreciated.

We got this working by using the following Expression call to start the other process:

${execution.getProcessEngineServices().getRuntimeService().startProcessInstanceByMessage("triggerEamAllocation")}

Also, with this there is no need to link the processes together in a single deployment - we are deploying separately, as I’d hoped for a loosely coupled process.

Found in the documentation, here.

Do you mean by “deployed at the same time” something like this?

curl -w "\n" \
-H "Accept: application/json" \
-F "deployment-name=multi-deployment" \
-F "enable-duplicate-filtering=false" \
-F "deploy-changed-only=false" \
-F "Caller.bpmn=@Caller.bpmn" \
-F "Callee.bpmn=@Callee.bpmn" \
http://localhost:8080/engine-rest/deployment/create