I have a generated start form which asks the user for some data. Immediately afterwards I have a service task which uses those data to make a backend call, running for maybe 10-20 sec.
I would expect that the start form closes before the service task starts executing, after all, the process has started and the first activity runs. However that is not the case, the start form stays open until the first task is done and blocks interactions.
What can I do to ensure that the start form closes once the service task begins?
The default behavior is that start form would only disappear after the process reaches it’s next “Wait State” (e.g. User Task, Message Event, Timer etc.) so it would run the service task in the same thread that starts the process.
If you like you can create Wait States by ticking the “Asynchronous Before/After” tick box on a given element. If you tick Async After on the start event, it’ll return immediately.
i have the similar problem im ExecutionListener on ServiceTask : that is next after Start Event:
Cannot fetch a ProccessInstance for processInstanceId by std. Query:
private ProcessInstance getProcessInstanceForId(String processInstanceId) {
return runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); // .active() ??
}
// because it is not persisted
PROBLEM-1:
if I don’t use a “before” : it gets Null ProcessInstance for processInstanceId in ExecutionListener
if I use a “before” of SeviceTask : Process token it is hanging without execution of serviceTask !
before + after = should : persist before and go towards User Task. Am I right ?