Need a good Example of "Receive Task", completed via REST API

Receive Tasks waits until the corresponding message correlation is received.
I have added a Receive Task next to a Service Task like below:

image

Task1 is a Service Task and is associated with a Java Delegate class. Now, Task1 is completed and the token has been moved to the Receive Task.

How to send the message using REST API to complete/move ahead after “Receive Task”?

I am referring to the below REST API but am not sure about the payload to be sent:

Do I need to add some correlation-related code in the Java Delegate class attached with Task1? I do not think so, because I do not want to complete it via Task1. I want to wait on the “Receive Task” and complete it from outside through the REST API call.

Here is the example:



Additionally you can refer this thread: What are localCorrelationKeys and correlationKeys parameters of Correlate a Message REST API - #6 by StephenOTT

1 Like

@kesava_Palanisamy Thanks!

I am not using “buisnessKey”, but the below payload is working for me.

{
  "messageName" : "Task1_Completed_By_Service",
  "processInstanceId":"d10edc3e-4e68-11ec-ac4a-ca289c20f7da",
  "resultEnabled" : true
}

I hope I can add more parameters to attach with the “Receive Task” to complete so that the message will not start any other Receive Task.

I hope it is also possible to add output and other key values from POST message, which can be used as output.