Introduction to Design and Runtime Concepts

26-8 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite ■ Reminders: The task can be reminded multiple times based on the time after the assignment or the time before the expiration. ■ Escalation: The task is escalated up the management hierarchy. ■ Expiration: The task has expired. ■ Renewal: The task is automatically renewed. For more information, see Section 27.3.9, How to Escalate, Renew, or End the Task.

26.2.1.5 Notifications

You can configure your human task to use notifications. Notifications enable you to alert interested users to changes in the state of a task during the task lifecycle. For example, a notification is sent to an assignee when a task has been approved or withdrawn. You can specify for notifications to be sent to different types of participants for different actions. For example, you can specify the following: ■ For the owner of a task to receive a notification message when a task is in error for example, been sent to a nonexistent user. ■ For a task assignee to receive a notification message when a task has been escalated. You can specify the contents of the notification message and the notification channel to use for sending the message. ■ Email You can configure email notification messages to be actionable, meaning that a task assignee can act upon a task from within the email. ■ Voice message ■ Instant messaging IM ■ Short message service SMS For example, you may send the message shown in Example 26–1 by email when a task assignee requests additional information before they can act upon a task: Example 26–1 Email Message For me to approve this task, more information is required to justify the need for this business trip During runtime, you can mark a message senders address as spam and also display a list of bad or invalid addresses. These addresses are automatically removed from the bad address list. For more information about notifications, see the following: ■ Chapter 16, Using the Notification Service ■ Section 27.3.10, How to Specify Participant Notification Preferences Getting Started with Human Workflow 26-9 ■ Part XI, Using Oracle User Messaging Service

26.2.1.6 Task Forms

Task forms provide you with a way to interact with a task. Oracle BPM Worklist displays all worklist tasks that are assigned to task assignees in the task form. When you drill down into a specific task, the task form displays the contents of the task to the users worklist. For example, an expense approval task may show a form with line items for various expenses, and a help desk task form may show details such as severity, problem location, and so on. The integrated development environment of Oracle SOA Suite includes Oracle Application Development Framework Oracle ADF for this purpose. With Oracle ADF, you can design a task form that depicts the human task in the SOA composite application. ADF-based task forms can be automatically generated. Advanced users can design their own task forms by using ADF data controls to lay out the content on the page and connect to the workflow service engine at execution time to retrieve task content and act on tasks. You can create task forms in JSF, .NET, or any other client technologies using the APIs. Integration with Microsoft Excel for initiating and acting on tasks is also provided. For more information, see the following: ■ Chapter 28, Designing Task Forms for Human Tasks. ■ Chapter 29, Using Oracle BPM Worklist

26.2.1.7 Advanced Concepts

This section describes advanced human workflow concepts.

26.2.1.7.1 Rule-based Routing You can use Oracle Business Rules to dynamically alter

the routing flow. If used, each time a participant completes their step, the associated rules are invoked and the routing flow can be overridden from the rules. For more information, see Section 27.3.7.2, Specifying Advanced Task Routing Using Business Rules.

26.2.1.7.2 Rule-based Participant Assignment You can use Oracle Business Rules to

dynamically build a list of users, groups, and roles to associate with a participant. For more information, see Section 27.3.6, How to Assign Task Participants.

26.2.1.7.3 Stages A stage is a way of organizing the approval process for blocks of

participant types. You can have one or more stages in sequence or in parallel. Within each stage, you can have one or more participant type blocks in sequence or in parallel. For more information, see Section 27.3.6, How to Assign Task Participants.

26.2.1.7.4 Access Rules You can specify access rules that determine the parts of a task

that assignees can view and update. For example, you can configure the task payload data to be read by assignees. This action enables only assignees and nobody else to have read permissions. No one, including assignees, has write permissions. For more information, see Section 27.3.11.1, Specifying Access Policies on Task Content. 26-10 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite

26.2.1.7.5 Callbacks While human workflow supports detailed behavior that can be

