Thank you pmsevestre for your consideration.
"That leads to the problem of how would you inform the parser when a task is long or not": this is a point I already considered and which is easily doable, at least in the context of my project. To be short, in the function executeParse() of my own ServiceTaskParseHandler, I have this information:
<java>
public class MyOwnServiceTaskParseHandler extends ServiceTaskParseHandler {
@Override
protected void executeParse(BpmnParse bpmnParse, ServiceTask serviceTask) {
….
boolean isAsync = hasTaskToBeAsync(serviceTask);
bpmnParse.getCurrentActivity().setAsync(isAsync);
…
}
}
</java>
Doing that, I can easily make my long running tasks being async so startProcessInstanceByKey() will now be async, i.e. it will not wait for the end of my long running task before returning
Now, my main question the impact of making workflows "not having long running tasks" asynchronous too, in order they are treated consistently with workflows "having long running tasks"
"Be aware though that this kind of implicit behaviour must be fully understood by the person who is designing the BPMN process, since it changes the transaction contract associated with the execution of consecutive activities": one of my objectives is that the BPMN process designer is not impacted at all with any implementation detail. Can you please tell me more about the changes regarding "transaction contract associated with the execution of consecutive activities"?
One again, thank you very much
Philippe