Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Human Task and ADF: How-To (whitepaper)


Published on

April 2014 - Collaborate/IOUG

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Human Task and ADF: How-To (whitepaper)

  1. 1. COLLABORATE 14 – IOUG Forum Middleware 1 | P a g e “Human Task and ADF: How-To” White Paper Human Task and ADF: How-To Harold Dost, Raastech ABSTRACT As we progress, manual processes give way to automated efficiency. However, some decisions simply can’t be automated. For this reason Oracle Human Task exists. If you want to learn how to incorporate the human element into your business process, reading this paper will provide you the basics to getting started, including setting up a simple human task, providing a user friendly interface to interact with the process, and recommendations for implementation. This session is great for any new SOA Suite developers or those who simply haven’t used Human Task and workflow capabilities. TARGET AUDIENCE The intended readers of this paper are those involved with development that have little, preferably, no experience with the Oracle Human Task and its functionality. EXECUTIVE SUMMARY Reader will be able to:  Identity use cases for Human Task  Create a simple process implementing Human Task BACKGROUND Human intervention is unavoidable when running a business. A support person receives work tickets, which need to be assigned to the appropriate person, and a status needs to be provided to the requester. An account manager responsible for reviewing expense reports needs to be able to approve or reject the reports with the ability to comment on the reason for the action. A hiring manager needs to work with HR to find new candidates, review resumes, and decide which candidates should be called to interview. Employees need to vote on floating holidays for the coming year. All of these scenarios require humans interacting with some sort of workflow. Clearly some of these workflows require much more human interaction than others, and it is easy to see how ingrained manual processes are in the workplace. This is not really a surprise, since most of the systems that we work with everyday perform tasks that were once performed by hundreds or thousands of people. They also didn’t have the level correctness or speed that today’s machines can provide. Some decisions cannot or should not be made by machines, because of either a need for intuition, or a need for further information that can’t just be queried from a table with data readily available. This need for interaction through out business processes is not a difficult problem to solve. Many products exist to provide this human workflow functionality, but choosing a product can be difficult, some companies even choose to develop their own. This paper should provide the basic knowledge of how Oracle’s Human Task works. Hopefully it provides an insight as to the strengths and weaknesses of Human Task, and allows your company to decide if it would be useful in your workplace. TECHNICAL DISCUSSIONS AND EXAMPLES As with creating anything that has a long life cycle, it is a good idea to have a design at least started before any production code is written. It may be good to write a few proof-of-concept pieces, and build the basics of your design. Lets assume there is a new requirement from your business, a grocery chain, to create a piece of software for the stores as part of the company’s “Groceries2Go” (G2G) program. Employees need to receive notifications of new orders, providing a list of items that need to be picked for customers. The employee should be able to mark items as having been retrieved, not available or partially available. Other requirements are a method to print receipts and notify customers when their order is ready for pickup. The determined workflow is as follows: the customer places a G2G order on the website, the order is entered into a queue which is based on time window of pickup selected by the customer, based on some matrix of complexity and the time window orders are send out to employees to go through the store to grab the groceries specified, the employee marks if items are out of stock at the time of retrieval, based on the customer’s choice the customer’s credit card is billed or upon pickup the customer pays. After the workflow is validated, it is determined that the project will use SOA Suite to deal with the logic involved with the G2G program. SOA Suite is one of your company’s middleware tools, and by proxy as is the Human Task product. You’ve been tasked with the creation of a BPEL Process and Human Task. The process responsible for determining what orders should be picked calls the BPEL. BPEL receives confirmation of all the
  2. 2. COLLABORATE 14 – IOUG Forum Middleware 2 | P a g e “Human Task and ADF: How-To” White Paper items that have picked up and ones that were out of stock, and responds back to the orchestrating BPEL process for the next step of the order management workflow to process credit. You mockup a form to get an idea of how the employee may use it. The first step to begin development is to create the composite in the same fashion that you would for any other SOA Project. Figure 1: Form Mockup Before we get too much into the development talk, lets step back for a moment and look at the core abilities available. Human Task is not merely another container within which disparate pages are hosted. It also provides a number of faculties to you as the developer that would otherwise need to be built. Some of these features are a little more basic such as: assignment, notification, and deadlines. Other more complex features, such as, tying in the assignments with identity management tools are also built into the platform as a function of the underlying WebLogic server. These features might seem like not sound much, but this functionality is not restricted to the confines of SOA Suite. Your company does not need to rely on the Oracle Fusion Middleware stack for every aspect of the process. For example, if this task needs to be available through some centralized site used by all employees or customers, and it is hosted or otherwise running in a different system, then those other systems can interact with the system through SOAP and other mechanisms. In fact, the same services that are available for general consumption by external portals are the very same services that are used by the BPM Worklist application, the Oracle application that provides access to all tasks, comes as part of SOA Suite. There are eight services total including one very interesting service called the Evidence Store Service, which, “Supports storage and nonrepudiation of digitally-signed workflow tasks.” Basically this service provides a way for workflow tasks, comments, and other associated data to be verified for authenticity. Every person needs a certificate associated with his or her identity, and with this certificate people are able to sign their actions through out the workflow. This sort of authenticity may not be needed for the scenario that is currently presented, but it may be necessary for companies approving changes to contracts and other legal documents that have much more weight to them than a grocery fulfillment service. Coming back to our example, we are going to make a few assumptions: 1. Our company has made positioned BPM Worklist as a pivotal application to be used by its employees. 2. The process we are working on does not require actions and comments to be cryptographically verifiable 3. The employee responsible for filling the order should be logged. With these assumptions we can start to see how we are going to incorporate Human Task. The first assumption allows us to keep the example simple without needing to involve other systems. The second assumption means that we will not need to use the Evidence Store, and the third is provided by the built-in functionality of Human Task The presentation of the task to employees will be done through the built-in BPM Worklist. A group of employees will be assigned the task, and the available employees will be responsible for claiming the task. The employee collects the groceries available and makes his or her remarks in the sheet and click completes order. If for whatever reason the employee can’t complete the order they will return it to the queue. From there the BPEL responds with the information collected from the form and replies to the orchestration process. The parent process is responsible for coordination of the various tasks associated with receiving the order, charging the customer and notifying the customer. The work of the process is as follows: 1. Receive the order from the order control process 2. Start a task for the employee 3. Wait for the task to be completed 4. Return completed information back to the order control process Some may be wondering about various scenarios that are not handled by the process, but let’s keep in mind this is a basic introduction. One scenario we are blatantly ignoring is the case where a product of a similar type may be substituted for another, or the restriction of such a substitution on a line level basis. This is something that could easily be handled by the addition of some data fields. Also, there could be some extra logic in the task’s form displaying that a replacement of one product for another is unacceptable. Barring any exception cases that may have been come to mind, we will progress.
  3. 3. COLLABORATE 14 – IOUG Forum Middleware 3 | P a g e “Human Task and ADF: How-To” White Paper Development has begun, and so far our process is basic. We have created an Asynchronous BPEL, which at this point in time only echoes our request back to the requester. The next step is to create the Human Task. The creation of the Human task has a few minimum requirements. A human task must have an owner, an assignees/participants, a title, parameters, and finally actions. The actions or outcomes as they are also known are very useful, because they are used to control the flow of logic. For example, looking at Figure: 1 there are two buttons present: Return to Queue and Complete Order. The Return To Queue button could be linked to an outcome called REQUEUE and the Complete Order button could be linked to an outcome called FILLED. After the BPEL receives a message that the task has been completed there will be an If Activity to choose logic for both of the possible outcomes. For the outcome of a REQUEUE we want the BPEL process to re initialize the Human task for someone else to claim and then fill the order. Reasons for needing to requeue could be anything from switching duties to needing to leave for a family emergency. Whatever their reason, we have that case covered. For the FILLED outcome we want the BPEL process to reply to the caller and be finished. Since this is not meant to be an introduction to BPEL we will only speak in passing about BPEL. One of the big advantages of having Human Task as part of the Oracle SOA Suite is that it like Business Rules, they can be included as part of a composite. A lot of the overhead that may be associated with the connecting and communication with the product can be managed through BPEL. In most cases when using the SOA Suite product the invocation of Human Task is performed through the Human Task activity, however there is the ability for custom Java code to create and respond to changes that may occur in a particular task as it runs through its workflow. With the basic BPEL created we are going to create a Human Task. The Human Task will have the outcomes of: REQUEUE and FILLED as we mentioned above. The task will have an owner of the store manager. The assignees will be a group of G2G employees. These G2G employees will be typical employees, but added to a special group. For the purposes of a pilot the grocery fulfillment service will only be available when at least employee in the pilot group is working that day. The title will be related to the Groceries2Go Order. The data parameters will consist of typical order data such as: order number, line quantities, descriptions, etc. An XML type will define this data parameter. We will also want to make sure we send a notification to all people in the group that there is a new order on the queue. Once we have the task setup there is one last major step that must be completed before we can think about deploying it for testing. The missing link is the actual code to allow the employees interact with this task. As explained before there are multiple ways of accessing this data, so no particular technology must be used for accessing these tasks. However, we have already determined that our system will be using the BPM Worklist. Therefore, we will be utilizing the ADF framework. This framework is built upon JSF/JSP and provides a Model-View-Controller (MVC) pattern for developing these web forms. Thankfully, for the basic workflow we are dealing with there is a wizard that is associated with the Human Task itself. When the Human Task file is open is it possible to see a Create Form button. This provides access to the wizard or auto- generating method of creating a form. Both of these methods provide a quick method of getting your form started, filling the form with fields for all the different types of data provided as part of your human task. Certain parts of your data may need to be made unchangeable which is done easily through the wizard or later editing of the form. Now all the necessary components of your part of the integration exist. With all of the components we have successfully provided a definition for our task, we have been able to bind it to our BPEL, and provided a method for employees to interact with the task. Overall the Human Task product is a simple, yet, powerful method to add a human workflow into any of your automated processes. Making simple features available from the start such as basic decisions and data feedback into a process. In addition, providing more advance features including callbacks on any step in the process, allowing for progress of the workflow to be more transparent to external systems, web services on which portals and APIs can be built, and nonrepudiation to guarantee data integrity and authenticity. All of these features together can provide you and your company robust human workflow system with which your employees and customers may interact comfortably.
  4. 4. COLLABORATE 14 – IOUG Forum Middleware 4 | P a g e “Human Task and ADF: How-To” White Paper APPENDICES APPENDIX A: TASK DEFINITION EXAMPLE <?xml version = '1.0' encoding = 'UTF-8'?> <taskDefinition targetNamespace="" xmlns:xp20="" xmlns:ora="" xmlns:oraext="" xmlns:task="" xmlns:xsd="" xmlns="" xmlns:aia="" xmlns:bpel2="" xmlns:ns0="" xmlns:dvm="" xmlns:evidence="" xmlns:hwf="" xmlns:ids="" xmlns:bpm="" xmlns:xref=""> <name>OrderFulfillment</name> <id>${domain_id}_${process_id}_${process_revision}_OrderFulfillment</id> <priority>3</priority> <process processId="" processVersion=""/> <routingSlip xmlns=""> <globalConfiguration> <applicationContext></applicationContext> <taskOwner type="STATIC" identityType="user">weblogic</taskOwner> <sharePayloadConfiguration> <type>USE_SYSTEM_WIDE_GLOBAL_CONFIGURATION</type> </sharePayloadConfiguration> </globalConfiguration> <participants isAdhocRoutingSupported="false"> <stage name="Filling"> <participant name="G2G Employee"> <resource type="STATIC" identityType="group">ug_g2g_emp</resource> </participant> </stage> </participants> <notification includeTaskAttachments="false" actionable="false" secureNotifications="false" hideWorklistUrlInEmail="false"> <reminder relativeDate="EXPIRATION" recurrence="1"/> <action name="ASSIGN" recipient="ASSIGNEES"><![CDATA[concat(string('Task '), /task:task/task:title, string(' requires your attention.'))]]></action> <action name="COMPLETE" recipient="CREATOR"><![CDATA[concat(string('Task '), /task:task/task:title, string(' requires your attention.'))]]></action> <action name="ERROR" recipient="OWNER"><![CDATA[concat(string('Task '), /task:task/task:title, string(' requires your attention.'))]]></action> <groupNotificationConfiguration>SEND_INDIVIDUAL_NOTIFICATION</groupNotificationConfiguration> </notification> </routingSlip> <workflowConfiguration xmlns="" xmlns:ns0=""> <outcomes> <outcome>REQUEUE</outcome> <outcome>FILLED</outcome> </outcomes> <payload xmlSchemaDefinition="xsd/OrderFulfillmentPayload.xsd"> <messageAttribute name="G2GFulfillmentRequest" attributeType="ELEMENT" type="ns0:G2GFulfillmentRequest" updatable="true" external="false"/> </payload>
  5. 5. COLLABORATE 14 – IOUG Forum Middleware 5 | P a g e “Human Task and ADF: How-To” White Paper <bpelEventListener>false</bpelEventListener> <bpelNoCallbacks>false</bpelNoCallbacks> <showCompleteGraphicalHistory>true</showCompleteGraphicalHistory> <reevalTranslatablesOnUpdate>false</reevalTranslatablesOnUpdate> <preActionMandatoryUserSteps> <preActionMandatoryUserStep> <userStep>PROVIDE_COMMENTS</userStep> <outcome>REQUEUE</outcome> </preActionMandatoryUserStep> </preActionMandatoryUserSteps> <allowInitiatorEditParticipants>false</allowInitiatorEditParticipants> <allowParticipantsEditParticipants>false</allowParticipantsEditParticipants> <globalCreationTask>false</globalCreationTask> <workflowConditions/> </workflowConfiguration> </taskDefinition> APPENDIX B: SCHEMA EXAMPLE <?xml version="1.0" encoding="UTF-8"?> <xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="" xmlns:tns="" xmlns:xsd=""> <xsd:element name="G2GFulfillmentRequest" type="tns:G2GFulfillmentRequestType"/> <xsd:complexType name="G2GFulfillmentRequestType"> <xsd:sequence> <xsd:element name="OrderInformation" type="tns:OrderInformationType"/> <xsd:element name="CustomerInformation" type="tns:CustomerInformationType"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="OrderInformationType"> <xsd:sequence> <xsd:element name="OrderNumber" type="xsd:int"/> <xsd:element name="OrderDate" type="xsd:date"/> <xsd:element name="OrderFillTimeFrame"> <xsd:complexType> <xsd:sequence> <xsd:element name="StartTime" type="xsd:dateTime"/> <xsd:element name="EndTime" type="xsd:dateTime"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="OrderLines"> <xsd:complexType> <xsd:sequence> <xsd:element name="OrderLine" type="tns:OrderLineType" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> <xsd:complexType name="CustomerInformationType"> <xsd:sequence> <xsd:element name="CustomerName"> <xsd:complexType> <xsd:sequence> <xsd:element name="FirstName" type="xsd:string"/> <xsd:element name="LastName" type="xsd:string"/>
  6. 6. COLLABORATE 14 – IOUG Forum Middleware 6 | P a g e “Human Task and ADF: How-To” White Paper <xsd:element name="Suffix" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="BillingAddress" type="tns:AddressType"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="AddressType"> <xsd:sequence> <xsd:element name="StreetAddress1" type="xsd:string"/> <xsd:element name="StreetAddress2" type="xsd:string"/> <xsd:element name="City" type="xsd:string"/> <xsd:element name="State" type="xsd:string"/> <xsd:element name="PostalCode" type="xsd:int"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="OrderLineType"> <xsd:sequence> <xsd:element name="ItemName" type="xsd:string"/> <xsd:element name="ItemDescription" type="xsd:string"/> <xsd:element name="ItemLocation" type="xsd:string"/> <xsd:element name="QuantityOrdered" type="xsd:int"/> <xsd:element name="QuantityFilled" type="xsd:int"/> <xsd:element name="ItemPrice" type="xsd:decimal"/> <xsd:element name="UnitOfMeasure" type="xsd:string"/> <xsd:element name="OrderFillComments" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:schema> REFERENCES