declaratively specified, in some advanced situations, more extensible behavior may be required. Task callbacks enable such extensibility; these callbacks can either be handled in the invoking BPEL process or a Java class. For more information, see Section 27.3.14.1, Specifying Callback Classes on Task Status.

26.2.1.8 Reports and Audit Trails

Oracle BPM Worklist provides several out-of-the-box reports for task analysis: ■ Unattended tasks Analysis of tasks assigned to users groups or reportees groups that have not yet been acquired. ■ Tasks priority Analysis of tasks assigned to a user, reportees, or their groups, based on priority. ■ Tasks cycle time Analysis of the time taken to complete tasks from assignment to completion based on users groups or reportees groups. ■ Tasks productivity Analysis of assigned tasks and completed tasks in a given time period for a user, reportees, or their groups. ■ Tasks time distribution The time an assignee takes to perform a task. You can view an audit trail of actions performed by the participants in the task and a snapshot of the task payload and attachments at various points in the workflow. The short history for a task lists all versions created by the following tasks: ■ Initiate task ■ Reinitiate task ■ Update outcome of task ■ Completion of task ■ Erring of task ■ Expiration of task ■ Withdrawal of task ■ Alerting of task to the error assignee For more information, see Chapter 29, Using Oracle BPM Worklist.

26.2.2 Introduction to the Stages of Human Workflow Design

Human workflow modeling consists of three stages of modeling, as described in Table 26–1 . Getting Started with Human Workflow 26-11

26.3 Introduction to Human Workflow Features

This section provides an introduction to use cases for human workflow. After that, a tutorial guides you through the design of a human task from start to finish.

26.3.1 Human Workflow Use Cases

The following sections describe multiple use cases for workflow services.

26.3.1.1 Task Assignment 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 identity store. This scenario is shown in Figure 26–3 . Figure 26–3 Assigning Tasks to a User or Role from a Directory

26.3.1.2 Use of 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 is shown in Figure 26–4 . Table 26–1 Stages of Human Workflow Modeling Step Description For More Information... 1 You create and define contents of the human task in the Human Task Editor, including defining a participant type, routing policy, escalation and expiration policy, notification, and so on. Section 27.2.1, Create a Human Task Definition. 2 You associate the human task definition with a BPEL process. The BPEL process integrates a series of activities including the human task activity and services into an end-to-end process flow. Section 27.2.2, Associate the Human Task Definition with a BPEL Process. 3 You create a task form. This form displays the task details on which you act at runtime in Oracle BPM Worklist. Section 27.2.3, Generate the Task Form. Assign Task Task Complete Workflow Services BPEL Process OID LDAP 26-12 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite Figure 26–4 Flow Patterns and Routing Policies You can use these types as building blocks to create complex workflows.

26.3.1.3 Escalation, Expiration, and Delegation

A high-priority task can be assigned to a certain user or role based on the task type through use of custom escalation functions. 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 email, telephone voice message, or SMS. 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 26–5 . For example, consider a support call, which is part of a help desk service request process. A high-priority task may be assigned to a certain user, and if the user does not respond in two days, the task is routed to the manager for further action. Figure 26–5 Escalation and Notification

26.3.1.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 BPM Worklist 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 direct 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 Change Routing Get Approvals All Approvals Complete BPEL Process Various Routing Patterns Workflow Service Notify Manager Escalate Task Workflow Services 1 2 3 4 5 6 8 7 9 10 11 12 13 15 14 16 17 18 19 20 22 21 23 24 25 26 27 29 28 30 Calendar Task Resolved BPEL Process Notification Getting Started with Human Workflow 26-13 assign tasks to the individual with the lowest number of outstanding tasks the least busy.

26.3.1.5 Dynamic Assignment of Users Based on Task Content

An employee named James in the human resources department requests new hardware that costs 5000. The company may have a policy that all hardware expenses greater than 3000 must go through manager and vice president approval, and then review by the director of IT. In this scenario, the workflow can be configured to automatically determine the manager of James, the vice president of the human resources department, and the director of IT. The purchase order is routed through these three individuals for approval before the hardware is purchased.

