PDA

View Full Version : subflow question



Gideon
Apr 22nd, 2005, 05:00 AM
Hi,

is it right that the subflow feature is only a feature to go into a other process without losing the flow data?

because when calling subflows directly which are depending on data input from the main flow, the user will get a error. so for this i can't use subflows.

is it right, so when i will use subflows because some flows repeates, i have to create a transition on this first which catch the error and finish the flow.

or are there any other solutions?

thanks mfg Gideon

Keith Donald
Apr 22nd, 2005, 08:42 AM
A subflow may be passed input data from its parent flow when it is spawned.

Also, a subflow may pass back output data to its parent flow when it ends.

The FlowAttributeMapper strategy does this, and is used by the SubFlowState that manages spawning a subflow and resuming the parent flow when the subflow ends.

So with that said, a Flow has a contract. It is like a black box--a component. It should be self-contained, but may require input data to work and may produce output data other flows can take and do stuff with. If a Flow that requires some input doesn't get it, it needs to take an appropriate action: either throw a exception if it's a programmer error, or immediately end the flow with a error result if it's recoverable.

klr8
Apr 23rd, 2005, 12:52 AM
If you grab the latest & greatest from CVS you will see that there is a new sample application 'FlowLauncher' that demonstrates launching flows with input parameters:

* as stand-alone top-level flows
* as sub-flows
* from the end state of an ending flow

Erwin