Chapter 34. Business and Workflow Process Management Using WLI

Introduction

A business process is a series of interconnected business activities involving various systems, applications, manual interventions, and other processes. Business processes now span across the enterprise boundaries through business-to-business (B2B) and collaborative commerce.

Business Process Management (BPM) is a term that encompasses management support for core activities of an enterprise, incorporating the technologies for workflow synchronization and execution and Application Integration. Effective Business Process Management has become more important in today’s enterprises than ever before. Many vendors in the industry have solutions for meeting the needs of business process and workflow management. The BEA WebLogic Integration product provides comprehensive functionality for Business Process Management needs within an enterprise and across enterprises. In this chapter, we will discuss BPM functionality provided by WebLogic Integration.

Business Process Management (BPM)

Business Process Management provides functionality to design, execute, and monitor complex business processes using a Java-based process engine, also referred to as a BPM server.

Figure 34.1 illustrates how BPM functionality fits together in relation to other components needed to implement an integrated solution.

BPM with respect to other components needed to implement an integrated solution.

Figure 34.1. BPM with respect to other components needed to implement an integrated solution.

WebLogic Integration BPM has the following main components:

  • Process engine—A Java-based process engine that manages the runtime execution of business processes

  • WebLogic Integration Studio—A graphical user interface that provides functionality for workflow design, workflow monitoring, and data administration

  • Worklist—A tool which can be used by users to start and stop processes, and interact with a running process

  • BPM application programming interface (API)—APIs that programmers can use to access BPM functionality in their client applications

  • Plug-in framework—A framework that supports development of plug-ins that help extend the functionality of BPM

WebLogic Integration Studio and Worklist are swing-based tools. Studio is used in design time for graphically laying out and modeling processes. This graphical representation of a business process is referred to as a workflow. A workflow can be triggered or invoked at runtime by the following methods (see Figure 34.2):

Triggering mechanisms of a workflow.

Figure 34.2. Triggering mechanisms of a workflow.

  • A timer (scheduled time)

  • A manually operated tool such as Worklist (covered later in the chapter) or supplied APIs

  • Another workflow

  • An XML message placed on a JMS destination

  • A plug-in

Let’s consider one of the workflows in the platform sample shipped with WebLogic Platform 7.0 (look under %WL_HOME%/weblogic700/samples/platform/e2eDomain/).

In this sample, there are two scenarios: One is a B2C portal, and the other is a B2B portal. In the B2C portal case (see Figure 34.3), the consumer uses the portal to shop at Avitek’s site for digital cameras and accessories. The user selects items and places them in a shopping cart. After the order is confirmed, it is converted to an XML representation and placed on a JMS queue (com.bea.wlpi.EventQueue). This triggers the E2E_OrderWorkflow. The E2E_OrderWorkflow then persists the order information in Order Management tables. Using WebLogic Studio, E2E_OrderWorkflow can be inspected, as shown in Figure 34.4. Note the properties of the start node showing the triggering mechanism as “XML Event”.

Information flow in WebLogic Platform sample application (B2C Portal).

Figure 34.3. Information flow in WebLogic Platform sample application (B2C Portal).

E2E_OrderWorkflow in WebLogic Integration Studio.

Figure 34.4. E2E_OrderWorkflow in WebLogic Integration Studio.

Worklist is primarily used for runtime human interactions with the workflows. BPM APIs can be used to design, execute, and monitor client applications. WebLogic Integration BPM functionality also includes a plug-in framework that supports development of plug-ins. This plug-in framework makes WLI BPM very extensible. Using the plug-in framework, other WLI components such as AI and B2Bi can be used in conjunction with BPM.

Process Types

