Correlation

How to call/trigger camunda Intermediate message event from another camunda process with correlation Id?

Any one could provide details steps?

thanks
Srikanth

Hi Srikanth,

Have a look at the java docs for RuntimeService [1]. Here you will find methods such as;

void correlateMessage(String messageName,
Map<String,Object> correlationKeys,
Map<String,Object> processVariables)

There is a family of correlateMessage methods, each with different parameters depending on your use case. Hence typical code in a service task to generate a message for another process could be;

execution.getProcessEngineServices().getRuntimeService().correlateMessage(“MyMessageName”, “MyBusinessKey”);

regards

Rob

[1] https://docs.camunda.org/javadoc/camunda-bpm-platform/7.7/

1 Like

hi Rob

thanks for your quick reply.

1.not sure how to call camunda process from another camunda process using java class. I am using call activity of first camunda process to call Intermediate messsage event of second camunda process. Not sure how to use java class here .can you please expalin in detail

  1. is it possible with out java class?

thanks
Srikanth

which task/activity I am suppose to use to trigger Intermediate catch Message event in second camunda process from first camunda process. can you please explain in detail?

thanks
Srikanth

this is very urgent and critical. can you please check and let me know

Hi,

Ive attached a very simple example. Note Im using a script task to send the message to the second process. Hence to run this, you would need to start process B and supply a business key. Then if you start process A, it should send a message to process B.

Note: The supplied process model is an outline to show the concept, its not necessarily executable out of the box…

regards

Rob
Correlate_Message.bpmn (7.3 KB)

thanks for your reply

1.in my situation, bpmn’s are diferent. from one bppm to another bpmn, i need Intermediate message event.

  1. how about output parameter or response from second bpmn. how to get response back?

use_case_interprocess_messages.bpmn (7.6 KB)

1 Like

Hi,

I think more clarity is required. Are you trying to;

  1. Make a service call where the service is realised by a process
  2. Use inter-process communication.

If 1, use can use a process model to implement a function. Hence just use a service call to start a process instance and let the process return a result. Alternately, you could use a call subprocess construct.

If 2, use as I and other have suggested. In addition, to get information back, there is no reason why the message receiver process cannot then become a sender with a payload reflecting the result. This pattern is often implemented when you want an asynchronous request/response pattern…

regards

Rob

1 Like

Anyone can you tell me the process of triggering message in camunda and how long time it take.

Hi @BarcodeMaker,

Could you create a new topic for this question?

Thanks!