if (factory.hasWorkflow(document)) {
try {
String userId = getParameters().getParameter(PARAMETER_USER_ID);
String machineIp = getParameters().getParameter(PARAMETER_IP_ADDRESS);
SynchronizedWorkflowInstances instance;
try {
instance = factory.buildSynchronizedInstance(document);
} catch (WorkflowException e) {
throw new ExecutionException(e);
}
Situation situation = factory.buildSituation(getRoleIDs(), userId, machineIp);
Event event = getExecutableEvent(instance, situation);
assert event != null;
if (log.isDebugEnabled()) {
log.debug("Invoking event [" + event.getName() + "]");
}
instance.invoke(situation, event);
if (log.isDebugEnabled()) {
log.debug("Invoking transition completed.");
}
} catch (Exception e) {
throw new ExecutionException(e);