There are two kinds of processes: public and private. Public processes are developed for B2B transactions and enable the interaction of trading partners in a business-to-business arrangement, whereas private processes are internal to an enterprise and trading partners cannot interact with them directly. The BPM Studio can be used to model, execute, and monitor both types of processes. You can develop these inter-enterprise processes using Studio by installing a B2B plug-in (covered later in the chapter). The messages flowing between these processes must be based on a format that is acceptable to all parties involved. ebXML and RossettaNet are among the message standards that are supported by BPM. Private processes are used for intra-enterprise needs. These processes do not interact with any external entities like business trading partners. For example, when a customer places an order on an e-commerce Web site, a private workflow may be initiated to send email confirmation to the customer when the order items are shipped.

The end-to-end integration sample shipped with Platform 7.0, as discussed in Chapter 33, “Introducing WebLogic Integration (WLI),” has both private and public business processes. In the B2B portal, when the Avitek purchase agent submits a Query for Price and Availability (QPA), an XML representation of the QPA is pushed to a JMS destination, which triggers a private workflow. This private workflow invokes a public workflow, passing it the QPA request XML document. This request is then further packed into an ebXML message based on the trading partners’ (Supplier One and Supplier Two) agreement. The exchange of this ebXML message takes place through a hub that acts as a proxy between the buyer and the partners (see Figure 34.5).

Public and private QPA processes in the end-to-end sample.

Figure 34.5. Public and private QPA processes in the end-to-end sample.

Stages in Business Process Management

There are three critical steps in management of a business process: design, execution, and monitoring (see Figure 34.6).

Stages in Business Process Management.

Figure 34.6. Stages in Business Process Management.

Process Design

In the design phase of Business Process Management, the business process is conceptualized and designed using graphical tools such as Studio. The Studio tool helps to graphically describe a process, its inputs, and outputs. Using WebLogic Integration Studio, a process designer can put together a business process without knowing the underlying technical implementations. The designer identifies the process flow using entities called nodes. These nodes are steps in a business, which may represent a decision point or an end of the process. The nodes available in the BPM design tool, Studio, include the following:

  • Start—Represents the beginning of a workflow.

  • Task—Represents a unit of work or activity in the workflow.

  • Decision—Represents a point in the workflow where a decision needs to be made.

  • Event—Represents a wait state in the workflow that can be activated on receipt of an XML message.

  • And join—Represents a logical And operation. This forces the workflow to proceed when both paths complete execution.

  • Or join—Represents a logical Or operation.

  • Done—Represents the end of a workflow.

Using nodes, a business process is designed and saved as a template definition as part of a template in an associated data store (Oracle, SQL Server, and so on) of the process engine. A template is equivalent to a business process. Just as a business process evolves as business requirements change, a template allows multiple template definitions. This template definition can be re-used and modified for other business processes. In the next phase of Business Process Management, the process engine executes an instance of the designed template definition.

Process Execution

In the execution phase, XML is used for data representation, and JMS is used for messaging between workflows and/or other back-end applications (AI is the recommended way to connect to the back-end applications). A business process execution can be triggered in various ways, as illustrated in Figure 34.2. Typically, multiple instances of a business process are executing at a given time. In the integration sample, the E2E_OrderWorkflow executes when an XML message appears on a configured event queue.

Process Monitoring

Ongoing monitoring is very important in Business Process Management. Monitoring may be extremely useful when statistical data is collected in real-time. Users can modify running workflows if needed. This monitoring can be done using Studio. In the integration sample described earlier, the E2E_OrderWorkflow simply receives the XML message, takes the data sent, and persists that data into back-end tables. The Studio tool can be used to monitor the scenario. You can monitor the E2E_OrderWorkflow by first starting the server; to do so, run the <WL_HOME>/weblogic700/samples/platform/e2eDomain/starte2e.bat script.

After the server is up, log in as Rachel Adams on the B2C portal and add items to the shopping cart. Then proceed to Step 3, as shown in Figure 34.7. When you click the Submit Order button, an XML representation of the order is placed on a JMS queue, triggering a workflow.

WebLogic Platform sample application B2C portal.

Figure 34.7. WebLogic Platform sample application B2C portal.

