Hi,
a bit of a random question, in a scenario of needing to have the result of a workflow sent back. ie
REST request comes in -> starts workflow
workflow executes
result sent on REST response
i have achieved this by doing a Thread.sleep on the main request thread then query for the workflow by id every 500ms
instances = workflowInstances.listWorkflowInstances(query);
if (instance.state.equals(MyWorkFlow.State.done.name())) {
return instance.getStateVariable("RESPONSE",Response.class)
}
is there a builtin hook/callback that can be put on a workflow or should i create a service layer with callable futures that the workflow puts the response on.
i suppose my question being, "is there a best practice way of doing this"
Regards,
Julian