if (logger.isDebugEnabled()) {
logger.debug("Resuming flow execution with key '" + flowExecutionKey);
}
ExternalContextHolder.setExternalContext(context);
FlowExecutionKey key = executionRepository.parseFlowExecutionKey(flowExecutionKey);
FlowExecutionLock lock = executionRepository.getLock(key);
lock.lock();
try {
FlowExecution flowExecution = executionRepository.getFlowExecution(key);
flowExecution.resume(context);
if (!flowExecution.hasEnded()) {
executionRepository.putFlowExecution(flowExecution);
return createPausedResult(flowExecution);
} else {
executionRepository.removeFlowExecution(flowExecution);
return createEndResult(flowExecution);
}
} finally {
lock.unlock();
}
} finally {
ExternalContextHolder.setExternalContext(null);
}
}