An edge case in ThreadSafeExecution#complete() seems to be handled in a too simple way that might only work in a unit test:
public void complete() {
try {
getRuntimeServiceWhenCommitted().signal(getId(), getVariables());
} catch (PvmException e) {
if (e.getMessage().equals("cannot signal execution " + getId() + ": it has no current activity")) {
Execution execution = getRuntimeService().createExecutionQuery()
.activityId(getCurrentActivityId()) // FIXME test with multiple instances running in parallel; maybe getActivityInstanceId() was meant here
.singleResult();
getRuntimeServiceWhenCommitted().signal(execution.getId(), getVariables());
} else {
throw e;
}
}
}
An edge case in ThreadSafeExecution#complete() seems to be handled in a too simple way that might only work in a unit test: