Configuring Subprocess Activities

You have the option to configure subprocess activities by assigning a process to a subprocess activity or by creating them from activity networks.

Configuring Subprocess Activities

To define an activity as a subprocess, select Subprocess as the type of the activity. In the properties dialog, select the desired process from list of existing process definitions.
If you select Display Imported Model Elements as Groups check box, the references for the referenced process definitions are displayed. It also groups local and referenced elements.  

Configuring a Subprocess
Figure: Configuring a Subprocess

If you assign a process to a subprocess activity, you have the option to give the activity the name of this process. Please refer to the section Naming the subprocess for details.

You can configure your subprocesses with the following three different execution types:

Synchronous Subprocesses with Shared Data

Synchronous subprocesses with shared data "inherit" data from their super process. Hence, you do not have to pass data to or retrieve data from synchronous subprocesses explicitly by data mappings.

Subprocess Properties
Figure: Subprocess Properties Dialog with Execution Type Synchronous Shared Data

Synchronous subprocesses with separate data

Subprocesses being invoked with the option synchronous, separate data will not have access to data values bound to the scope of their parent process instance. In the activities properties dialog you can enable or disable the option Copy all Data to determine the type of data handling.

With this option disabled the invoked process instance scope will initially contain no data value. Passing data between the invoking process instance and back has to be explicitly performed with IN or OUT data mappings.

Having the option enabled, a copy of the value of any user-defined data existing in the parent process instance scope at invocation time will be created in the invoked process instance scope. You can still work with OUT data mappings, but IN data mappings are disabled.


Figure: Subprocess Properties Dialog with Execution Type Synchronous Separate Data


Figure: Execution Type Synchronous Separate with Copy all Data enabled.

Generally, any root process instance and any process instance invoked with the Synchronous Separate option will function as scope for data values. Any process instance will have exactly one associated scope, where scope process instances are their own scope, and non-scope process instances have the same scope as their parent process instance.

Asynchronous subprocesses with separate data

Asynchronous subprocesses receive a copy of the super process data (separate data). The subprocess is detached from the super process and becomes a root process instead of scope process.


Figure: Subprocess Properties Dialog with Execution Type Asynchronous Separate Data

 

Switching between the options will not delete existing data mappings if the selected combination does not support them but a succeeding warning is displayed if the Copy Process Data checkbox is selected and also the data mappings are provided.

Naming

If you assign a process to a subprocess activity, you have the option to give the activity the name of this process. In this case you have to set the preferences option Auto Name Generation of Subprocess Activities to enabled, as described in the Setting Process Manager Preferences section of the Stardust Process Workbench chapter. If Auto ID Generation is enabled, also the id of the activity is changing according to the process name as described in the Auto Id Generation section.

Automatic Naming of Subprocess
Figure: Automatic Name Generation of a Subprocess

Creating Subprocesses from Activity Networks

In the Stardust modeler you can create subprocesses from a selected activity network. Selected activities will be replaced by a subprocess activity in the source process. Additional process definitions will be created containing all dependent elements. The connections between organizations and other participants are deleted.

Requirements

A subprocess can only be created if it follows these rules:

Creating a Subprocess

Select the activities to be replaced , e.g. by holding the Ctrl key and clicking on them. Right-click and select Create Subprocess.

Create a Subprocess
Figure: Create a Subprocess from the selected Activities.

A new activity with subprocess implementation is created:

new Subprocess Activity
Figure: A new Subprocess Activity is created.

Also a new process definition is created containing all the selected activities and according transitions.

new Process Definition
Figure: A new Process Definition is created.

Behavior in Lanes

If the source mouse location is a lane, the subprocess activity is also created in this lane.

Creating Subprocesses from Activities having Symbols in Multiple Diagrams

In case you create a subprocess from an activity network with activities having symbols also in other diagrams, the symbols are removed from these diagrams as well. This applies also for other elements which are moved to the new process definition.

Automatic Creation of a Subprocess

The subprocess is created automatically when a process interface is defined in one model and referenced in another model, through file connection, and its process definition is imported via drag-n-drop gesture.

Show Subprocess Diagram

The Show Subprocess Diagram option is available in two cases.

Local Subprocess