This workflow can be monitored using Studio. Figure 34.8 shows the XML order received in the workflow. Studio can also be used to change the running workflow without necessarily interrupting it.

Monitoring workflow using Studio.

Figure 34.8. Monitoring workflow using Studio.

HelloWorld Workflow: A Workflow Which Triggers on an XML Event

In our first example, the workflow triggers on an XML event (see the properties of the start node in Figure 34.9). Many workflows can consume the messages placed on the default JMS queue. You can specify a root element for each workflow in the Start Properties dialog box to distinguish between messages it is interested in. In the HelloWorld workflow, the helloworld root element is specified. A driver in the sample source (MyQueueSender.java) sends an XML message to the default queue (com.bea.wlpi.bpm.event), as shown in the following code:

Properties of the start node in the HelloWorld workflow.

Figure 34.9. Properties of the start node in the HelloWorld workflow.

<?xml version="1.0" encoding="UTF-8" ?>
<helloworld>
</helloworld>

When the XML message is sent to the JMS queue, the workflow is triggered and completes execution. You can use Studio to see that the workflow started and completed (see Figure 34.10).

Monitoring the HelloWorld workflow.

Figure 34.10. Monitoring the HelloWorld workflow.

You can run Example1 as follows:

  1. Start the WLI samples server by running the following script:

    <WL_HOME>weblogic700samplesintegrationsamplesinRunSamples.cmd
    
  2. Open Studio.

  3. Log in as admin/security.

  4. Use the Import package tool to import “HelloWorld” workflow under chapter34example1helloworld.jar in the ORG1 organization. Make sure the “Activate workflows after import” checkbox is checked.

  5. Run the MyQueueSender driver. This will place an XML message on the configured JMS Queue:

    1. Copy chapter34example1 to your local drive.

    2. Use cd to change the directory to example1.

    3. While you’re in the example1 directory, run the setWLSenv.cmd script from <WL_HOME>weblogic700serverin.

    4. Run ant, which will first compile and then run the sample. Run ant -projecthelp to list all the targets.

  6. In Studio, right-click the helloworld template and select Instances.

  7. All workflow instances will be shown in a tabular list, as shown in Figure 34.10.

  8. Double-click an instance which you just created and check out the contents on the XML message received.

Designing Business Processes

BPM provides three constructs to define context of use: organization, role, and user. These Business Process Management–specific constructs do not correspond to any J2EE users or roles.

  • Organization—A company, business unit, department, or any such categorization.

  • Role—A business function or responsibility such as Admin.

  • User—A user of a business process who is generally responsible for a specific business task. A user always has a default organization assigned and can be mapped to one or more roles. The roles can have one-to-one, one-to-many, and many-to-one associations with users. A role must be mapped with a group in WebLogic Server.

Workflows are created using Studio (see the next section, “BPM Tools”). The workflow definitions are referred to as templates, which are stored in a persistence store like a database. A template can have multiple definitions or versions based on effective and expiry dates. These dates determine a range of time when a particular version of a template can be executed.

Some of the important constructs you’ll encounter while designing business processes are the following:

  • Actions—When you’re designing a workflow by defining nodes such as Start, Task, Decision, Done, and so on, you need to define actions. Actions are tasks that need to be performed at various points in the workflow. A Task represents a user-defined logical unit of business function. An action can be as simple as sending a notification like an email or calling another application to do a custom task. For example, the E2E_OrderWorkflow uses the AI framework to persist the order into back-end order management tables.

  • Variables—Variables hold runtime data. Variables can be used to evaluate a condition in a decision node of a business process. The types of variables supported are Double, Integer, String, Boolean, Date, Java Object, Entity EJB, Session EJB, and XML.

  • Exception Handlers—Business processes can be very complex and are prone to exception due to abnormal conditions. You can write custom exception handlers to handle such conditions for one or a series of actions.

BPM Tools

WebLogic Integration comes with tools to design, execute, and monitor workflows. For designing and monitoring workflows, you use Studio. For executing and monitoring workflows, you use a tool called Worklist.

