SWF-1213 Added calls to lock/unlock the conversation when an execution is launched. This causes the conversation to be put back into the HTTP session.
This commit is contained in:
@@ -139,7 +139,13 @@ public class FlowExecutorImpl implements FlowExecutor {
|
||||
FlowExecution flowExecution = executionFactory.createFlowExecution(flowDefinition);
|
||||
flowExecution.start(input, context);
|
||||
if (!flowExecution.hasEnded()) {
|
||||
executionRepository.putFlowExecution(flowExecution);
|
||||
FlowExecutionLock lock = executionRepository.getLock(flowExecution.getKey());
|
||||
lock.lock();
|
||||
try {
|
||||
executionRepository.putFlowExecution(flowExecution);
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
return createPausedResult(flowExecution);
|
||||
} else {
|
||||
return createEndResult(flowExecution);
|
||||
|
||||
@@ -53,11 +53,19 @@ public class FlowExecutorImplTests extends TestCase {
|
||||
execution.hasEnded();
|
||||
EasyMock.expectLastCall().andReturn(Boolean.FALSE);
|
||||
|
||||
MockFlowExecutionKey flowExecutionKey = new MockFlowExecutionKey("12345");
|
||||
EasyMock.expect(execution.getKey()).andReturn(flowExecutionKey);
|
||||
EasyMock.expect(repository.getLock(flowExecutionKey)).andReturn(lock);
|
||||
|
||||
lock.lock();
|
||||
|
||||
repository.putFlowExecution(execution);
|
||||
|
||||
lock.unlock();
|
||||
|
||||
EasyMock.expect(execution.getDefinition()).andReturn(definition);
|
||||
EasyMock.expect(definition.getId()).andReturn("foo");
|
||||
EasyMock.expect(execution.getKey()).andReturn(new MockFlowExecutionKey("12345"));
|
||||
EasyMock.expect(execution.getKey()).andReturn(flowExecutionKey);
|
||||
|
||||
replayMocks();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user