Hey everyone,
I am iterating through JSON array node collection using .elements() method. I was wondering if I could set fixed delay between sequential call activities using camunda engine fuctionality, like I showed in the screenshot.
@ilyabr in the multi instance activity, add a execution listener in the Start event type to wait for fixed time, once the time elapsed, let the execution listener to complete it. Note until the execution listener completes the execution, task won’t be created.
public class ExampleExecutionListenerOne implements ExecutionListener {
public void notify(DelegateExecution execution) throws Exception {
if (ExecutionListener.EVENTNAME_START.equals(execution.getEvent()){
try {
java.util.concurrent.TimeUnit.SECONDS.sleep(secondsToSleep);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
}
//business logic
}
}
}
or
public class ExampleExecutionListenerOne implements ExecutionListener {
public void notify(DelegateExecution execution) throws Exception {
if (ExecutionListener.EVENTNAME_START.equals(execution.getEvent()){
try {
Thread.sleep(secondsToSleep * 1000);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
}
//business logic
}
}
}
Yeah correct. You can try and let us know if any issue
Works indeed. Much appreciated, dude.