Chapter 9. When Do I Use a Subprocess?
A subprocess is really just a process, but it is called by another (parent) process. It
has functions similar to an activity block, but it can do more for you. The
characteristics of a subprocess include:
Reusability: a subprocess can be invoked at multiple points in a single process;
and it can be invoked from different processes. It is a reusable object.
It can run as a stand-alone process.
It can run on a separate server from its parent process, using a different
FlowMark database and different users (staff definitions). This permits you to
shift work to another server.
It can be tested alone, allowing independent application development.
Like an activity block, a subprocess:
Can have an exit condition, so it can repeat until specified conditions are met.
Helps make high-level process diagrams easier to understand.
In addition to the many functions that subprocesses can serve, they can be used to
save some amount of database space, in the case where they are infrequently
used in your process flow. With such a list, there is the temptation to use them
everywhere. But you need to be careful not to overuse them, as you can
significantly alter the performance of your system.
9.1 Performance and Capacity Considerations
A subprocess affects performance and capacity. You are trading off between
processor usage and database space.
A subprocess is “late bound,” that is, not invoked until needed. There is no
database space consumed unless the subprocess is invoked. Thus, if you have a
process that includes multiple special cases or exceptions or has several possible
paths, the use of subprocesses will reduce the amount of database storage used
for a process instance. Rather than having many different activity steps loaded
when an instance is created, you can defer them so only the particular special case
(subprocess) is loaded, and then only if you need one. Depending on your
business process, this could save some amount of database space plus the
overhead to create large instances.
On the other hand, when you invoke a subprocess, the effort involved is similar to
creating a process instance. There are performance implications for creation and
deletion of the instance. See Chapter 5, “Starting and Deleting Process Instances”
on page 9 for a discussion of this.
It is worth considering the ability to run a subprocess on another FlowMark server
even if your original plans are for a single server. If you later add other servers,
you can simply update the server page in the subprocess activity notebook and
change the server (domain) where the subprocess runs.
So you need to make a decision. As in most performance and capacity decisions,
there are trade-offs. In this one, you are weighing processor usage on the server
versus space in your database. Ask yourself how frequently the particular path is
followed. If the probability is high that the function is used every time, it is better to
Copyright IBM Corp. 1996, 1998 17