Workflow Framework Classes and Types of Work Items
All workflows are JavaBean components that extend a common base class, net.juniper.smgt.workflow.Workflow. All the classes mentioned in this section are in the same package as the Workflow class. The Workflow class implements all the basic services needed by a workflow to interface with the workflow engine. The Workflow class also serves as a container for other components. All components are specializations of the WFComponent abstract class, including the Workflow class itself. Thus, a workflow can contain other workflows. The class diagram of the framework is shown in Figure 6.
![]()
The Workflow application employs the following types of work items:
- Regular work item type—Most work items belong to the regular work item type. It extends the WorkItem class, which provides the basic infrastructure for executing a task in its own thread. The work item logs the information used by the workflow probe, which collects statistics about the progress of workflows.
- Synchronization work item type—Extends the SyncWorkItem class and is the only type that accepts more than one predecessor. The synchronization work item enables the synchronization of concurrent paths and provides a basic interface to the more specialized work items that implement logical operations with the input tokens. These operations are the only factors that determine the contents of the output token. Because the synchronization work item does not have an associated task, it pauses and resumes instantly.
- Token processor work item type—Very similar to the synchronization work item type, but does not allow multiple predecessors. It extends the TokenProcessorWorkItem class. The processing operations can alter the token in any way, as long as they do not take a long time to complete. What distinguishes a long-time task from a common task is that the latter does not use external resources that might not be available, and the computation is not complex enough to take more than a few seconds.
- Start state work item type—Realized by the StartState class. The Start State type does not have an input, because it is the entry point for a token coming from outside the workflow.
- End state work item type—Realized by the EndState class. The End State type does not have an output, because it is the exit point for a token to return to outside the workflow.
See Table 32 in Chapter 6, Building Workflows for a list of work items categorized by type.
The WFTokentoken class implements the functionality of a token. It provides methods for accessing the properties and the embedded result. Another support class is the WFParameterList, which implements a parameter list. All parameter lists must extend it and obey the naming convention.