Call back or wait mechanism of Service Task implemented using http-connector

Hi ,
Can anyone please help me provide a sample bpmn file which has call back /wait mechanism implemented.
My BPMN file calls the Rest microservice service tasks using http-connector.

Thanks and Regards ,
Albin

Hi @Albin_Chandy

one good option to wait for a callback in BPMN is to directly model it as e.g. one Send Task & a Receive Task afterwards. The Send Task can be implemented using the connector and the Receive Task would have to be triggered by using message correlation from your external system.

Does this help?

Best
Felix

2 Likes

Thanks @felix-mueller .
I will try this .
I am using the camunda rest api to create the bpmn .So I dont have diagramatic representation.
Any examples of the receive task trigger using message correlation would be helpful.

Hi @Albin_Chandy

you can correlate a message using e.g. the REST API:

or using the Java API e.g.

// correlate the message
runtimeService.createMessageCorrelation("messageName")
  .processInstanceBusinessKey("AB-123")
  .correlate(); 

More you will find Message Events | docs.camunda.org
because the receive Task basically works same way as an intermediate catch message event (which you could use instead of the receive task, too).

Don’t forget to specify a message name for the receive task :slight_smile:

3 Likes

Hi @felix-mueller ,

Here is a sample of the bpmn file which I am using right now.
I want to introduce a wait/receive task after each service task .
If am right on this the service task should trigger the url and its response should be taken to the next receive task which then continues the flow.

Is it possible for me to introduce the wait/receive task with the current design.Please help.

bpmn-model-api-7683246753027691751.bpmn (6.6 KB)

HI @Albin_Chandy
do you have to make use of the model API or could you also use the Camunda Modeler?
As you can see here: https://docs.camunda.org/manual/7.8/user-guide/model-api/bpmn-model-api/fluent-builder-api/ the model api is limited to specific elements at the moment.
If you do have to use the Model API you would have to look for a workaround in your service task implementation.

Thank you for your answer, however I have problem with the Send something call.
I have two process definitions which run at difference time in day. The “Send something to API” task is a API in external/third party system. Could you help me how I can trigger message event to “Receive task” which belong to process instance called to the API.