Skip Headers
Oracle® BPEL Process Manager Developer's Guide
10g (10.1.3.1.0)

Part Number B28981-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

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

15 Oracle BPEL Process Manager Workflow Services

A company's business processes drive the integration of systems and people that participate in it. The business process and associated systems have a life cycle and certain behavior. The users who participate in the business process have roles and privileges to perform tasks in the business process. Using the workflow services of Oracle BPEL Process Manager, you can blend the integration of systems and services with human workflow into a single end-to-end process flow, while providing visibility and enabling exception handling and optimization at various levels.

This chapter contains the following topics:

See Also:

15.1 Oracle BPEL Process Manager Workflow Services 10.1.2 and 10.1.3.1.0 Compatibility

Workflows that you designed in 10.1.2 with the workflow wizard can be deployed and run in 10.1.3.1.0. However, you must use the old worklist URL to access these tasks:

http://localhost:9700/integration/oldworklistapp/Login

For release 10.1.3.1.0, the workflow wizard has been replaced by a Human Task editor. This editor enables you to specify task settings such as task outcome, payload structure, task participants, assignment and routing policy, expiration and escalation policy, notification settings, and so on.

You cannot use the Human Task editor to edit 10.1.2-based workflows. To use any new 10.1.3.1.0 functionality, the task scope of the workflow must be manually migrated to use the new workflow metadata.

Note also that this is the last release in which you can deploy workflows designed with 10.1.2.

15.2 Overview of Workflow Services

Workflow services enable you to interleave human interactions with connectivity to systems and services within an end-to-end process flow. As shown in Figure 15-1, workflow services are linked to a BPEL process through a WSDL contract, 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.

Figure 15-1 High-Level View of Workflow Services in Oracle BPEL Process Manager

High-level view of workflow services.
Description of the illustration bpmdg036.gif

Terms used in workflow services include:

Features of workflow services include:

15.2.1 Workflow Functionality: A Procurement Process Example

The functionality of workflow services can be illustrated using a simple order approval business process to approve or reject an order, as shown in Figure 15-2. requested items. Approval and rejection is a two-step process involving an initial approver and the manager of the initial approver. The order is first assigned to the Supervisor role. Once a user belonging to the Supervisor role approves the order, it is sent to this user's manager for final approval.

See Also:

Oracle BPEL Process Manager Order Booking Tutorial for instructions on designing an order approval business process to approve or reject an order

15.2.2 Workflow Services Components

Figure 15-3 shows the following workflow services components:

  • Task Service

    The task service provides task state management and persistence of tasks. In addition to these services, the task service exposes operations to update a task, complete a task, escalate and reassign tasks, and so on. The task service is used by the Oracle BPEL Worklist Application to retrieve tasks assigned to users. This service also determines if notifications are to be sent to users and groups when the state of the task changes. The task service consists of the following services.

    • Task Routing Service

      The task routing service offers services to route, escalate, and reassign the task. The service makes these decisions by interpreting a declarative specification in the form of the routing slip.

    • Task Query Service

      The task query service queries tasks for a user based on a variety of search criterion such as keyword, category, status, business process, attribute values, history information of a task, and so on.

    • Task Metadata Service

      The task metadata service exposes operations to retrieve metadata information related to a task.

  • Identity Service

    The identity service is a thin Web service layer on top of the Oracle Application Server 10g security infrastructure or any custom user repository. It enables authentication and authorization of users and the lookup of user properties, roles, group memberships, and privileges.

  • Notification Service

    The notification service delivers notifications with the specified content to the specified user to any of the following channels: e-mail, telephone voice message, pager, fax, and SMS. See "Notifications from Workflow Services" for more information.

  • User Metadata Service

    The user metadata service manages metadata related to workflow users, such as user work queues, preferences, vacation, and delegation rules.

  • Runtime config service

    The runtime config service provides methods for managing metadata used in the task service run time environment. It principally supports management of task payload flex field mappings.

Figure 15-3 Workflow Services Components

Description of bpmdg041.gif follows
Description of the illustration bpmdg041.gif

Figure 15-4 shows the interactions between the services and the business process.

Figure 15-4 Workflow Services and Business Process Interactions

Description of bpmdg042.gif follows
Description of the illustration bpmdg042.gif

See Also:

Oracle BPEL Process Manager Administrator's Guide for identity service details

15.3 Use Cases for Workflow Services

Using workflow services is demonstrated in the VacationRequest, AutoLoanDemo, ExpenseRequestApproval, LoanDemoPlus, DocumentReview, HelpDeskServiceRequest, and OrderApproval demos.

See Also:

The following sections describe multiple use cases for workflow services.

15.3.1 Assigning a Task to a User or Role

A vacation request process may start with getting the vacation details from a user and then routing the request to their manager for approval. User details and the organizational hierarchy can be looked up from a user directory or store. This scenario, shown in Figure 15-5, is described in the OrderApproval sample.

Figure 15-5 Assigning Tasks to a User or Role from a Directory

Assigning tasks in workflow.
Description of the illustration bpmdg037.gif

15.3.2 Using the Various Participant Types

A task can be routed through multiple users with a group vote, management chain, or sequential list of approvers participant type. For example, consider a loan request that is part of the loan approval flow. The loan request may first be assigned to a loan agent role. After a specific loan agent acquires and accepts the loan, the loan may be routed further through multiple levels of management if the loan amount is greater that $100,000. This scenario, shown in Figure 15-6, is described in the LoanDemoPlus sample.

Figure 15-6 Flow Patterns and Routing Policies

Description of bpmdg038.gif follows
Description of the illustration bpmdg038.gif

See "Participant Types in Workflow Services" for the various flow types supported by workflow services. You can use these types as building blocks to create complex workflows.

15.3.3 Escalation, Expiration, and Delegation

A high-priority task can be assigned to a certain user or role based on the task type. However, if the user does not act on it in a certain time, the task may expire and in turn be escalated to the manager for further action. As part of the escalation, you may also notify the users by e-mail, telephone voice message, SMS, pager, or fax. Similarly, a manager may delegate tasks from one reportee to another to balance the load between various task assignees. All tasks defined in BPEL have an associated expiration date. Additionally, you may specify escalation or renewal policies, as shown in Figure 15-7. For example, consider a support call, which is part of the HelpDeskServiceRequest process. A high-priority task may be assigned to a certain user and if the user does not respond in two days, then the task is routed to the manager for further action.

Figure 15-7 Escalation and Notification

Escalation and notification
Description of the illustration bpmdg039.gif

15.3.4 Automatic Assignment and Delegation

A user may decide to have another user perform tasks on their behalf. Tasks can be explicitly delegated from the Oracle BPEL Worklist Application or can be automatically delegated. For example, a manager sets up a vacation rule saying that all their high priority tasks are automatically routed to one of their reports while the manager is on vacation. In some cases, tasks can be routed to different individuals based on the content of the task. Another example of automatic routing is to allocate tasks among multiple individuals belonging to a group. For example, a help desk supervisor decides to allocate all tasks for the western region based on a round robin basis or assign tasks to the individual with the lowest number of outstanding tasks (the least busy).

15.3.5 Work Queues and Proxy Support

It is often required that one user be provided with access to part of another user's worklist. For example, an executive decides to provide access to expense approvals within a certain limit to their secretary. Work queues allow you to create a custom view to group a subset of tasks in the worklist (say high priority tasks, tasks due in 24 hours, expense approval tasks, and so on). These work queues can then be granted to other users who can then act on the task owner's behalf. For example, in the scenario described above, the executive can create a delegated expense approvals work queue for expenses below $5000.

15.3.6 The Oracle BPEL Worklist Application

Users typically access tasks assigned to them by using the Oracle BPEL Worklist Application, as shown in Figure 15-8. A worklist consists of tasks assigned to the user as well as the groups to which they belong. A task may also include forms and attachments in addition to other task details such as history, comments, and approval sequence. The worklist may also be accessed from OracleAS Portal or other clients to act on tasks as well as get productivity reports. The Oracle BPEL Worklist Application can be customized and extended based on the specific needs of an application. See Chapter 16, "Worklist Application" for details about worklist functionality and the sample Oracle BPEL Worklist Application.

Figure 15-8 Oracle BPEL Worklist Application—Access Tasks, Forms, Attachments, and Reports

Description of bpmdg040.gif follows
Description of the illustration bpmdg040.gif

15.4 Participant Types in Workflow Services

Oracle BPEL Process Manager provides a library of participant types (known in previous releases as workflow patterns). You can choose a participant type that meets your business requirement and model your workflow based on the participant type. Oracle BPEL Process Manager supports the following participant types:

15.4.1 Continuing Workflows from Other Workflows

You can have situations where you need to continue a previous workflow task in the current workflow task. Oracle BPEL Process Manager enables you to include the task history, comments, and attachments from the previous task. This provides you with a complete end-to-end audit trail.

15.5 Overview of the Modeling Process

The modeling process consists of creating a human task, associating it with a BPEL process, and generating the format for displaying the human task during run time in the Oracle BPEL Worklist Application. This section provides a brief overview of these modeling tasks and provides references to specific modeling instructions.

15.5.1 Create a Human Task Definition with the Human Task Editor

The Human Task editor enables you to define the metadata for the task. This editor enables you to specify human task settings, such as task outcome, payload structure, task participants, assignment and routing policy, expiration and escalation policy, notification settings, and so on. This information is saved to a metadata task configuration file with a .task extension.

15.5.2 Associate the Human Task Definition with a BPEL Process

You associate the .task file that consists of the human task settings with a BPEL process. Association is made with a human task activity that you drag and drop into your BPEL process for configuring. You also define the task definition, task initiator, task priority, and map the task parameter that carries the input data to a BPEL variable. You can also define advanced features, such as the scope and global task variables names (instead of accepting the default names), task owner, identification key, BPEL callback customizations, and whether to extend the human task to include other workflow tasks.

When association is complete, a Task Service partner link is created. The Task Service exposes the operations required to act on the task.

15.5.3 Generate the Task Display Form

You generate the layout of the task display form used for displaying the task header, body (task payload), and footer details at run time in Oracle BPEL Worklist Application. The task display form defines the display mechanism for the task payload (data in the task) in the Oracle BPEL Worklist Application. Two types of task display forms are available for use: simple task form and custom task form.

See Also:

"Task 3: Generating the Task Display Form" for specific instructions

15.6 Task 1: Creating the Human Task Definition with the Human Task Editor

The Human Task editor enables you to define the metadata for the task. This editor enables you to specify human task settings, such as task outcome, payload structure, task participants, assignment and routing policy, expiration and escalation policy, notification settings, and so on.

When human task creation is complete, the following folder and file are created:

This section contains the following topics:

15.6.1 Accessing the Human Task Editor

When you are ready to begin creation of a human task, the Human Task editor can be accessed in several ways in Oracle JDeveloper:

15.6.1.1 From the Application Navigator

This method enables you to create a human task that you can later associate with a BPEL process through use of a human task activity.

  1. Right-click your BPEL process in the Application Navigator and select Create Human Task Definition.

    The Add a Human Task window appears.

  2. Enter a name in the Human Task Name field.

    The name you enter is added to the directory path in the Location field.

    SOA_Oracle_Home/jdev/mywork/my_application/my_process/bpel/
    Human_task_directory/Human_task_name.task
    
    
  3. Click OK.

    The Human Task editor appears.

  4. Go to section "Reviewing the Sections of the Human Task Editor".

Note:

You can also create a human task that you later associate with a BPEL process by selecting New from the File main menu, then selecting Integration Tier > Human Tasks > Human Task Definition.

15.6.1.2 From the Component Palette

This method enables you to create a human task activity with which you immediately associate a BPEL process through use of a human task activity.

  1. Select Process Activities from the Component Palette.

  2. Drag and drop a Human Task activity into your BPEL process.

    The Add a Human Task window appears.

  3. Click the second icon to the right of the Task Definition field.

    Description of ht_addtask.gif follows
    Description of the illustration ht_addtask.gif

  4. Enter a name in the Human Task Name field.

    The name you enter is added to the directory path in the Location field.

    SOA_Oracle_Home/jdev/mywork/my_application/my_process/bpel/
    Human_task_directory/Human_task_name.task
    
    
  5. Click OK.

    The Human Task editor appears.

  6. Go to section "Reviewing the Sections of the Human Task Editor".

15.6.2 Reviewing the Sections of the Human Task Editor

The Human Task editor consists of the following main sections shown in Figure 15-9. These sections enable you to create a human task.

Figure 15-9 Human Task Editor

Description of ht_editor.gif follows
Description of the illustration ht_editor.gif

Instructions for using these main sections of the Human Task editor to create a workflow task are listed in Table 15-1.

Table 15-1 Human Task Editor

For This Main Section... See...
Task Configuration

(title, outcomes, priority, and owner)

"Specifying the Task Title, Priority, Outcome, and Owner"
Parameters "Specifying the Task Payload Data Structure"
Assignment and Routing Policy "Assigning Task Participants"
Expiration and Escalation Policy "Escalating, Renewing, or Ending the Task"
Notification Settings "Specifying Participant Notification Preferences"
Advanced Settings

(for specifying custom escalation rules, custom style sheets for attachments, multilingual settings, custom task actions, error messages, and callback classes)

"Specifying Advanced Settings"

15.6.3 Specifying the Task Title, Priority, Outcome, and Owner

Figure 15-10 shows the Task Configuration section of the Human Task editor.

This section enables you to specify details such as the task title, task priority, task outcomes, and task owner.

Figure 15-10 Human Task Editor — Task Configuration Section

Description of ht_taskconfig.gif follows
Description of the illustration ht_taskconfig.gif

Instructions for configuring the following subsections of the Task Configuration section are listed in Table 15-2:

Table 15-2 Human Task Editor — Task Configuration Section

For This Subsection... See...
Title

Priority

"Specifying a Task Title and Priority"
Outcomes "Specifying a Task Outcome"
Owner "Specifying a Task Owner"

15.6.3.1 Specifying a Task Title and Priority

  1. Enter the following details.

    Field Description
    Title Enter an optional task title. The task title displays in the Oracle BPEL Worklist Application. If you enter a title in the Task Title field of the General tab of the Human Task window described in "Specifying the Task Title", the title you enter here is overridden.
    Priority Specify the priority of the tasks. Priority can be 1 through 5, with 1 being the highest. By default, the priority of a task is 3. The priority can be used to sort tasks in the Oracle BPEL Worklist Application. This priority value is overridden by any priority value you select in the General tab of the Add a Human Task window.

    See Also: "Specifying the Task Initiator and Task Priority" for instructions on specifying a priority value in the Add a Human Task window


15.6.3.2 Specifying a Task Outcome

Task outcomes capture the possible outcomes of a task. The Oracle BPEL Worklist Application displays the outcomes you specify here as the possible actions to perform during run time. You can specify the following types of task outcomes:

  • Select a seeded outcome

  • Enter a custom outcome

The task outcomes can also have run time display values that are different from the actual outcome value specified here. This permits outcomes to be displayed in a different language in the Oracle BPEL Worklist Application. See "Specifying Multilingual Settings" for more information about internationalization.

  1. Click the flashlight icon to the right of the Outcomes field.

    The Outcomes window displays the possible outcomes for tasks. APPROVE and REJECT are selected by default.

    Description of ht_outcomes.gif follows
    Description of the illustration ht_outcomes.gif

  2. Select additional task outcomes or deselect the default outcomes.

  3. Enter any custom outcomes separated by commas in the Custom Outcomes field.

  4. Click OK to return to the Human Task editor.

    Your selections display in the Outcomes field.

    The seeded and custom outcomes selected here display for selection in the Majority Voted Outcome section of the group vote participant type.

15.6.3.2.1 Displaying Custom Outcomes in a Human Task Activity

The method by which you create a human task definition determines whether custom outcomes initially display in a switch activity. If you perform the following tasks:

  1. Drag and drop a human task activity into the design window.

  2. Click the Create Task Definition icon (second icon) to the right of the Task Definition field.

  3. Create a human task definition with custom outcomes.

  4. Expand the human task activity.

    Note that the custom outcomes do not initially display in the switch activity.

As a workaround, perform the following steps:

  1. Click the human task activity to display the Human Task window.

  2. Click OK.

  3. Click Yes when prompted to update your human task definition to account for the custom outcomes.

  4. Click Source.

  5. Click Diagram.

  6. Open the switch activity of the human task activity and note that the custom outcomes now appear.

Or, always create human task definition files as follows:

  1. Right-click the BPEL process in the Application Navigator.

  2. Select Create Human Task Definition.

  3. Design a human task definition.

  4. Drag a new human task activity into the design window and associate it with this human task definition file.

  5. Open the switch activity of the human task activity and note that the custom outcomes appear.

15.6.3.3 Specifying a Task Owner

The task owner can view the tasks belonging to business processes they own and perform operations on behalf of any of the assigned task participant types. Additionally, the owner can also reassign, withdraw, or escalate tasks. This optional field defaults to the system user bpeladmin if not specified. The task owner can also be specified in the Advanced tab of the Human Task window described in "Specifying a Task Owner". The task owner specified in the Advanced tab overrides any task owner you enter here.

  1. Select a method for specifying the task owner:

15.6.3.3.1 Specifying a Task Owner By Browsing the User Directory

Task owners can be selected by browsing the user directory (Oracle Internet Directory (OID), JAZN/XML, LDAP, and so on) that is configured for use with Oracle BPEL Process Manager.

  1. Click the first icon to the right of the Owner field to display the Identity lookup dialog.

  2. Search for the owner by entering a search string such as jcooper, j*, *, and so on. Clicking Lookup fetches all the users that match the search criteria.

    Description of ht_idserv1.gif follows
    Description of the illustration ht_idserv1.gif

    One or more users or groups can be highlighted and selected by clicking Select.

  3. View the hierarchy of a user by highlighting the user and clicking Hierarchy. Similarly, clicking Reportees displays the reportees of a selected user or group.

    Description of ht_idserv2.gif follows
    Description of the illustration ht_idserv2.gif

  4. View the details of a user or group by highlighting the user or group and clicking Detail.

    Description of ht_idserv3.gif follows
    Description of the illustration ht_idserv3.gif

  5. Click OK to return to the Identity lookup dialog.

  6. Click Select to add the user to the Selected user section.

  7. Click OK to return to the Human Task editor.

    Your selection displays in the Owner field.

15.6.3.3.2 Specifying a Task Owner Dynamically

Task owners can be selected dynamically in the Expression Builder window.

  1. Click the second icon to the right of the Owner field to display the Expression Builder window:

    Description of ht_dynamicowner.gif follows
    Description of the illustration ht_dynamicowner.gif

  2. Browse the available variable schemas and functions to create a task owner.

  3. Click OK to return to the Human Task editor.

    You selection displays in the Owner field.

    See Also:

15.6.4 Specifying the Task Payload Data Structure

Figure 15-11 shows the Parameters section of the Human Task editor.

This section enables you to define the structure (message attributes) of the task payload (the data in the task). Task payload data consists of one or more elements or types. Based on your selections, an XML schema definition is created for the task payload.

Figure 15-11 Human Task Editor — Parameters Section

Description of ht_params.gif follows
Description of the illustration ht_params.gif

  1. Click the + sign to display the Add Task Parameter window.

    Description of ht_addtaskp.gif follows
    Description of the illustration ht_addtaskp.gif

  2. Enter the following details:

    Field Description
    Parameter Type Select Type or Element and click the flashlight icon to display the Type Chooser window for selecting the task parameter.
    Name Accept the default name or enter a custom name. This field only displays if Type is the selected parameter type.
    Modifiable via worklist Select this check box to enable users to edit task payload data in the footer of the Oracle BPEL Worklist Application. For example, the approver in the application may need to add approver comments.

    Note:

    You can only define payload flex field mappings in the Oracle BPEL Worklist Application for payload parameters that are simple XML types.
  3. Click OK to return to the Human Task editor.

    Your selection displays in the Parameters section.

  4. If you want to edit your selection, highlight it and click the first icon in the upper right part of the Parameters section.

15.6.5 Assigning Task Participants

Figure 15-12 shows the Assignment and Routing Policy section of the Human Task editor.

This section enables you to select a participant type that meets your business requirement. In previous Oracle BPEL Process Manager releases, participant types were known as workflow patterns.

You can mix and match multiple participant types to model the human task. This enables you to extend the functionality of a previously configured human task to model more complex workflows.

Each of the participant types has an associated editor that you use for configuration tasks. The sequence in which the assignees are added indicates the execution sequence.

Figure 15-12 Human Task Editor — Assignment and Routing Policy Section

Description of ht_arp.gif follows
Description of the illustration ht_arp.gif

  1. Click the + sign to display the Add Participant Type window.

    This enables you to select a specific participant type.

  2. Select a participant type from the Type list.

    Description of ht_types.gif follows
    Description of the illustration ht_types.gif

    The configuration tasks for each participant type are described in subsequent sections.

  3. See the following section based on your selection:

  4. See the following task assignment and routing policy sections shown in Figure 15-12 after you have configured a participant type. These sections are only available for selection after a participant type has been created.

    For This Subsection... See...
    Allow all participants to invite other participants "Allowing All Participants to Invite Other Participants"
    Enable abrupt completion condition "Abruptly Completing a Condition"

15.6.5.1 Specifying Task Approvers

Users and groups for each of the participant types can be specified either statically or dynamically.When the users and groups are specified statically (or by browsing the identity service), the values can be either of the following:

  • A single user or group (for example, jstein), which in the case of a single approver, is captured as follows:

    <participant name="Assignee1">
      <resource isGroup="false" type="STATIC">jstein</resource>
     </participant> 
    
    
  • A delimited string of users or groups (for example, jstein, wfaulk, cdickens), which in the case of a single approver, is captured as follows:

    <participant name="Assignee1">
     <resource isGroup="false" type="STATIC">jstein, wfaulk, cdickens</resource>
    </participant>
    
    

You may have a business requirement to create a dynamic list of task approvers specified in a payload variable. This XPath expression can resolve to zero or more XML nodes. Each node value can be either of the following:

  • A single user or group

  • A delimited string of users or groups. For example, the following task shows that the payload message attribute is of type xsd:String and its value is a comma-delimited string of approvers. This node can be used to specify the participants.

    <task>
     . . .
     <payload>
       <approvers>jstein,wfaulk,cdickens</approvers>
     </payload>
    </task> 
    
    

