I’m trying to test a process model that has a start event with the flag asynBefore.
When I start the process with
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(“processKey”);
This is all green, but I don’t know how to move on to the first task or job because the processes
waits at the start event which is neither a task nor a job.
Can you give any hints?
after the process is started a Job is created. So you have to query the job and execute it via the management service.
See following code snipped:
ProcessInstance asyncProc = rule.getRuntimeService().startProcessInstanceByKey("asyncProc");
Job job = rule.getManagementService().createJobQuery().singleResult();
if you use camunda-bpm-assert (https://github.com/camunda/camunda-bpm-assert#get-started-in-3-simple-steps),
excute(job()) will do your job.
you are both right! Thank you very much!
typo in expression: