public void afterPropertiesSet() throws Exception { Assert.notNull(flowDefinitionLocator, "The flow definition locator property is required"); if (conversionService == null) { conversionService = new DefaultConversionService(); } MutableAttributeMap<Object> executionAttributes = createFlowExecutionAttributes(); FlowExecutionImplFactory executionFactory = createFlowExecutionFactory(executionAttributes); DefaultFlowExecutionRepository executionRepository = createFlowExecutionRepository(executionFactory); executionFactory.setExecutionKeyFactory(executionRepository); flowExecutor = new FlowExecutorImpl(flowDefinitionLocator, executionFactory, executionRepository); }
private DefaultFlowExecutionRepository createFlowExecutionRepository(FlowExecutionFactory executionFactory) { ConversationManager conversationManager = createConversationManager(); FlowExecutionSnapshotFactory snapshotFactory = createFlowExecutionSnapshotFactory(executionFactory); DefaultFlowExecutionRepository rep = new DefaultFlowExecutionRepository(conversationManager, snapshotFactory); if (maxFlowExecutionSnapshots != null) { rep.setMaxSnapshots(maxFlowExecutionSnapshots); } return rep; }
private MutableAttributeMap<Object> createFlowExecutionAttributes() { LocalAttributeMap<Object> executionAttributes = new LocalAttributeMap<>(); if (flowExecutionAttributes != null) { for (FlowElementAttribute attribute : flowExecutionAttributes) { executionAttributes.put(attribute.getName(), getConvertedValue(attribute)); } } putDefaultFlowExecutionAttributes(executionAttributes); return executionAttributes; }
public void afterPropertiesSet() throws Exception { Assert.notNull(definitionLocator, "The flow definition locator is required"); // apply defaults executionAttributes = defaults.applyExecutionAttributes(executionAttributes); repositoryType = defaults.applyIfNecessary(repositoryType); // pass all available parameters to the hook methods so that they // can participate in the construction process // a factory for flow executions FlowExecutionFactory executionFactory = createFlowExecutionFactory(executionAttributes, executionListenerLoader); // a strategy to restore deserialized flow executions FlowExecutionStateRestorer executionStateRestorer = createFlowExecutionStateRestorer(definitionLocator, executionAttributes, executionListenerLoader); // a repository to store flow executions FlowExecutionRepository executionRepository = createExecutionRepository(repositoryType, executionStateRestorer, conversationManager); // combine all pieces of the puzzle to get an operational flow executor flowExecutor = createFlowExecutor(definitionLocator, executionFactory, executionRepository); }
private Object getConvertedValue(FlowElementAttribute attribute) { if (attribute.needsTypeConversion()) { Class<?> targetType = fromStringToClass(attribute.getType()); ConversionExecutor converter = conversionService.getConversionExecutor(String.class, targetType); return converter.execute(attribute.getValue()); } else { return attribute.getValue(); } }
private Object getConvertedValue(FlowElementAttribute attribute) { if (attribute.needsTypeConversion()) { Class<?> targetType = fromStringToClass(attribute.getType()); ConversionExecutor converter = conversionService.getConversionExecutor(String.class, targetType); return converter.execute(attribute.getValue()); } else { return attribute.getValue(); } }
public void afterPropertiesSet() throws Exception { Assert.notNull(flowDefinitionLocator, "The flow definition locator property is required"); if (conversionService == null) { conversionService = new DefaultConversionService(); } MutableAttributeMap<Object> executionAttributes = createFlowExecutionAttributes(); FlowExecutionImplFactory executionFactory = createFlowExecutionFactory(executionAttributes); DefaultFlowExecutionRepository executionRepository = createFlowExecutionRepository(executionFactory); executionFactory.setExecutionKeyFactory(executionRepository); flowExecutor = new FlowExecutorImpl(flowDefinitionLocator, executionFactory, executionRepository); }
private DefaultFlowExecutionRepository createFlowExecutionRepository(FlowExecutionFactory executionFactory) { ConversationManager conversationManager = createConversationManager(); FlowExecutionSnapshotFactory snapshotFactory = createFlowExecutionSnapshotFactory(executionFactory); DefaultFlowExecutionRepository rep = new DefaultFlowExecutionRepository(conversationManager, snapshotFactory); if (maxFlowExecutionSnapshots != null) { rep.setMaxSnapshots(maxFlowExecutionSnapshots); } return rep; }
private MutableAttributeMap createFlowExecutionAttributes() { LocalAttributeMap executionAttributes = new LocalAttributeMap(); if (flowExecutionAttributes != null) { for (Iterator it = flowExecutionAttributes.iterator(); it.hasNext();) { FlowElementAttribute attribute = (FlowElementAttribute) it.next(); executionAttributes.put(attribute.getName(), getConvertedValue(attribute)); } } putDefaultFlowExecutionAttributes(executionAttributes); return executionAttributes; }
private Object getConvertedValue(FlowElementAttribute attribute) { if (attribute.needsTypeConversion()) { Class targetType = fromStringToClass(attribute.getType()); ConversionExecutor converter = conversionService.getConversionExecutor(String.class, targetType); return converter.execute(attribute.getValue()); } else { return attribute.getValue(); } }
public void afterPropertiesSet() throws Exception { Assert.notNull(flowDefinitionLocator, "The flow definition locator property is required"); if (conversionService == null) { conversionService = new DefaultConversionService(); } MutableAttributeMap executionAttributes = createFlowExecutionAttributes(); FlowExecutionImplFactory executionFactory = createFlowExecutionFactory(executionAttributes); DefaultFlowExecutionRepository executionRepository = createFlowExecutionRepository(executionFactory); executionFactory.setExecutionKeyFactory(executionRepository); flowExecutor = new FlowExecutorImpl(flowDefinitionLocator, executionFactory, executionRepository); }
private DefaultFlowExecutionRepository createFlowExecutionRepository(FlowExecutionFactory executionFactory) { ConversationManager conversationManager = createConversationManager(); FlowExecutionSnapshotFactory snapshotFactory = createFlowExecutionSnapshotFactory(executionFactory); DefaultFlowExecutionRepository rep = new DefaultFlowExecutionRepository(conversationManager, snapshotFactory); if (maxFlowExecutionSnapshots != null) { rep.setMaxSnapshots(maxFlowExecutionSnapshots.intValue()); } return rep; }
private MutableAttributeMap<Object> createFlowExecutionAttributes() { LocalAttributeMap<Object> executionAttributes = new LocalAttributeMap<>(); if (flowExecutionAttributes != null) { for (FlowElementAttribute attribute : flowExecutionAttributes) { executionAttributes.put(attribute.getName(), getConvertedValue(attribute)); } } putDefaultFlowExecutionAttributes(executionAttributes); return executionAttributes; }