public void init() { registerBeanDefinitionParser("flow-executor", new FlowExecutorBeanDefinitionParser()); registerBeanDefinitionParser("flow-execution-listeners", new FlowExecutionListenerLoaderBeanDefinitionParser()); registerBeanDefinitionParser("flow-registry", new FlowRegistryBeanDefinitionParser()); registerBeanDefinitionParser("flow-builder-services", new FlowBuilderServicesBeanDefinitionParser()); } }
private void registerFlowLocations(DefaultFlowRegistry flowRegistry) { for (FlowLocation location : this.flowLocations) { String path = location.getPath(); String id = location.getId(); AttributeMap<Object> attributes = location.getAttributes(); updateFlowAttributes(attributes); FlowDefinitionResource resource = this.flowResourceFactory.createResource(path, attributes, id); registerFlow(resource, flowRegistry); } }
private void registerFlowLocations() { if (flowLocations != null) { for (FlowLocation location : flowLocations) { flowRegistry.registerFlowDefinition(createFlowDefinitionHolder(createResource(location))); } } }
public void afterPropertiesSet() { flowResourceFactory = new FlowDefinitionResourceFactory(flowBuilderServices.getApplicationContext()); if (basePath != null) { flowResourceFactory.setBasePath(basePath); } flowRegistry = new DefaultFlowRegistry(); flowRegistry.setParent(parent); registerFlowLocations(); registerFlowLocationPatterns(); registerFlowBuilders(); }
private FlowDefinitionResource createResource(FlowLocation location) { AttributeMap<Object> flowAttributes = getFlowAttributes(location.getAttributes()); return flowResourceFactory.createResource(location.getPath(), flowAttributes, location.getId()); }
/** * Create and return a {@link FlowDefinitionRegistry} instance. */ public FlowDefinitionRegistry build() { DefaultFlowRegistry flowRegistry = new DefaultFlowRegistry(); flowRegistry.setParent(this.parent); registerFlowLocations(flowRegistry); registerFlowLocationPatterns(flowRegistry); registerFlowBuilders(flowRegistry); return flowRegistry; }
private void registerFlowBuilders(DefaultFlowRegistry flowRegistry) { for (FlowBuilderInfo info : this.flowBuilderInfos) { AttributeMap<Object> attributes = info.getAttributes(); updateFlowAttributes(attributes); FlowBuilderContext builderContext = new FlowBuilderContextImpl( info.getId(), attributes, flowRegistry, this.flowBuilderServices); FlowAssembler assembler = new FlowAssembler(info.getBuilder(), builderContext); flowRegistry.registerFlowDefinition(assembler.assembleFlow()); } }
private FlowModelHolder createFlowModelHolder(FlowDefinitionResource resource) { FlowModelHolder modelHolder = new DefaultFlowModelHolder(createFlowModelBuilder(resource)); // register the flow model holder with the backing flow model registry - this is needed to support flow model // merging during the flow build process flowRegistry.getFlowModelRegistry().registerFlowModel(resource.getId(), modelHolder); return modelHolder; }
/** * Return a builder for creating a {@link FlowDefinitionRegistry} instance. * @return the created builder */ protected FlowDefinitionRegistryBuilder getFlowDefinitionRegistryBuilder() { return new FlowDefinitionRegistryBuilder(this.applicationContext); }
/** * Create a classpath-based resource from the path provided. * @param path the {@link ClassPathResource} path * @param clazz to specify if the path should be relative to another class * @return the classpath-based flow definition resource */ public FlowDefinitionResource createClassPathResource(String path, Class<?> clazz) { Resource resource = new ClassPathResource(path, clazz); return new FlowDefinitionResource(getFlowId(resource), resource, null); }
private void registerFlowBuilders() { if (flowBuilders != null) { for (FlowBuilderInfo builderInfo : flowBuilders) { flowRegistry.registerFlowDefinition(buildFlowDefinition(builderInfo)); } } }
/** * Register a custom {@link FlowBuilder} instance with the given flow id. * @param builder the FlowBuilder to configure * @param id the id assign to the flow definition in this registry. * Specify when you wish to provide a custom flow definition identifier. */ public FlowDefinitionRegistryBuilder addFlowBuilder(FlowBuilder builder, String id) { addFlowBuilder(builder, id, null); return this; }
/** * Register a {@link FlowExecutionListener} that observes the lifecycle of all flow * executions launched by this executor. * @param listener the listener to be registered */ public FlowExecutorBuilder addFlowExecutionListener(FlowExecutionListener listener) { return addFlowExecutionListener(listener, "*"); }
/** * Register a flow defined at the following location as an .xml file. * This may be a path to a single resource or a ANT-style path expression that * matches multiple resources. * @param path the resource path to the externalized flow definition resource. */ public FlowDefinitionRegistryBuilder addFlowLocation(String path) { this.addFlowLocation(path, null, null); return this; }
/** * Return a builder for creating a {@link FlowExecutor} instance. * @param flowRegistry the {@link FlowDefinitionRegistry} to configure on the flow executor * @return the created builder */ protected FlowExecutorBuilder getFlowExecutorBuilder(FlowDefinitionLocator flowRegistry) { return new FlowExecutorBuilder(flowRegistry); }
/** * Create a flow definition resource from the path location provided. * @param path the encoded {@link Resource} path. * @return the flow definition resource */ public FlowDefinitionResource createResource(String path) { return createResource(path, null, null); }
/** * Return a builder for creating a {@link FlowBuilderServices} instance. * @return the created builder */ protected FlowBuilderServicesBuilder getFlowBuilderServicesBuilder() { return new FlowBuilderServicesBuilder(); }
/** * Return a builder for creating a {@link FlowDefinitionRegistry} instance. * @param flowBuilderServices the {@link FlowBuilderServices} to configure on the flow registry with * @return the created builder */ protected FlowDefinitionRegistryBuilder getFlowDefinitionRegistryBuilder(FlowBuilderServices flowBuilderServices) { return new FlowDefinitionRegistryBuilder(this.applicationContext, flowBuilderServices); }
/** * Register a custom {@link FlowBuilder} instance. * @param builder the FlowBuilder to configure */ public FlowDefinitionRegistryBuilder addFlowBuilder(FlowBuilder builder) { addFlowBuilder(builder, null, null); return this; }
/** * Create a flow definition resource from the path location provided. The returned resource will be configured with * the provided attributes. * @param path the encoded {@link Resource} path. * @param attributes the flow definition meta attributes to configure * @return the flow definition resource */ public FlowDefinitionResource createResource(String path, AttributeMap<Object> attributes) { return createResource(path, attributes, null); }