Refreshable flows with ExternalizedFlowRegistrar
Hello,
This configuration worked well with 1.0-rc2 when reading flows from files with a specific format.
But i need now the flows get reloaded each time they are started, because their definitions are changed diectly in the filesystem.
I just cant see the way to do this declaratively with RefreshableFlowHolder or by any other way.
Any help? ThanksCode:
lt;bean id=quot;flowExecutorquot; class=quot;org..webflow.executor.FlowExecutorImplquot;gt;
lt;constructor-arg ref=quot;repositoryFactoryquot; /gt;
lt;/beangt;
lt;bean id=quot;repositoryFactoryquot; class=quot;org..webflow.execution.repository.continuation.ContinuationFlowExecutionRepositoryFactoryquot;gt;
lt;constructor-arg ref=quot;flowRegistryquot; /gt;
lt;/beangt;
lt;bean id=quot;flowRegistryquot; class=quot;org..webflow.registry.FlowRegistryFactoryBeanquot;gt;
lt;property name=quot;flowRegistrarsquot;gt;
lt;listgt;
lt;ref bean=quot;cuestionarioFlowRegistrarquot; /gt;
lt;/listgt;
lt;/propertygt;
lt;/beangt;
lt;bean id=quot;cuestionarioFlowRegistrarquot; class=quot;org.fundacionctic.cuestionarios.flow.CuestionarioFlowRegistrarquot;gt;
lt;property name=quot;redireccionFinalquot;gt;
lt;valuegt;evaluador.jsplt;/valuegt;
lt;/propertygt;
lt;property name=quot;flowLocationsquot;gt;
lt;listgt;
lt;valuegt;/cuestionarios_competencias/*.cuestionariolt;/valuegt;
lt;/listgt;
lt;/propertygt;
lt;/beangt;I'd recommend upgrading to 1.0.1 and using the Spring 2.0 webflow configuration schema. You'll get refreshable flows by default.
Keith
Thank for your response, Keith
I have subclassed ExternalizedFlowDefinitionRegistrar (CuestionarioFlowRegistrar) and AbstractFlowBuildingFlowRegistryFactoryBean (CuestionariosFlowRegistryFactoryBean) as i read in another post that was the way to manage a registrar for our own file format.
And the configuration 2.0 we have now:
Code:
lt;flow:executor id=quot;flowExecutorquot; registry-ref=quot;flowRegistryquot; repository-type=quot;continuationquot;/gt;
lt;bean id=quot;flowRegistryquot;
class=quot;org.fundacionctic.cuestionarios.flow.CuestionariosFlowRegistryFactoryBeanquot;gt;
lt;property name=quot;cuestionarioFlowRegistrarquot; ref=quot;cuestionarioFlowRegistrarquot; /gt;
lt;/beangt;
lt;bean id=quot;cuestionarioFlowRegistrarquot; class=quot;org.fundacionctic.cuestionarios.flow.CuestionarioFlowRegistrarquot;gt;
lt;property name=quot;redireccionFinalquot;gt;
lt;valuegt;evaluador.jsplt;/valuegt;
lt;/propertygt;
lt;property name=quot;locationsquot;gt;
lt;listgt;
lt;valuegt;
/cuestionarios_competencias/*.cuestionario
lt;/valuegt;
lt;/listgt;
lt;/propertygt;
lt;/beangt;
The flows work ok, buy we still have the problem that they dont refresh when changed its source files in the filesystem. We have to reload the webapp. How can we get automatic refreshable flows?
And another question, in 1.0-rc2 the FlowRegistryFactoryBean allowed a list of 'flowRegistrars' of different types. Not in 1.0.1. Can we have different registrar in the same registry?
How can we get automatic refreshable flows?
Make sure you're using the RefreshableFlowDefinitionHolder. That's the part of SWF that does the refresh.
Can we have different registrar in the same registry?
Yes, you can have different FlowDefinitionRegistrar implementations all register flows in the same FlowDefinitionRegistry. Consider subclassing AbstractFlowDefinitionRegistryFactoryBean or AbstractFlowBuildingFlowRegistryFactoryBean to do this.
Erwin |