The Show Subprocess Diagram option is available at the subprocess level when you associate any process definition of the same model with that subprocess. To view this option, perform the following steps:

  1. Assign any other local process definition with the subprocess

  2. Figure: Subprocess - Assign Process Definition

  3. Right-click the subprocess and select Show Subprocess Diagram option. The subprocess diagram opens in the same model editor. In this case, you can edit and save the changes.

  4. Figure: Local Subprocess - Show Subprocess Diagram

Referenced Subprocess

The Show Subprocess Diagram option is available at the subprocess activity of consumer model. To view this option, perform the following steps:

  1. Ensure that the process interface is defined in the provider model
  2. Ensure that file connection is created from the consumer model
  3. Once the file connection is established, drag and drop the Process Definition that is displayed under the File Connection node in the Outline tree of consumer model.


    Figure: Subprocess - Created via drag-n-drop

  4. Right-click the subprocess and select Show Subprocess Diagram option


    Figure: Show Subprocess Diagram

  5. Click OK in the Open Referenced Model dialog box. The subprocess diagram opens in the new model editor.

Data Copy/Mapping Semantics for Spawned Subprocesses

Spawned subprocesses inherit the data of their root process by copy using the usual semantic for copy all data. Similarly, processes that are aborted and started from the root process instance copy the data using the following data copy semantics.

Data Synchronous/Asynchronous Subprocess Spawned Subprocess And Peer Process
Primitive Data Passed by value Passed by value
Serializable Data Passed by value Passed by value
Structured Data Passed by value Passed by value
XML Document Passed by value Passed by value
Hibernate Data Passed by reference Passed by reference
Entity Bean Passed by reference Passed by reference
Document Passed by reference Passed by reference, except for the Extract Pages functionality. In the latter case new documents are created.
Document List Shallow copy means the list get copied and content passed by reference Shallow copy means the list get copied and content passed by reference
Folder Passed by reference Passed by reference
Folder List Shallow copy means the list get copied and content passed by reference Shallow copy means the list get copied and content passed by reference
Notes Notes do not get copied Notes do not get copied
Process Attachment Refer Document List Refer Document List

Data Mapping Heuristics for Spawned Subprocesses and Peer Processes

Data mapping heuristics is only applied to document data and document list. Consider Po is the originating process instance while Ps is spawned one. The following data mapping heuristic apply for spawned subprocesses and peer processes.

Data Mapping Heuristic
Document All data values of Po are passed to Ps regardless of whether Ps uses this data. In addition, the following copy heuristics apply to the document data values Po has, but the Process Definition of Ps does not use and the data of Ps that hasn't been initialized yet via the prior step (passing all data from Po to Ps):
  • The same-type-rule - If Po uses a document data d1 with document type t1 and Po has exactly one document data with type t1 and if Ps has exactly one document data d2 with the same document type t1 then the document (including meta data) will be passed from d1 to d2.
  • The one-document-rule - If Po has exactly one document data d1 with type t1 and Ps uses exactly one document data d2 with type t1 (t1 and t2 might be the same types or not)}} then this document data (excluding meta data) will be passed from d1 to d2.
  • else the document data (including meta data) will be passed as process attachment(s) from Po to Ps (unless Ps does not support process attachments).
Document List Same as Document

Currently, Stardust Portal does not support viewing of Document List, Folder and Folder List.

Department Scoping for Spawn Subprocess

In case the data associated with root process contains department information, it gets copied to the spawned process as it is. Thus, the department scope of a spawned process inherits the department scope of the root process.

Behavior of Subprocesses in Process Instance Hierarchy

Is Subprocess Of Root Process Instance Subprocess Instance Must Be Completed
To Complete Root Process Instance
Abort Of Root Process Instance Results
In Abort Of Subprocess Instance
Abort Of Subprocess Instance Results
In Abort Of Root Process Instance
Interrupted Subprocess: Recovery Of
Root Process Instance Recovers Subprocess
Synchronous Subprocess Supported Supported Supported (If it hasn't been terminated yet) Supported (configurable - the user can decide whether to abort root process instance) Supported
Asynchronous Subprocess Not Supported Not Supported Not Supported Not Supported Not Supported (since asynchronous 'subprocesses' are not real subprocesses)
Spawned Subprocess Supported Supported Supported (If it hasn't been terminated yet) Supported (configurable - the user can decide whether to abort root process instance Supported