Invoke Subprocess Activity
This activity is used to invoke an independent subprocess.
The activity can also be used to call a remote process
(residing in a different MDW application).
If you need to invoke multiple subprocesses (of the same or
different process definition), where the number of subprocesses
to invoke may be unknown at design time,
you can use the Invoke Multiple Subprocesses activity.
Configuration involves specifying the name and version of the subprocess to be invoked,
as well as bindings to the input/output parameters of the subprocess.
With MDW 6 you can use Smart Subprocess Versioning to support greater modularity and encapsulation.
This is based on Semantic Versioning rules and conventions.
By default MDW Studio automatically infers a Smart Subprocess Version, even if you select a specific version when
configuring the caller (although you can turn this off through Window > Preferences > MDW > Process Design > Infer Smart Subprocess/Asset Version Spec).
Here's the way smart versioning works: instead of an exact version you can specify a range of versions that are acceptable to the caller.
The syntax is modeled on the OSGi version specifier syntax. Specifically, there are four supported formats:
- A specific version -- such as 1.2 -- can be specified.
- Zero can be specified to always use the absolute latest process version.
- A 'half-open' range -- such as [1.2,2) -- designates an inclusive lower limit and an exclusive upper limit,
denoting version 1.2 and any version after this, up to, but not including, version 2.0.
- An 'unbounded' version range -- such as [1.2 -- denotes version 1.2 and all later versions.
MDW Studio by default uses the third format behind the scenes.
So, for example, if you choose process "SmartProcessChild" and it happens to be version 1.0 as illustrated below,
the attribute will be saved as [1.0,2 -- defaulting to an exclusive upper limit of the next major version number.
At runtime the latest process version falling within the designated range will be invoked.
If you want to override the default MDW smart version spec, you can type directly into the Asset Selector widget
(say, "SmartProcessChild v[1.0" to designate the fourth, or unbounded, version range syntax.
MDW Studio automatically inspects the parameters defined
by the subprocess and pre-populates the variable binding
table with parameter names and their modes.
Note that the parameter table does not include those
variables in the subprocess with "Local" mode.
In general, the binding can be a simple string value,
a variable, or a binding expression.
A string without '$' or '#' is treated
as a static string; otherwise it's treated as an
expression (Java Expression would have ${something} or #{something}), with a single variable ('$' followed by variable
name) as a special case.
The following restrictions apply to specific modes:
- For Input mode, the binding cannot be blank
- For Output and Input/Output mode, the binding must
be a variable ('$' without curly braces, followed by variable name), as
that variable will receive the returned value.
- For Static mode, any binding is treated as static
string value, including those containing '$', '#', and quotes.
- NOTE: For Document type variables, the binding will pass the Document Reference (i.e. 'DOCUMENT:document_id') to the child process.
If you need to pass the actual document content, you can use a Java expression to evaluate the variable content instead (i.e. '#{variableName}' ).
A good scenario for when you might want to do this is if the parent process is not persisting the Document in the Database (i.e. Service Process
running on performance level 5 or 9 or Non-Service process running on level 9) and the child will execute
in a separate thread (Asynchronous execution)
See the MDW binding expressions documentation for examples of how to
pass input variable values.
Also see Sub-Process Invocations documentation for an explanation of different factors that
come into play when invoking a sub process using the InvokeSubProcessActivity activity.