Studio

Studio is a graphical design tool that allows you to design and monitor workflows. It comes with the following utilities:

  • XML Finder—XML Finder is an XML content management tool that facilitates access and management of different types of XML content, including Schema Documents (XSD), Document Type Definitions (DTD), Extensible Stylesheet Language (XSL) template documents, and so on that may be stored in a datastore such as WLI repository.

  • XML Editor—The XML Editor enables you to compose, import, and export XML documents from within workflows. You can use it to compose XML document templates from scratch, edit existing documents, and validate content based on given XML Schemas.

  • Expression Builder—While you’re designing a workflow, you need to create expressions consisting of variables, operators, literals, and functions. The Expression Builder tool helps you construct and validate the syntax.

  • XPath Wizard—XPath functions are used to extract content from incoming XML documents. The XPath Wizard is a point-and-click tool that generates XPath expressions from selected content in sample XML documents or schemas or DTD-generated XML.

  • Import/Export Wizard—The Import/Export Wizard enables export of all workflow templates and associated resources, such as business operations, event keys, plug-ins, and XML entities defined in the system. Workflow objects are exported to a Java archive (.jar) file and can be re-imported to any system running Studio. This is the mechanism used to move workflows from development to QA to production.

Worklist

Worklist is a swing-based tool that is used to interact with a workflow. It can be used to both start and stop a workflow. Using Worklist, a user can provide specific input to a process. For example, if the inventory is less than a certain amount, the process could be set to get an approval before back-ordering a part. The inventory manager would then need to log on using Worklist and approve or disapprove the order.

This tool is deprecated and will be replaced by a JSP-based tool. Users can also write their own tools using the BPM API.

Programming Using BPM APIs

WebLogic Integration provides rich BPM APIs for creating custom configuration, design, and runtime management, and for monitoring clients. The business process engine consists of Session EJBs, Entity EJBs, and message-driven beans (MDBs). The session EJBs provide the primary interface to the business process engine. Both stateful and stateless session EJBs provide various functions. The session EJBs shown in Table 34.1 are available to the BPM API.

Table 34.1. BPM Session EJBs

Name of Session EJB

Stateless/Stateful

Functionality

Admin

Stateful

Serves as a primary interface for design clients such as Studio. One example is an API for defining a template definition.

Audit

Stateless

Provides an interface that encapsulates WebLogic JMS Topic (wlpsAudit) to which a process engine sends audit and error messages.

EJBCatalog

Stateful

Collects EJB metadata by scanning the JNDI tree and storing it in a catalog.

Permission

Stateless

Supports getting and setting user and role permissions.

PluginManager

Stateless

Provides runtime management of plug-ins during workflow execution.

PluginManagerCfg

Stateless

Enables management of user-defined plug-ins.

ServerProperties

Stateless

Enables clients to obtain information about properties governing BPM.

WLPIPrincipal

Stateless

Configures, manages, and gets information about roles, users, and organizations.

Worklist

Stateful

Provides a primary interface for runtime management clients.

XMLRepository

Stateless

Provides access to the XML repository.

There are other useful classes in the following packages:

  • com.bea.wlpi.client.common—. This package provides client-side classes used by BPM clients.

  • com.bea.wlpi.client.util—. This package provides two JMS utilities for testing.

  • com.bea.wlpi.common—. This package provides value objects for describing different BPM entities.

  • com.bea.wlpi.security—. This package provides value objects for describing roles and user permissions.

An Example of Using BPM APIs

The second example shows how to start a workflow and then execute a specific task within the workflow by using BPM APIs.

A workflow (called MyWorkFlow) has been created using Studio. This workflow is designed so that it can be started manually (see the manual option in Start Properties dialog in Figure 34.11). After the workflow is started, a task (called MyTask) is activated. Refer to Figure 34.11.

Example2: The MyWorkflow workflow.

Figure 34.11. Example2: The MyWorkflow workflow.

