public void testSubflow() throws Exception {
final FlowExecutionImplFactory executionFactory = new FlowExecutionImplFactory();
final Flow flow = createFlowWithSubflow("parent", "child");
final CasFlowExecutionKeyFactory keyFactory = new CasFlowExecutionKeyFactory(
this.mockConversationManager,
new SimpleFlowExecutionSnapshotFactory(executionFactory, newMockFlowLocator(flow)));
keyFactory.setAlwaysGenerateNewNextKey(true);
executionFactory.setExecutionKeyFactory(keyFactory);
final FlowExecution execution = executionFactory.createFlowExecution(flow);
execution.start(null, new MockExternalContext());