@JobWorker(type="notifyOrder")
public void notifyOrder(@Variable String orderId, @Variable String paymentInformation) {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("paymentInformation", paymentInformation);
execution.getProcessEngineServices().getRuntimeService()
.createMessageCorrelation("MsgPaymentReceived")
.processInstanceVariableEquals("orderId", orderId)
.setVariables(variables)
.correlate();
}
The above example should be like below:
zeebeClient.newPublishMessageCommand()
.messageName("messageNameX")
.correlationKey("someKeyX")
.send()
.join();