MyTask is designed to send an XML response to the client including the date and time (see Figure 34.12).

Example2: Properties for MyTask.

Figure 34.12. Example2: Properties for MyTask.

At this point, a command-line Worklist client has been created; it will start this workflow and execute the task named MyTask.

Now you can establish a connection to the running BPM server and obtain a handle on the WorkList Session Bean, as shown in Listing 34.1.

Example 34.1. Connecting to BPM Server

private static boolean connect(String url, String userId, String password ) {
     Object result;
     try {
        ctx = getInitialContext(url, userId, password);
        result = ctx.lookup(WORKLIST_JNDI);
        WorklistHome wHome = (WorklistHome)
               PortableRemoteObject.narrow(result,WorklistHome.class);
        worklist = wHome.create();
        return true;
      }
      catch(Exception e) {
        System.err.println("Caught Exception:" + e);
      }
      return false;
}

Start the workflow by using Worklist EJB, as shown in Listing 34.2. You can obtain a list of workflows that can be started manually by using the following method:

public java.util.List getStartableWorkflows(java.lang.String orgID)
    throws java.rmi.RemoteException,  WorkflowException

From the list of startable workflows, you can choose and instantiate MyWorkFlow by using the following call:

public java.lang.String instantiateWorkflow(java.lang.String orgID,
                                            java.lang.String templateID,
                                            java.lang.Object requestID)
                             throws java.rmi.RemoteException, WorkflowException

Example 34.2. Starting the Workflow