The default delimiter for the assignee delimited string is a comma (,). This delimiter can be changed using the assigneeDelimiter XML element in the wf-config.xml file. This delimiter applies to all workflows in the system.

Specifying participants in this manner is applicable to all participant types, although they are interpreted differently for each type. For example:

  • In a single user participant type, the task is assigned to everyone evaluated.

  • In a sequential list of approvers participant type, the task is sequentially assigned to users and groups evaluated in the list.

  • In a group vote participant type, a task is created for each user and group evaluated in the list.

This interpretation of resource XPath expressions provides orcl:create-nodeset-from-delimited-string-equivalent functionality to enable you to specify a dynamic list of one or more task approvers (resource element members) from the payload variable.

15.6.5.2 Configuring the Single Approver Participant Type

Figure 15-13 displays the Single Approver window.

This participant type requires a single user to act on a task. If the task is assigned to a role or group with multiple users, one of the members must claim the task and act on it. Based on the user's action, you define what the business process does.

For example, a vacation request is assigned to a manager. The manager must act on the request task three days before the vacation starts. If the manager formally approves or rejects the request, the employee is notified with the decision. If the manager does not act on the task, the request is treated as rejected. Notification actions similar to the formal rejection are taken.

Figure 15-13 Add Participant Type — Single Approver

Description of ht_singleapprove.gif follows
Description of the illustration ht_singleapprove.gif

  1. Enter a recognizable label for this participant in the Label field. This label must be unique within this workflow (for example, Approval Manager, Primary Reviewers, and so on).

    Instructions for configuring the following subsections of the Add Participant Type - Single Approver window are listed in Table 15-3:

    Table 15-3 Add Participant Type — Single Approver

    For This Subsection... See...
    Requires action from one of the participants below "Assigning Participants to the Single Approver Task"
    Specify skip rule "Bypassing a Task Participant"
    Limit allocated duration to "Specifying a Time Limit for Acting on a Task"
    Allow this participant to invite other participants "Inviting Additional Participants to a Task"

15.6.5.2.1 Assigning Participants to the Single Approver Task
  1. Select a method for assigning a user or group to participate in performing actions on this task.

    • By name

      Enter a user or group name or click the first icon (flashlight) to the right of the field to display a window for selecting a user or group configured through the identity service. The identity service enables user authorization and the lookup of user properties, roles, group memberships, and privileges. User information is obtained from Java AuthoriZatioN (JAZN) or an LDAP server such as Oracle Internet Directory. You can use wild cards (*) to search for IDs.

    • By expression

      Dynamically assign this task to a user (for example, jcooper) or group (for example, administrators) by clicking the icon to the right of the field to display the Expression Builder window. Users who are members of a group are assigned this task. For a user to act on a task assigned to a group, they must first claim the task in the Oracle BPEL Worklist Application during run time.

      The XPath expressions for specifying assignees must follow these rules:

      • They must be based off the task XSD. This includes the payload as defined in the payload section. For example, /task:task/task:payload/order:orderAssignee is an example of an XPath expression based of the task XSD.

      • The XPath expressions cannot contain BPEL-specific XPath functions such as bpws:getVariableData(), and so on because these XPath expressions are not evaluated from the context of a BPEL instance.

      • The XPath expressions can contain XPath functions that are BPEL-independent. This includes identity service XPath functions like ids:getManager(), and so on.

15.6.5.2.2 Bypassing a Task Participant
  1. Select the Specify skip rule check box if you want the user or group to be bypassed if a specific condition is satisfied. This action displays an icon for accessing the Expression Builder window for building a condition. For example, if a user submits a business trip expense report that is below a specific amount, no approval is required by their manager.

    The expression to bypass a task participant must evaluate to a Boolean value. For example, /task:task/task:payload/order:orderAmount < 1000 is a valid XPath expression for skipping a participant.

15.6.5.2.3 Specifying a Time Limit for Acting on a Task
  1. Click the + sign to expand the Advanced section shown in Figure 15-13.

  2. Select Limit allocated duration to.

  3. Specify the amount of time a user or group receives to act on a task. If the user or group does not act in the time specified, the global escalation and renewal policies that you set in the Expiration and Escalation Policy section (known as the routing slip level) of the Human Task editor are applied. For example, if the global policy is set to escalate the task and this participant does not act in the duration provided, the task is escalated to the manager or another user, as appropriate.

    See Also:

    "Escalating, Renewing, or Ending the Task" for instructions on setting the global escalation and renewal policies in the Expiration and Escalation Policy section of the Human Task editor
15.6.5.2.4 Inviting Additional Participants to a Task
  1. Click the + sign to expand the Advanced section (if not already expanded).

  2. Select the Allow this participant to invite other participants check box if you want this task assignee to invite other participants into the workflow before routing it to the next assignee in this workflow. For example, assume the approval workflow goes from James Cooper to John Steinbeck. If this option is checked, James Cooper can decide to first route it to Irving Stone before it goes to John Steinbeck.

15.6.5.3 Configuring the Group Vote Participant Type

Figure 15-14 displays the Group Vote window.

This participant type is used when multiple users, working in parallel, must take action simultaneously, such as in a hiring situation when multiple users vote to hire or reject an applicant. You specify the voting percentage that is needed for the outcome to take effect, such as a majority vote or a unanimous vote.

For example, a business process collects the feedback from all interviewers in the hiring process, consolidates it, and assigns a hire or reject request to each of the interviewers. At the end, the candidate is hired if the majority of interviewers vote for hiring instead of rejecting.

Figure 15-14 Add Participant Type — Group Vote

Description of ht_groupvote.gif follows
Description of the illustration ht_groupvote.gif

  1. Enter a recognizable label for this participant in the Label field. This label must be unique within this workflow (for example, Approval Manager, Primary Reviewers, and so on).

    Instructions for configuring the following subsections of the Add Participant Type - Group Vote window are listed in Table 15-4:

    Table 15-4 Add Participant Type — Group Vote Window

    For This Subsection... See...
    Required consensus between the participants below: 50 "Assigning Participants to the Group Vote Task"
    Specify skip rule "Bypassing a Task Participant"
    Share attachments and comments "Sharing Attachments and Comments with Task Participants"
    Default Outcome

    Consensus Percentage

    Immediately trigger voted outcome when minimum percentage is met

    Wait until all votes are in before triggering outcome

    "Specifying Group Voting Details"
    Limit allocated duration to "Specifying a Time Limit for Acting on a Task"

15.6.5.3.1 Assigning Participants to the Group Vote Task
  1. Select a method for assigning a user or group to participate in this task. The assigned participants must establish a consensus on when a task is considered complete.

    • By name

      Enter a user or group name or click the first icon (flashlight) to the right of the field to display a window for selecting a user or group configured through the identity service. The identity service enables user authorization and the lookup of user properties, roles, group memberships, and privileges. User information is obtained from Java AuthoriZatioN (JAZN) or an LDAP server such as Oracle Internet Directory. You can use wild cards (*) to search for IDs.

    • By expression

      Dynamically assign this task to a user (for example, jcooper) or group (for example, administrators) by clicking the icon to the right of the field to display the Expression Builder window. Users who are members of a group are assigned this task. For a user to act on a task assigned to a group, they must first claim the task in the Oracle BPEL Worklist Application during run time.

    See Also:

    "Assigning Participants to the Single Approver Task" for rules to follow when specifying assignees with XPath expressions
15.6.5.3.2 Bypassing a Task Participant
  1. Select the Specify skip rule check box if you want the user or group to be bypassed if a specific condition is satisfied. This action displays an icon for accessing the Expression Builder window for building a condition. For example, if a user submits a business trip expense report that is below a specific amount, no approval is required by their manager. The expression must evaluate to a Boolean value.

    See Also:

    "Bypassing a Task Participant" for an example of a valid XPath expression for skipping a participant
15.6.5.3.3 Sharing Attachments and Comments with Task Participants
  1. Select the Share attachments and comments check box if you want all group voters or workflow participants to share comments and attachments for this task. This information typically displays in the footer region of the Oracle BPEL Worklist Application.

15.6.5.3.4 Specifying Group Voting Details

  1. Specify a method for selecting the outcome for the final task. If you select By Expression from the lists below, you can dynamically specify the details by clicking the icon to the right of the field to display the Expression Builder window.

    • Default Outcome

      Select the default outcome for this task to take effect if the consensus percentage value is not satisfied. This happens if there is a tie or if all participants do not respond before the task expires. Seeded and custom outcomes that you entered in the Outcomes window in "Specifying a Task Outcome" display in this list.

    • Consensus Percentage

      Select a percentage value required for the outcome of this task to take effect; for example, a majority vote (51) or a unanimous vote (100). For example, assume there are two possible outcomes (ACCEPT and REJECT) and five subtasks. If two subtasks are accepted and three are rejected, and the required acceptance percentage is 50%, the outcome of the task is rejected.

  2. Specify additional group voting details:

    • Immediately trigger voted outcome when minimum percentage is met

      If selected, the outcome of the task can be computed early with the outcomes of the completed subtasks, enabling the pending subtasks to be withdrawn. For example, assume four users are assigned to act on a task, the default outcome is APPROVE, and the consensus percentage is set at 50. If the first two users approve the task, the third and fourth users do not need to act on the task, since the consensus percentage value has already been satisfied.

    • Wait until all votes are in before triggering outcome

      If selected, the workflow waits for all responses before an outcome is initiated.

15.6.5.3.5 Specifying a Time Limit for Acting on a Task
  1. Click the + sign to expand the Advanced section shown in Figure 15-14.

  2. Select Limit allocated duration to.

  3. Specify the amount of time a user or group receives to act on a task. If the user or group does not act in the time specified, the global escalation and renewal policies that you set in the Expiration and Escalation Policy section (known as the routing slip level) of the Human Task editor are applied. For example, if the global policy is set to escalate the task and this participant does not act in the duration provided, the task is escalated to the manager or another user, as appropriate.

    See Also:

    "Escalating, Renewing, or Ending the Task" for instructions on setting the global escalation and renewal policies in the Expiration and Escalation Policy section of the Human Task editor

15.6.5.4 Configuring the Management Chain Participant Type

Figure 15-15 displays the Management Chain window.

This participant type routes tasks for approval to multiple users in a management chain hierarchy. You specify the task participants as a management chain list or a list of users.

For example, a purchase order is assigned to a manager. If the manager approves the order, it is assigned to their manager. If that manager approves it, it is assigned to their manager, and so on until three managers approve the order. If any of the managers reject the request or the request expires, the order is rejected.

Figure 15-15 Add Participant Type — Management Chain

Description of ht_manchain.gif follows
Description of the illustration ht_manchain.gif

  1. Enter a recognizable label for this participant in the Label field. This label must be unique within this workflow (for example, Approval Manager, Primary Reviewers, and so on).

    Instructions for configuring the following subsections of the Add Participant Type - Management Chain window are listed in Table 15-5:

    Table 15-5 Add Participant Type - Management Chain

    For This Subsection... See...
    Requires management chain approval of one of the participants below "Assigning Participants to the Management Chain Task"
    Specify skip rule "Bypassing a Task Participant"
    Maximum Number of Chain Levels Up

    Highest Title of Approver

    "Specifying the Number of Approvers"
    Limit allocated duration to "Specifying a Time Limit for Acting on a Task"
    Allow this participant to invite other participants "Inviting Additional Participants to a Task"

15.6.5.4.1 Assigning Participants to the Management Chain Task
  1. Select a method for assigning a user or group to participate in this task.

    • By name

      Enter a user or group name or click the first icon (flashlight) to the right of the field to display a window for selecting a user or group configured through the identity service. The identity service enables user authorization and the lookup of user properties, roles, group memberships, and privileges. User information is obtained from Java AuthoriZatioN (JAZN) or an LDAP server such as Oracle Internet Directory. You can use wild cards (*) to search for IDs.

    • By expression

      Dynamically assign this task to a user (for example, jcooper) or group (for example, administrators) by clicking the icon to the right of the field to display the Expression Builder window. Users who are members of a group are assigned this task. For a user to act on a task assigned to a group, they must first claim the task in the Oracle BPEL Worklist Application during run time.

      See Also:

      "Assigning Participants to the Single Approver Task" for rules to follow when specifying assignees with XPath expressions
15.6.5.4.2 Bypassing a Task Participant
  1. Select the Specify skip rule check box if you want the user or group to be bypassed if a specific condition is satisfied. This action displays an icon for accessing the Expression Builder window for building a condition. For example, if a user submits a business trip expense report that is below a specific amount, no approval is required by their manager. The expression must evaluate to a Boolean value.

    See Also:

    "Bypassing a Task Participant" for an example of a valid XPath expression for skipping a participant
15.6.5.4.3 Specifying the Number of Approvers
  1. Specify the following task routing parameters. When both parameters are specified, task routing is determined by both parameters. The routing continues until one of these parameters is satisfied. If you select By Expression from the lists below, you can dynamically specify the details by clicking the icon to the right of the field to display the Expression Builder window.

    • Maximum Number of Chain Levels Up

      Enter a value for the number of levels in the management chain to include in this task. For example, if set to 2 and the task is initially assigned to user jcooper, both the user jstein (manager of jcooper) and the user wfaulk (manager of jstein) are included in the list (apart from jcooper, the initial assignee). This is a mandatory field.

    • Highest Title of Approver

      Select the title of the last (highest) user in the management chain. The title is retrieved from the identity service.

15.6.5.4.4 Specifying a Time Limit for Acting on a Task
  1. Click the + sign to expand the Advanced section shown in Figure 15-15.

  2. Select Limit allocated duration to.

  3. Specify the amount of time a user or group receives to act on a task. If the user or group does not act in the time specified, the global escalation and renewal policies that you set in the Expiration and Escalation Policy section (known as the routing slip level) of the Human Task editor are applied. For example, if the global policy is set to escalate the task and this participant does not act in the duration provided, the task is escalated to the manager or another user, as appropriate.

    See Also:

    "Escalating, Renewing, or Ending the Task" for instructions on setting the global escalation and renewal policies in the Expiration and Escalation Policy section of the Human Task editor
15.6.5.4.5 Inviting Additional Participants to a Task
  1. Click the + sign to expand the Advanced section (if not already expanded).

  2. Select Allow this participant to invite other participants if you want this task assignee to invite other participants into the workflow before routing it to the next assignee in this workflow. For example, assume the approval workflow goes from James Cooper to John Steinbeck. If this option is checked, James Cooper can decide to first route it to Irving Stone before it goes to John Steinbeck.

    Note:

    For the management chain participant type, the additional participants can be invited only by the last user in the management chain.

15.6.5.5 Configuring the Sequential List of Approvers Participant Type

Figure 15-16 displays the Sequential List of Approvers window.

This enables you to create a list of sequential participants for a workflow. For example, if you want a document to be reviewed by John, Mary, and Scott in sequence, use this participant type. This is similar to the management chain participant type, except that with that type, the users are part of an organization hierarchy. For the sequential list of approvers participant type, they can be any list of users or groups.

Figure 15-16 Add Participant Type — Sequential List of Approvers

Description of ht_seqlist.gif follows
Description of the illustration ht_seqlist.gif

  1. Enter a recognizable label for this participant in the Label field. This label must be unique within this workflow (for example, Approval Manager, Primary Reviewers, and so on).

    Instructions for configuring the following subsections of the Add Participant Type - Sequential List of Approvers window are listed in Table 15-6.

    Table 15-6 Add Participant Type — Sequential List of Approvers

    For This Subsection... See...
    Requires sequential approval of all participants below "Assigning Participants to the Sequential List of Approvers Task"
    Specify skip rule "Bypassing a Task Participant"
    Limit allocated duration to "Specifying a Time Limit for Acting on a Task"
    Allow this participant to invite other participants "Inviting Additional Participants to a Task"

15.6.5.5.1 Assigning Participants to the Sequential List of Approvers Task
  1. Select a method for assigning a user or group to participate in this task.

    • By name

      Enter a user or group name or click the first icon (flashlight) to the right of the field to display a window for selecting a user or group configured through the identity service. The identity service enables user authorization and the lookup of user properties, roles, group memberships, and privileges. User information is obtained from Java AuthoriZatioN (JAZN) or an LDAP server such as Oracle Internet Directory. You can use wild cards (*) to search for IDs.

    • By expression

      Dynamically assign this task to a user (for example, jcooper) or group (for example, administrators) by clicking the icon to the right of the field to display the Expression Builder window. Users who are members of a group are assigned this task. For a user to act on a task assigned to a group, they must first claim the task in the Oracle BPEL Worklist Application during run time.

      See Also:

      "Assigning Participants to the Single Approver Task" for rules to follow when specifying assignees with XPath expressions
15.6.5.5.2 Bypassing a Task Participant
  1. Select the Specify skip rule check box if you want the user or group to be bypassed if a specific condition is satisfied. This action displays an icon for accessing the Expression Builder window for building a condition. For example, if a user submits a business trip expense report that is below a specific amount, no approval is required by their manager. The expression must evaluate to a Boolean value.

    See Also:

    "Bypassing a Task Participant" for an example of a valid XPath expression for skipping a participant
15.6.5.5.3 Specifying a Time Limit for Acting on a Task
  1. Click the + sign to expand the Advanced section shown in Figure 15-16.

  2. Click Limit allocated duration to.

  3. Specify the amount of time a user or group receives to act on a task. If the user or group does not act in the time specified, the global escalation and renewal policies that you set in the Expiration and Escalation Policy section (known as the routing slip level) of the Human Task editor are applied. For example, if the global policy is set to escalate the task and this participant does not act in the duration provided, the task is escalated to the manager or another user, as appropriate.

    See Also:

    "Escalating, Renewing, or Ending the Task" for instructions on setting the global escalation and renewal policies in the Expiration and Escalation Policy section of the Human Task editor
15.6.5.5.4 Inviting Additional Participants to a Task
  1. Click the + sign to expand the Advanced section (if not already expanded).

  2. Select Allow this participant to invite other participants if you want this task assignee to invite other participants into the workflow before routing it to the next assignee in this workflow. For example, assume the approval workflow goes from James Cooper to John Steinbeck. If this option is checked, James Cooper can decide to first route it to Irving Stone before it goes to John Steinbeck.

    Note:

    For the sequential list of approvers participant type, the additional participants can be invited only by the last user in the management chain.

15.6.5.6 Configuring the FYI Assignee Participant Type

Figure 15-17 displays the FYI Assignee window.

This participant type is used when a task is sent to a user, but the business process does not wait for a user response; it just continues. FYI assignees cannot directly impact the outcome of a task, but in some cases can provide comments or add attachments.

For example, a magazine subscription is due for renewal. If the user does not cancel the current subscription before the expiration date, the subscription is renewed. This user is reminded weekly until the request expires or the user acts on it.

Figure 15-17 Add Participant Type — FYI Assignee

Description of ht_fyi.gif follows
Description of the illustration ht_fyi.gif

  1. Enter a recognizable label for this participant in the Label field. This label must be unique within this workflow (for example, Approval Manager, Primary Reviewers, and so on).

    Instructions for configuring the following subsections of the Add Participant Type - FYI Assignee window are listed in Table 15-7:

    Table 15-7 Add Participant Type - FYI Assignee

    For This Subsection... See...
    Send an FYI copy of this task to all participants below "Assigning Participants to the FYI Assignee Task"
    Share attachments and comments "Sharing Attachments and Comments with Task Participants"

15.6.5.6.1 Assigning Participants to the FYI Assignee Task
  1. Select a method for assigning a user or group to participate in this task.

    • By name

      Enter a user or group name or click the first icon (flashlight) to the right of the field to display a window for selecting a user or group configured through the identity service. The identity service enables user authorization and the lookup of user properties, roles, group memberships, and privileges. User information is obtained from Java AuthoriZatioN (JAZN) or an LDAP server such as Oracle Internet Directory. You can use wild cards (*) to search for IDs.

    • By expression

      Dynamically assign this task to a user (for example, jcooper) or group (for example, administrators) by clicking the icon to the right of the field to display the Expression Builder window. Users who are members of a group are assigned this task. For a user to act on a task assigned to a group, they must first claim the task in the Oracle BPEL Worklist Application during run time.

      See Also:

      "Assigning Participants to the Single Approver Task" for rules to follow when specifying assignees with XPath expressions
15.6.5.6.2 Sharing Attachments and Comments with Task Participants
  1. Select the Share attachments and comments check box if you want all group voters or workflow participants to share comments and attachments for this task. This information typically displays in the footer region of the Oracle BPEL Worklist Application.

15.6.5.7 Configuring the External Routing Service Participant Type

Figure 15-18 displays the External Routing Service window.

This participant type enables you to configure an external routing service that dynamically determines the participants in the workflow. If this participant type is specified, all other participant types are ignored. It is assumed that the external routing service provides a list of participant types (single approver, list of approvers, group vote, and so on) at run time to determine the routing of the task.

Figure 15-18 Add Participant Type — External Routing Service

Description of ht_ers.gif follows
Description of the illustration ht_ers.gif

  1. Enter a recognizable label for this participant in the Label field. This label must be unique within this workflow (for example, Approval Manager, Primary Reviewers, and so on).

15.6.5.7.1 Specifying a Class Name
  1. Enter the fully qualified class file name or click the flashlight icon to select the name (for example, the org.mycompany.tasks.RoutingService class name). This class must implement the oracle.bpel.services.workflow.task.IAssignmentService interface.

  2. Click the + sign to add name and pair value parameters that can be passed to the external service.

    See Also:

    "Dynamically Assigning Task Participants with the Assignment Service" for details about using this interface

15.6.5.8 Allowing All Participants to Invite Other Participants

After you configure a participant type and are returned to the Human Task editor, the Allow all participants to invite other participants check box is enabled, as shown in Figure 15-19.

Figure 15-19 Human Task Editor — Assignment and Routing Policy Section

Description of ht_arp.gif follows
Description of the illustration ht_arp.gif

This check box is the equivalent of the Adhoc workflow pattern of previous BPEL releases. This applies when there is at least one participant. In this case, each user selects users or groups as the next assignee when approving the task.

  1. If you want this task assignee to invite other participants into the workflow before routing it to the next assignee in this workflow, select the Allow all participants to invite other participants check box.

