/** * 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); }
/** * 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, "*"); }
private DefaultFlowExecutionRepository getFlowExecutionRepository(FlowExecutionFactory executionFactory) { ConversationManager manager = getConversationManager(); FlowExecutionSnapshotFactory snapshotFactory = getSnapshotFactory(executionFactory); DefaultFlowExecutionRepository repository = new DefaultFlowExecutionRepository(manager, snapshotFactory); if (this.maxFlowExecutionSnapshots != null) { repository.setMaxSnapshots((this.maxFlowExecutionSnapshots == 0) ? 1 : this.maxFlowExecutionSnapshots); } return repository; }
/** * Create and return a {@link FlowExecutor} instance. */ public FlowExecutor build() { FlowExecutionImplFactory executionFactory = getExecutionFactory(); DefaultFlowExecutionRepository executionRepository = getFlowExecutionRepository(executionFactory); executionFactory.setExecutionKeyFactory(executionRepository); return new FlowExecutorImpl(this.flowRegistry, executionFactory, executionRepository); }
@Bean public FlowExecutor flowExecutor() { return getFlowExecutorBuilder(flowRegistry()) .setMaxFlowExecutions(1).setMaxFlowExecutionSnapshots(2) .setConversationManager(new ExceptionThrowingConversationManager()) .setAlwaysRedirectOnPause(false) .setRedirectInSameState(true) .addFlowExecutionAttribute("foo", "bar") .addFlowExecutionAttribute("bar", 2) .addFlowExecutionListener(new ConfigurationListener(), "*") .build(); }
@Bean public FlowExecutor flowExecutor() { return getFlowExecutorBuilder(flowRegistry()).addFlowExecutionListener(new SecurityFlowExecutionListener(), "*") .build(); }
@Bean public FlowExecutor flowExecutorSimpleRepo() { return getFlowExecutorBuilder(flowRegistry()) .setMaxFlowExecutions(1).setMaxFlowExecutionSnapshots(0) .build(); } }
private FlowExecutionImplFactory getExecutionFactory() { FlowExecutionImplFactory executionFactory = new FlowExecutionImplFactory(); executionFactory.setExecutionAttributes(getExecutionAttributes()); if (this.listenerLoader != null) { executionFactory.setExecutionListenerLoader(this.listenerLoader); } return executionFactory; }
/** * Create and return a {@link FlowExecutor} instance. */ public FlowExecutor build() { FlowExecutionImplFactory executionFactory = getExecutionFactory(); DefaultFlowExecutionRepository executionRepository = getFlowExecutionRepository(executionFactory); executionFactory.setExecutionKeyFactory(executionRepository); return new FlowExecutorImpl(this.flowRegistry, executionFactory, executionRepository); }
private FlowExecutionImplFactory getExecutionFactory() { FlowExecutionImplFactory executionFactory = new FlowExecutionImplFactory(); executionFactory.setExecutionAttributes(getExecutionAttributes()); if (this.listenerLoader != null) { executionFactory.setExecutionListenerLoader(this.listenerLoader); } return executionFactory; }
/** * 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); }
/** * 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, "*"); }
private DefaultFlowExecutionRepository getFlowExecutionRepository(FlowExecutionFactory executionFactory) { ConversationManager manager = getConversationManager(); FlowExecutionSnapshotFactory snapshotFactory = getSnapshotFactory(executionFactory); DefaultFlowExecutionRepository repository = new DefaultFlowExecutionRepository(manager, snapshotFactory); if (this.maxFlowExecutionSnapshots != null) { repository.setMaxSnapshots((this.maxFlowExecutionSnapshots == 0) ? 1 : this.maxFlowExecutionSnapshots); } return repository; }
/** * 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); }
/** * 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); }