public String getFlowDefinitionId() { return assembler.getFlowBuilderContext().getFlowId(); }
public String getFlowDefinitionResourceString() { return assembler.getFlowBuilder().getFlowResourceString(); }
/** * Factory method that initially creates the flow implementation during flow builder initialization. Simply * delegates to the configured flow artifact factory by default. * @return the flow instance, initially created but not yet built */ protected Flow createFlow() { String id = getContext().getFlowId(); AttributeMap<Object> attributes = getContext().getFlowAttributes(); return getContext().getFlowArtifactFactory().createFlow(id, attributes); }
/** * Build all parts of the flow by directing flow assembly by the flow builder. * @throws FlowBuilderException when flow assembly fails */ protected void directAssembly() throws FlowBuilderException { flowBuilder.buildVariables(); flowBuilder.buildInputMapper(); flowBuilder.buildStartActions(); flowBuilder.buildStates(); flowBuilder.buildGlobalTransitions(); flowBuilder.buildEndActions(); flowBuilder.buildOutputMapper(); flowBuilder.buildExceptionHandlers(); } }
/** * 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(); } }
private FlowDefinitionHolder createFlowDefinitionHolder(FlowDefinitionResource flowResource) { FlowBuilder builder = createFlowBuilder(flowResource); FlowBuilderContext builderContext = new FlowBuilderContextImpl(flowResource.getId(), flowResource.getAttributes(), flowRegistry, flowBuilderServices); FlowAssembler assembler = new FlowAssembler(builder, builderContext); return new DefaultFlowHolder(assembler); }
private void assembleFlow() throws FlowDefinitionConstructionException { try { assembling = true; flowDefinition = assembler.assembleFlow(); } catch (FlowBuilderException e) { throw new FlowDefinitionConstructionException(assembler.getFlowBuilderContext().getFlowId(), e); } finally { assembling = false; } }
/** * Gets the converterId for the binding with the specified name. Returns null if either a binding or a converterId * for the given name is not found. * * @param name the name of the binding. * @return the binding */ public String getConverterId(String name) { Binding binding = getBinding(name); if (binding != null) { return binding.getConverter(); } else { return null; } }
public AttributeMap<Object> getFlowAttributes() { return parent.getFlowAttributes(); }
private FlowBuilder getFlowBuilder() { return assembler.getFlowBuilder(); }
public String getFlowId() { return parent.getFlowId(); }
public synchronized void refresh() throws FlowDefinitionConstructionException { assembleFlow(); }
/** * Gets the binding with the specified name, or returns null if no such binding is found. * @param name the name of the binding. * @return the binding */ public Binding getBinding(String name) { for (Binding binding : bindings) { if (name.equals(binding.getProperty())) { return binding; } } return null; }
public ConversionService getConversionService() { if (localFlowContext.containsLocalBean("conversionService")) { return localFlowContext.getBean("conversionService", ConversionService.class); } else { return parent.getConversionService(); } }
public ViewFactoryCreator getViewFactoryCreator() { if (localFlowContext.containsLocalBean("viewFactoryCreator")) { return localFlowContext.getBean("viewFactoryCreator", ViewFactoryCreator.class); } else { return parent.getViewFactoryCreator(); } }
public ExpressionParser getExpressionParser() { if (localFlowContext.containsLocalBean("expressionParser")) { return localFlowContext.getBean("expressionParser", ExpressionParser.class); } else { return parent.getExpressionParser(); } }
public FlowArtifactFactory getFlowArtifactFactory() { if (localFlowContext.containsLocalBean("flowArtifactFactory")) { return localFlowContext.getBean("flowArtifactFactory", FlowArtifactFactory.class); } else { return parent.getFlowArtifactFactory(); } }
public FlowDefinitionLocator getFlowDefinitionLocator() { if (localFlowContext.containsLocalBean("flowRegistry")) { return localFlowContext.getBean("flowRegistry", FlowDefinitionLocator.class); } else { return parent.getFlowDefinitionLocator(); } }
private boolean isCustomConverterConfigured(String field) { if (binderConfiguration == null) { return false; } return (binderConfiguration.getConverterId(field) != null); }
public ValidationHintResolver getValidationHintResolver() { if (localFlowContext.containsLocalBean("validationHintResolver")) { return localFlowContext.getBean("validationHintResolver", ValidationHintResolver.class); } else { return parent.getValidationHintResolver(); } }