15.6.5.9 Abruptly Completing a Condition

After you configure a participant type and are returned to the Human Task editor, the Enable abrupt completion condition check box is enabled, as shown in Figure 15-19.

  1. If you want to specify conditions under which to complete the task early, regardless of the other participants in the workflow, select the Enable abrupt completion condition check box.

    The Abrupt Completion Details window appears.

    For example, assume an expense report goes to the manager, and then the director. If the first participant (manager) rejects it, you can end the workflow without sending it to the next participant (director).

    There are two methods for specifying the abrupt completion of a task:

    • Outcomes

    • XPath expression routing condition

    If outcomes are specified, any time the selected task outcome occurs, the task completes. If both outcome and routing condition are specified, the workflow service performs a logical OR on the two.

  2. Select appropriate outcomes and click the > button. To select all, click the >> button.

    Description of ht_abrupt.gif follows
    Description of the illustration ht_abrupt.gif

  3. Click the icon to the right of the Routing Condition field to display the Expression Builder window for dynamically creating a condition under which to complete this task early. For example, if a user submits a business trip expense report that is below a specific amount, no approval is required by their manager.

  4. Click OK to return to the Human Task editor.

    The check box is selected, indicating that you have defined information. You can click the icon to the right of the Enable abrupt completion condition check box to edit this information.

15.6.6 Escalating, Renewing, or Ending the Task

Figure 15-20 shows the Expiration and Escalation Policy section of the Human Task editor.

You can specify expiration duration of a task in this global policy section (also known as the routing slip level). If expiration duration is specified at the routing slip level instead of at the participant type level, then this duration is the expiration duration of the task across all the participants. However, if you specify expiration duration at the participant type level (through the Limit allocated duration to field), then those settings take precedence over settings specified in the Expiration and Escalation Policy section (routing slip level).

Figure 15-20 Human Task Editor — Expiration and Escalation Policy Section

Description of ht_exp.gif follows
Description of the illustration ht_exp.gif

15.6.6.1 Overview or Escalation and Expiration Policy

This section provides an overview of how specifying the expiration duration at this level makes this setting the expiration duration of the task across all the participants.

For example, participant LoanAgentGroup and participant Supervisor have 3 days to act on the task between them, as shown in Figure 15-21:

Figure 15-21 Expire After Policy

Description of ht_esc.gif follows
Description of the illustration ht_esc.gif

If there is no expiration specified at either the participant level or this routing slip level, then that task has no expiration duration.

If expiration duration is specified at any of the participant's level, then for that participant the participant expiration duration is used. However, the global expiration duration is still used for the participants that do not have participant level expiration duration. The global expiration duration is always decremented by the time elapsed in the task.

The policy to interpret the participant level expiration for the participants is described below:

  • Management Chain — Each participant in the management chain gets the same expiration duration. The duration is not for all the assignments resulting from this assignment. If the task expires at any of the assignments in the management chain, the task expires and the escalation and renewal policy is applied.

  • Sequential list of approvers — Each assignment in the management chain gets the same expiration duration as the one specified in the sequential list of approvers. Note that the duration is not for all the assignments resulting from this assignment. If the task expires at any of the assignments in the management chain, the task expires and the escalation and renewal policy is applied.

  • Group vote

    • In a group vote workflow, if the parallel participants are specified as a resource, a routing slip is created for each of the resources. The expiration duration of each created routing slip follows these rules:

      • The expiration duration is the same as the expiration duration of the parallel participant if it has an expiration duration specified.

      • The expiration duration that is left on the task if it was specified at the routing slip level.

      • No expiration duration, otherwise.

    • If parallel participants are specified as routing slips, then the expiration duration for the parallel participants are determined by the routing slip.

Note:

When the parent task expires in a parallel task, the subtasks are withdrawn if those tasks have not expired or completed.

In the following routing slip sample, participant Loan Agent Group has an expiration duration of 1 day and participant Loan Agent Supervisor does not have any expiration duration on the task, even though an expiration duration is specified at the routing slip level. In this example, the routing slip is treated just as if there were no expiration duration specified at the routing slip level.

<routingSlip xmlns="http://xmlns.oracle.com/pcbpel/workflow/routingslip">
  <expirationDuration>PT10D </expirationDuration>

  <participants>

    <participant name="Loan Agent 1" expirationDuration="PT2D">
      <resource isGroup="true" type="STATIC">jcooper</resource>
    </participant>
    <participant name="Loan Agent 2">
      <resource isGroup="true" type="STATIC">jstein</resource>
    </participant>

    <managementChain name="Loan Approval Chain" 

                     expirationDuration="PT2D">
      <resource isGroup="true" type="STATIC">wfaulk</resource>
      <levels type="STATIC">1</levels>
      <title type="STATIC">Vice President</title>
    </managementChain>

    <participant name="Reviewer">
      <resource isGroup="true" type="STATIC">sfitzger</resource>
    </participant>
  </participants>

</routingSlip>

Table 15-8 demonstrates the expiration policy. Note that the management chain in the above example evaluates to two users — wfaulk and cdickens (manager of wfaulk).

Table 15-8 Expiration Policy

Participant Expiration Actual Time Taken to Approve
Loan Agent 1jcooper 2 days (participant level) One day
Loan Agent 2jstein 9 days (10 – 1 days) (global level) One day
Loan Approval Chainwfaulk (first user in chain) 2 days (participant level) One day
Loan Approval Chaincdickens (second user in chain) 2 days (participant level) One day
Reviewer - sfitzger 6 days (10 – 4 days) (global level)

  1. Select an escalation and expiration policy. You can enter a fixed time or a dynamic time by clicking the icon to the right of the By Expression field to display the Expression Builder window.

15.6.6.2 Never Expire Policy

  1. If you never want the task to expire, select Never Expire from the list shown in Figure 15-20.

15.6.6.3 Expire After Policy

  1. If you want the task to expire, select Expire after from the list shown in Figure 15-20.

  2. Specify the maximum time period for the task to remain open.

    When the task expires, either the escalation policy or the renewal policy at the routing slip level is applied. If neither is specified, the task expires. The expiration policy at the routing slip level is common to all the participants.

    The expiration policy for parallel participants is interpreted as follows.

    • If parallel participants are specified as resources in parallel elements, there is no expiration policy for each of those participants.

    • If parallel participants are specified as routing slips, then the expiration policy for the routing slip applies to the parallel participants.

    Figure 15-22 indicates that the task expires in 3 days.

    Figure 15-22 Expire After Policy

    Description of ht_esc.gif follows
    Description of the illustration ht_esc.gif

15.6.6.4 Renew After Policy

  1. If you want to extend the expiration period when the user does not respond within the allotted time, select Renew after from the list shown in Figure 15-20.

  2. Specify the maximum number of times to continue renewing this task.

    The renewal policy specifies the number of times the task can be renewed on expiration and the renewal duration. In Figure 15-23, when the task expires, it is renewed at most 3 times. It does not matter if the task expired at the LoanAgentGroup participant or the Supervisor participant.

    Figure 15-23 Renew After Policy

    Description of ht_esc2.gif follows
    Description of the illustration ht_esc2.gif

15.6.6.5 Escalate After Policy

  1. If you want to escalate the task (for example, to the user's manager) if the user does not respond within the allotted time, select Escalate after from the list shown in Figure 15-20.

  2. Specify the following additional values:

    • Maximum Escalation Levels

      Number of management levels to which to escalate the task

    • Highest Approver Title

      The title of the highest approver (for example, self, manager, director, or CEO).

    The escalation policy specifies the number of times the task can be escalated on expiration and the renewal duration. In Figure 15-24, when the task expires, it is escalated at most 3 times. It does not matter if the task expired at the LoanAgentGroup participant or the Supervisor participant.

    Figure 15-24 Escalate After Policy

    Description of ht_esc3.gif follows
    Description of the illustration ht_esc3.gif

15.6.7 Specifying Participant Notification Preferences

Figure 15-25 shows the Notification Settings section of the Human Task editor (when fully expanded).

Notifications indicate when a user is assigned a task or informed that the status of the task has changed. Notifications can be sent through e-mail, voice message, fax, pager, or SMS. Notifications are sent to different types of participants for different actions. Notifications are configured by default with default messages. For example, a notification message is sent to indicate that a task has completed and closed. You can create your own or modify existing configurations.

Figure 15-25 Human Task Editor — Notification Settings Section

Description of ht_notif.gif follows
Description of the illustration ht_notif.gif

  1. Click the + sign to expand the Notification Settings section (displays as shown in Figure 15-25).

    Instructions for configuring the following subsections of the Notification Settings section are listed in Table 15-9.

    Table 15-9 Human Task Editor — Notification Settings Section

    For This Subsection... See...
    Task Status

    Recipient

    "Notifying Recipients of Changes to Task Status"
    Notification Header "Editing the Notification Message"
    Reminders "Setting Up Reminders"
    Make notifications secure (exclude details)

    Make e-mail messages actionable

    Send task attachments with email notifications

    "Securing Notifications, Making Messages Actionable, and Sending Attachments"

15.6.7.1 Notifying Recipients of Changes to Task Status

Three default status types display in the Task Status column: Assign, Complete, and Error. You can select other status types for which to receive notification messages.

  1. Click a type in the Task Status column to display the complete list of task types:

    • Assign—when the task is assigned to users or a group. This action captures the following actions:

      • Task is assigned to a user

      • Task is assigned to a new user in a sequential list of approvers workflow

      • Task is renewed

      • Task is delegated

      • Task is reassigned

      • Task is escalated

      • Information for a task is submitted

    • Complete

    • Error

    • Expire

    • Request Info

    • Update Outcome

    • Suspend

    • Withdraw

  2. Select a task status type.

    Notifications can be sent to users involved in the task in various capacities. This includes when the task is assigned to a group, each user in the group is sent a notification if there is no notification endpoint available for the group.

  3. Click an entry in the Recipient column to display a list of possible recipients for the notification message.

    • Assignees—the users or groups to whom the task is currently assigned

    • Initiator—the user who created the task

    • Approvers—the users who have approved the task so far. This applies in a sequential list of approvers participant type where multiple users have approved the task and a notification must be sent to all of them.

    • Owner—the task owner

15.6.7.2 Editing the Notification Message

A default notification message is available for delivery to the selected recipient. If you want, you can modify the default message text.

  1. Click the icon in the Notification Header column to modify the default notification message.

    The Edit Notification Message window appears.

    Description of ht_notifmess.gif follows
    Description of the illustration ht_notifmess.gif

    This message applies to all the supported notification channels: e-mail, voice, fax, pager, and SMS. E-mail and fax messages can also include the worklist task detail defined in this message. The channel by which the message is delivered is based upon the notification preferences you specify.

  2. Modify the message wording as necessary.

  3. Click OK to return to the Human Task editor.

See Also:

"Notifications from Workflow Services" for notification preference details

15.6.7.3 Setting Up Reminders

You can send task reminders, which can be based on the time the task was assigned to a user or the expiration time of a task. The number of reminders and the interval between the reminders can also be configured.

  1. Select the number of reminders to send from the Remind list.

  2. If you selected to remind the assignee one, two, or three times, select the interval between reminders, and whether to send the reminder before or after the assignment.

    Description of ht_remind.gif follows
    Description of the illustration ht_remind.gif

15.6.7.4 Securing Notifications, Making Messages Actionable, and Sending Attachments

You can perform additional notification tasks in this section.

  1. Select the corresponding check box for functionality you want to use.

  2. Field Value
    Make notifications secure (exclude details) Select to make the notification message secure. If selected, a default notification message is used. There are no HTML worklist task details, attachments, or actionable links in the e-mail. Only the task number is in the message.

    See Also: "Sending Secure Notifications"

    Make e-mail messages actionable Select to make e-mail notifications actionable. This enables you to perform task actions through e-mail.

    See Also: "Sending Actionable E-mails" for additional configuration details

    Send task attachments with e-mail notifications Select to send task attachments with the notification message.

    See Also: "Sending Inbound and Outbound Attachments"


15.6.8 Specifying Advanced Settings

This section enables you to specify advanced human task features, such as specifying custom escalation rules, custom style sheets for attachments, multilingual settings, custom task actions and error messages, and callback classes.

Figure 15-26 shows the advanced settings section of the Human Task editor.

Figure 15-26 Human Task Editor — Advanced Settings Section

Description of ht_adv.gif follows
Description of the illustration ht_adv.gif

Table 15-10 describes the sections available.

Table 15-10 Advanced Settings Sections

Section See...
Specify escalation rule "Specifying Escalation Rules"
Specify WordML Stylesheet for attachments "Specifying WordML Style Sheets for Attachments"
Specify stylesheet for attachments "Specifying Style Sheets for Attachments"
Specify multilingual settings "Specifying Multilingual Settings"
Override default system actions "Overriding Default System Actions"
Override default exception management "Overriding Default Exception Management"
Specify callback class on task status "Specifying Callback Classes on Task Status"
Allow task and routing customization in BPEL callbacks "Allowing Task and Routing Customization in BPEL Callbacks"

15.6.8.1 Specifying Escalation Rules

This option allows a custom escalation rule to be plugged in for a particular workflow. For example, to assign the task to a current user's department manager on task expiration, you can write a custom task escalation function, register it with the workflow service, and use that function in task definitions.

The default escalation rule is to assign a task to the manager of the current user. To add a new escalation rule, follow the steps below.

  1. Implement interface oracle.bpel.services.workflow.assignment.dynamic.IDynamicTaskEscalationFunction. This implementation has to be available in the classpath for the server.

  2. Change the file SOA_Oracle_Home\bpel\system\services\config\wf-dynamic-assign-cfg.xml to add a new function:

    <dynamicAssignmentFunctions>
    
      <function name="MANAGERS_MANAGER"
     classpath="oracle.bpel.services.workflow.assignment.dynamic.patterns.
     TaskEscalationManagersManager">
      </function>
    
    </dynamicAssignmentFunctions>
    
    
  3. Enter the function name as defined in the wf-dynamic-assign-cfg.xml file for the escalation rule in the Specify Escalation Rule field.

15.6.8.2 Specifying WordML Style Sheets for Attachments

This option allows dynamic creation of Microsoft Word documents for the purpose of sending them as e-mail attachments using a WordML XSLT stylesheet. The XSLT stylesheet is applied on the task document.

  1. Click the flashlight icon to select a WordML style sheet as an attachment.

15.6.8.3 Specifying Style Sheets for Attachments

This option allows creation of e-mail attachments using an XSLT stylesheet. The XSLT stylesheet is applied on the task document.

  1. Click the flashlight icon to select a stylesheet as an attachment.

15.6.8.4 Specifying Multilingual Settings

You can specify resource bundles for displaying task details in different languages in the Oracle BPEL Worklist Application. Resource bundles are supported for the following task details.

  • Displaying the value for task outcomes in plain text or with the message(key) format

  • Displaying the XML element and attributes names in the payload display of the Oracle BPEL Worklist Application. The key name in the resource bundle must be the same as the name of the XML element and attributes for internationalization of XML element names in the Oracle BPEL Worklist Application.

  • Making e-mail notification messages available in different languages. At run time, specify the XPath extension function hwf:getTaskResourceBundleString(taskId, key, locale?) to obtain the internationalized string from the specified resource bundle. The locale of the notification recipient can be retrieved with the function hwf:getNotificationProperty(propertyName).

  1. Click Configure Resource.

    The Resource Details window appears.

    Description of ht_resource.gif follows
    Description of the illustration ht_resource.gif

  2. Enter the name of the resource used in the resource bundle.

  3. Click the flashlight icon to select the JAR or ZIP resource bundle file to use. The resource bundle can be part of your BPEL suitcase.

  4. Click OK to return to the Human Task editor.

15.6.8.5 Overriding Default System Actions

The actions performed from the Oracle BPEL Worklist Application are common to all business processes. However, you can restrict some actions in a particular business process.

For example, assume that in a loan approval process, the business requirement is to never suspend a loan application. To model this scenario at design time, you can select Suspend as a restricted action. When an action is selected as restricted, the Oracle BPEL Worklist Application does not display the action for this task.

By default, these actions are available on all tasks based on the user's privileges. The task owner or bpeladmin administrator can always perform any of these actions on processes they own.

  1. Click Configure Actions.

  2. Select the system actions allowed on a task. By default, all are selected and available (unrestricted).

    Description of ht_sysact.gif follows
    Description of the illustration ht_sysact.gif

    The following system actions can be restricted by unselecting them:

    • Suspend — Enables task owners (or users with the BPMWorkflowSuspend privilege) to put a workflow temporarily on hold. Task expiration and escalation do not apply until the workflow is resumed. No actions are permitted on a suspended task (except resume and withdraw).

    • Push back — Sends the task one level back in the workflow. For example, assume the task was routed to the LoanAgentGroup and then to jstein. If jstein now pushes the task back, it goes back to the LoanAgentGroup.

    • Renew — If a task is about to expire, a task assignee can renew the task and request more time to perform the task. This operation is not allowed if the process designer has restricted task renewal on the workflow.

    • Skip current assignment — Skips the current assignment and moves to the next assignment or picks the outcome as set by the previous approver if there are no more assignees.

    • Adhoc Route — Enables a user to enter an outcome and then route the task in an adhoc fashion to the next user who must review the task.

    • Request Information — Any workflow participant can request information from the task initiator or any of the prior approvers of the task. When the requested information is submitted, the task is assigned to the user who requested the information.

    • Delegate — Any workflow participant can delegate the task to another user. In this case, the other user is acting on behalf of the current assignee. When the task is delegated, it resides on both users' worklists until the original assignee or the delegated person acts on it.

    • Reassign — Enables the current assignee of the task to transfer it to another user or group. In this case, the task is moved from the worklist of the current assignee to the new assignee.

    • Escalate — Escalates a task to their manager for further action.

    • Withdraw — Enables the task initiator to withdraw any pending task if they no longer want to send it through the workflow. A task owner can also withdraw a task on behalf of the initiator. When a task is withdrawn, the business process is called back with the state attribute of the task set to Withdrawn.

  3. Click OK to return to the Human Task editor.

15.6.8.6 Overriding Default Exception Management

Tasks can error due to incorrect assignments. Incorrect assignments can occur for any of the following reasons:

  • Invalid assignees — The task assignee user or group is not a valid user in the system.

  • Invalid dynamic assignment — When assignees are specified to be dynamic, the dynamic XPath expression is not evaluated.

In the above cases, the task is marked as errored. By default, the life cycle of the task is completed with that action.During modeling of workflow tasks, you can specify error assignees for the workflow. If error assignees are specified, they are evaluated and the task is assigned to them. The error assignee can perform one of the following actions:

  • Adhoc route — route the task to the actual users assigned to the task. Adhoc route allows the task to be routed to users in sequence, parallel, and so on.

  • Reassign — reassign the task to the actual users assigned to this task

  • Error task — indicate that this task cannot be rectified.

If there are any errors in evaluating the error assignees, the task is marked as errored.

This window enables you to specify the users or groups to whom the task is assigned if an error in assignment has occurred.

  1. Click Configure Assignment.

  2. Select the error assignees.

    Description of ht_erroras.gif follows
    Description of the illustration ht_erroras.gif

15.6.8.7 Specifying Callback Classes on Task Status

You can register callbacks for the workflow service to call during the life cycle of a task. The callback class has to implement the interface oracle.bpel.services.workflow.task.IRoutingSlipCallback. Make the callback class available in the classpath of the server.

  1. Click Configure Callbacks.

  2. Click the + sign to add a callback to the table. A callback named OnAssigned is automatically added to the Callback column.

    Description of ht_callback.gif follows
    Description of the illustration ht_callback.gif

  3. Click OnAssigned to display a list of additional callback values to select for this column.

    The following callbacks are available:

    • onCompleted — This callback is invoked when the task is completed, expired, withdrawn, or errored.

    • onAssigned — This callback is invoked when the task is assigned to a new set of assignees due to the following actions:

      • outcome update

      • skip current assignment

      • override routing slip

    • onUpdated — This callback is invoked for any other update to the task that does not fall in the onTaskComplete or onTaskAssigned callback. This includes updates on a task due to request for information, submit information, escalation, reassign, and so on.

    • onSubtaskUpdated — This callback is invoked for any update to a subtask.

  4. Click Java in the Type column to display a list of additional values for this column.

  5. Click the empty field in the Value column to enter a value. The value is the complete class name of the Java class that implements oracle.bpel.services.workflow.task.IRoutingSlipCallback.

  6. Click OK.

15.6.8.8 Allowing Task and Routing Customization in BPEL Callbacks

The Allow task and routing customization in BPEL callbacks check box must be selected if you select the check box of the same name on the Human Task - Advanced tab shown in Figure 15-28. Selecting both check boxes updates the metadata for callbacks.

See Also:

"Allowing Task and Routing Customizations in BPEL Callbacks" for details on using callbacks

15.6.9 Exiting the Human Task Editor and Saving Your Changes

You can save your human task changes at any time. The task can be re-edited at a later time by clicking the metadata task configuration .task file in the Application Navigator.

  1. Select Save from the File main menu or click the X sign to close the .task metadata task configuration file. Description of ht_exit.gif follows
    Description of the illustration ht_exit.gif

  2. If you click the X sign, select Yes when prompted to save your changes.

15.7 Task 2: Associating the Human Task with a BPEL Process

You must associate the .task file that consists of the human task settings with a BPEL process. When association is complete, a Task Service partner link is created. The Task Service exposes the operations required to act on a task.

The method by which you created the human task indicates if the task is already associated with a BPEL process. Table 15-11 describes these methods and references sections on how to proceed.

Note:

Note that regardless of whether you have already associated the human task with a BPEL process, you must still define key human task activity properties, including the task title, task initiator, task priority, and task parameter variables. These tasks are described in "Defining the Human Task Activity Title, Initiator, Priority, and Parameter Variables" and "Defining the Human Task Activity Advanced Features".

Table 15-11 Human Task Association with the BPEL Process

Human Task Creation Method Then... See...
  1. Right-clicked the BPEL process in the Application Navigator.
  2. Selected Create Human Task Definition.

You must associate the human task with your BPEL process. "Associating a Human Worklist Task with a BPEL Process"
  1. Dragged and dropped a human task activity into the BPEL process.
  2. Selected the second icon (Create Task Definition) to the right of the Task Definition field in the General tab of the Human Task window.

The human task is already associated with the BPEL process "Opening a Human Task Activity Already Associated with a BPEL Process"

See Also:

"Task 1: Creating the Human Task Definition with the Human Task Editor" for instructions on creating a human task

15.7.1 Associating a Human Worklist Task with a BPEL Process

  1. Select the BPEL process with which to associate the .task file of the human task in the Application Navigator.

  2. Select Process Activities from the Component Palette.

  3. Drag and drop a new Human Task activity into your BPEL process.

    The Add a Human Task window appears.

    Note:

    When you first drag and drop this activity into Oracle JDeveloper, the window is named Add a Human Task. After you finish specifying details on this window and click OK, the name of this window changes to simply Human Task.
  4. Click the first icon to the right of the Task Definition field.

    Description of ht_browse.gif follows
    Description of the illustration ht_browse.gif

    The Choose Task Definition File appears.

  5. Select the .task file and click Open. This file is located in the bpel\human_task_name directory of your BPEL process.

    The .task file is added to the Task Definition field.

  6. See the following sections to configure the human task activity:

15.7.2 Opening a Human Task Activity Already Associated with a BPEL Process

  1. Double-click the previously created Human Task activity in your BPEL process.

    The Human Task window appears.

  2. Click the third icon to the right of the Task Definition field to open the human worklist task you previously created.

    Description of ht_taskdef.gif follows
    Description of the illustration ht_taskdef.gif

  3. See the following sections to configure the human task activity:

15.7.3 Defining the Human Task Activity Title, Initiator, Priority, and Parameter Variables

Figure 15-27 shows the General tab.

Figure 15-27 Human Task — General Tab

Description of ht_blank.gif follows
Description of the illustration ht_blank.gif

The General tab of the Human Task activity enables you to perform the tasks shown in Table 15-12:

Table 15-12 Human Task - General Tab

For this Field... See...
Task Title "Specifying the Task Title"
Initiator

Priority

"Specifying the Task Initiator and Task Priority"
Task Parameters "Specifying Task Parameters"

15.7.3.1 Specifying the Task Title

  1. Enter the task title in the Task Title field through one of the following methods. This is a mandatory field. Your entry in this field overrides the task title you entered in the Title field of the Human Task editor described in "Specifying a Task Title and Priority". The title displays the task in the Oracle BPEL Worklist Application during run time.

    • Enter the title manually.

    • Click the icon to the right of the field to display the Expression Builder window to dynamically create the title.

    You can also mix static text and dynamic expressions in the same title. To include dynamic text, place your cursor at the appropriate point in the text and click the icon on the right to invoke the Expression Builder window.

See Also:

"Assigning Input and Output Parameters for the Human Task" for an example of specifying the task title name

15.7.3.2 Specifying the Task Initiator and Task Priority

  1. Enter the initiator (for example, jcooper) or click the icon to the right of the Initiator field to display the Expression Builder window for dynamically specifying an initiator. This field is optional.

    The initiator is the user who initiates a task. The initiator can view their created tasks from the Oracle BPEL Worklist Application and perform specific tasks defined in the System Action Details window, such as withdrawing or suspending a task. If not specified, the initiator defaults to the task owner specified on the Advanced tab of the Human Task window. The initiator defaults to bpeladmin if a task owner is also not specified.

  2. 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 run time. The priority can be used to sort tasks in the Oracle BPEL Worklist Application. This priority value overrides the priority value you select in the Priority list of the Human Task editor.

See Also:

"Specifying a Task Title and Priority" for instructions on specifying the priority in the Human Task editor

15.7.3.3 Specifying Task Parameters

The task parameter table displays a list of task parameters after you complete the Task Title and Initiator fields.

Description of ht_general.gif follows
Description of the illustration ht_general.gif

  1. Click the flashlight 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, you do not need to map the corresponding variables.

    The Task Parameters window appears.

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

    Description of ht_taskparam.gif follows
    Description of the illustration ht_taskparam.gif

  3. Click OK.

    The Human Task window appears as follows.

    Description of ht_humantask.gif follows
    Description of the illustration ht_humantask.gif

  4. Click Apply.

  5. If you want to define advanced features for the human task activity, click the Advanced tab and go to section "Defining the Human Task Activity Advanced Features". Otherwise, click OK to close the Human Task window.

15.7.4 Defining the Human Task Activity Advanced Features

Figure 15-28 shows the Advanced tab.

Figure 15-28 Human Task — Advanced Tab

Description of ht_advanced.gif follows
Description of the illustration ht_advanced.gif

The Advanced tab of the Human Task activity enables you to perform the tasks shown in Table 15-13:

Table 15-13 Human Task - Advanced Tab

For this Field... See...
Scope Name

Global Task Variable Name

"Specifying a Scope Name and a Global Task Variable Name"
Owner "Specifying a Task Owner"
Identification Key "Specifying an Identification Key"
Include task history from "Including the Task History of Other Human Tasks"
Allow task and routing customization in BPEL callbacks "Allowing Task and Routing Customizations in BPEL Callbacks"

15.7.4.1 Specifying a Scope Name and a Global Task Variable Name

You are automatically provided with default scope and global task variable names during human task activity creation. However, you can specify custom names that are used to name the scope and global variable during human task activity creation.

  1. Enter the name for the BPEL scope to be generated in the Scope Name field.

    This BPEL scope encapsulates the entire interaction with the workflow service and BPEL variable manipulation.

  2. Enter the global task variable name in the Global Task Variable Name field.

    This is the name of the BPEL task variable used for the workflow interaction.

15.7.4.2 Specifying a Task Owner

  1. Enter the task owner name in the Owner field or click the icon to the right to use the Expression Builder to dynamically specify the owner of this task.

    The task owner can view tasks belonging to business processes they own and perform operations on behalf of any of the task assignees. Additionally, the owner can also reassign, withdraw, or escalate tasks.

    If you do not specify a task initiator on the General tab of the Human Task window, it defaults to the owner specified here. If an owner is not specified, it defaults to the bpeladmin administrator.

15.7.4.3 Specifying an Identification Key

  1. Enter an optional identification key value in the Identification Key field.

    The identification key can be used as a user-defined ID for the task. For example, if the task is meant for approving a purchase order, the purchase order ID can be set as the identification key of the task. Tasks can be searched from the Oracle BPEL Worklist Application using the identification key. This attribute has no default value.

15.7.4.4 Including the Task History of Other Human Tasks

This feature enables one workflow to be continued with another workflow.

  1. Select the Include task history from check box to extend a previous workflow task in the BPEL process. Selecting this check box includes the task history, comments, and attachments from the previous task. This provides you with a complete end-to-end audit trail.

    When a workflow task is continued with another workflow, the following information is carried over to the new workflow:

    • Task payload and the changes made to the payload in the previous workflow

    • Task history

    • Comments added to the task in the previous workflow

    • Attachments added to the task in the previous workflow

    In the Include task history from list, all existing workflows are listed. Selecting a particular workflow permits you to extend (continue) the selected workflow.

    For example, a hiring process is used to hire new employees. Each interviewer votes to hire or not hire a candidate. If 75% of the votes are to hire, then the candidate is hired; otherwise, the candidate is rejected. If the candidate is to be hired, an entry in the HR database is created and the human resources contact completes the hiring process. The HR contact also needs to see the interviewers and the comments they made about the candidate. This process can be modeled using a group vote for the hiring. If the candidate is hired, a database adapter is used to create the entry in the HR database. After this, a simple workflow can include the task history from the group vote so that the hiring request, history, and interviewer comments are carried over. This simple workflow is assigned to the HR contact.

15.7.4.5 Allowing Task and Routing Customizations in BPEL Callbacks

  1. Select the Allow task and routing customizations in BPEL callbacks check box to notify the BPEL process using OnMessage callbacks every time a task is routed to a different user or when the task status changes. You must also select the check box of the same name in the Advanced Settings section of the Human Task editor shown in Figure 15-26 in order to update the metadata for callbacks.

    In these callbacks, you can call the Task Service to change the routing or update the current assignees. This option impacts the BPEL code generated to interact with the Task Service.

    If this option is not selected, the client process gets notified only when the task completes or when it expires or errors out.

  2. Click OK to close the Human Task window.

  3. Go to the Human Task editor for this human task (the .task file).

  4. Expand the Advanced Settings section at the bottom of the editor.

  5. Click Allow task and routing customization in BPEL callbacks.

    This check box must be selected to use callbacks. This enables you to update the metadata.

15.7.5 Viewing the Generated Human Task Activity

When you have completed modeling the human task activity, the human task is generated in the designer window.

Figure 15-29 shows how a workflow interaction is modeled in Oracle BPEL Process Manager. Figure 15-29 also illustrates the interaction when no BPEL callbacks are modeled. In this case, once a task is complete, the BPEL process is called back with the completed task. No intermediary events are propagated to the BPEL process instance. It is recommended that any user customizations be done in the first assign, AssignTaskAttributes, and that AssignSystemTaskAttributes not be changed.

Figure 15-29 Workflow Interaction Modeling

Description of bpmdg051.gif follows
Description of the illustration bpmdg051.gif

Figure 15-30 shows a workflow interaction in Oracle JDeveloper.

Figure 15-30 Workflow Interaction Modeling in Oracle JDeveloper

Description of vacationreq.gif follows
Description of the illustration vacationreq.gif

15.7.5.1 BPEL Callbacks

If intermediary events need to be propagated to the BPEL process instance, select the Allow task and routing customization in BPEL callbacks check box in both the Advanced tab of the Human Task window and the Advanced Settings section of the Human Task editor. When these options are selected, the workflow service invokes callbacks in the BPEL instance during each update of the task. The callbacks are listed in the TaskService.wsdl file and described below:

  • onTaskCompleted — This callback is invoked when the task is completed, expired, withdrawn, or errored.

  • onTaskAssigned — This callback is invoked when the task is assigned to a new set of assignees due to the following actions:

    • Outcome update

    • Skip current assignment

    • Override routing slip

  • onTaskUpdated — This callback is invoked for any other update to the task that does not fall in the onTaskComplete or onTaskAssigned callback. This includes updates on tasks due to request for information, submit information, escalation, reassign, and so on.

  • onSubTaskUpdated — This callback is invoked for any update to a subtask.

Figure 15-31 shows how a workflow interaction with callbacks is modeled in Oracle BPEL Process Manager. Once this task is initiated, a while loop is used to receive messages until the task is complete. The while loop contains a pick with four onMessage branches — one for each of the above-mentioned callback operations. The workflow interaction works fine even if nothing is changed in the onMessage branches, meaning that customizations in the onMessage branches are not required.

In this scenario, a workflow context is captured in the BPEL instance. This context can be used for all interaction with the workflow services. For example, if you want to reassign a task if it is assigned to a group, then you need the workflow context for the reassignTask operation on the Task Service.

It is recommended that any user customizations be done in the first assign, AssignTaskAttributes, and that AssignSystemTaskAttributes not be changed.

Figure 15-31 Workflow Interaction Modeling (with Callbacks)

Description of bpmdg052.gif follows
Description of the illustration bpmdg052.gif

Figure 15-32 shows a workflow interaction in Oracle JDeveloper.

Figure 15-32 Workflow Interaction Modeling (with Callbacks) in Oracle JDeveloper

Description of vacationreq2.gif follows
Description of the illustration vacationreq2.gif

15.7.5.2 Including the Task History from Other Workflows

When the task history is included in a workflow, the generated BPEL process described in the previous two sections is similar, with the following differences:

  • The BPEL variable from the workflow whose task history is to be included is reused and no new BPEL variable is created.

  • The first invoke activity invokes the reinitiate operation instead of the initiate operation.

15.7.6 Outcome-Based Modeling

In many cases, the outcome of a task determines the flow of the business process. To facilitate modeling of the business logic, when a user task is generated, a BPEL switch activity is also generated with prebuilt BPEL case activities. By default, one case branch is created for each outcome selected during creation of the task. An otherwise branch is also generated in the switch to represent cases when the task is withdrawn, expired, or errored.

15.7.6.1 Payload Updates

The task carries a payload in it. If the payload is set from a business process variable, then an assign activity with the name copyPayloadFromTask is created in each of the case and otherwise branches to copy the payload from the task back to its source. If the payload is expressed as other XPath expressions (such as ora:getNodes(...)), then this assign is not created because of the lack of a process variable to copy the payload back. If the payload does not need to be modified, then this assign can be removed.

15.7.6.2 Case Statements for Other Task Conclusions

By default, the switch activity contains case statements for the outcomes only. The other task conclusions are captured in the otherwise branch. These conclusions are as follows:

  • The task is withdrawn

  • The task is errored

  • The task is expired

If business logic must be added for each of these other conclusions, then case statements can be added for each of the preceding conditions. The case statements can be created as shown in the following BPEL segment. The XPath conditions for the other conclusions in the case activities for each of the preceding cases are shown in bold.

<switch name="taskSwitch">
  <case condition="bpws:getVariableData('SequentialWorkflowVar1',
'/task:task/task:state') = 'COMPLETED' and
bpws:getVariableData('SequentialWorkflowVar1', '/task:task/task:conclusion') = 'ACCEPT'">
    <bpelx:annotation>
      <bpelx:pattern>Task outcome is ACCEPT
      </bpelx:pattern>
    </bpelx:annotation>
      ...
  </case>
  <case condition=
"bpws:getVariableData('SequentialWorkflowVar1', '/task:task/task:state') = 'WITHDRAWN'">
    <bpelx:annotation>
      <bpelx:pattern>Task is withdrawn
      </bpelx:pattern>
    </bpelx:annotation>
     ...
  </case>
  <case condition=
"bpws:getVariableData('SequentialWorkflowVar1', '/task:task/task:state') = 'EXPIRED'">
    <bpelx:annotation>
      <bpelx:pattern>Task is expired
      </bpelx:pattern>
    </bpelx:annotation>
     ...
  </case>
  <case condition=
"bpws:getVariableData('SequentialWorkflowVar1', '/task:task/task:state') = 'ERRORED'">
    <bpelx:annotation>
      <bpelx:pattern>Task is errored
      </bpelx:pattern>
    </bpelx:annotation>
     ...
  </case>
  <otherwise>
    <bpelx:annotation>
      <bpelx:pattern>Task is EXPIRED, WITHDRAWN or ERRORED
      </bpelx:pattern>
    </bpelx:annotation>
      ...
  </otherwise>
</switch>

15.8 Task 3: Generating the Task Display Form

The task display form defines the display mechanism for the task payload in the Oracle BPEL Worklist Application. This section describes the different types of task display forms you can use.

This section contains the following topics:

15.8.1 Overview of Task Display Forms

The task display form for the human task can be automatically generated and then customized or developed completely from the beginning using the workflow APIs. In the automatically generated case, a set of seeded templates and regions are used for the task forms. There are two methods for generating forms associated with the task definition:

  • Automatically generate a simple task form — JSP-based forms that use the standard header, body, and footer template.

  • Custom task form — enables you to select one of the existing templates and regions to create a task form. You can also specify which task parameters to display in the form.

When task display forms are generated, a .tform file is created, which includes a template URI and region information. The .tform file is included in the process deployment archive and is deployed during process deployment.

See Also:

"Automatically Generating a Simple Task Display Form" for an example of a .tform file

15.8.2 Selecting a Task Display Form

Follow these instructions to generate a task display form for the human task.

  1. Go to the Application Navigator in Oracle JDeveloper.

  2. Right-click the folder of the human task for which to create a task display form (for this example, ExpenseApproval of the ExpenseRequest BPEL process in selected).

    The following menu of selections appears.

    Description of ht_jsp.gif follows
    Description of the illustration ht_jsp.gif

  3. See the following sections for details about generating the different types of task forms:

    Selection See...
    Auto Generate Simple Task Form "Automatically Generating a Simple Task Display Form"
    Custom Task Form "Generating a Custom Task Display Form"

15.8.2.1 Preview Release of Task Display Form Support for ADF Data Controls

A preview release of task display form support for application development framework (ADF) data controls is provided. Very minimal support is provided with this preview release. Note the following limitations:

  • There is no support for complex XSDs with recursive elements.

  • Task forms generated with ADF data controls cannot be edited.

Follow these procedures to use this preview release:

  1. Open an operating system command prompt.

  2. Open Oracle JDeveloper in preview mode:

    JDev_Oracle_Home\jdev\bin\jdev.exe -J"-Dpreview_mode=true"
    
    

    Note that Auto Generate Task Form With ADF Datacontrols now appears as a menu option when you right-click the folder of the human task, as shown in Step 2 of "Selecting a Task Display Form".

  3. Open the SOA_Oracle_Home\j2ee\OC4J_Home\config\server.xml file.

    where OC4J_Home is the name of the OC4J container for your install type:

    • home — for the Oracle Application Server SOA Basic install type

    • OC4J_SOA — if you accepted the default value for the Oracle Application Server SOA Advanced install types

  4. Add the following line under the <shared-library name="oracle.bpel.common" version="10.1.3"> section:

    <import-shared-library name="adf.oracle.domain"/> 
    
    
  5. Restart Oracle Application Server SOA Suite for the changes to take effect.

15.8.3 Automatically Generating a Simple Task Display Form

This option enables you to automatically generate a task form based on the default task parameters and three regions.

  1. Select Auto Generate Simple Task Form from the list shown in Step 2.

    The default layout is based on the following three region template:

    • Header region — this region has standard task attributes such as title, priority, created date, assignee, and expiration date. This information is contained in the Header1.jsp file.

    • Body region — this region is generated based on the task parameters. Depending on the XSD used in the task, it is either generated as a list of values or as a table (for repeating items). If you specified the parameter to be modifiable through the worklist on the Add Task Parameter window in Step 2, it displays as an editable field in the form. Otherwise, the field displays as read-only. The information for this region is contained in the payload-body.jsp file and the payload-body.xml mapping file. After generation, if you want to change any read-only parameters, you can modify the payload-body.xml file.

    • Footer region — this region has an area for comments, attachments, and a short history of the task routing. This information is contained in the Footer1.jsp file.

    A .tform file is generated. The contents of this file are as follows:

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

15.8.3.1 Payload File for the Autogenerated JSP

Two files are automatically generated to display the payload for the autogenerated JSP:

  • A default JSP file named payload-body.jsp. This file is added to the HTML root directory of your project, which is by default the public_html directory.

  • A mapping XML file named payload-body.xml. This file is added to the same directory of your project as payload-body.jsp.

    Note:

    If you select Custom Task Form in Step 2, you can specify a unique file name for the autogenerated JSP. The mapping XML file is created based on the JSP file name. You can also select the payload elements to include in the autogenerated JSP. For example, if the JSP file is named autogenerate-body.jsp, then the mapping XML file is named autogenerate-body.xml.

    See "Generating a Custom Task Display Form" for details.

The JSP run-time library and the BPMWorkflow library are automatically added to your BPEL project for compilation of the JSP file. The default JSP is designed with two goals in mind:

  • To present you with a simple form; that is, an XSD tree with a depth of more than three must be shown in a more readable way in the JSP.

  • The default JSP must require minimum modification. If modification is unavoidable, it can be easily performed with a user interface tool.

To attain these goals, instead of presenting a tree structure that mimics the payload XSD structure, the default JSP groups the entire payload structure in sections. It groups simple types that belong to the same parents and makes them sections.

For example, assume you provide the following payload XSD:

<schema xmlns="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://www.mycompany.com/mycompany"
        xmlns:mp="http://www.mycompany.com/mycompany">

  <element name="myCompany" type="mp:myCompanyType"/>

  <complexType name="myCompanyType" >
    <sequence>
      <element name="board" type="mp:boardType" />
      <element name="CEO" type="string"/>
      <element name="department" type="mp:departmentType" maxOccurs="unbounded"/>
    </sequence>
  </complexType>

  <complexType name="boardType">
    <sequence>
      <element name="size" type="int" />
      <element name="head" type="string" />
    </sequence>
  </complexType>

  <complexType name="departmentType">
    <sequence>
      <element name="size" type="int" />
      <element name="head" type="string" />
      <element name="function" type="string" />
    </sequence>
  </complexType>

</schema>


This XSD has the structure shown in Figure 15-33.

Figure 15-33 Structure of the XSD for myCompanyType

Description of wf43.gif follows
Description of the illustration wf43.gif

In the default JSP, based on the structure of the leaf nodes, there are three sections: {size, head}, {CEO}, and {size, head, function}. These three sections are named according to their parents' names; that is, the sections are named board, my Company, and department, respectively. In the board section, there are two fields, size and head. Each of these fields are in an editable HTML input type.The section department is different from other sections and can have multiple occurrences (maxOccurs > 1). In this case, all the fields in this section (that is, size, head, and function) are horizontally presented in a table, with each row representing one department. This is called a table section. There is a plus (+) button for adding a row (department) and a minus (-) button for subtracting a row (department) for the department table section.Unlike a regular section, it is not necessarily true that all the fields belong to the same XSD parent in a table section. For example, suppose the head element has two elements: employeeNumber and dateOfBirth. Since these two elements have maxOccurs set to less than or equal to 1, they are shown in the same department table section. This is a desired behavior, because adding a row in the department table not only adds a size and a function field, but also adds the head information fields in the same department row. This makes it easy to move through complicated payload instances.

Nested multiple (maxOccurs > 1) elements are supported. Assume the department element has a groupMember child element whose maxOccurs is unbounded. In that case, the parent element department is presented in a table section while the child groupMember elements are presented in different child table sections. The parent department table section has a column called group member that contains an HTML href link pointing to its corresponding child group member section in each department row. Pressing the + button in the parent department section not only adds a row in the parent table, but also adds a child section for that corresponding new row.

The default JSP in the current release has the following limitations:

  • XSDs that contain recursive elements are not supported.

  • The default JSP shows all the simple types defined in the payload XSD. If multiple simple types belong to the same XSD choice block, all these simple types are shown in the default JSP. Although simple types are preserved in the JSP, XSD restrictions are not relevant.

  • Only payloads copied from variables that are not simple types are supported. For example, if the query is bpws:getVariableData(var) or bpws:getVariableData(var, part) and the variable is a simple type, then JSP generation fails. Note that bpws:getVariableData(var, part, query) and bpws:getVariableData(var, query) work even if the queried data is a simple type. You only need to make sure the variable itself is not a simple type.

  • XSI extensions are not supported

  • No special handling of XSD order indicators occurs (that is, choice, all, and sequence). For example, the default JSP does not check if you entered both firstname and lastname:

    <xs:element name="person">
     <xs:complexType>
       <xs:all>
         <xs:element name="firstname" type="xs:string"/>
         <xs:element name="lastname" type="xs:string"/>
       </xs:all>
     </xs:complexType>
    </xs:element>
    
15.8.3.1.1 Customizing the Autogenerated JSP

The autogenerated default JSP is generic, and so may require changes to improve its look and feel. The JSP works in conjunction with the mapping file to determine which elements in the payload are displayed in the form.

15.8.3.1.2 Customizing the Mapping File

The mapping file gives you control of the presentation. The mapping file is an XML file that contains a list of viewable fields. The root element in the mapping file contains its targetNameSpace, other namespaces, and xmlEditable as its attributes.

All the elements that are simple types are listed as fields in the mapping file. Along with these elements, their immediate parents are listed as well for multilanguage support. Each field has three properties defined in the mapping file. They are xpath, editable, and resource_key.

The xpath property defines the XPath of this field. It is always prefixed by /ns0:task/ns0:payload. This is the XPath to the root of the payload object. When maxOccurs is greater than 1, it is denoted by [*]. For example, /ns0:task/ns0:payload/company[*]/ceo shows that maxOccurs is greater than 1 for the company field.

Note:

Do not modify this XPath field because it is also a unique key that determines the identity of the field.

The editable property defines if this field is editable. It defaults to true. If the value of this field is changed to false, the default JSP shows a disabled text field that disallows value changes.

The resource_key property is for multilanguage support. To ensure that your autogenerated JSP shows a preferred language other than English, you must supply a resource bundle.

Follow these steps to add a resource bundle:

  1. Create a bundle file (for example, MyBundle). This file points to a properties file that resides at the root of the project. The following code shows an example of MyBundle_en-US.properties:

    ACCEPT_MSG = Accept0
    REJECT_MSG = Reject0
    FLEX_STRING1_MSG = Flex String1
    FLEX_LONG1_MSG = Flex Long1
    FLEX_DATE1_MSG = Flex Date1
    TASK_TITLE = i18n Task
    
    

    In this case, if a field is defined in your mapping file as follows

    <field>
          <xpath>/ns0:task/ns0:payload/taskTitle</xpath>
          <editable>true</editable>
          <resourceKey>TASK_TITLE</resourceKey>
       </field>
    
    

    then calling

    FormUtil.getElementDisplayName("/ns0:task/ns0:payload/taskTitle", ,
    form, context.getLocale(), task)
    
    

    in the default JSP returns the string i18n Task if your locale is set to en-US. Similarly, if your locale is set to French, the proper properties file (MyBundle_fr.properties) is picked up.

  2. Specify the resource bundle name and location in the Resource Details window of the Human Task editor, as shown in "Specifying Multilingual Settings".

15.8.3.1.3 Customizing the Default JSP

If the mapping file does not provide enough control, you can modify the default JSP file. Only modify the section after the label:

/* Modify the code below when necessary */

Most JSP modifications can be made in the JSP design view of Oracle JDeveloper.

By default, all the fields are set to text field. If you want to change a text field to a text area, you can do the following.

  1. Select Text Area in the Component Palette, as shown in Figure 15-34.

    Figure 15-34 Oracle JDeveloper JSP Design View

    Description of wf103.gif follows
    Description of the illustration wf103.gif

  2. Drop it into the position of the text field you want to replace.

  3. Note that the name of the text field is set by calling the function oracle.bpel.services.workflow.worklist.payload.PayloadFormGenerator.constructName(String xpath), and the value of the field is set by PayloadFormGenerator.selectNodeValue(Element payload, String xpath, Map namespace). These functions must be used to construct form field names and to retrieve form field values.

  4. Set the text area's name and value to the same name and value as the text field.

  5. Delete the text field.

  6. In the place you want to insert text or other HTML elements that are not in a table, add text by typing it or add an HTML element by dragging and dropping the HTML component from the Component Pallet.

  7. If the place you want to insert HTML elements is in an HTML table, to insert text or a horizontal rule, first add a table row by clicking a row, right-clicking, and selecting Insert Row. After a row is inserted, you may need to merge all the cells in the row by selecting all the cells in the row and right-clicking to select Merge Cells. Then you can either type your text or drag and drop your HTML component.

  8. If you want to change the layout of the table or form, highlight the section you want to modify, right-click, and select table or form.

  9. If you want to format the text, use the toolbar's color and style buttons.

    It is recommended that you modify the default JSP's look and feel only. You should preserve the functions being used in the JSP. You must not alter the hidden parameters being submitted in the HTML form, because the Update button invokes form submission to the WFTaskUpdate that expects certain values. If your change is complicated and has programming logic in it, you must switch to the source view and modify the JSP code directly.

    By putting the statement <%@ page pageEncoding="UTF-8" %> in the default JSP, UTF-8 is set as the default encoding.

    See Also:

    The HelpDeskServiceRequest demo in SOA_Oracle_Home\bpel\samples\demos for an example of an autogenerated JSP and how to change the payload presentation
15.8.3.1.4 Displaying a Check Box on the Worklist Payload JSP

Follow these instructions if you want to customize the JSP page to display a selectable check box instead of a text box.

  1. Note that the input for the status is generated as follows.

    <input name="<%=PayloadFormGenerator.constructName("/ns0:task/ns0:payload/ns1:holds/ns
    1:holdCodes[" + i3 + "]/ns1:status")%>"
     value="<%=PayloadFormGenerator.selectNodeValue(payload,
     "/ns0:task/ns0:payload/ns1:holds/ns1:holdCodes[" + i3 + "]/ns1:status",
     form.getNamespaceMap())%>" dataType="string" <%=thisDisabled%> ></input>
    
    
  2. Substitute the entire code block shown in Step 1 with the following code block:

    String checked = "";
       String status = PayloadFormGenerator.selectNodeValue(payload,
     "/ns0:task/ns0:payload/ns1:holds/ns1:holdCodes[" + i3 + "]/ns1:status",
     form.getNamespaceMap());
       if(status != null && status.equals("true"))
       {
            checked = "checked";
       }
    
     <input type="CHECKBOX"
     name="<%=PayloadFormGenerator.constructName
      ("/ns0:task/ns0:payload/ns1:holds/ns
    1:holdCodes[" + i3 + "]/ns1:status")%>" value="<%=status%>"  <%=checked%>
     onClick="changeStatusValue(this)" ></input> 
    
    
  3. Add the following JavaScript. This is required because the value for the check box field in JavaScript is always the value defined in the input element.

    function changeStatusValue(obj)
        {
          obj.value = obj.checked;
        } 
    

15.8.4 Generating a Custom Task Display Form

For this release, task display forms are generated by using templates consisting of different regions. Oracle JDeveloper automatically 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, XSL, default JSP, or autogenerated JSP files. The automatically generated 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:

  • The header JSP displays task attributes such as task number, priority, title, and so on.

  • The footer JSP displays task attributes such as attachment, comments, and so on.

The custom task display form enables you to select the template and rendering type for displaying task details.

  1. Select Custom Task Form from the list shown in Step 2.

    The Task Form Display window appears.

    Description of ht_taskform.gif follows
    Description of the illustration ht_taskform.gif

  2. Select a template from the Current Template list. Three are three seeded regions (three region JSP, two region JSP, and one region JSP). After selecting a region, you can specify how to render it.

  3. See the following sections for details about generating the different types of custom task display forms:

    Type See...
    Auto JSP "Autogenerated JSP"
    Custom JSP "Custom JSP"
    Default JSP "Default JSP"
    XSL "XSL"

15.8.4.1 Autogenerated JSP

This option enables you to automatically generate a form for the payload of the task. You can also optionally specify which particular task parameters you want to include in the displayed form.

  1. Select Auto JSP from the Body list in the Rendering section.

    An icon displays to the right of Body.jsp in the Source section.

  2. Click the icon.

    The Payload Mapping window appears.

    Description of ht_taskform2.gif follows
    Description of the illustration ht_taskform2.gif

    This window enables you to select message attributes.

  3. Select message attributes to include in the autogenerated JSP.

  4. Click OK to return to the Task Form Display window.

15.8.4.2 Custom JSP

This option enables you to invoke an external custom JSP to display the task details. You can also specify URL parameters to pass to this JSP at run time. Three parameters are passed in by default — taskID, version, and workflowContext. Additional parameters must be explicitly specified.

  1. Select Custom JSP from the Header list in the Rendering section.

    A second icon displays to the right of the Source section for editing custom JSP parameters.

  2. Enter the custom JSP file name in the Source field or click the first icon to select the JSP file to use. This JSP is used in the project and deployed with the other JSP files.

  3. Click the second icon to specify run time JSP parameters.

    The Payload Mapping window appears. This window enables you to add input JSP parameters.

    Description of ht_taskform3.gif follows
    Description of the illustration ht_taskform3.gif

  4. Add a parameter by clicking the + sign.

  5. Add a name in the Name column.

  6. Click the icon to the right of the row to display the Expression Builder window to dynamically enter a value for the XPath column.

    For this example, the custom JSP is using a parameter named PRIORITY to receive the task ID from the request. Therefore, PRIORITY is specified as the name and /tns:task/tns:systemAttributes/tns:PRIORITY is specified as the XPath expression.

    See Also:

    "Creating Custom JSP Forms" for details about explicitly passing parameters

15.8.4.3 Default JSP

This option provides the default Header1.jsp and Footer1.jsp files to display the header and footer regions, respectively.

15.8.4.4 XSL

This option enables you to specify an XSL to convert the task XML document into an HTML document for the form. Note that this is useful only to create read-only forms.

  1. Enter the HTTP location in the Source field or click the first icon to select the input XSL file to use.

15.8.5 Deploying Task Display Forms

Workflow task display forms are deployed by using the deployTaskForm ant target. This target is executed when you deploy the BPEL process from Oracle JDeveloper or from the command prompt. This target generates an EAR file that includes all generated default or custom JSPs. This generated EAR file is deployed as a child of the Oracle BPEL Process Manager application.

The following directory structure is generated.

JDev_Oracle_Home\jdev\mywork\application_name\project_name\public_html\human_task_name\form

The following subdirectories and files are created:

  • A J2EE enterprise archive directory named ear is created. EAR deployment descriptors are generated and stored in the META-INF subdirectory.

  • A Web archive (WAR) directory named war is created. This directory contains the following files and subdirectories:

    • Style sheets and Java server page files for the header (Header1.jsp), footer (Footer1.jsp), and body (payload-body.jsp and payload-body.xml) are generated and stored in the war directory.

    • Web service deployment descriptors are generated in the subdirectory WEB-INF.

You can delete all form-related files by right-clicking the human task folder in the Application Navigator and selecting Delete Task Form files.

15.8.6 Creating Custom JSP Forms

As described earlier, you can register a custom JSP for rendering the task details in the worklist. The BPEL worklist invokes any custom JSP that has been registered.

Follow these instructions to create a custom JSP form.

  1. Get the task ID, version, and context ID from the request.

  2. Get the workflow context object based on the context ID.

  3. Get the task object based on the task ID and version. Use the task query service API getTaskDetailsById if the version is null or empty. Otherwise, use the getTaskVersionDetails API.

  4. Use the task object methods to get the values you want to display in the JSP.

  5. In the case of update support, generate the hidden HTML type for the following parameters, so that the update servlet can read these parameter values:

    • oracle.bpel.service.workflow.worklist.api.payload.PayloadConstants.WORKLIST_NEXT_PAGE_PARAMETER_NAME

    • oracle.bpel.service.workflow.worklist.api.payload.PayloadConstants.WORKLIST_LOGIN_PAGE_PARAMETER_NAME

    • oracle.bpel.service.workflow.worklist.api.payload.PayloadConstants.WORKLIST_ERROR_PAGE_PARAMETER_NAME

    You can get the values for these parameters in the custom JSP servlet request object. Run time invokes the custom JSP by passing these parameters.

The following custom JSP code shows how to use these steps to write a custom JSP that uses the local query service and verification APIs. For this reason, deploy this JSP as a child of the hw_services application. If you do not want to deploy to the same application server, replace local APIs with remote APIs.

<%@ page contentType="text/html;charset=UTF-8"%>
  <%@ page import="java.util.*,
                   java.net.URLEncoder,
                   java.io.UnsupportedEncodingException,
                   java.text.*, 
                   oracle.bpel.services.workflow.query.impl.TaskQueryService,
                   oracle.bpel.services.workflow.query.ITaskQueryService,
                   oracle.bpel.services.workflow.verification.IWorkflowContext,
                   oracle.bpel.services.workflow.verification.IVerificationService,
 oracle.bpel.services.workflow.verification.impl.VerificationService,
                   oracle.bpel.services.workflow.task.model.Task,
                   oracle.bpel.services.workflow.task.model.IdentityType,
                   oracle.bpel.services.workflow.task.model.CommentType,
                   oracle.bpel.services.workflow.task.model.AttachmentType,
                   oracle.bpel.services.workflow.task.model.IdentityType,
                   oracle.bpel.services.workflow.worklist.display.Resource,
 oracle.bpel.services.workflow.worklist.display.ResourceKeyConstants,
                   oracle.bpel.services.workflow.worklist.servlet.Constants,
                   oracle.bpel.services.workflow.worklist.api.util.WorklistUtil,
   oracle.bpel.services.workflow.worklist.api.payload.PayloadConstant;"%>
        <%
      String taskId = request.getParameter(Constants.WORKLIST_TASKID_PARAMETER_
NAME);
      String strTaskVersion = request.getParameter(Constants.WORKLIST_TASK_
VERSION_PARAMETER_NAME);
      String contextId = request.getParameter(Constants.WORKLIST_CONTEXT_
PARAMETER_NAME);
      
      int taskVersion = 0;
      // incase strTaskVersion is null means user wants latest version
      // from WFTask table
      // else it wants from the WFTaskHistory table
      if(strTaskVersion != null && !strTaskVersion.trim().equals(""))
      {
        try
        {
          taskVersion = Integer.parseInt(strTaskVersion);
        }
        catch(NumberFormatException exc)
        {
          //TO DO throw the exception
          taskVersion = 1;
        }
      }
      
      //no need to use Notm to get the task
      Task task = (Task)session.getAttribute(Constants.SESSION_CURRENT_TASK_
OBJECT);
      
      IVerificationService verificationService =
 VerificationService.getVerificationService();
      IWorkflowContext context = verificationService.getContext(contextId);
      
      
      if(task == null)
      {
         ITaskQueryService queryService = TaskQueryService.getInstance();
         if(taskVersion == 0)
         {
           task =  queryService.getTaskDetailsById(context, taskId);
         } 
         else
         {
           task = queryService.getTaskVersionDetails(context,taskId,taskVersion);
         }
      }
      Locale locale = context.getLocale();
      
      // get the TaskId and use above object
      SimpleDateFormat dfshort = new SimpleDateFormat( "MM/dd/yy" );
      SimpleDateFormat dflong = new SimpleDateFormat( "MM/dd/yy hh:mm a" );
      
      String nextPage = request.getParameter(Constants.WORKLIST_NEXT_PAGE_
PARAMETER_NAME);
      String loginPage = request.getParameter(Constants.WORKLIST_LOGIN_PAGE_
PARAMETER_NAME);
      
    %> 

15.8.6.1 Adding Update Support in the Custom JSP

To add update support in the custom JSP, you can write the servlet that uses the remote task service APIs to update the custom JSP task values:

  1. Get the task object by using the same steps as used in the custom JSP.

  2. Query the task object and set the values based on the custom JSP form.

    For example, if the custom JSP form allows a user to update the priority attribute, then get the priority JSP form value and call task.setPriority(newvalue);.

  3. Use the remote task service API to update the task.

  4. Get the value from servlet parameter WORKLIST_NEXT_PAGE_PARAMETER_NAME, which the custom JSP page includes as a hidden parameter.

  5. Redirect the page to the URL.

15.9 How Changes to a Workflow Appear in Worklist Application

Changes made in Oracle BPEL Control to a BPEL process that includes a human task impact how tasks display in Oracle BPEL Worklist Application:

15.10 Notifications from Workflow Services

Notifications are sent to alert users of changes to the state of a task. Notifications can be sent through any of the following channels: e-mail, telephone voice message, fax, pager, or SMS.

This section contains the following topics:

15.10.1 Configuring the Notification Channel

After configuring the notification service for e-mail and other channels in Oracle JDeveloper, set the NotificationMode parameter for the notification service to either ALL or EMAIL in the SOA_Oracle_Home\bpel\system\services\config\ns_emails.xml file.

By default, this value is set to NONE, meaning that no notifications are sent. The possible values for the NotificationMode attribute are:

  • ALL – the e-mail, SMS, voice, fax, and pager channels are configured and notification is sent through any channel.

  • EMAIL – Only the e-mail channel is configured for sending notification messages.

  • NONE – No channel is configured for sending notification messages. This is the default setting.

The notifications for a task can be configured during the creation of a task in the Human Task editor. Notifications can be sent to different types of participants for different actions. The actions for which a task notification can be sent are as follows:

  • Assigned — when the task is assigned to users or a group. This action captures the following task actions — acquire, adhoc route, delegate, escalate, information for a task is submitted, push back, reassign, release, and resume.

  • Task is completed

  • Task is errored

  • Task is expired

  • Information is requested for a task

  • Task outcome is updated

  • Task is suspended

  • Task is withdrawn

Notifications can be sent to users involved in the task in various capacities. This includes:

  • Assignees – the users or groups to whom the task is currently assigned

  • Initiator - the user who created the task

  • Creator – the user who created the task

  • Approvers – the users who have approved the task so far

    • This applies to a sequential list of approvers participant type where multiple users have approved the task and a notification must be sent to all.

  • Owner – the owner of the task

When the task is assigned to a group, each user in the group is sent a notification if no notification endpoint is available for the group.

See Also:

15.10.2 Contents of Notification

Each e-mail notification can contain the following parts:

  • The notification message

  • The HTML content from the worklist application — This is a read-only view of the worklist application on the task.

  • Task attachments — If the notification includes task attachments

  • Actionable links

Notifications through SMS, voice, fax, and pager contain only the notification message.

The notification message is an XPath expression that can contain static text and dynamic values. In creating the messages, only the task BPEL variable is available for dynamic values. This restriction is because the messages are evaluated outside the context of the BPEL process. The payload in the task variable is also strongly typed to contain the type of the payload for XPath tree browsing. The XPath extension function hwf:getNotificationProperty(propertyName) is available to get properties for a particular notification. The function evaluates to corresponding values for each notification. The propertyName can one of the following values:

  • recipient — The recipient of the notification.

  • recipientDisplay — The display name of the recipient.

  • taskAssignees — The task assignees.

  • taskAssigneesDisplay — The display names of the task assignees.

  • locale — The locale of the recipient.

  • taskId — The ID of the task for which the notification is meant.

  • taskNumber — The number of the task for which the notification is meant.

  • appLink — The HTML link to the worklist application task details page.

The following example demonstrates the use of hwf:getNotificationProperty and hwf:getTaskResourceBundle together:

concat('Dear ', hwf:getNotificationProperty('recipientDisplay'), ' Task ',
/task:task/task:systemAttributes/task:taskNumber, ' is assigned to you. ',
hwf:getTaskResourceBundleString(/task:task/task:systemAttributes/task:taskId,
'CONGRATULATIONS', hwf:getNotificationProperty('locale')))

This results in a message similar to the following:

Dear Cooper, James Task 1111 is assigned to you. Congratulations

15.10.3 Configuring Messages in Different Languages

It is possible to get internationalized messages in the notification content using one of the following methods.

  • If you want to use values from the resource bundle specified during the task definition, use the XPath extension function hwf:getTaskResourceBundleString(taskId, key, locale?). This function returns the internationalized string from the resource bundle specified in the task definition.

    • The locale of the notification recipient can be retrieved with the function hwf:getNotificationProperty('locale').

    • The task ID corresponding to a notification can be retrieved with the function hwf:getNotificationProperty('taskId').

  • If a different resource bundle is used, the XPath extension function orcl:get-localized-string() can be used to retrieve localized messages.

15.10.4 Sending Actionable E-mails

Task actions can be performed through e-mail if the task is set up to enable actionable e-mail (the same actions can also be performed from the Oracle BPEL Worklist Application). An actionable e-mail account is the account in which task action-related e-mails are received and processed. This e-mail account name is identified by the element actionableEmailAccountName in the configuration file SOA_Oracle_Home\bpel\system\services\config\wf_config.xml.

Ensure that you select Make e-mail messages actionable in the Notification Settings section of the Human Task editor to make e-mail notifications actionable. (See Figure 15-25.) This enables you to perform task actions through e-mail.

If a notification is actionable, the e-mail contains links for each of the custom outcomes. Clicking on the links invokes the compose window of the e-mail client. You do not have to change anything in the subject or the body in this e-mail. If you change the content with the NID substrings, the e-mail is not processed.

Figure 15-35 shows an actionable e-mail sample:

Figure 15-35 Actionable E-mails

Description of ht_action.gif follows
Description of the illustration ht_action.gif

15.10.5 Sending Inbound and Outbound Attachments

If the include attachments flag is checked; only e-mail is sent. The e-mails include all the task attachments as e-mail attachments. Select Send task attachments with e-mail notifications in the Notification Settings section of the Human Task editor. (See Figure 15-25.)

In the actionable e-mail reply, the user can add attachments in the e-mail and these attachments are added as task attachments.

15.10.6 Sending Inbound Comments

In the actionable e-mail reply, the user can add comments in the e-mail between Comments[[' and ']] and those contents are added as task comments. For example, Comments[[looks good]].

15.10.7 Reliability Support

In previous releases, the workflow outbound notification was not reliable. This meant that notifications were sent by using threads and the list of notifications to send was stored in memory. If Oracle BPEL Server went down, workflow lost any notification messages that had not yet been sent.

With release 10.1.3, the workflow outbound notification service uses queues with the persistency service to send notifications to users.

Whenever a workflow needs to send a notification to a user, it stores the task information such as notification ID, task ID, version, and so on in the dehydration store and enqueues the notification ID to the queue. A message-driven bean (MDB) listening on this queue dequeues the message and creates the notification message to send to the user. It then uses the notification service to send this message, which uses the queue with the dehydration store.

See Also:

Chapter 14, "Oracle BPEL Process Manager Notification Service" for additional details about the reliable notification service

15.10.8 Sending Secure Notifications

If a notification is marked as secure in the Notification Settings section of the Human Task editor, a default notification message is used. (See Figure 15-25.) The default notification message includes a link to the task in the Oracle BPEL Worklist Application. You must log in to see task details.

15.10.9 Channels Used for Notifications

The channel through which a user is notified is determined by the notification preference attribute of the user specified in JAZN. The notification preference is identified by the attribute orclWorkflowNotificationPreference. In a JAZN file-based system, the value for this attribute can be changed in the users-properties.xml file located at SOA_Oracle_Home\bpel\system\services\config.

In an Oracle Internet Directory-based system, the user properties can be changed using the Oracle Delegated Administration Service. If this attribute is not set, the e-mail channel is used as the default.

See Also:

Oracle Identity Management Guide to Delegated Administration for more information on the Oracle Delegated Administration Service

15.10.10 Sending Reminders

Tasks can be configured to send reminders, which can be based on the time the task was assigned to a user or the expiration time of a task. The number of reminders and the interval between the reminders can also be configured. The message used for reminders is the message that is meant for ASSIGNEES when the task is marked as ASSIGNED.

You set reminders in the Notification Settings section of the Human Task editor. (See Figure 15-25.) Reminder configuration involves these parameters.

  • Recurrence — The recurrence specifies the number of times reminders are sent. The possible values for recurrence are EVERY, NEVER, 0, 1, 2 …, 10.

  • RelativeDate — The relativeDate specifies if the reminder duration is computed relative to the assigned date or to the expiration date of the task. The possible values for the relativeDate are ASSIGNED and EXPIRATION.

  • Duration — The duration from the relativeDate and the first reminder and each reminder since then. The data type of duration is xsd:duration, whose format is defined by ISO 8601 under the form PnYnMnDTnHnMnS. The capital letters are delimiters and can be omitted when the corresponding member is not used. Examples include PT1004199059S, PT130S, PT2M10S, P1DT2S, -P1Y, or P1Y2M3DT5H20M30.123S.

The following examples illustrate when reminders are sent.

  • The relativeDate is ASSIGNED, the recurrence is EVERY, and the reminder duration is PT1D. If the task is assigned at 3/24/2005 10:00 AM, then reminders are sent at 3/25/2005 10:00 AM, 3/26/2005 10:00 AM, 3/27/2005 10:00 AM, and so on until the user acts on the task.

  • If the relativeDate is EXPIRATION, the recurrence is 2, the reminder duration is PT1D, and the task expires at 3/26/2005 10:00 AM, then reminders are sent at 3/24/2005 10:00 AM and 3/25/2005 10:00 AM if the task was assigned before 3/24/2005 10:00 AM.

  • If the relativeDate is EXPIRATION, the recurrence is 2, the reminder duration is PT1D, the task expires at 3/26/2005 10:00 AM, and the task was assigned at 3/24/2005 3:00 PM, then only one reminder is sent at 3/25/2005 10:00 AM.

15.11 End-to-End Workflow Examples

Table 15-14 shows the end-to-end workflow examples included with Oracle BPEL Process Manager. Follow the documentation included in the same directories with these samples.

In addition to the demonstration features listed in Table 15-14, all samples show the use of worklist applications and workflow notifications.

Table 15-14 End-to-End Examples

Sample Location Description Demonstrates
AutoLoanDemo SOA_Oracle_Home\bpel\samples\demos Review and approve a loan request
  • Single approval
  • Integration with a business rule engine

DocumentReview SOA_Oracle_Home\bpel\samples\demos Review and approve a document
  • Group vote
  • Adding attachments to tasks

ExpenseRequestApproval SOA_Oracle_Home\bpel\samples\demos The ExpenseRequest business process is used to approve and reject an expense request from an employee
  • Management chain approval
  • Use of decision service to determine the levels of approvals required for a particular expense request

  • Microsoft Office integration

HelpDeskServiceRequest SOA_Oracle_Home\bpel\samples\demos Approval of a help desk service
  • Adhoc approval
  • Custom worklist user interface

  • Promotion of task payload message attributes

LoanDemoPlus SOA_Oracle_Home\bpel\samples\demos Approval of a loan application
  • Group assignment (in StarLoan process)
  • Custom worklist user interface (in LoanFlowPlusUI and StarLoanUI)

  • FYI tasks (in LoanFlowPlus process)

OrderApproval SOA_Oracle_Home\bpel\samples\tutorials\127.OrderBookingTutorial Approve or reject a purchase order
  • Sequential workflow
VacationRequest SOA_Oracle_Home\bpel\samples\demos Vacation request approval or denial
  • Simple workflow

15.11.1 Vacation Request Example

This example describes how to create a vacation request business process. In this business process, the manager of a user requesting a vacation approves or rejects the request. The approval or rejection is a one-step process.

This example highlights the use of the following:

  • Modeling a single approval workflow using Oracle JDeveloper

  • Using the Oracle BPEL Worklist Application to view and respond to tasks

15.11.2 Prerequisites

This example assumes the following:

  • You are familiar with basic BPEL constructs, including BPEL activities and partner links, and basic XPath functions. Familiarity with Oracle JDeveloper—the environment for creating and deploying BPEL processes—is also assumed.

  • You must configure the e-mail server settings for the account Default to enable e-mail notifications. The Default account is used to send e-mails. The e-mail server configuration is in

    SOA_Oracle_Home\bpel\system\services\config\ns_emails.xml
    
    

    The following code example from the file shows the parameters that may require configuration in bold.

    <EmailAccount>
          <Name>Default</Name>
          <GeneralSettings>
             <FromName>Oracle BPM</FromName>
             <FromAddress>accountId@yourdomain.com</FromAddress>
          </GeneralSettings>
          <OutgoingServerSettings>
             <SMTPHost>yourdomain.com</SMTPHost>
             <SMTPPort>25</SMTPPort>
          </OutgoingServerSettings>
          <IncomingServerSettings>
             <Server>yourdomain.com</Server>
             <Port>110</Port>
             <Protocol>pop3</Protocol>
             <UserName>accountId</UserName>
             <Password ns0:encrypted="false"  
                xmlns:ns0="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
                password</Password>
             <UseSSL>false</UseSSL>
             <Folder>Inbox</Folder>
             <PollingFrequency>1</PollingFrequency>
             <PostReadOperation>
                <MarkAsRead/>
             </PostReadOperation>
          </IncomingServerSettings>
       </EmailAccount>
    
    
  • You must set the NotificationMode parameter to one of the following values in the ns_emails.xml file:

    • ALL – If you have the e-mail, SMS, voice, fax, and pager channels set up.

    • EMAIL – If you have only the e-mail channel set up.

    For example:

    <EmailAccounts xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService" 
                   EmailMimeCharset="" 
                   NotificationMode="EMAIL">
    
    
  • You must change the e-mail address for the user jstein to an accessible e-mail address. If the XML-based JAZN provider is used, these properties can be changed in:

    SOA_Oracle_Home\bpel\system\services\config\users-properties.xml
    
    

    The following XML segment from the users-properties.xml file shows where the e-mail is configured:

    <userObject>
      <name>jstein</name>
      <description>Demo User</description>
      <email>user1@dlsun4254.us.oracle.com</email>
      <title>Manager2</title>
      <firstName>John</firstName>
      <lastName>Steinbeck</lastName>
      <manager>wfaulk</manager>
      <timeZone>America/Los_Angeles</timeZone>
      <languagePreference>en-US</languagePreference> 
      <notificationPreferences>Mail</notificationPreferences>
    </userObject>
    
    
  • You must restart Oracle BPEL Process Manager after making any of the preceding changes.

15.11.3 Modeling the Vacation Request Process

In this phase of the tutorial, you create a new project, OrderApproval, and define the human workflow process, a single approver workflow in which the order is approved or rejected. The order is first assigned to the Supervisor role. After a user with the Supervisor role approves the order, it is sent to the user's manager for final approval.

This section contains these tasks:

15.11.3.1 Creating the Vacation Request Process and Importing the Schema

  1. Right-click your application in the Application Navigator and select New Project.

  2. Select BPEL Process Project.

  3. Create an asynchronous BPEL process with the name VacationRequest.

  4. Click Next.

  5. Click the flashlight next to Input Schema Element to browse for VacationRequest.xsd in

    SOA_Oracle_Home\bpel\samples\demos\VacationRequest\bpel
    
    
  6. Click Open.

    The Type Chooser window appears.

  7. Expand and select Imported Schemas > VacationRequest.xsd > VacationRequestProcessRequest.

  8. Click OK.

  9. Click the flashlight next to Output Schema Element.

  10. Expand and select Imported Schemas > VacationRequest.xsd > VacationRequestProcessResponse.

  11. Click Finish.

    The schemas are now imported into the project. VacationRequest.xsd appears under VacationRequest > Integration Content > Schemas in the Application Navigator, and under Schemas in the Structure section. The BPEL process—a Receive activity (receiveInput) and an Invoke activity (callbackClient)—is displayed.

  12. Select Save from the File main menu.

15.11.3.2 Adding a Human Task to the Order Approval Process

Summary:

When you define the human task, the VacationApproval.task file—the task configuration metadata file—is created.
  1. Drag and drop a Human Task activity between receiveInput and callbackClient.

  2. Click the Create Task Definition icon (second icon).

    Add a human task.
    Description of the illustration wf_task_def.gif

  3. Enter VacationApproval for the human task name and click OK. (Accept the default location.)

    The VacationApproval.task file is created.

    The Human Task editor is displayed.

  4. For Title, enter Vacation Approval.

  5. Accept the default values for Priority and Outcomes.

  6. For Parameters, click the + icon on the right side of the window.

    The Add Task Parameter window is displayed.

  7. Click Element and then the flashlight icon.

  8. In the Type Chooser window, expand and select Project Schema Files > VacationRequest.xsd > VacationRequestProcessRequest, and click OK.

    The Human Task window
    Description of the illustration ht_typechooser.gif

  9. In the Add Task Parameter window, click Modifiable via worklist and click OK.

    This ensures that you can modify task data using the Oracle BPEL Worklist Application.

  10. In the Assignment and Routing Policy section, click the + icon on the right side of the window.

    The Add Participant Type window is displayed.

  11. For Type, select Single Approver.

    This participant type acts alone on the task.

  12. For Label, enter Vacation Approver.

  13. Click By expression.

    In this example, you assign the task to the manager of the vacation requester.

  14. Click the icon to the right of the Dynamic User Xpath field to display the Expression Builder window.

  15. Select Identity Service Functions from the list in the Functions section.

  16. Double-click getManager.

  17. Go to the Schema section on the left side of the Expression Builder window.

  18. Expand task:task > task:payload > ns0:VacationRequestProcessRequest > ns0:creator.

  19. Click Insert Into Expression.

    The Expression Builder window appears as follows:

    Description of ht_vacreq1.gif follows
    Description of the illustration ht_vacreq1.gif

  20. Click OK to return to the Add Participant Type window.

  21. Click OK to return to the Human Task editor.

  22. Click the + sign to expand the Expiration and Escalation Policy section.

  23. Select Expire after from the drop-down list.

  24. Click Fixed Duration and select 1 from the Day list.

  25. Select Save from the File main menu.

  26. Click the X next to VacationApproval.task to close the Human Task editor.

15.11.3.3 Assigning Input and Output Parameters for the Human Task

Summary:

Map the fields to the variables in the BPEL process.
  1. Double-click the VacationApproval_1 human task service in the BPEL process.

    Human Task activity in the BPEL process
    Description of the illustration ht_vacreq2.gif

    This displays the Human Task window.

  2. In the Task Title field, enter the word for after the words Vacation Approval.

  3. Click the icon at the right to display the Expression Builder window.

  4. In the BPEL Variables section, expand and select inputVariable> payload > client:VacationRequestProcessRequest > client:creator.

  5. Click Insert Into Expression.

    The XPath expression appears in the Expression section.

    Description of ht_vacreq3.gif follows
    Description of the illustration ht_vacreq3.gif

  6. Click OK.

    The XPath expression is appended to the task title.

  7. Click the icon to the right of the Initiator field to display the Expression Builder window.

  8. Repeat Steps 4 through 6 to insert the same XPath expression in the Initiator field.

    Human task
    Description of the illustration ht_vacreq4.gif

  9. Click the flashlight icon under the BPEL Variable column.

    The Task Parameters window appears.

  10. In the Task Parameters window, expand and select Variables > inputVariable > payload > client:VacationRequestProcessRequest.

  11. Click OK.

  12. In the Human Task window, click OK.

  13. Select Save from the File main menu.

15.11.3.4 Creating a Task Form for the Worklist

Summary:

An autogenerated task form, payload-body.jsp, is created.
  1. In the Application Navigator, right-click the VacationApproval folder and select Auto Generate Simple Task Form.

    This automatically generates a task form file.

  2. Close payload-body.jsp by clicking the X sign at the top.

15.11.3.5 Modeling the Task Outcome

Summary:

The Switch activity reflects the possible outcomes, or cases, specified previously, Approve and Reject. It also has an Otherwise case to represent other outcomes, such as errored, stale, or expired. Inside each of the cases, you can add activities to complete modeling of the business process. The copyPayloadFromTask Assign activities copy the payload back to its source.
  1. Double-click VacationRequest.bpel.

  2. Expand the taskSwitch Switch activity.

  3. Drag and drop an Assign activity to below the copyPayloadFromTask Assign activity in the <case Task outcome is APPROVE> section of the Switch activity.

  4. Double-click the Assign icon to display the Assign window.

  5. Click the General tab.

  6. Enter assignVacationApproval1 in the Name field.

  7. Click Apply.

  8. Click the Copy Operation tab.

  9. Click Create and select Copy Operation.

  10. Enter the following details:

    Field Value
    From
    • Type
    Expression
    • Expression
    string('Approved')
    To
    • Type
    Variable
    • Variables
    Expand and select Variables > outputVariable > payload > client:VacationRequestProcessResponse > client:result

    Note: The namespace number values (for example, client, ns1) can vary. Use the namespace values that automatically appear.


  11. Click OK to close the Create Copy Operation window and the Assign window.

  12. Repeat Steps 3 through 11 to create an Assign activity below the copyPayloadFromTask Assign activity in the <case Task outcome is REJECT> section. Enter the same details as described above, with the following exceptions:

    • Name it assignVacationApproval2

    • Set the Expression field to string('Rejected')

  13. Repeat Steps 3 through 11 to create an Assign Activity below the copyPayloadFromTask Assign activity in the <otherwise> section. Enter the same details as described above, with the following exceptions:

    • Name it assignVacationApproval3

    • Set the Expression field to string('Rejected')

  14. The process looks as follows:

    Order approval
    Description of the illustration ht_vacreq5.gif

  15. Select Save from the File main menu.

  16. Click the - sign to close the taskSwitch Switch activity.

15.11.3.6 Validating, Compiling, and Deploying the Order Approval Process

  1. Go to the Application Navigator section.

  2. Right-click VacationApproval.

  3. Select Deploy > my_integration_server_connection > Deploy to default domain.

    This compiles the BPEL process. Check for errors by clicking the buttons at the bottom of the window. If there are no errors, deployment was successful.

15.11.3.7 Running the Order Approval Process

  1. Log into Oracle BPEL Control by selecting Start > All Programs > Oracle - Oracle_Home > Oracle BPEL Process Manager > BPEL Control.

    The Dashboard tab of Oracle BPEL Control appears.

  2. Enter the following details to log into Oracle BPEL Control and click Login:

    Field Value
    Username oc4jadmin
    Password welcome1

  3. Click VacationApproval in the Deployed BPEL Processes list.

  4. Enter jcooper for the creator of the vacation.

  5. Enter appropriate values for the remaining fields.

  6. Click Post XML Message.

    The BPEL Processes tab displays a message similar to the following:

    Test Instance Initiated
    
    
  7. Click the Instances tab at the top.

  8. Click the OrderApproval instance.

    A message appears indicating that the instance is active.

  9. Select Start > All Programs > Oracle - Oracle_Home > Oracle BPEL Process Manager > Sample Worklist Application to access the login window for Oracle BPEL Worklist Application:

  10. Log in as jstein/welcome1.

    The user jstein is the manager of jcooper. This displays Oracle BPEL Worklist Application. A task waiting to be approved appears.

  11. Select Claim in the Actions list for the task to approve.

  12. Click Go.

    The task details and payload information appear.

  13. Review the information. For example, the following information appears if you copied and pasted in the contents of OrderBookingPO_1.xml.

  14. Select Approve from the Task Action list and click Go.

  15. Log out as user jcooper.

  16. Log into Oracle BPEL Worklist Application as jstein/welcome1.

  17. Select Approve from the Actions list and click Go.

    After processing, no tasks appear in Oracle BPEL Worklist Application.

  18. Log out.

  19. Return to Oracle BPEL Control.

  20. Click the Instances tab at the top.

  21. Click the VacationApproval instance.

    A message appears indicating that the instance has completed.

  22. Click the Audit and Flow links to observe additional details about the completed OrderApproval process.

15.12 Workflow Services

Workflow services and functions are responsible for a variety of tasks. This section describes the responsibilities of the following workflow services:

15.12.1 EJB, SOAP, and Java Support for the Workflow Services

Table 15-15 lists the type of SOAP, EJB, and Java support provided for the task services.

Table 15-15 EJB, SOAP, and Java Support

Service Name Supports SOAP Web Services Supports Remote EJB Supports Local EJB Supports Plain Java APIs
Task Service Yes Yes Yes
Task Query Service Yes Yes Yes Yes
Task Metadata Service Yes Yes Yes Yes
Task Reports Service


Yes
User Metadata Service Yes Yes Yes Yes
Runtime Config Service Yes Yes Yes Yes
Identity Service:



  • BPM Authentication Service
Yes

Yes
  • BPM Authorization Service
Yes

Yes

Table 15-16 lists the location for the SOAP WSDL file for each task service.

Table 15-16 SOAP WSDL Location for the Task Services

Service name SOAP WSDL location
Task Service http://host:port/integration/services/TaskService/TaskServicePort?WSDL
Task Metadata Service http://host:port/integration/services/TaskMetadataService/TaskMetadataServicePort?WSDL
Task Query Service http://host:port/integration/services/TaskQueryService/TaskQueryService?WSDL
User Metadata Service http://host:port/integration/services/UserMetadataService/UserMetadataService?WSDL
Runtime Config Service http://host:port/integration/services/RuntimeConfigService/RuntimeConfigService?WSDL
Identity Service http://host:port/integration/services/IdentityService/configuration?WSDL

http://host:port/integration/services/IdentityService/identity?WSDL

Notification Service http://host:port/integration/services/NotificationService/NotificationService?WSDL

15.12.2 Security Model for Services

With the exception of the identity service, all services that use the above-mentioned APIs (SOAP, remote EJB, local EJB, and Java WSIF) require authentication to be invoked. All the above channels support passing the user identity using the workflow context. The workflow context contains either of the following:

  • Login and password

  • Token

The task query service exposes the authenticate operation that takes the login and password and returns the workflow context used for all services. Optionally, with each request, you can pass the workflow context with the login and password.

The authenticate operation also supports the concept of creating the context on behalf of a user with the admin ID and admin password. This enables you to create the context for a logged-in user to the Oracle BPEL Worklist Application if the password for that user is not available.

15.12.2.1 Security in SOAP Web Services

SOAP Web services also support Web service security. When Web service security is used, the workflow context does not need to be present in the SOAP input. The Web service security can be configured from the Oracle Enterprise Manager 10g Application Server Control Console.

Note:

Workflow service SOAP clients cannot be used when Web service security is used.

See Also:

"Configuring Single Sign-on Using SAML" in the Oracle Application Server Web Services Security Guide for details about propagating the identity of a user from a Web application to the Web service

15.12.2.2 Security in EJBs

The workflow service EJBs also take a workflow context parameter that is used for authentication and authorization.

15.12.2.3 Creating Workflow Context on Behalf of a User

The authenticate API operation on the task query service can create the workflow context on behalf of a user by passing the user ID and password of an admin user in the request. An admin user is a user who has the BPMWorkflowAdmin role. This created context is as if it was created using the password on behalf of the user.

In this example, the workflow context is created for user jcooper.

ITaskQueryService taskQueryService = …. 
String realm = …;
IWorkflowContext wfCtx = 
    taskQueryService.authenticate('bpeladmin', 'welcome1', realm, 'jcooper');

15.12.3 Task Service

The task service exposes operations to act on tasks. Table 15-17 describes the operations of the task service. Package oracle.bpel.services.workflow.task corresponds to the task service.

Table 15-17 Task Service Methods

Method Description
acquireTask Acquire a task.
acquireTasks Acquire a set of tasks.
addAttachment Add an attachment to a task.
addComment Add a comment to a task.
delegateTask Delegate a task to a different user. Both the current assignee and the user to whom the task is delegated can view and act on the task.
errorTask Cause the task to error. This operation is typically used by the error assignee.
escalateTask Escalate a task. The default escalation is to the manager of the current user. This can be overridden using escalation functions.
getApprovers Get the previous approvers of a task.
getFutureParticipants Get the future participants of a task. The future participants are returned in the form of a routing slip that contains simple participants — (participant node and parallel nodes that contain routing slips in them).
getUsersToRequestInfoForTask Get the users from whom a request for information can be requested.
initiateTask Initiate a task.
mergeAndUpdateTask Merge and update a task. Use this operation when a partial task should be updated. A partial task is one in which not all the task attributes are present. In this partial task, only the following task attributes are interpreted:
  • Task payload

  • Comments

  • Task state

  • Task outcome

overrideRoutingSlip Override the routing slip of a task instance with a new routing slip. The current task assignment is nullified and the new routing slip is interpreted as its task is initiated.
pushBackTask Push back a task to the previous approver or original assignees. The original assignees do not need to be the approver as they may have reassigned the task, escalated the task, and so on. The property pushbackAssignee in wf_config.xml controls whether the task is pushed back to the original assignees or the approvers.
reassignTask Reassign a task.
reinitiateTask Reinitiate a task. Reinitiating a task causes a previously completed task to be carried forward so that the history, comments, and attachments are carried forward in a new task.
releaseTask Release a previously acquired task.
releaseTasks Release a set of previously acquired tasks.
removeAttachment Remove a task attachment.
renewTask Renew a task to extend the time it takes to expire.
requestInfoForTask Request information for a task.
requestInfoForTaskWithReapproval Request information for a task with reapproval. For example, assume jcooper created a task and jstein and wfaulk approved the task in the same order. When the next approver, cdickens, requests information with reapproval from jcooper, and jcooper submits the information, jstein and wfaulk approve the task before it comes to cdickens. If cdickens requests information with reapproval from jstein, and jstein submits the information, wfaulk approves the task before it comes to cdickens.
resumeTask Resume a task. Operations can only be performed by the task owners (or users with the BPMWorkflowSuspend privilege) to remove the hold on a workflow. After a workflow is resumed, actions can be performed on the task.
resumeTasks Resume a set of tasks.
routeTask Allow a user to route the task in an adhoc fashion to the next user(s) who must review the task. The user can specify to route the tasks in sequential, parallel, or simple assignment. Routing a task is permitted only when the workflow permits adhoc routing of the task.
skipCurrentAssignment Skip the current assignment and move to the next assignment or pick the outcome as set by the previous approver if there are no more assignees.
submitInfoForTask Submit information for a task. This action is typically performed after the user has made the necessary updates to the task or has added comments or attachments containing additional information.
suspendTask Allows task owners (or users with the BPMWorkflowSuspend privilege) to put a workflow on hold temporarily. In this case, task expiration and escalation do not apply until the workflow is resumed. No actions are permitted on a task that has been suspended (except resume and withdraw).
suspendTasks Suspend a set of tasks.
updateOutcomeOfTasks Update the outcome of a set of tasks.
updateTask Update the task.
updateTaskOutcome Update the task outcome.
updateTaskOutcomeAndRoute Update the task outcome and route the task. Routing a task allows a user to route the task in an adhoc fashion to the next user(s) who must review the task. The user can specify to route the tasks in sequential, parallel, or simple assignment. Routing a task is permitted only when the workflow permits adhoc routing of the task.
withdrawTask The creator of the task can withdraw any pending task if they are no longer interested in sending it further through the workflow. A task owner can also withdraw a task on behalf of the creator. When a task is withdrawn, the business process is called back with the state attribute of the task set to Withdrawn.
withdrawTasks Withdraw a set of tasks.

See Also:

Oracle BPEL Process Manager Workflow Services API Reference located in the SOA_Oracle_Home\bpel\docs\workflow directory

15.12.4 Task Query Service

The task query service queries tasks based on a variety of search criterion such as keyword, category, status, business process, attribute values, history information of a task, and so on. Table 15-18 describes the operations of the task query service, including how to use the service over SOAP. Package oracle.bpel.services.workflow.query corresponds to the task query service.

Table 15-18 Task Query Service Methods

Method Description
authenticate Authenticates a user with the identity authentication service and passes back a valid IWorkflowContext object. Authentication can optionally be made on behalf of another user.
createContext Creates a valid IWorkflowContext object from a preauthenticated HTTP request.
getWorkflowContext Gets a workflow context with the specified context token.
destroyWorkflowContext Cleans up a workflow context that is no longer needed. This method is typically used when a user logs out.
getTaskDetailsById Gets the details of a specific task from the task's taskId property.
getTaskDetailsByNumber Gets the details of a specific task from the task's task number property.
getTaskHistory Gets the last of the task versions for the specified task ID.
getTaskVersionDetails Gets the specific task version details for the specified task ID and version number.
queryTasks Returns a list of tasks that match the specified filter conditions. Tasks are listed according to the ordering condition specified (if any). The entire list of tasks matching the criteria can be returned or clients can execute paging queries, in which only a specified number of tasks in the list are retrieved. The filter conditions are as follows:
  • assignmentFilter — Filters tasks according to whom the task is assigned, or who created the task. Possible values for the assignment filter are as follows:

    ADMIN — No filtering; returns all tasks regardless of assignment or creator.

    ALL — No filtering; returns all tasks regardless of assignment or creator.

    CREATOR — Returns tasks where the context user is the creator.

    GROUP — Returns tasks that are assigned to one of the groups of which the context user is a member.

    MY — Returns tasks that are assigned to the context user.

    MY_AND_GROUP — Returns tasks that are assigned to either the context user, or one of the groups of which they are a member.

    OWNER — Returns tasks where the context user is the task owner.

    PREVIOUS — Returns tasks the context user previously updated.

    REPORTEES — Returns tasks that are assigned to reportees of the context user.

  • keywords — An optional search string. This only returns tasks where the string is contained in the task title, task identification key, or one of the task text flex fields.

  • predicate — An optional oracle.bpel.services.workflow.repos.Predicate object that allows clients to specify complex, SQL-like query predicates.

    Note: To use the task query service over SOAP, call Predicate.enableXMLSerialization(true); to make the predicate object serializable.

queryViewTasks Returns a list of tasks according to the criteria in the specified view. The entire list or paged list of tasks can be returned. Clients can specify additional filter and ordering criteria to those in the view.

See Also:

Oracle BPEL Process Manager Workflow Services API Reference located in the SOA_Oracle_Home\bpel\docs\workflow directory

15.12.5 Identity Service

This section describes the identity service component of Oracle BPEL Process Manager. The identity service is a thin Web service layer on top of the Oracle Application Server 10g security infrastructure, namely OracleAS JAAS Provider (JAZN), or any custom user repository. It enables authentication and authorization of users and the lookup of user properties, roles, group memberships, and privileges.

Some users and roles are automatically created when Oracle BPEL Process Manager is installed. Seeded users include:

  • guest

  • default

  • bpeladmin

  • oc4jadmin

The identity service predefines the following roles, which can be granted to users to perform workflow-related operations:

  • PUBLIC—This role is an implicit JAZN role; it does not need to be granted explicitly to any of the users. If any user can authenticate with the worklist, then they can see tasks assigned to them or groups they belong to and act on these tasks.

    Note:

    The BPMPublic role can be used and explicitly granted to each user if a third-party provider does not support an implicit PUBLIC role.
  • BPMWorkflowReassign—This role enables a user to reassign tasks to any other user in the organization. A manager can always delegate tasks to any users under him in the organization hierarchy without any Reassign privileges. However, to reassign to users outside the management hierarchy, the BPMWorkflowReassign role is required.

  • BPMWorkflowSuspend—This role enables users to suspend a process. If a process is suspended, then the expiration time does not apply. When the process is resumed, the expiration date is recomputed. Users cannot suspend the workflow if the process designer has designated Suspend as a restricted action, even if the user has the BPMWorkflowSuspend role.

  • BPMWorkflowViewHistory—In general, a user can see only the task assignment sequence as part of their worklist. This role enables a user to drill down further into the BPEL business process audit trail from the task approval sequence.

  • BPMWorkflowAdmin—This role enables a user to perform system actions on any workflow in the system. This role does not allow you to change the outcome of the task (such as approve or reject); it only allows you to perform actions such as delegate, escalate, and suspend. Only the task assignee or the task owner can change the outcome of the task.

  • BPMSystemAdmin—Both BPMWorkflowAdmin and BPMSystemAdmin have the same level of workflow privileges.

  • BPMDefaultDomainAdmin—This role provides a user with access to the default domain through Oracle BPEL Control.

    See Also:

    Oracle BPEL Process Manager Administrator's Guide for instructions on configuring the identity service and additional details about the BPMSystemAdmin and BPMDefaultDomainAdmin roles

Some of these roles are nested. The BPMWorkflowReassign, BPMWorkflowSuspend, and BPMWorkflowViewHistory roles are granted to the BPMWorkflowAdmin role. The BPMSystemAdmin role is granted to the seeded bpeladmin user.

The following table represents the relationship between the grantees and roles:

Role\Grantee bpeladmin default guest BPMWorkflowAdmin BPMSystemAdmin
BPMSystemAdmin Directly -- -- -- --
BPMWorkflowAdmin Indirectly through BPMSystemAdmin -- -- -- Directly
BPMWorkflowReassign Indirectly through BPMSystemAdmin -- -- Directly Indirectly through BPMWorkflowAdmin
BPMWorkflowSuspend Indirectly through BPMSystemAdmin -- -- Directly Indirectly through BPMWorkflowAdmin
BPMWorkflowViewHistory Indirectly through BPMSystemAdmin -- -- Directly Indirectly through BPMWorkflowAdmin
BPMDefaultDomainAdmin Indirectly through BPMSystemAdmin Directly -- -- Directly

15.12.5.1 Creating Users and Groups

You use directory-specific tools to create realms, users, or groups. For example:

  • To create users and groups when using OID, you use the Oracle Delegated Administration Services tools. See Oracle Identity Management Guide to Delegated Administration for more information.

  • To create user and group credentials when using the XML-based JAZN provider, you use the JAZN Admintool to modify the jazn-data.xml file. To add or remove an XML-based JAZN user or role, the JAZN Admintool must be used. You can manually edit the users-properties.xml file to specify detailed user properties that JAZN does not support.

    For example, to add a user to a specified realm, issue the following command:

    java -jar jazn.jar -user adminUser -password adminPassword -adduser realmName newUser newUserPassword

    The JAZN Admintool provides different command options. You can list all the options and their syntax with the -help option, as in:

    java -jar jazn.jar -help

  • If you are using a third-party LDAP server or a custom user repository, you must use the specific tools available for that directory.

See Also:

Oracle Containers for J2EE Security Guide for instructions on using the JAZN Admintool

15.12.5.2 Identity Service Providers

Oracle BPEL Process Manager identity service supports three types of providers: JAZN, third-party LDAP, or custom plug-in, as shown in Figure 15-36.

Figure 15-36 Identity Service Providers

Description of bpmdg034.gif follows
Description of the illustration bpmdg034.gif

The identity service providers perform the following operations:

  • Authentication—authenticates users given their username and password

  • Authorization—determines roles and group memberships for a specific user. These roles are then used to control access to various work items and operations on the worklist.

  • Retrieve user properties—includes contact information such as first name, last name, phone, e-mail, preferred notification channel, language preference, time zone, and organization details such as manager name and reportees.

15.12.5.2.1 The JAZN Provider

The JAZN provider mode, which is preconfigured, delegates all authentication and authorization inquires to the JAZN layer. Two JAAS providers are supplied as part of the OC4J security infrastructure: the XML-based file and LDAP-based OID.

  • XML-Based JAZN Provider Type — The XML-based provider type is used for lightweight storage of information in the XML files. All the user names, roles, and permissions are stored in XML files. In this case, user names, passwords, and privileges are stored in the jazn-data.xml file. In addition, Oracle BPEL Process Manager uses a user-properties.xml file that works in conjunction with this file to store detailed user properties such as name, e-mail, phone, and manager.

  • LDAP-Based JAZN Provider Type (Oracle Internet Directory) — The LDAP-based provider type is based on the Lightweight Directory Access Protocol (LDAP) for centralized storage of information in a directory. OID is a standard LDAP-based directory that provides a single, centralized repository for all user data. It allows sites to manage user identities, roles, authorization, and authentication credentials, as well as application-specific preferences and profiles in a single repository.

15.12.5.2.2 Third-Party LDAP Server

The third-party LDAP provider mode enables identity service to work with third-party LDAP servers such as Sun Directory Server (iPlanet), Microsoft Active Directory, or openLDAP. In this mode, identity service assumes that the directory is the central repository of all user data, including authentication credentials, roles, and profiles. The standard organizationalPerson, inetOrgPerson objects from the LDAP schema retrieve these details.

15.12.5.2.3 Custom User Repository Plug-ins

This mode enables you to plug in a non-LDAP-based user repository by registering a custom identity service provider. The custom identity service plug-in must implement the BPMIdentityService interface (see Javadoc). This identityservice class name must be registered in is_config.xml.

See Also:

15.12.5.3 User and Role Properties

The identity service supports the following user properties:

  • Display name

  • Given name, middle name, and last name

  • Description

  • Title

  • E-mail address

  • Telephone number

  • Home phone number

  • Mobile phone number

  • Fax number

  • Pager number

  • Manager ID

  • Owners (applies to groups and roles, but not users)

  • Time zone

  • Language preference (Java locale)

  • Notification preference (preferred notification channel)

The preceding properties are optional for Oracle BPEL Process Manager users. However, some features, such as task notification, are not available if the contact information is not present in the directory or in the users-properties file for the JAZN XML-based provider. Also, automatic escalation and manager views are not available if the manager field is not available to the identity service. If the user is not listed among the owners of the group, they cannot modify the rule defined for the group.

See Also:

The service configuration chapter of Oracle BPEL Process Manager Administrator's Guide for instructions on defining group ownership

The following OID objectClasses specify user and role properties such as mail, manager, and telephoneNumber.

  • top

  • person

    • cn

    • sn

    • description

    • telephoneNumber

  • organizationalPerson

    • title

    • telephoneNumber

    • facsimileTelephoneNumber

  • inetOrgPerson

    • uid

    • displayName

    • givenName

    • manager

    • mail

    • homePhone

    • mobile

    • pager

    • preferredLanguage

  • orclUserV2

    • middleName

    • orclTimeZone

    • orclWorkflowNotificationPref

  • groupOfUniqueNames

    • description

    • owner

    • uniqueMember

  • orclGroup

    • displayName

    • mail

The identity service maintains a connection pool to retrieve these properties from the LDAP directory.

If you are using the XML-based JAZN provider, the same entries are represented as XML elements in the users-properties.xml file in

SOA_Oracle_Home\bpel\system\services\config

15.12.5.4 Multirealm Support

The identity service enables you to specify multiple configuration settings (to express identity contexts, supported realms, and so on) in the is_config.xml file. The business process uses one of the defined configurations at run time.

The configuration must specify the realm name to enable a business process to resolve the context at run time. For the JAZN provider, the realm name must match one of supported JAZN realm names. Otherwise, a run time exception is thrown. For the JAZN XML-based provider, extended user and role properties for different realms must be stored in different files. For the LDAP provider, the realm name can be any unique name, while the context is defined by the LDAP URL, user search base, and role search base nodes in the LDAP server tree. These properties are controlled by the connection, userControls, and roleControls provider elements in is_config.xml.

If the is_config.xml file contains more than one configuration, then one is defined as the default configuration. The default context is used by the BPEL process if no specific context information is found at run time. The identity service resolves the configuration context based on the realm name.

See Also:

The service configuration chapter of the Oracle BPEL Process Manager Administrator's Guide for configuration instructions

15.12.5.5 Authentication, Authorization, and Identity Service Providers

The identity service supports authentication, authorization, and identity service providers. The identity service provider is the default pseudoservice provider. It must be defined for each configuration in the is_config.xml file. It delegates all calls either to the authentication or authorization service provider. By default, all three service providers share the same context setting defined in the identity provider.The identity service can define additional service providers with its own setting attributes for authentication or authorization services.If the provider service attribute is set to Authentication, the setting and the provider context are used only for all authentication calls for the configuration. If the provider service attribute is set to Authorization, the setting and provider context are used only for authorization calls.

See Also:

The multiple service providers section of the service configuration chapter of the Oracle BPEL Process Manager Administrator's Guide for an example of a configuration with two providers:
  • The JAZN XML-based identity service provider is used for all calls, except authentication

  • The custom plug-in provider is used only for authentication calls

15.12.6 Notification Service

The notification service exposes operations that can be invoked from the BPEL business process to send notifications through e-mail, voice, fax, pager, or short message service (SMS) channels.

See Also:

15.12.7 Task Metadata Service

Task metadata service exposes operations to retrieve metadata information related to a task. Table 15-19 describes these methods. Package oracle.bpel.services.workflow.metadata corresponds to the task metadata service.

Table 15-19 Task Metadata Service Methods

Method Description
getOutcomes Get the permitted outcomes of a task. The outcomes are returned with their display values.
getResourceBundleInfo Get the resource bundle information of the task. The resource bundle information contains the location and the name of the bundle.
getRestrictedActions Get the actions that are restricted for a particular task.
getTaskAttributes Get the task message attributes.
getTaskAttributesForTaskDefinition Get the message attributes for a particular task definition.
getTaskDefinition Get the task definition associated with the task.
getTaskDefinitionById Get the task definition by the task definition ID.
getTaskDefinitionOutcome Get the outcomes given the task definition ID.
getTaskDisplay Get the task display for a task.
getTaskDisplayRegion Get the task display region for a task.
getVersionTrackedAttrs Get the task attributes that when changed causes a task version creation.
listTaskMetadata List the task definitions in the system.

See Also:

Oracle BPEL Process Manager Workflow Services API Reference located in the SOA_Oracle_Home\bpel\docs\workflow directory

15.12.8 User Metadata Service

The user metadata service provides methods for managing metadata specific to individual users and groups. It is used for getting and setting user worklist preferences, managing user custom views, and managing workflow rules for users and groups.

For most methods in the user metadata service, the authenticated user can query and update their own user metadata. However, they cannot update metadata belonging to other users.

In the case of group metadata (for example, workflow rules for groups), only a user designated as an owner of a group (or a BPMWorkflowAdmin user) can query and update the metadata for that group. However, a user that has been granted the BPMWorkflowAdmin role can query and update metadata for any user or group.

Table 15-20 describes the methods in the user metadata service. Package oracle.bpel.services.workflow.user corresponds to the user metadata service.

Table 15-20 User Metadata Service Methods

Method Description
setVacationInfo Sets a date range over which the user is unavailable for the assignment of tasks. (Dynamic assignment functions do not assign tasks to a user that is on vacation.)
getVacationInfo Retrieves the date range (if any) during which a user is unavailable for the assignment of tasks.
getRuleList Retrieves a list of rules for a particular user or group.
getRuleDetail Gets the details for a particular workflow rule.
createRule Creates a new rule.
updateRule Updates an existing rule.
deleteRule Deletes a rule.
increaseRulePriority Increases the priority of a rule by one. Rules for a user or group are maintained in an ordered list of priority. Higher priority rules (those closer to the head of the list) are executed before rules with lower priority. This method does nothing if this rule already has the highest priority.
decreaseRulePriority Decreases the priority of a rule by one. This method does nothing if this rule already has the lowest priority.
getRuleSetInfo Returns information relating to the Oracle Business Rules rule set being used to store the rules for a particular user or group. This is useful if a client wants to make use of the rules SDK directly for manipulating rules, rather than using the user metadata service.
getUserTaskViewList Gets a list of the user task views that the user owns.
getGrantedTaskViewList Gets a list of user task views that have been granted to the user by other users. Users can use granted views for querying lists of tasks, but they cannot update the view definition.
getStandardTaskViewList Gets a list of standard task views that ship with the workflow service, and are available to all users.
getUserInboxView Gets a special view to store configuration information, allowing users to personalize their main inbox list of tasks.
getUserTaskViewDetails Gets the details for a single view.
createUserTaskView Creates a new user task view.
updateUserTaskView Updates an existing user task view.
deleteUserTaskView Deletes a user task view.
updateGrantedTaskView Updates details of a view grant made to this user by another user. Updates are limited to hiding or unhiding the view grant (hiding a view means that the view is not listed in the main inbox page of the worklist application), and changing the name and description that the granted user sees for the view.
getUserPreferences Gets a list of user preferences for the user. User preferences are simple name-value pairs of strings. User preferences are private to each user (but can still be queried and updated by BPMWorkflowAdmin).
setUserPreferences Sets the user preference values for the user. Any preferences that were previously stored and are not in the new list of user preferences are deleted.
getPublicPreferences Gets a list of public preferences for the user. Public preferences are similar to user preferences, except any user can query them. However, only the user that owns the preferences, or the BPMWorkflowAdmin, can update them. Public preferences are useful for storing application wide preferences (preferences can be stored under a dummy user name, such as MyAppPrefs).
setPublicPreferences Sets the public preferences for the user.

See Also:

15.12.9 Runtime Config Service

The runtime config service provides methods for managing metadata used in the task service run time environment. It principally supports management of task payload flex field mappings.

The task object used by the task service contains a number of flex field attributes, which can be populated with information from the task payload. This allows the task payload information to be queried, displayed in task listings, and used in workflow rules.

The runtime config service allows administrators to create mappings between simple task payload attributes and these flex field attributes.

Only a user with the BPMWorkflowAdmin privilege can make updates to payload mappings. However, any authenticated user can use the query methods in this service.

An administrator can create attribute labels for the various flex field attributes. These attribute labels provide a meaningful label for the attribute (for example, a label Location may be created for the flex field attribute TextAttribute1). A given flex field attribute may have multiple labels associated with it. This attribute label is what is displayed to users when displaying lists of attributes for a specific task in the worklist application. The attribute labels for a specific task type can be determined by calling the getTaskAttributesForTaskDefinition method on the task metadata service.

When defining attribute labels, the following fields are automatically populated by the service. You do not need to specify values for these attributes when creating or updating attribute labels:

  • Id

  • CreatedDate

  • WorkflowType

  • Active

Valid values for the task attribute field are as follows:

  • TextAttribute1 through TextAttribute10

  • FormAttribute1 through FormAttribute5

  • UrlAttribute1 through UrlAttribute5

  • DateAttribute1 through DateAttribute5

  • NumberAttribute1 through NumberAttribute5

Mappings can then be created between task payload fields and the attribute labels. For example, the payload field customerLocation can be mapped to the attribute label Location. Different task types can share the same attribute label. This allows payload attributes from different task types that have the same semantic meaning to be mapped to the same attribute label.

Note:

Only payload fields that are simple XML types can be mapped.

The runtime config service also provides methods for querying the dynamic assignment functions supported by the server.

Table 15-21 describes the methods in the runtime config service. Package oracle.bpel.services.workflow.runtimeconfig corresponds to the runtime config service.

Table 15-21 Runtime Config Service

Method Description
GetWorkflowPayloadMappings Gets a list of all the flex field mappings for a particular workflow task definition.
CreateAttributeLabel Creates a new attribute label for a particular task flex field attribute.
updateAttributeLabel Updates an existing attribute label.
DeleteAttributeLabel Deletes an existing attribute label.
getAttributeLabelUsages Gets a list of attribute labels (either all attribute labels, or labels for a specific type of attribute) for which mapping (if any) the labels are currently used.
createPayloadMapping Creates a new mapping between an attribute label and a task payload field.
deletePayloadMapping Deletes an existing payload mapping.
getUserDynamicAssignmentFunctions Returns a list of the dynamic assignment functions that can select a user that are implemented on this server.
getGroupDynamicAssignmentFunctions Returns a list of the dynamic assignment functions that can select a group that are implemented on this server.

See Also:

15.12.9.1 Internationalization of Attribute Labels

Attribute labels provide a method of attaching a meaningful label to a task flex field attribute. It can be desirable to present attribute labels that are translated into the appropriate language for the locale of the user.

To achieve this, you can add entries to the WorkflowLabels.properties resource property file, and associated resource bundles in other languages. This file exists in the SOA_Oracle_Home\bpel\system\services\config\wfresource directory.

Entries for flex field attribute labels must be of the form:

FLEX_LABEL.[label name]=Label Display Name

For instance, the entry for a label named Location is:

FLEX_LABEL.Location=Location

Note that adding entries to these files for attribute labels is optional. If no entry is present in the file, the name of the attribute label as specified using the API is used instead.

15.13 Configuring the Assignment Service

This section describes how to configure the assignment service.

This section contains the following topics:

15.13.1 Dynamic Assignment Functions

Dynamic assignment functions select a particular user or group from either a group, or from a list of users or groups.

The selection is made according to criteria specific to the particular dynamic assignment function. The three dynamic assignment functions shown in Table 15-22 are included with Oracle BPEL Process Manager:

Table 15-22 Dynamic Assignment Functions

Function Description
ROUND_ROBIN Picks each user or group in turn.
least-busy Picks the user or group with the least number of tasks currently assigned to it.
most-productive Picks the user or group that has completed the most tasks over a certain time period (by default, the last seven days).

These functions all check a user's vacation status. A user that is currently unavailable is not automatically assigned tasks.

These dynamic assignment functions can be called using the custom XPath functions in a BPEL process or task definition.

  • wfDynamicUserAssign

  • wfDynamicGroupAssign

These XPath functions must be called with at least two, and optionally more parameters:

  • The name of the dynamic assignment function being called.

  • The name of the group on which to execute the function (or a list of users or groups).(Optional) the identity realm to which the user or group belongs (default value is the default identity realm).

  • Additional optional parameters specific to the dynamic assignment function. In the case of the most-productive assignment function, this is the length of time (in days) to calculate a user's productivity. The two other functions do not use additional parameters.

In addition, workflow rules created for a group can use dynamic assignment functions to select a member of that group for reassignment of a task.

In addition to the three functions, a dynamic assignment framework is provided that allows you to implement and configure your own dynamic assignment functions.

15.13.1.1 Implementing a Dynamic Assignment Function

To implement your own dynamic assignment function, write a Java class that implements one or both of the following interfaces:

oracle.bpel.services.workflow.assignment.dynamic. IDynamicUserAssignmentFunction
oracle.bpel.services.workflow.assignment.dynamic. IDynamicGroupAssignmentFunction

If your dynamic assignment function selects users, implement the first interface. If it selects groups, implement the second interface. If it allows the selection of both users and groups, implement both interfaces.

The two interfaces above both extend the interface oracle.bpel.services.workflow.assignment.dynamic.IDynamicAssignmentFunction.

Your Java class should also implement the methods in that interface.

These interfaces as shown below:

public interface IDynamicAssignmentFunction 
{
  /**
   * Sets the initialization parameters required by the function (if any)
   * This function is called automatically by the DynamicAssignmentRegistry
   * on registration of a new function. Initialization parameters can be
   * specified in the xml definition of the function in the dynamic assign
   * config file
   * @param initParams Map of String parameter values keyed by String parameter
   * names
   * @throws DynamicAssignmentException if implementation of method finds invalid 
   * parameters
   */
  public void setInitParams( Map initParams ) throws DynamicAssignmentException;
  
   
   /**
   * Gets the name of this Dynamic Assignment Function 
   * @return String the name of the Dynamic Assignment Function 
   */
   public String getFunctionName();
   
 
  /**
   * Gets a description of this Dynamic Assignment Function
   * @return  String description of function
   */
   public String getDescription();
}
public interface IDynamicGroupAssignmentFunction extends
 IDynamicAssignmentFunction
{
  /**
    * This method contains the implementation of the Assignment Function
    * Given a group name, it will return a subgroup in that group, 
    * according to the assignment pattern implemented
    * @return String name of group 
    * @param groupName String name of group to select group from 
    * @param realm String name of Identity Service realm the group belongs
    * to. If realm is null, the default Identity Service realm will be used.
    * @param parameters String[] optional array of parameter values.
    * Use of parameter values is implementation-specific.
    */
    public String getGroupAssignment( String groupName, String realm, String[]
 parameters )
      throws DynamicAssignmentException;
  /**
    * This method contains the implementation of the Assignment Function
    * Given an arbitrary list of groups, it will return a group in that 
    * list, according to the assignment pattern implemented
    * @return String name of group 
    * @param groupNames List of groups to select from 
    * @param realm String name of Identity Service realm the groups belong
    * to. If realm is null, the default Identity Service realm will be used.
    * @param parameters String[] optional array of parameter values.
    * Use of parameter values is implementation-specific.
    */
    public String getGroupAssignment( List groupNames, String realm, String[]
 parameters )
      throws DynamicAssignmentException;
}
public interface IDynamicUserAssignmentFunction extends IDynamicAssignmentFunction
{
  /**
    * This method contains the implementation of the Assignment Function
    * Given a group name, it will return a user in that group, 
    * according to the assignment pattern implemented
    * @return String username of user 
    * @param groupName String name of group to select user from
    * @param realm String name of Identity Service realm the group belongs
    * to. If realm is null, the default Identity Service realm will be used.
    * @param parameters String[] optional array of parameter values.
    * Use of parameter values is implementation-specific.
    */
    public String getUserAssignment( String groupName, String realm, String[]
 parameters )
      throws DynamicAssignmentException;
   /**
    * This method contains the implementation of the Assignment Function
    * Given an arbitrary list of users, it will return a user in that 
    * list, according to the assignment pattern implemented
    * @return String username of user 
    * @param usernames List of usernames to select user from 
    * @param realm String name of Identity Service realm the users belong
    * to. If realm is null, the default Identity Service realm will be used.
    * @param parameters String[] optional array of parameter values.
    * Use of parameter values is implementation-specific.
    */
    public String getUserAssignment( List usernames, String realm, String[]
 parameters )
      throws DynamicAssignmentException;
}

The dynamic assignment framework also provides the utility class oracle.bpel.services.workflow.assignment.dynamic.DynamicAssignmentUtils.

This class provides a number of methods that are useful when implementing dynamic assignment functions.

These include:

/**
   * Method returns a list of users belonging to the specified group
   * that are available (i.e. not on vacation etc.)
   * @return List of String usernames of available users
   * @param  group - name of group to lookup users for
   * @throws DynamicAssignmentException if error encountered looking up 
   * group, or checking users.
   */
  public static List getAvailableUsersFromGroup( String group, String realm )
    throws DynamicAssignmentException
    /**
   * Method returns a list of users from the specified list
   * that are available (i.e. not on vacation etc.)
   * @return List of String usernames of available users
   * @param usernames - List of String usernames to check
   * @param realm - realm that users belong to
   * @throws DynamicAssignmentException if error encountered looking up 
   * group, or checking users.
   */
  public static List getAvailableUsersFromList( List usernames, String realm )
    throws DynamicAssignmentException
  /**
  * Method uses the specified group name to lookup the sub-groups belonging to
  * that group using the identity service. 
  * @return List of String names of groups
  * @param groupName name of group to lookup
  * @param realm to lookup group in - if null, then use identity service default
  * @realm
  * @batam boolean - directsOnly: if true return only the direct sub-groups
  * of this group. If false, return all groups belonging to this group.
  * @throws DynamicAssignmentException if group could not be found
  */
  public static List getGroupsFromGroup( String groupName
                                       , String realm
                                       , boolean directsOnly )
    throws DynamicAssignmentException
  /**
  * Method uses the specified group name to lookup the users belonging to that
  * group using the identity service. 
  * @return List of String usernames of user
  * @param groupName String name of group to lookup
  * @param realm to lookup group in - if null, then use identity service default
  * @realm
  * @throws DynamicAssignmentException if group could not be found
  */
  public static  List getUsersFromGroup( String groupName, String realm ) 
    throws DynamicAssignmentException
  /**
   *Method returns the default identity management realm for the Identity Service
   *Instance.
   */
  public static String getIDServiceDefaultRealm( ) throws
 DynamicAssignmentException
  
  /**
  * Method checks WF Schema to determine if the specified user is available 
  * (i.e. they are not on vacation etc.).
  * @return true if user is available, false if they are on vacation
  * @param username
  * @param realm
  */
  public static boolean isUserAvailable( String username, String realm )
    throws DynamicAssignmentException

15.13.1.2 Configuring Dynamic Assignment Functions

Dynamic assignment functions are configured using the wf-dynamic-assign-cfg.xml file in the SOA_Oracle_Home\bpel\system\services\config directory.

Each dynamic assignment function must have an entry in this file, in the form of a <function> tag.

The function tag must contain two attributes:

  • name — the name of the function.

  • classpath — the classpath of the class that implements the function.

In addition, the function tag can optionally contain any number of <property> tags. These tags pass initialization parameters to the dynamic assignment function. Each property tag must contain a name attribute. The value of the property is specified in the body of the tag.

The property values specified in these tags are passed as a map (indexed by the value of the name attributes) to the setInitParameters method of the dynamic assignment functions.

Two of the functions have initialization parameters. These are:

  • ROUND_ROBIN — The parameter MAX_MAP_SIZE specifies the maximum number of sets of users or groups for which the function can maintain ROUND_ROBIN counts. The dynamic assignment function holds a list of users and groups in memory for each group (or list of users and groups) on which it is asked to execute the ROUND_ROBIN function.

  • most-productive — The parameter DEAFULT_TIME_PERIOD specified the length of time (in days) over which to calculate the user's productivity. This value can be overridden when calling the most-productive dynamic assignment function. Use an XPath function by specifying an alternative value as the third parameter in the XPath function call.

15.13.1.3 Configuring Display Names for Dynamic Assignment Functions

The runtime config service provides methods for returning a list of available user and group dynamic assignment functions. These functions return both the name of the function, and a user-displayable label for the function. The functions support localization of the display name, so that it displays in the appropriate language for the context user. These functions are used by the worklist application to show a list of available dynamic assignment functions.

To specify display names (and appropriate translations) for your dynamic assignment functions, add entries to the resource property file WorkflowLabels.properties, and associated resource property files in other languages. This file exists in the SOA_Oracle_Home\bpel\system\services\config\wfresource directory.

Entries for dynamic assignment functions must be of the form:

DYN_ASSIGN_FN.[function name]=Function Display Name

For instance, the entry for the ROUND_ROBIN function is:

DYN_ASSIGN_FN.ROUND_ROBIN = Round Robin

Note that adding entries to these files for dynamic assignment functions is optional. If no entry is present in the file, then the name of the function (for example, ROUND_ROBIN') is used instead.

15.13.2 Dynamically Assigning Task Participants with the Assignment Service

Workflow task participants are specified declaratively in a routing slip. The routing slip guides the workflow by specifying the participants and how they participate in the workflow task (for example, management chain hierarchy, sequential list of approvers, and so on).

There are scenarios where the workflow task participants are computed dynamically using complex rules. To support such dynamic assignment, an assignment service is used. The assignment service is responsible for determining the task assignees. You can also implement your own assignment service and plug in that implementation for use with a particular workflow.

This section contains the following topics:

15.13.2.1 Assignment Service Overview

The assignment service determines the following task assignment details in a workflow:

  • The assignment when the task is initiated

  • The assignment when the task is reinitiated

  • The assignment when a user updates the task outcome. When the task outcome is updated, the task can either be routed to other users or completed.

  • The assignees from whom information for the task can be requested

  • If the task supports reapproval from the Oracle BPEL Worklist Application, a user can request information for reapproval.

  • The users who reapprove the task if reapproval is supported.

The workflow service identifies and invokes the assignment service for a particular task to determine the task assignment.

For example, a simple assignment service iteration is as follows:

  1. A client initiates an expense approval task whose routing is determined by the assignment service.

  2. The assignment service determines that the task assignee is jcooper.

  3. When jcooper approves the task, the assignment service assigns the task to jstein. The assignment service also specifies that a notification must be sent to the creator of the task, jlondon.

  4. jstein approves the task and the assignment service indicates that there are no more users to which to assign the task.

15.13.2.2 Implementing an Assignment Service

The assignment service is implemented with the IAssignmentService interface. The workflow service passes the following information to the assignment service to determine the task assignment:

  • Task document — The task document that is executed by the workflow. The task document contains the payload and other task information like current state, and so on.

  • Map of properties — When an assignment service is specified, a list of properties can also be specified to correlate callbacks with backend services that determine the task assignees.

  • Task history — The task history is a list of chronologically ordered task documents to trace the history of the task. The task documents in this list contain a subset of attributes in the actual task (such as state, updatedBy, outcome, updatedDate, and so on).

15.13.2.3 Example of Assignment Service Implementation

Notes:

  • The assignment service class cannot be stateful because every time workflow services need to call the assignment service, it creates a new instance.

  • The getAssigneesToRequestForInformation method can be called multiple times because one of the criteria to show the request-for-information action is that there are users to request information. Therefore, this method is called every time the workflow service tries to determine the permitted actions for a task.

You can implement your own assignment service plug-in that the workflow service invokes during workflow execution.

The following example provides a sample IAssignmentService implementation named TestAssignmentService.java.

/* $Header: TestAssignmentService.java 24-may-2006.18:26:16 rarangas Exp $ */
/* Copyright (c) 2004, 2006, Oracle. All rights reserved.  */
/*
   DESCRIPTION
    Interface IAssignmentService defines the callbacks an assignment 
    service will implement. The implementation of the IAssignmentService 
    will be called by the workflow service
   PRIVATE CLASSES
    <list of private classes defined - with one-line descriptions>
   NOTES
    <other useful comments, qualifications, etc.>
   MODIFIED    (MM/DD/YY)
      rarangas  01/30/06 - 
 */
/**
 *  @version $Header: IAssignmentService.java 29-jun-2004.21:10:35 rarangas Exp
 $
 *  @author  rarangas
 *  @since   release specific (what release of product did this appear in)
 */
package oracle.bpel.services.workflow.test.workflow;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import oracle.bpel.services.workflow.metadata.routingslip.model.*; 
import oracle.bpel.services.workflow.metadata.routingslip.model.Participants;
import oracle.bpel.services.workflow.metadata.routingslip.model.ParticipantsType.*;
import oracle.bpel.services.workflow.task.IAssignmentService;
import oracle.bpel.services.workflow.task.ITaskAssignee;
import oracle.bpel.services.workflow.task.model.Task;
public class TestAssignmentService implements
 oracle.bpel.services.workflow.task.IAssignmentService {
    static int numberOfApprovals = 0;
    static String[] users = new String[]{"jstein", "wfaulk", "cdickens"};
    public Participants onInitiation(Task task, 
                                     Map propertyBag) {
        return createParticipant();
    }
    public Participants onReinitiation(Task task, 
                                       Map propertyBag) {
        return null;
    }
    public Participants onOutcomeUpdated(Task task, 
                                         Map propertyBag,
                                         String updatedBy,
                                         String outcome) {
        return createParticipant();
    }
    public Participants onAssignmentSkipped(Task task, 
                                            Map propertyBag) {
        return null;
    }
    public List getAssigneesToRequestForInformation(Task task, 
                                                    Map propertyBag) {
        List rfiUsers = new ArrayList();
        rfiUsers.add("jcooper");
        rfiUsers.add("jstein");
        rfiUsers.add("wfaulk");
        rfiUsers.add("cdickens");
        return rfiUsers;
    }
    public List getReapprovalAssignees(Task task, 
                                       Map propertyBag,
                                       ITaskAssignee infoRequestedAssignee) {
        List reapprovalUsers = new ArrayList();
        reapprovalUsers.add("jstein");
        reapprovalUsers.add("wfaulk");
        reapprovalUsers.add("cdickens");
        return reapprovalUsers;
    }
    private Participants createParticipant() {
        if (numberOfApprovals > 2) {
            numberOfApprovals = 0;
            return null;
        }
        String user = users[numberOfApprovals++];

        ObjectFactory objFactory = new ObjectFactory();
        Participants participants = objFactory.createParticipants();
        Participant participant = objFactory.createParticipantsTypeParticipant();
        participant.setName("Loan Agent");
        ResourceType resource2 = objFactory.createResourceType(user);
        resource2.setIsGroup(false);
        resource2.setType("STATIC");
        participant.getResource().add(resource2);

        participants.getParticipantOrSequentialParticipantOrAdhoc().
          add(participant);
        return participants;
    }

}

15.13.2.4 Deploying a Custom Assignment Service

You must use one of the following methods to make an assignment service implementation class and its related classes available in the class path of Oracle BPEL Process Manager:

  • Load your classes in the SOA_Oracle_Home\bpel\system\classes directory and unzip your JAR files in the same directory.

  • Change the Oracle BPEL Process Manager shared library to include your JAR files.

Note:

  • You cannot create different versions of the assignment service for use in different BPEL processes unless you change package names or class names.

  • Java classes and JAR files in the suitcase are not available in the class path and therefore cannot be used as a deployment model for the assignment service.

  • The steps must be repeated for each node in a cluster.

15.13.3 Custom Escalation Function

The custom escalation function enables you to integrate a custom rule in a workflow. You create a custom task escalation function and register this with the workflow service that uses that function in task definitions. The Advanced Settings section of the Human Task editor enables you to integrate the rule in a human task.

See Also:

"Specifying Escalation Rules" for details

15.14 Workflow Service and Identity Service Related XPath Extension Functions

Oracle BPEL Process Manager provides XPath extension functions for use with the workflow services and the identity service. XPath extension functions mimic XPath 2.0 standards. Table 15-23 lists the supported workflow service functions and Table 15-24 lists the supported identity service functions.

Table 15-23 Workflow Service Functions

Function Description See
hwf:clearTaskAssignees() Clears the task assignees in a task. "clearTaskAssignees"
hwf:createWordMLDocument() Creates a Word document by transforming the given XSLT to WordML "createWordMLDocument"
hwf:getNotificationProperty() Gets properties for a particular notification. "Contents of Notification"

"getNotificationProperty"


hwf:getNumberOfTaskApprovals() Gets the number of task approvals. "getNumberOfTaskApprovals"
hwf:getPreviousTaskApprover() Gets the previous task approver. "getPreviousTaskApprover"
hwf:getTaskAttachmentByIndex() Gets the task attachment by attachment index. "getTaskAttachmentByIndex"
hwf:getTaskAttachmentByName() Gets the task attachment by attachment name. "getTaskAttachmentByName"
hwf:getTaskAttachmentContents() Gets the task attachment contents by attachment name. "getTaskAttachmentContents"
hwf:getTaskAttachmentsCount() Gets the number of task attachments. "getTaskAttachmentsCount"
hwf:getTaskAttachmentByIndex() Gets the resource string for a particular task "getTaskAttachmentByIndex"
hwf:wfDynamicGroupAssign() Gets the name of an identity service group, selected according to the specified assignment pattern. "wfDynamicGroupAssign"
hwf:wfDynamicUserAssign() Gets the name of an identity service user, selected according to the specified assignment pattern. "wfDynamicUserAssign"

Table 15-24 Identity Service Functions

Function Description See
ids:getDefaultRealmName() Gets the default realm name. "getDefaultRealmName"
ids:getGroupProperty() Gets a group property. "getGroupProperty"
ids:getManager() Gets the manager of a given user. "getManager"
ids:getReportees() Gets the direct reportees of the user. "getReportees"
ids:getSupportedRealmNames() Gets the supported realm names. "getSupportedRealmNames"
ids:getUserProperty() Gets a user property. "getUserProperty"
ids:getUserRoles() Gets the user roles. "getUserRoles"
ids:getUsersInGroup() Gets the users in a group. "getUsersInGroup"
ids:isUserInRole() Verifies if a user has a given role. "isUserInRole"
ids:lookupGroup() Gets the group object. "lookupGroup"
ids:lookupUser() Gets the user object. "lookupUser"

15.14.1 Deprecated Workflow Service and Identity Service Functions

Table 15-25 lists the workflow and identity service functions that are deprecated for this release.

Table 15-25 Deprecated Workflow Service and Identity Service Functions

Workflow Function Identity Service Functions
ora:getNumberOfTaskApprovals() ora:getGroupProperty()
ora:getPreviousTaskApprover() ora:getManager()
ora:getTaskAttachmentByIndex() ora:getReportees()
ora:getTaskAttachmentByName() ora:getUserRoles()
ora:getTaskAttachmentContents() ora:getUsersInGroup()
ora:getTaskAttachmentCount() ora:isUserInRole()

ora:lookupGroup()

ora:lookupUser()

ora:getUserProperty()

15.15 NLS Configuration

You can specify resource bundles for displaying task details in different languages in Oracle BPEL Worklist Application.

In addition, the resource property file WorkflowLabels.properties can be used for setting display names for the following:

See Also:

15.16 Summary

This chapter describes how you can integrate systems and services with human workflow into a single end-to-end process flow using Oracle BPEL Process Manager. The predefined workflow participant types are described, as are the components of workflow services—the task service, task routing service, identity service, worklist service, notification service, and others.