Skip Headers
Oracle® SOA Suite Developer's Guide
10g (10.1.3.1.0)

Part Number B28764-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

7.12 Creating a Human Workflow Task

Human workflow tasks enable you to interweave human interactions with connectivity to systems and services within an end-to-end process flow. As shown in Figure 7-29, human workflow is linked to a BPEL process through a WSDL, like any other web service. The process assigns a task to a user or role and waits for a response. The users act on the task using Oracle BPEL Worklist Application (Worklist Application).

Figure 7-29 Human Workflow in Oracle BPEL Process Manager

High-level view of workflow services.
Description of "Figure 7-29 Human Workflow in Oracle BPEL Process Manager"

Features of human workflow include:

7.12.1 How to Create a Human Workflow Task

Use a human task activity and the Human Task editor to create a human workflow task. Human Task editor inputs are saved in the human_task_name.task file.

To create a human workflow task:

  1. Drag and drop a human task activity into the BPEL process.

  2. Click the Create Task Definition icon, shown in Figure 7-30.

    Figure 7-30 Creating a Task Definition

    Description of Figure 7-30 follows
    Description of "Figure 7-30 Creating a Task Definition"

  3. Enter a human task name and click OK.

  4. Use the Human Task editor to configure the task.

    1. Enter a title.

    2. Select a priority

    3. Use the flashlight icon to look up and select outcomes.

    4. Enter the task owner's name, or use the flashlight icon or the expression builder icon to specify the task owner.

  5. In the Parameters section of the Human Task editor, shown in Figure 7-31, to provide parameters.

    Figure 7-31 Creating a Human Task: Parameters

    Description of Figure 7-31 follows
    Description of "Figure 7-31 Creating a Human Task: Parameters"

    1. Click the + icon on right side of the window.

    2. In the Add a Parameter dialog, click Element and then the flashlight icon.

    3. In the Type Chooser window, locate the parameter you want by expanding the Project Schema Files node and the XSD file node.

    4. Click OK.

  6. In the Assignment and Routing Policy section of the Human Task editor, shown in Figure 7-32, provide participant information.

    Figure 7-32 Creating a Human Task: Assignment and Routing Policy

    Description of Figure 7-32 follows
    Description of "Figure 7-32 Creating a Human Task: Assignment and Routing Policy"

    1. Click the + icon on the right side of the window.

    2. In the Add Participant Type dialog, select from Single Approver, Group Vote, Management Chain, List of Single Approvers, FYI Assignee, and External Routing Service.

    3. Enter a label for the participant type, for example, Approval Manager.

    4. Specify users or groups that must act on the task.

    5. Specify any participants who should be skipped if the condition is satisfied.

    6. Expand the Advanced section to limit the duration of the task or to allow the participant to invite other participants.

    7. Click OK.

    8. Optionally select Allow all participants to invite other participants or Enable abrupt completion condition.

  7. In the Expiration and Escalation Policy section, shown in Figure 7-33, select from Never Expire, Expire after, Renew after, or Escalate after, and specify any applicable parameters.

    Figure 7-33 Creating a Human Task: Expiration and Escalation Policy

    Description of Figure 7-33 follows
    Description of "Figure 7-33 Creating a Human Task: Expiration and Escalation Policy"

  8. In the Notification Settings section, shown in Figure 7-34, indicate how a user is assigned a task or informed that the task status has changed.

    Figure 7-34 Creating a Human Task: Notification Settings

    Description of Figure 7-34 follows
    Description of "Figure 7-34 Creating a Human Task: Notification Settings"

    1. Select one of the following task status types: Assign, Complete, Error, Expire, Request Info, Update Outcome, Suspend, Withdraw.

      Use the Assign task status for tasks assigned to a user or a new user in a sequential list, for tasks that are renewed, delegated, reassigned, or escalated, or when information for a task is submitted.

    2. Select one of the following recipients for the notification message: Assignees, Initiator (task creator), Approvers, or Owner.

    3. Click the Edit icon to modify the default notification message text.

      This message applies to the notification channel you selected when you created a notification (email, voice, fax, pager, or SMS). Email and fax messages can also include the worklist task detail defined in this message.

  9. In the Advanced Settings section, shown in Figure 7-35, specify advanced settings, such as custom escalation rules, custom style sheets for attachments, multilingual settings, custom task actions and error messages, and callback classes.

    Figure 7-35 Creating a Human Task: Advanced Settings

    Description of Figure 7-35 follows
    Description of "Figure 7-35 Creating a Human Task: Advanced Settings"

