Jan 5th, 2012, 07:57 AM
How to make a flow only executable as a sub flow
I have a flow defined "participantTransaction" that invokes a subflow "selectParticipant". The sub flow works as expected.
I was wondering if there is a way to keep the flow "selectParticipant" from being directly invoked as the main flow since it will only ever be used as a subflow to another flow?
Jan 5th, 2012, 07:02 PM
You might be able to use the FlowExecutionListener interface to do this. You could implement a sessionStarting method that looks to see if the flowSession has a parent flow and throw an exception if it does not. The listener will fire for all flows so you will some way of indicating that specific flows should not be started directly (perhaps use a flow attribute).
For inspiration, take a look at the SecurityFlowExecutionListener that is used to handle secured flows.