bea.com | products | dev2dev | support | askBEA |
![]() |
![]() |
|
![]() |
e-docs >
WebLogic Platform >
WebLogic Integration >
Best Practices in Designing BPM Workflows
> Best Practices in Designing BPM Workflows |
Best Practices in Designing BPM Workflows
|
Best Practices in Designing BPM Workflows
The BEA WebLogic Integration Studio provides the design environment for you to design and monitor business process workflows. If you have created Studio workflows or are planning to use the Integration Studio as your workflow management system, you may want to design your workflows with some best practices in mind. The following sections provide some guidelines for constructing workflows to provide for an easier transition to future product releases:
Why Follow Best Practices?
The current WebLogic Integration Studio implementation allows the construction of unstructured workflows. Both best practices in the workflow management industry and the emerging, but young, workflow standards encourage the use of structured workflow design. Future versions of the WebLogic Integration Studio will require the use of structured workflows, in particular to support workflow standards as they mature and become ready for use. This document describes structured workflow patterns for use in the WebLogic Integration Studio today. Following these guidelines will lead to better designed workflows for easier migration to a structured workflow paradigm.
Note: These guidelines are NOT intended to suggest how you should implement your business logic.
Design for Your Business Processes
Workflows definitions encapsulate complex business processes, policies and procedures. Given their complexity, the best practice guidelines are provided in the context of common workflow patterns. For certain concepts, we provide the desired implementation of that concept, together with a list of things that should be avoided.
The provided workflow patterns and programming suggestions should not be taken as the only way to implement the corresponding concepts. They are intentionally simplified to readily convey the general design principle or to clearly point out models or workflow patterns that might not be optimal for automated migration. Clearly, your business may require different implementations or design variations for some of these concepts and your workflow designs will probably be more complex than the patterns presented as examples in this document.
Use the suggested implementations in this guide as a way to evaluate and to estimate how much you want to optimize your workflow designs. Remember that blindly following the guidelines suggested here is not suggested as it may result in incorrect workflows that do not reflect your own business processes.
Designing Workflows with WebLogic Integration Studio
The desired best practices are defined in the context of designing workflows with the WebLogic Integration Design Studio component of WebLogic Platform release 7.0. For complete information about designing workflows using the WebLogic Integration Studio, refer to the following topics:
Suggested Workflow Designs for Commonly Used Workflow Patterns
The following sections describe suggested patterns for constructing workflows. These guidelines are designed to provide some good approches to common workflow problems. Common patterns for business processes that are likely to be found in many workflows include:
The following sections describes these patterns and gives the suggested implementation of these workflows in detail.
Parallel Execution
The Parallel Execution pattern represents a case in which all the parallel paths coming out of a workflow node will execute in parallel and rendezvous at an And node where the parallelism ends. Follow these guidelines to implement this workflow pattern properly.
Note: In BPM, parallel paths are not executed concurrently. The same thread executes each path, progresses through one until it stops, then switches to a new path and works along that path until either all paths can no longer progress or all are ready for the And node. The choice of the starting path varies.
Figure - 1 Implementing the Parallel Execution pattern
Choice of Events
The Choice of Events pattern represents a case in which all the parallel paths coming out of a node wait for certain events to occur and the first event to occur determines which path will execute. (See Figure 4). Only one of parallel paths will ever execute depending on which event has occurred first. (All other paths are suppressed and will not fire). In order to guarantee mutual exclusion of the execution paths use the Cancel Event action as described in the following guidelines.
Figure - 4 Implementing the Choice of Events pattern
Use the following steps to properly implement the Choice of Events workflow pattern:
Event with Timeout
The Event with Timeout pattern represents a case where a set of mutually exclusive events are required to occur within a certain time frame or before a deadline. The first event that occurs before the timeout will run to completion, and other paths will be suppressed, including the timeout path. If, however, no events occur before the timeout, the timeout path is executed. Any event that occurs after the timeout will not trigger its corresponding execution path. Although the timeout logic can be implemented using either a Timed Event action or a Set Task Due Date action, the use of Set Task Due Date is recommended as it results in a cleaner, and easier-to-understand implementation. Figure 5 shows the proper implementation of this workflow pattern. For a description of best practices using Timed Event actions, see Event with Timeout.
Use the following guidelines to properly implement the Event with Timeout workflow pattern:
Figure - 5 Implementing the Event with Timeout pattern
Cancellation via Event
The Cancellation via Event pattern represents a case in which an execution path is cancelled by an event (e.g., the arrival of a message that cancels an order that has been placed previously.) Two variations are possible depending on whether the execution path can be cancelled in the middle of its execution:
You should decide which one of these two variations more closely reflects your business logic and implement it as suggested in the following guidelines. The first approach
All-or-Nothing Variation
Figure 6 shows the suggested implementation for the Cancellation via Event workflow pattern, in which the path that is subject to cancellation runs only if the cancellation event has not been received by the time it has started execution. Follow the steps given below to implement this variation properly.
Figure - 6 Implementing the Cancel via Event pattern: All-or-Nothing variation
The All-or-Nothing variaton on a Cancel via Event is a pattern designed to check whether an event occured before proceeding to perform certain critical tasks. A simple example of this pattern can be seen in an order processing workflow (See Figure 7). The tasks in an order processing workflow might be as follows:
Figure - 7 Implementing the All-or-Nothing variation in Order Processing
Interrupt-based Variation
Figure 8 shows the suggested implementation for the Interrupt-based variation.The implementation of this variation, however, requires a greater level of coordination between the normal execution path that is subject to cancellation, and the cancellation path, so that the cleanup logic is implemented correctly.
In general, the cancellation path should perform the necessary cleanup logic.The cleanup logic might be different depending upon how far the normal execution path was able to progress. Detecting the amount of progress on the normal execution path can be done by setting certain variables in the normal execution path and then inspecting them on the cancellation path when the cancellation event occurs.Similarly, the normal execution path may need to detect that the cancellation path has been activated and perform certain cleanup actions that are not done by the cancellation path. It is up to you to implement the proper coordination in order to ensure that the resulting workflow reflects your business process accurately. We suggest you do the cleanup on one path.
Figure 8 shows only the skeleton implementation of the Interrupt-based Variation. Details of the cancellation/cleanup logic are not included.
Figure - 8 Implementing the Cancel via Event pattern: Interrupt-based variation
The following general steps demonstrate how to implement this workflow pattern properly.
Execution Timeout
The Execution Timeout pattern is similar to the Cancellation via Event pattern in that a timeout, rather than an event, will cause the cancellation of execution along a path. Figure 9 shows the suggested implementation for this workflow pattern.
The Execution Timeout pattern may require a certain level of coordination between the normal execution path and the timeout path, in case the timeout is triggered. Moreover, complex cleanup logic may be required. (See the Cancellation via Event section for a related discussion.) It is up to you to implement the necessary workflow actions for cleanup. This section only gives the skeleton implementation of this workflow pattern.
Follow these steps when implementing the Execution Timeout pattern.
Figure - 9 Implementing the Execution Timeout pattern
Using Actions With Workflow Patterns
Table 1 lists actions that are associated with the workflow patterns presented in prior sections of this document. To optimize your workflows for automated migration, follow the guidelines in Table 1 when using these particular actions in your workflows:
Note: Do not define any action (such as Start Workflow) other than Set Task as Done in the callback action list for asynchronous actions.
Using Task Nodes
The WebLogic Integration Studio Task nodes can contain an arbitrary number of actions in their Created, Activated, Executed, and Marked Done lists. You define these lists in the Task Properties dialog of the WebLogic Integration Studio. For detail information about the Task Properties dialog, see Using the WebLogic Integration Studio.
In general, there are two kinds of tasks:
Guidelines for User Tasks Use of the following guidelines when implementing user tasks:
Guidelines for Automated Tasks
Use of the following guidelines when implementing automated tasks:
Exception Handling
Future versions of WebLogic Integration will use structured exception handling. To provide for an easier transition to future WebLogic Integration product releases, you should consider the following suggestions when setting exception handlers:
Figure - 10 Example of an Exception Handler Block
Guidelines for Using the Studio Plug-ins
The WebLogic Integration Studio features support for plug-ins to extend the functionality of selected workflow components. Although plug-ins will continue to work, whenever possible you should use EJBs over customized plug-ins to optimize your workflows for automated migration. See Programming BPM Plug-Ins for WebLogic Integration.
![]() |
![]() |
![]() |
![]() |
||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |