SOA 11g Tutorial: Human Tasks

 

This is part of the Oracle SOA11g hands on tutorials.

Human Tasks Overview

Human Work Flow Service

* Exposed as
– Web Service
– Java API
* Provides
– Task Service
– Task Query Service
– Task Metadata Service
– User Metadata Service
– Identity Service
– Notification Service

Work List App

* ADF based web app
* Default roles
– Adminitrator
– Process owner
– Supervisor
– Assignee
* Example actions
– Update payload
– Attach doc
– Route tasks
– Complete tasks
* User actions
– Perform authorized actions
– Acquire and checkout shared tasks
– Define personal to-do tasks
– Define subtasks
– Filter tasks
– Define custom work queue
– Proxy access to other user’s work list
– Define vacation and delegation rules
– Access work history and audit trails

Add Human Task to Composite Diagram

Add Human Task

* Open POProcessing > composite.xml
* Drag and drop a Human Task icon onto Components lane and enter
– Name: ManualPOApproval
– Click OK
* Wire from BPEL process to human task
– Drag a wire from lower right corner of approveLargeOder icon to upper left of ManualPOApproval icon.
* Double click ManualPOApproval icon to open human task editor, enter
– General tab
Task Title: Approve Order
Description: Manual approval task for large orders
– Data tab
click green plus sign and select Add other parameter to open Add Task Parameter dialog
click magnifying glass to the right of Element and browse to Project Schema Files -> internalorder.xsd -> Order
click OK
select Editable via worklist
click OK
– Assignment tab
double click Edit Participant box and enter
Type: Single
Lable: Large Order Approver
click green plus icon and select Add User. Enter weblogic in Value field
* Click OK
* Save all
* Close human task editor

Call Human Task from BPEL Process

* Open BPEL designer by double clicking BPEL icon
* Drag and drop a Human Task below assignApproval Assign activity
* Double click Human Task icon to open Human Task editor
Task Definition: ManualPOApproval
– Click […] underneath BPEL Variable field and select Variables -> Process -> Variables -> inputVariable -> payload -> Order, click OK
– Click OK again on Human Task editor
* Drag and drop assignApproval Assign activity below CopyPayloadFromTask icon in the APPROVE lane
* Double click CopyPayloadFromTask icon in the REJECT lane
– drag and drop the Expression icon (with fx on it located in the upper right corner) onto outputVariable -> payload -> OrderType -> status field on the right field . Enter ‘rejected’ and click ok
– click OK again on Edit Assign dialog.
* Double click CopyPayloadFromTask in the otherwise lane.
– Do the same and set status to ‘expired’
* Save All

Auto Generate Task Form

* On approveLargeOrder.bpel diagram,
– double click ManualPOApproval1 icon
– click the Edit Task Definition icon (pencil) to the right of Task Definition label.
* On ManualPOApproval.task file screen, click Create Form -> Auto-Generate Task Form… (upper left corner), enter
Project Name: ApproveTaskDetails
Directory: C:\po\POProcessing\ApproveTaskDetails
* Click OK
* Wait until TaskDetails1.jspx opens
* Click Save All

Manual Generate Task Form

* TODO

Deploy

Deploy SOA App

* Right click POProcessing -> Deploy

Deploy ApproveTaskDetails Project

* Note that right click ApproveTaskDetails project -> Deploy ApproveTaskDetails… won’t work.
* Select ApproveTaskDetails project
* From Application menu,
select Application -> Deploy -> ApproveTaskDetails
* Select Deploy to Application Server, click Next
* Select MyAppServerConnection, click Next
* Select
– Deploy to selected instances in the domain
– soa_server1
click Next
* Click Finish

Test

Test Manual PO Approval

Input message

* Log into EM and enter the test message for POProcessing

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body xmlns:ns1="http://xmlns.oracle.com/ns/order">
        <ns1:PurchaseOrder>
            <ns1:CustID>1111</ns1:CustID>
            <ns1:ID>2222</ns1:ID>
            <ns1:productName>iPod shuffle</ns1:productName>
            <ns1:itemType>Electronics</ns1:itemType>
            <ns1:price>145</ns1:price>
            <ns1:quantity>30</ns1:quantity>
            <ns1:status>Initial</ns1:status>
            <ns1:ccType>Mastercard</ns1:ccType>
            <ns1:ccNumber>1234-1234-1234-1234</ns1:ccNumber>
        </ns1:PurchaseOrder>
    </soap:Body>
</soap:Envelope>

* Click Launch Message Flow Trace
– Check ManualPOApproval Human Workflow Component has a state of Running

Perform Human Task

* Login worklistapp
URL: http://localhost:8001/integration/worklistapp
Username: weblogic
Pass: welcome1
* Click Approve Order in My Tasks window
* Click Approve or Reject

Message Flow

* Back in EM
* Click Launch Message Flow Trace
– Check ManualPOApproval Human Workflow Component has a state of Completed

New Order File

* Check that a new order file is created

Issues

Caused by: java.lang.ClassNotFoundException: oracle.adf.library.webapp.ResourceServlet

* You tried to deploy ApproveTaskDetails with right click ApproveTaskDetails project -> Deploy ApproveTaskDetails… method.
* Deploy instead with Application -> Deploy -> ApproveTaskDetails

Warning: Error assignee not specified

* This is can be ignored
* See http://forums.oracle.com/forums/thread.jspa?threadID=950504&start=0&tstart=0

JDBC driver does not support XA

* Exception in soa_server1.out:

JDBC driver does not support XA, hence cannot be a participant in two-phase comm
it. To force this participation, set the GlobalTransactionsProtocol attribute to
 LoggingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source
= soademoDatabase
        at weblogic.transaction.internal.TransactionImpl.throwRollbackException(
TransactionImpl.java:1881)

* Cause: soademoDatabase was created with the non-XA jdbc driver.
* Fix: recreate soademoDatabase and make sure to select Oracle’s Driver (Thin XA) for Service connections; Verions:9.0.1 and later as database driver.

* OFMW Developer’s Guide: Using the Human Workflow Service Component
* http://redstack.wordpress.com/2010/01/08/human-workflow-in-11g/

This entry was posted in soa11g. Bookmark the permalink.

2 Responses to SOA 11g Tutorial: Human Tasks

Leave a Reply

Your email address will not be published. Required fields are marked *


*

This site uses Akismet to reduce spam. Learn how your comment data is processed.