26.3.2 Designing a Human Task from Start to Finish

This section guides you through design of your first human task. This sample describes how an employee submits a vacation request that is automatically routed to their manager for approval. Once the manager responds approved or rejected, a notification is sent to the employee. This sample illustrates creation of a SOA composite application with two components: ■ A BPEL process ■ A human task, for approving a vacation request submitted by an employee This example highlights the use of the following: ■ Using the SOA Composite Editor and Human Task Editor ■ Modeling a single approval workflow using Oracle BPEL Designer ■ Creating an Oracle ADF-based Oracle BPM Worklist ■ Using Oracle BPM Worklist to view and respond to the task

26.3.2.1 Prerequisites

This tutorial makes the following assumptions: ■ Oracle SOA Suite is installed on a host on which the SOA Infrastructure is configured. ■ You are familiar with basic BPEL constructs, including BPEL activities and partner links, and basic XPath functions. Familiarity with the SOA Composite Editor and Oracle BPEL Designer, the environment for designing and deploying BPEL processes, is also assumed. 1. Create a file named VacationRequest.xsd with the following syntax. This file includes the schema for the vacation request and subsequent response. schema attributeFormDefault=qualified elementFormDefault=qualified targetNamespace=http:xmlns.oracle.comVacationRequest xmlns=http:www.w3.org2001XMLSchema element name=VacationRequestProcessRequest complexType sequence element name=creator type=string element name=fromDate type=date element name=toDate type=date element name=reason type=string sequence complexType 26-14 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite element element name=VacationRequestProcessResponse complexType sequence element name=result type=string sequence complexType element schema

26.3.2.2 How to Create the Vacation Request Process

In this tutorial, you create a new application and SOA project and design the human task to send a vacation request to a manager for approval or rejection. You also create a second application and project in which you create an Oracle ADF-based task form from which to act upon the vacation request.

26.3.2.2.1 Creating an Application and a Project with a BPEL Process

To create an application and a project with a BPEL process: 1. Start Oracle JDeveloper.

2. From the File main menu, select New Applications SOA Application.

3. Click OK.

4. In the Application Name field, enter VacationRequest, and click Next.

5. In the Project Name field, enter VacationRequest, and click Next.

6. In the Composite Template list, select Composite with BPEL Process, and click

Finish .

7. The Create BPEL Process dialog appears.

8. In the Name field, enter VacationRequestProcess.

9. Go to the bottom of the Create BPEL Process dialog.

10. To the right of the Input field, click the Search icon.

The Type Chooser dialog appears.

11. In the upper right corner, click the Import Schema File icon.

The Import Schema File dialog appears.

12. Browse for and select the VacationRequest.xsd file you created in

Section 26.3.2.1, Prerequisites.

13. Click OK until you are returned to the Type Chooser dialog, as shown in

Figure 26–6 . Note: The VacationRequest.xsd file is also available for download as part of tutorial workflow-100-VacationRequest. See Section 26.3.3, Additional Tutorials for information on downloading this and other tutorials. Getting Started with Human Workflow 26-15 Figure 26–6 Type Chooser Dialog with the Request and Response Elements

14. Select the input element VacationRequestProcessRequest, and click OK.

You are returned to the Create BPEL Process dialog.

15. To the right of the Output field, click the Search icon.

16. Select the output element VacationRequestProcessResponse, and click OK.

You are returned to the Create BPEL Process dialog, as shown in Figure 26–7 . Figure 26–7 BPEL Process Dialog

17. Accept the default values for all other settings, and click OK.

A BPEL process service component is created in the SOA Composite Editor, as shown in Figure 26–8 . Because Expose as a SOAP service was selected in the Create BPEL Process dialog, the BPEL process is automatically connected with a service binding component. The service exposes the SOA composite application to external customers.