/** * Factory method that creates a flow definition from an externalized resource location. * @param location the location of the resource * @return the externalized flow definition pointer */ protected FlowDefinitionResource createFlowDefinitionResource(Resource location) { return new FlowDefinitionResource(location); }
/** * Creates a new externalized flow definition resource. The flow id assigned will be the same name as the * externalized resource's filename, excluding the extension. * @param location the flow resource location * @param attributes flow definition attributes to be assigned */ public FlowDefinitionResource(Resource location, AttributeMap attributes) { init(conventionalFlowId(location), location, attributes); }
protected FlowDefinitionHolder createFlowDefinitionHolder(FlowDefinitionResource resource) { FlowBuilder builder = createFlowBuilder(resource.getLocation()); FlowAssembler assembler = new FlowAssembler(resource.getId(), resource.getAttributes(), builder); return new RefreshableFlowDefinitionHolder(assembler); }
/** * Add configured flow definition locations to the flow definition registrar. */ private void addFlowDefinitionLocations() { if (locations != null) { for (int i = 0; i < locations.length; i++) { String flowId = FlowDefinitionResource.conventionalFlowId(locations[i]); getXmlFlowRegistrar().addResource( new FlowDefinitionResource(flowId, locations[i], getFlowAttributes(flowId))); } } }
/** * Creates a new externalized flow definition. * @param id the flow id to be assigned * @param location the flow resource location */ public FlowDefinitionResource(String id, Resource location) { init(id, location, null); }
/** * Factory method to assemble a flow definition from a resource. Called by {@link #getFlowDefinition()} to create * the "main" flow to test. May also be called by subclasses to create subflow definitions whose executions should * also be exercised by this test. * @param resource the flow definition resource * @return the built flow definition, ready for execution * @see #createFlowBuilder(Resource, FlowServiceLocator) */ protected final Flow createFlow(FlowDefinitionResource resource, FlowServiceLocator serviceLocator) { FlowBuilder builder = createFlowBuilder(resource.getLocation(), serviceLocator); FlowAssembler assembler = new FlowAssembler(resource.getId(), resource.getAttributes(), builder); return assembler.assembleFlow(); }
/** * Creates a new externalized flow definition. * @param id the flow id to be assigned * @param location the flow resource location * @param attributes flow definition attributes to be assigned */ public FlowDefinitionResource(String id, Resource location, AttributeMap attributes) { init(id, location, attributes); }
/** * Creates a new externalized flow definition resource. The flow id assigned will be the same name as the * externalized resource's filename, excluding the extension. * @param location the flow resource location */ public FlowDefinitionResource(Resource location) { init(conventionalFlowId(location), location, null); }
/** * Convenient factory method that creates a {@link FlowDefinitionResource} from a file. Typically called by * subclasses overriding {@link #getFlowDefinitionResource()}. * @param file the file * @return the flow definition resource */ protected FlowDefinitionResource createFlowDefinitionResource(File file) { return new FlowDefinitionResource(new FileSystemResource(file)); } }
/** * Add flow definitions configured using a property map to the flow definition registrar. */ private void addFlowDefinitionsFromProperties() { if (flowDefinitions != null) { Iterator it = flowDefinitions.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); String flowId = (String) entry.getKey(); String location = (String) entry.getValue(); Resource resource = getFlowServiceLocator().getResourceLoader().getResource(location); getXmlFlowRegistrar().addResource( new FlowDefinitionResource(flowId, resource, getFlowAttributes(flowId))); } } }