How to define multiple flow executors for differents flow and disable continuation snapshot for some flows?

StackOverflow https://stackoverflow.com/questions/11796947

  •  24-06-2021
  •  | 
  •  

Pregunta

I'm working on a huge project and we would like to have a different management of continuation for some flows.

We want to be able to use the continuation snapshots (those that permit the use of the back button) for most of our flows but we also want to be able to totally disable continuation snapshots for some of our flows that use huge quantity of memory and that we don't want to serialize.

Is it possible ? And how ?

Thank you very much.

¿Fue útil?

Solución

Big caveat that I haven't tried to do any of this. But, here's a potential approach.

First of all, you need your own implementation of FlowExecutionSnapshotFactory. This will allow you to manage the creation and restoration of snapshots. You'll probably want to wrap SerializedFlowExecutionSnapshotFactory, but only allow the snapshot to be created in certain circumstances. Even better, you might want to allow the snapshot to be created, but to omit some of the data from it.

Now the problem is getting Webflow to use your new SnapshotFactory. The factory is created in FlowExecutorFactoryBean.createFlowExecutionSnapshotFactory(). So you need to get this created. You can specify your own FlowExecutorFactoryBean in your application-context.xml file. There's instructions on how to do that at http://forum.springsource.org/showthread.php?54714-SWF-2-0-Backtracking-and-exception-catching - scroll down to angrysoul's post at the bottom.

Now you just need to make sure you provide your own own instance of FlowExecutorImpl, that contains your own snapshot factory.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top