See Oracle BPEL Process Manager Developer's Guide for more information on the following topics:

  • Sending secure notifications

  • Sending actionable emails

  • Sending inbound and outbound attachments

  • Specifying advanced settings

7.12.2 What Happens When You Create a Human Workflow Task

The human task settings that you specified with the Human Task editor are stored in the metadata task configuration file. This .task file appears in the Application Navigator, under the BPEL project Integration Content directory, as shown in Figure 7-36.

Figure 7-36 The Human Task .task File

Description of Figure 7-36 follows
Description of "Figure 7-36 The Human Task .task File"

In the SOA Order Booking application, the ApproveOrder.task file is generated when you create the human workflow task ApproveOrder, shown in Figure 7-37. The ApproveOrder task is part of the requiresApproval switch activity. The workflow enables a manager to approve or reject orders over $1,000, for customers with Gold status.

Figure 7-37 The ApproveOrder Human Workflow

Description of Figure 7-37 follows
Description of "Figure 7-37 The ApproveOrder Human Workflow"

7.12.3 How to Assign Input and Output Parameters for the Human Workflow Task

Use the Expression Builder to map fields to BPEL process variables.

To assign input and output parameters:

  1. Double-click the human task activity that you created previously.

  2. Use the Add a Human Task dialog to complete the association of the human workflow task with the BPEL process:

    1. Enter a task title manually or use the Expression Builder to create the title dynamically.

      This is a required field. Your input here overwrites the task title you entered in the Title field of the Human Task editor. This title is displayed in the Worklist Application.

    2. Enter the initiator of the task manually or use the Expression Builder.

      Using the Worklist Application, the initiator can view tasks that he created and perform actions such as approving or rejecting a request. If not specified, the initiator defaults to the task owner specified on the Advanced tab of the Human Task dialog. The initiator defaults to bpeladmin if a task owner is also not specified.

    3. Select a priority value between 1 (the highest) and 5 from the Priority list.

      This field is provided for user reference and does not make this task a higher priority during runtime.

    4. Click the flashlight icon in the BPEL Variable column to map the task parameter to the BPEL variable.

      You must map only the task parameters that carry input data. For output data that is filled in from the Worklist Application, you do not need to map the corresponding variables

    5. Expand the Variables navigation tree and select the appropriate task variable.

    6. In the Human Task dialog, shown in Figure 7-38, click Apply.

      Figure 7-38 Human Task Dialog

      Description of Figure 7-38 follows
      Description of "Figure 7-38 Human Task Dialog"

  3. Use the Advanced tab of the Human Task dialog to optionally specify a scope name, global task variable name, task owner, identification key, and other advanced settings.

See Oracle BPEL Process Manager Developer's Guide for more information on the following advanced settings:

  • Specifying a scope name and a global task variable name

  • Specifying a task owner

  • Specifying an identification key (a user-defined task ID)

  • Including the task history of other human workflow tasks

  • Allowing task and routing customizations in BPEL callbacks

7.12.4 How to Generate a Task Display Form

The task display form defines how a task payload is displayed in the Worklist Application. Task display forms are generated by using templates. Oracle JDeveloper includes three templates and two default JSPs:

The three templates are as follows:

  • Three-region JSP: Consists of the header, body and footer regions. These regions can be displayed by using custom JSP or XSL or default JSP or autogenerated JSP. The autogenerated JSP displays the body region.

  • Two-region JSP: Consists of the header and footer regions

  • One-region JSP: Consists of the body region

The two default JSPs are as follows:

  • Header JSP: Displays task attributes such as task number, priority, title, and so on

  • Footer JSP: Displays task attributes such as attachment, comments, and so on

See Oracle BPEL Process Manager Developer's Guide for information on the following topics:

  • Generating a custom task display form

  • Generating a task display form with ADF Data Controls

  • Creating Custom JSP forms

