Datasheet

Chapter 1: Work ow Programming Principles
5
Note that the C# program itself is the root program statement in this program statement hierarchy. Also
note that this program statement hierarchy, like any other hierarchy, consists of two types of nodes.
The first type includes those program statements such as “ while, ” “ if, ” and “ else ” that contain other
program statements. These program statements are known as composite program statements . The second
type includes the leaf program statements that is, those program statements such as “ bool.Parse ”
and Console.WriteLine that do not contain other program statements.
A business process or workflow as a logical program also consists of a hierarchy of logical program
statements or activities, where the business process or workflow itself is the root of the tree. An activity
hierarchy, just like a C# program statement hierarchy, consists of two types of nodes. The first type
includes those activities such as a while activity that contain other activities. These activities are
known as composite activities . The second type includes leaf activities that is, those activities that do
not contain other activities.
Therefore, you have two options when it comes to developing a custom activity: leaf activities and
composite activities, as discussed in the following sections.
Developing Custom Leaf Activities
As mentioned earlier, a leaf activity is an activity that does not contain other activities. When it comes to
developing a custom leaf activity, the first order of business is to decide from which base activity to
inherit your custom leaf activity. Take these steps to make this determination:
1. List all the features that your custom leaf activity must support.
2. Search through the existing standard and custom activities for an activity that supports more of
these features than other activities. Inherit your leaf activity from this activity to take advantage
of the features that this activity already supports, consequently saving yourself a lot of
unnecessary coding effort.
elseif bool.Parse
Console. WriteLineConsole. WriteLine
while
Main
Program
bool.Parse
Figure 1-1
c01.indd 5c01.indd 5 8/25/08 4:02:52 PM8/25/08 4:02:52 PM