Aleks_V
December 13, 2019, 5:45am
1
hi!
i’m try to start process using “Message Start Event”, and its works.
i’am use Expression in Thow Message
${execution.getProcessEngineServices().getRuntimeService().createMessageCorrelation(“work”).correlateWithResult()}
how send Variable to new process using “Message Start Event” and get it back?
please, recommend me a book that details how to work with Camunda
Niall
December 13, 2019, 7:32am
2
You need to create a map of variables, add the variables you want and sent it along with the message call
Map<String, Object> vars = new HashMap<String, Object>();
vars.put("myVariable", true);
execution.getProcessEngineServices().getRuntimeService()
.createMessageCorrelation("messageName")
.setVariables(vars)
.correlateAllWithResult();
Aleks_V
December 13, 2019, 9:14am
3
Niall:
Map<String, Object> vars = new HashMap<String, Object>(); vars.put(“myVariable”, true); execution.getProcessEngineServices().getRuntimeService() .createMessageCorrelation(“messageName”) .setVariables(vars) .correlateAllWithResult();
thank you
maybe it’s good for java… but how i can use it in Camunda Modeler (something like expression)
this one work
${execution.getProcessEngineServices().getRuntimeService().createMessageCorrelation(“work”).processInstanceBusinessKey(“Id”).setVariable(“var1”, var1).correlateWithResult()}
can i get process Id in expression?
1 Like
Niall
December 13, 2019, 12:11pm
4
In the modeler you can use javascript directly - the code would look very much the same
Aleks_V
December 19, 2019, 11:38am
5
i use this one in groovy script:
execution.setVariable(“ps_id”,execution.getProcessInstanceId())
or
execution.setVariable(“ps_id”,execution.getId())
Can you show me an example of this?