Sometimes, an independently existing business process can take part in another more sophisticated process. Instead of redefining the activities, edges, properties, and hooks in the parent process, the independent process could be included as a “subProcess” within a specific node. As the execution logic is inside the subProcess, the subProcess activities are started and terminated automatically by the Workflow engine according to the subProcess state. Creating a SubProcess Activity: When a subProcess activity is defined in the process, a specific activity with subflow behavior is created with the definition of the parsed activity (process id of the process, local variables, in/out/in-out parameters of the sub...).. Instantiating a Process with a SubProcess Activity: At execution phase when the execution enter into the subflow type activity, the following operations are done:
an instance of the process referenced by the subflow activity is created.
A new root execution is created into this instance and is automatically started (then execution enters in the first activity of the subflow).
local variables of the subflow activity (defined with an extended attribute) are created as global variables of the instance of the subflow (this is the way to pass variables to a subflow when the processes are defined under proEd editor), As variables are not propagated, transmission of variables/values could be done thru hooks executed within activities of the subflow (setting variables into the parent process).
if both formal parameters into the subflow process and actual paremeters into the subflow activity have been defined, the list of actual parameters are passed to the subflow (these XPDL definitions are supported by Bonita engine but not by proEd editor).