/** * Assembles the flow, directing the construction process by delegating to the configured FlowBuilder. Every call to * this method will assemble the Flow instance. * <p> * This will drive the flow construction process as described in the {@link FlowBuilder} JavaDoc, starting with * builder initialization using {@link FlowBuilder#init(FlowBuilderContext)} and finishing by cleaning up the * builder with a call to {@link FlowBuilder#dispose()}. * @return the constructed flow * @throws FlowBuilderException when flow assembly fails */ public Flow assembleFlow() throws FlowBuilderException { try { flowBuilder.init(flowBuilderContext); directAssembly(); return flowBuilder.getFlow(); } finally { flowBuilder.dispose(); } }
/** * Assembles the flow, directing the construction process by delegating to the configured FlowBuilder. Every call to * this method will assemble the Flow instance. * <p> * This will drive the flow construction process as described in the {@link FlowBuilder} JavaDoc, starting with * builder initialisation using {@link FlowBuilder#init(String, AttributeMap)} and finishing by cleaning up the * builder with a call to {@link FlowBuilder#dispose()}. * @return the constructed flow * @throws FlowBuilderException when flow assembly fails */ public Flow assembleFlow() throws FlowBuilderException { if (logger.isDebugEnabled()) { logger.debug("Assembling flow definition with id '" + flowId + "' using flow builder '" + flowBuilder + "'; externally assigned flow attributes are '" + flowAttributes + "'"); } try { flowBuilder.init(flowId, flowAttributes); directAssembly(); return flowBuilder.getFlow(); } finally { flowBuilder.dispose(); } }
/** * Assembles the flow, directing the construction process by delegating to the configured FlowBuilder. Every call to * this method will assemble the Flow instance. * <p> * This will drive the flow construction process as described in the {@link FlowBuilder} JavaDoc, starting with * builder initialization using {@link FlowBuilder#init(FlowBuilderContext)} and finishing by cleaning up the * builder with a call to {@link FlowBuilder#dispose()}. * @return the constructed flow * @throws FlowBuilderException when flow assembly fails */ public Flow assembleFlow() throws FlowBuilderException { try { flowBuilder.init(flowBuilderContext); directAssembly(); return flowBuilder.getFlow(); } finally { flowBuilder.dispose(); } }
/** * Assembles the flow, directing the construction process by delegating to the configured FlowBuilder. Every call to * this method will assemble the Flow instance. * <p> * This will drive the flow construction process as described in the {@link FlowBuilder} JavaDoc, starting with * builder initialization using {@link FlowBuilder#init(FlowBuilderContext)} and finishing by cleaning up the * builder with a call to {@link FlowBuilder#dispose()}. * @return the constructed flow * @throws FlowBuilderException when flow assembly fails */ public Flow assembleFlow() throws FlowBuilderException { try { flowBuilder.init(flowBuilderContext); directAssembly(); return flowBuilder.getFlow(); } finally { flowBuilder.dispose(); } }
public void testDisposeCalledOnException() { builder.init(builderContext); EasyMock.expectLastCall().andThrow(new IllegalArgumentException()); builder.dispose(); EasyMock.replay(builder); try { assembler.assembleFlow(); fail("Should have failed"); } catch (IllegalArgumentException e) { EasyMock.verify(builder); } } }
public void testAssembleFlow() { builder.init(builderContext); builder.dispose(); builder.buildVariables(); builder.buildInputMapper(); builder.buildStartActions(); builder.buildStates(); builder.buildGlobalTransitions(); builder.buildEndActions(); builder.buildOutputMapper(); builder.buildExceptionHandlers(); EasyMock.expect(builder.getFlow()).andReturn(new Flow("search")); EasyMock.replay(builder); Flow flow = assembler.assembleFlow(); assertEquals("search", flow.getId()); EasyMock.verify(builder); }