Trigger external service and then listen for JMS response

cancel
Showing results for 
Search instead for 
Did you mean: 
wintuit
Member II

Trigger external service and then listen for JMS response

Hi there,

I'm currently working on a project that uses Activiti to trigger external systems and then waits for a response from that system in the form of a JMS message. I have a Java Service task that is responsible for calling the external service and then a listener class that uses RuntimeService.signal(executionId) to set a receive task to completed. The issue is that when the external service responds too quickly (within milliseconds), it seems as if Activiti hasn't transitioned into the receive task yet and the workflow isn't able to continue.

I've been trying to solve this by setting up the tasks in parallel but that's been its own can of worms as the trigger ends up happening multiple times. Is there a suggested way to build my workflow to fit this sort of situation?

I've attached images of our current workflow as well as the solution I've been attempting.

1 Reply
ryandawson
Alfresco Employee

Re: Trigger external service and then listen for JMS response

Could you maybe combine the sending and the listening into a single service task?