To generate a simple task display form:

  1. Right-click the folder of the human workflow task for which you want a task display form (for example, the ApproveOrder task of the SOA Order Booking application).

  2. Select Auto Generate Simple Task Form.

    A simple task form is generated with the three-region template. The header region is displayed by using a Header1.jsp file. The footer region is displayed by using a Footer1.jsp file. The body region is displayed by using a payload-body.jsp file based on the payload.

  3. Close payload-body.jsp by clicking the X in the tab.

7.12.5 What Happens When You Generate a Task Display Form

When you generate a task display form, a .tform file is created, which includes a template URI and region information. Workflow task display forms are deployed by using the deployForm ant target, which is executed when you deploy the BPEL process. The target generates an EAR file that includes all generated default or custom JSPs. The generated EAR file is deployed as a child of the Oracle BPEL Process Manager application.

Example 7-14 shows the source code for the ApproveOrder_Display.tform file of the SOA Order Booking application.

Example 7-14 Source Code for the Task Display Form ApproveOrder_Display.tform

<?xml version = '1.0' encoding = 'UTF-8'?>
<taskDisplay targetNamespace="http://xmlns.companyABC.com/workflow/orderTaskDisplay"
 generateInternationlizedJSP="false" xmlns:po="http://xmlns.oracle.com/bpel/workflowApproveOrder"
 xmlns:task="http://xmlns.oracle.com/bpel/workflow/task"
 xmlns="http://xmlns.oracle.com/bpel/workflow/taskDisplay">
   <taskDefinitionId>${domain_id}_${process_id}_${process_revision}_ApproveOrder</taskDefinitionId>
   <applicationName>worklist</applicationName>
   <templateName>ThreeRegionJSP</templateName>
   <template>${http_url}/${domain_id}/${process_id}/${process_revision}/
     ApproveOrder/ApproveOrder.jsp</template>
   <regions>
      <defaultJSP regionName="Header">
         <jspURI>Header1.jsp</jspURI>
      </defaultJSP>
      <autoGeneratedJSP regionName="Body" editable="true">
         <jspURI>payload-body.jsp</jspURI>
         <messageAttribute editable="false">PurchaseOrder</messageAttribute>
      </autoGeneratedJSP>
      <defaultJSP regionName="Footer">
         <jspURI>Footer1.jsp</jspURI>
      </defaultJSP>
   </regions>
</taskDisplay>

7.12.6 How to Log In to the Worklist Application

The Worklist Application uses a browser interface to enable users to act on their assigned human workflow tasks. Use Internet Explorer 6.0 or Mozilla Firefox 1.0.4 to access the Worklist Application.

See Oracle BPEL Process Manager Developer's Guide for more information about the Worklist Application.

To log in to the Worklist Application:

  1. Open a Web browser.

  2. Go to the following URL:

    http://hostname:portnumber/integration/worklistapp/Login
    
    
    • The hostname is the name of the host on which Oracle BPEL Process Manager is installed

    • The portnumber used at installation (typically 8888) is noted in bpelsetupinfo.txt, at

      SOA_Oracle_Home\install\
      
      

    You can also select Start, then All Programs, then Oracle - Oracle - soademo, then Oracle BPEL Process Manager, and then Worklist Application.

  3. Type the username and password, and click Login.

    You can use jcooper and welcome1 to log in.

7.12.7 What Happens at Runtime

When the ApproveOrder process runs as part of the SOA Order Booking application, the process appears in Oracle BPEL Control as an initiated activity waiting for a response, that is, waiting for a manager to approve the order. The manager uses the Worklist Application to approve or reject the request. After logging in, the manager sees a list of tasks, clicks the task title, Approve Order, claims the task, and then accepts or rejects it. The task details are displayed using the task display form described in Section 7.12.4, "How to Generate a Task Display Form" and shown in Figure 7-39.

Figure 7-39 Worklist Application for the Approve Order Task

Description of Figure 7-39 follows
Description of "Figure 7-39 Worklist Application for the Approve Order Task"

If the manager approves the order, then the message is sent back into the BPEL flow. If the manager rejects the order, then the process cancels the order.