/** * 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 synchronized FlowDefinition getFlowDefinition() throws FlowDefinitionConstructionException { if (assembling) { // must return early assembly result for when a flow calls itself recursively return getFlowBuilder().getFlow(); } if (flowDefinition == null) { logger.debug("Assembling the flow for the first time"); assembleFlow(); } else { if (flowDefinition.inDevelopment() && getFlowBuilder().hasFlowChanged()) { logger.debug("The flow under development has changed; reassembling..."); assembleFlow(); } } return flowDefinition; }
/** * 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 synchronized FlowDefinition getFlowDefinition() throws FlowDefinitionConstructionException { if (assembling) { // must return early assembly result for when a flow calls itself recursively return getFlowBuilder().getFlow(); } if (flowDefinition == null) { logger.debug("Assembling the flow for the first time"); assembleFlow(); } else { if (flowDefinition.inDevelopment() && getFlowBuilder().hasFlowChanged()) { logger.debug("The flow under development has changed; reassembling..."); assembleFlow(); } } return flowDefinition; }
public synchronized FlowDefinition getFlowDefinition() throws FlowDefinitionConstructionException { if (assembling) { // must return early assembly result for when a flow calls itself recursively return getFlowBuilder().getFlow(); } if (flowDefinition == null) { logger.debug("Assembling the flow for the first time"); assembleFlow(); } else { if (flowDefinition.inDevelopment() && getFlowBuilder().hasFlowChanged()) { logger.debug("The flow under development has changed; reassembling..."); assembleFlow(); } } return flowDefinition; }
public synchronized FlowDefinition getFlowDefinition() throws FlowDefinitionConstructionException { if (assembling) { // must return early assembly result return getFlowBuilder().getFlow(); } if (!isAssembled()) { lastModified = calculateLastModified(); assembleFlow(); } else { refreshIfChanged(); } return flowDefinition; }
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); }