/**
  * Start a workflow
  */
  public static String startWorkflow(String templateName) {
    String instanceId = null;
    try {
        String activeOrgId = worklist.getActiveOrganization();
        List templates;
        templates = worklist.getStartableWorkflows(activeOrgId);
        for(int i = 0; i < templates.size(); i++) {
          TemplateInfo templateInfo = (TemplateInfo)templates.get(i);
          if (templateInfo.getName().equals(templateName) == true) {
             String response = worklist.instantiateWorkflow(activeOrgId,
                                      templateInfo.getId());
             System.out.println("response:
" + response);
             //parse instance id from response
             int j = response.indexOf("<instanceid>");
             int k = response.indexOf("</instanceid>");
             instanceId = response.substring(j + "<instanceid>".length(), k);
          }
        }
   } catch (Exception e) {
       System.err.println("Caught Exception : " + e.getMessage());
   } finally {
       return instanceId;
   }
}

The response you will obtain is shown in the following code:

<wlpiresponse>
  <instanceid>13001</instanceid>
  <templatedefinitionid>9001</templatedefinitionid>
  <root>
    <actionid>1029650142617</actionid>
    <DateOfMyWorkFlow>Sun Aug 18 01:16:34 MDT 2002</DateOfMyWorkFlow>
  </root>
</wlpiresponse>

The response is parsed to get the instanceid. This instanceid is used for executing a task. To execute a task, use the method shown in Listing 34.3.

Example 34.3. Executing a Task in a Given Workflow

public TaskInfo getTask(java.lang.String taskName, java.lang.String instanceID)
                 throws java.rmi.RemoteException, WorkflowException


  /**
    *  Execute task of a given workflow
    */

  public static boolean executeTask(String taskName, String instanceId) {

  try {
       TaskInfo taskInfo = worklist.getTask(taskName, instanceId);
       String response =
            worklist.taskExecute (taskInfo.getTemplateDefinitionId(),
                                  taskInfo.getInstanceId(),
                            taskInfo.getTaskId());
       System.out.println("response:
" + response);
       return true;
      } catch (Exception e) {
          return false;
      }
  }

The following is the response you will obtain:

<wlpiresponse>
  <instanceid>15002</instanceid>
  <templatedefinitionid>9001</templatedefinitionid>
</wlpiresponse>

You can then run Example2 as follows:

  1. Start the WLI samples server by running the following script:

    <WL_HOME>weblogic700samplesintegrationsamplesinRunSamples.cmd
    
  2. Open Studio.

  3. Log in as admin/security.

  4. Use the Import package tool to import the given workflow under chapter34example2MyWorkFlow.jar in the ORG1 organization.

  5. Run the MyWorkList client written using the BPM APIs. This will start the workflow called MyWorkFlow and then execute a task in the workflow called MyTask:

    1. Copy chapter34example2 to your local drive.

    2. Use cd to change the directory to example2.

    3. While in the example2 directory, run the setWLSenv.cmd script from <WL_HOME>weblogic700serverin.

    4. Run ant, which will first compile and then run the sample. Run ant -projecthelp to list all the targets.

    5. The response from starting the workflow and subsequently executing the task is shown earlier in this section.

  6. In Studio, right-click the MyWorkFlow template and select Instances.

  7. Note the details of the instance that finished execution due to step d within step 5.

BPM Plug-in Framework

BPM supports plug-in development for extending its functionality. A plug-in is used to extend design and/or runtime behavior. It modifies the behavior of various workflow components, including start, event, and done nodes; task actions; functions; message types; and so on. One example is extending the behavior of the start node being triggered by a non-XML message.

In Figure 34.13, an external application interacts with BPM by both an XML and a non-XML event. The standard way of triggering BPM is by placing an XML message on a JMS queue. A non-XML event can be made to trigger a BPM workflow by using a plug-in. BPM clients such as Studio can also use plug-ins to enhance their functionality. The plug-in manager supports the configuration, design, and runtime management of plug-ins. The plug-in manager oversees the loaded plug-ins and their interactions with the WebLogic Integration process engine and BPM clients.

BPM plug-in architecture.

Figure 34.13. BPM plug-in architecture.

The plug-in manager’s functionality is exposed via the plug-in API, which consists of the following packages:

  • Com.bea.wlpi.server.plugin.*—. This package contains classes providing runtime management of plug-ins during workflow execution. PluginManager, a stateless session EJB, is used to get access to the metadata of the deployed plug-ins and handle event notifications. PluginManagerCfg, a stateless session EJB, provides configuration and design management of plug-ins. This maintains configuration information and the list of plug-ins that may be registered for system event notifications.

  • Com.bea.wlpi.common.plugin.*—. This package contains serializable classes providing utilities and value objects for process management.

Workflow Patterns

While you’re designing and implementing workflow functional interfaces, it is important to consider workflow standards. Standardized workflows are important for business re-engineering, operational flexibility, and interoperation with other workflow systems because interacting business processes often use different workflow systems.

The WebLogic BPM permits the creation of unstructured workflows, so it is important to be careful while designing workflows. Structured workflows also help migration to different, newer releases of the workflow engine and different workflow systems.

Certain workflow patterns have been identified toward making workflows structured. These patterns try to address some simple techniques that should be followed. The patterns are explained in the following sections.

Parallel Execution

You can design a workflow that has two or more parallel paths. To make a workflow with parallel paths structured, it is important to have all parallel paths originating from a common node end at the same And node. The parallel paths should have the same entry and exit points to make them structured (see Figure 34.14).

Implementing the parallel execution pattern.

Figure 34.14. Implementing the parallel execution pattern.

In the case that a subset of parallel paths (say, path1 and path2) needs to merge at a different And node, a dummy task node that simply marks itself as done can be placed to create nested parallelism. Figure 34.15 shows how a single entry point is created using a dummy task for two parallel paths that merge at a different And node (see the dotted section in the figure).

Single entry and exit points.

Figure 34.15. Single entry and exit points.

It is important not to have any “dangling paths” in a workflow. A path is said to be dangling when it contains a task with no subsequent node.

Choice of Events

The Choice of Events pattern is for solutions that have parallel paths, that need to execute in a mutually exclusive manner, and their execution is dependent on the occurrence of one or more events. It is important to have a cancel event in place to achieve this mutual exclusion; that is, after an event that starts an execution path is received, a cancel event action should be used to cancel other possible events, which may trigger other execution paths. All mutually exclusive paths should end at an Or node (see Figure 34.16).

Implementing the Choice of Events pattern.

Figure 34.16. Implementing the Choice of Events pattern.

Event with Timeout

The Event with Timeout pattern represents a workflow where mutually exclusive events can trigger different execution paths within a set time frame. So, there is a deadline in which the events must occur to trigger the respective execution paths. The timeout logic is typically implemented using a Timed Event action or a Set Task Due Date action. The latter is preferred and recommended as it results in a cleaner and easier-to-understand implementation. All the paths except one that has timeout functionality should start with an event node. (All paths except the execution path 3 shown in Figure 34.17 start with an event node.) The execution path 3 starts with a task node, which has a Set Due Date action for timeout. The last sub-action of this node should mark this task as done. After this node, a decision node checks the occurrence of events E1 and E2 with a flag (this flag is set when either E1 or E2 occurs). If the flag is not set, a task node with Cancel Event actions is executed, thereby suppressing other execution paths. All the execution paths should converge at the same Or node.

Implementing the Event with Timeout pattern.

Figure 34.17. Implementing the Event with Timeout pattern.

Cancellation via Event

The Cancellation via Event pattern represents a workflow where it is required to cancel an execution path if an event occurs. There are two variations to this pattern, depending on whether the execution path can be canceled in the middle of its execution. In the first variation, the cancellation event does not have any effect if the path has already started its execution. The second variation occurs when checks for the cancellation event are made at various points of execution in the workflow, so the cancellation may be effective throughout the execution path. This variation is complex and may require careful coordination of execution and cancellation paths (see Figure 34.18).

Implementing the Cancellation via Event pattern.

Figure 34.18. Implementing the Cancellation via Event pattern.

The cancellation path should start with an event node waiting for a cancel event. The regular execution path should start with a task node, which provides some latency by entering a quiescent state for a short span, allowing the event node to register properly. The cancellation path should set a flag after the event occurs; the event can be checked in the regular execution path after the quiescent state is exited. A decision node after the timeout node should test the value of the flag. After the regular execution path starts, the event node must be prevented from firing. This can be done by a Cancel Event action that cancels the cancellation event. Both of these execution paths must converge to an Or node.

Similar guidelines should also be followed for the second variation. The cancellation path should start with an Event node that waits for the cancellation event. As in the previous variation, start the normal execution path with a Task node that blocks for a short duration. The last action should disable the Event node by canceling the cancellation event through use of a Cancel Event action. Both execution paths should converge to an Or node.

Execution Timeout

The Execution Timeout pattern is similar to the Cancellation via Event pattern in that a timeout, instead of an event, causes the cancellation of the execution path. A scenario in which a workflow’s execution path must be completed in a certain amount of time fits into this pattern. Some of the guidelines for such a pattern are as follows. The timeout path must contain a task node that contains the timeout action. A task with a Set Task Due Date action is recommended. Both the normal execution path and the timeout path should have a single point of entry and should converge at an Or node. The timeout path must be disabled after the regular execution path has completed. This can be achieved by setting a timeout disabled flag (as shown in Figure 34.19) after the regular execution path has finished execution. A decision node must check this flag before doing any processing in the timeout path.

Implementing the Execution Timeout pattern.

Figure 34.19. Implementing the Execution Timeout pattern.

Summary

WebLogic Integration’s BPM provides comprehensive functionality that addresses complex enterprise process requirements. BEA WebLogic Integration combines an intuitive process design studio and a powerful process management engine that enables companies to design, execute, and continually optimize enterprisewide processes. In BPM, a business process can be designed to be triggered using different mechanisms—manual, XML event, another workflow, or timer—and using a plug-in. BPM also provides a rich API set for creating custom configuration, design, and runtime management and for monitoring clients. Both design and runtime behavior can be extended using the BPM plug-in framework. Using BPM can automate and streamline business process management.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset