Designer Sample Orchestration Project > Human Approval Sample > Adding Human Interaction
  

Adding Human Interaction

After an acknowledgment is sent to the loan requester, add the People activity to the process.

Step 1. Add the LoanApproval Human Task Participant and Task Owners and Administrators

To create the human interaction for approving a loan, use WS-BPEL For People and WS-Human Task features.
A group called loanreps can claim and work on the tasks, while a group called loanmgrs would be administrators--they can escalate and reassign tasks. In BPEL, these are called a Logical People Group. They are added in the Participants view under Human Task Participants.
Logical People Group definitions must be defined for both loanreps and loanmgrs, and then they aree associated with the proper role for the task.
  1. 1. In the Participants view, right click Human Task Participants, and select New Human Task Participant. You will need to add a new participant role named Role1 to the Participants view.
  2. 2. Select Role1. Edit the value for Name from Role1 to loanreps. Later, when defining a deployment descriptor for the process, you will associate this Logical People Group name with an actual set of users that the configured Identity Service will resolve at runtime.
  3. 3. Repeat Steps 1 through 2 to add a second Logical People Group, this time naming it loanmgrs.

Step 2. Create the loan approval Human Task

Now that you've declared the Logical People Groups, you can define its tasks. Start with WSDL defining the interactions. You can reuse the LoanApproval WSDL that was removed from the process earlier, but this time it will provide definitions for interaction with a person instead of a service.
  1. 1. In the Participants view, right click the loanreps Logical People Group, and select New Human Task.... The Human Task dialog opens, showing available port types. Remember that in WS-BPEL For People, people activities are just another type of service interaction, and they are declared in WSDL.
  2. 2. Expand the loanProcessHuman - Imported Services then the LoanApproval to display the approve operation, select it and press OK.
  3. Under review
    A new task will appear in the Participants view, under loanreps, called Task1.
  4. 3. Select Task1 so that is displayed in the Properties view. Edit the value of the Name property to approveTask.
  5. 4. Set the Priority to 3. Your task properties should look similar to the following:
  6. 5. Select the Presentation side tab in the Properties view and set the following properties:
  7. 6. Still at the Presentation tab, define the loansummary substitution variable that was just entered in the Subject area:
    1. a. Press the ellipsis button at the right of the panel.
    2. b. In the Presentation Parameters dialog that appears, press Add to add a new parameter. A new parameter called param1 whose type is string will appear.
    3. c. Click on the Parameter name to make it editable, and enter loansummary.
    4. d. Leave the Type as string.
    5. e. Click on the expression to make it editable, and enter the following value:
    6. concat(htd:getInput('Document')/loan:lastName , ", ",
      htd:getInput('Document')/loan:firstName , "; $",
      htd:getInput('Document')/loan:amountRequested )
      Your dialog should look similar to this:
      approve task presentation parms

Step 3. Complete Binding the Task Owners and Administrators to the Task

The Potential Owners Role was automatically set to loanreps when you created the task. You now need to assign other users to some of the other task roles. Do this by assigning the loanmgrs Logical People Group to the Business Administrators role, and by assigning the Loan Process literal to the Task Initiator role.
  1. 1. Select the Assignment tab and set the value for Business Administrator to loanmgrs as follows:
    1. a. Click in the Value column for Role Name Business Administrator. An ellipsis button appears. Click it to display the Role dialog.
    2. b. In the Role dialog, select Logical People Group in the Type picklist.
    3. c. In the Group picklist, select loanmgrs, and press OK.
    4. Under review
  2. 2. Still at the Assignment tab, set a value for Task initiator as follows:
    1. a. Click in the Value column for Role Name Task Initiator. An ellipsis button appears. Click it to display the Role dialog.
    2. b. In the Role dialog, select Literal in the Type picklist.
    3. c. Select Generate to generate XML for a user.
    4. d. Edit the value of the ht:user element to say Loan Process.
    5. e. Your dialog should look like this:
    6. task assignment task initiator dialog

Step 4. Setting Task Deadlines

You can specify one or more deadlines by which a task must be started and also one or more deadlines by which a task must be completed. If a start or completion date is missed, you can trigger one or more escalation actions. For example, if you set a start the task deadline for two hours after a task is created and the deadline is missed, you can send a notification to the task owner. Here are the deadlines you will set:
Step 4a. Setting the Start Deadline
  1. 1. From either Participants or Outline view, select the approveTask node and select the Deadlines side tab in the Properties view.
  2. 2. Click the Add button and set the properties for Deadline Type to Start, the Alarm Type to Duration and the Escalation Type to Inline Notification.
  3. Deadline Specification
  4. 3. Press OK.
  5. 4. Click in the blank value under the Expression column and press the ellipses button (...) and set the duration expression to the following: 'PT120M'. Include the single quotes in what you type.
  6. 5. Repeat steps 1-4 and create a completion deadline with a Duration Alarm Type for 10 minutes later ('PT130M').
  7. 6. The two task deadlines appear in the Properties view:
  8. Task deadlines
  9. 7. In the Outline view, select the Start Deadline and select the Escalations side tab in the Properties view.
  10. 8. Select the Inline Notification labeled InlineNofication1 and press the Go To button.
  11. 9. In the Properties view, select the Notification tab and change the name to TwoHourReminder.
  12. task notification
  13. 10. In the Outline view, expand the TwoHourReminder node and select the child node labeled N1. This is the where you define the escalation action that is triggered if the deadline is reached.
  14. 11. In the Properties view, select the Notification tab and set the following properties:
  15. 12. Press the ellipsis button to the right of the Notification Interface field.
  16. 13. In the Notification Interface dialog that appears, navigate to the LoanApprovalPeople port type, and select the remind operation.
  17. Notification Interface Dialog
    The remind operation is a one-way operation that notifies loanreps that a loan application has waited two hours for review. The Notification tab should look similar to the following:
    Notification tab
  18. 14. In the Properties view, select the Presentation tab and set the following properties:
  19. 15. In the Properties view, select the Presentation tab, press the ellipsis to the right of the Subject field, and set the following presentation parameters:
  20. Parameter
    Type
    Expression
    firstname
    string
    htd:getInput('Document', 'approveTask')/loan:firstName
    lastname
    string
    htd:getInput('Document', 'approveTask')/loan:lastName
    amount
    string
    htd:getInput('Document', 'approveTask')/loan:amountRequested
    priority
    string
    htd:getTaskPriority()
    Your completed dialog should look similar to this:
    Presentation parameters
  21. 16. Press OK.
  22. 17. In the Properties view, select the Assignment tab, click in the Value field, and set the Recipients to loanreps and Business Administrator to loanmgrs.
  23. Assignment tab
Step 4b. Setting the Completion Deadline
  1. 1. In the Outline view select the Completion Deadline and press the Escalation tab in the Properties view.
  2. 2. Select the Inline Notification labeled InlineNofication1 and press the Go To button.
  3. 3. In the Properties view, select the Notification tab and change the name to EscalateIfNotActedUpon.
  4. 4. In the Outline view, expand the EscalateIfNotActedUpon node and select the child node labeled N1.
  5. 5. In the Properties view select the Notification tab and set the following properties:
  6. 6. In the Properties view select the Presentation tab and set the following properties:
  7. 7. In the Properties view select the Assignment tab and set the Recipients to loanreps and Business Administrator to loanmgrs, as you did in a previous step for Reminder to Reps.
  8. 8. In the Outline view select the Completion Deadline and press the Escalation side tab in the Properties view.
  9. 9. Press the Add button and specify Reassignment for the Escalation Type:
  10. 10. Select the Reassignment labeledReassignment1 and press the Go To button.
  11. 11. In the Properties view select the Reassignment side tab and change the name to ReassignToMgr1.
  12. 12. In the Properties view select the Assignmentside tab and set the properties by pressing the ellipses (...) button in the Value column:

Step 5. Setting Task Renderings

Process Developer can create an HTML Form (or an XSL file or a custom rendering) that will render the task information in the Process Central Task forms. You can edit this form to customize how task information is presented to the user in the Process Central web application.
  1. 1. In the Outline view select the approveTask.
  2. 2. In the Properties view select the Renderings tab.
  3. 3. The Create Form button presents a dialog were you can specify the project folder and name for the form.
  4. 4. You will create the form in the form folder and use the default name of approveTask.html.
  5. Task Form Generation Dialog
    After you select OK, the Form editor opens.
  6. 5. You can see a preview of the form in the top half of the editor. Close the form.
  7. 6. Create Process Central forms for the task notifications by expanding the approveTask in the Outline view and trhen creating new Process Central Forms for the two notifications: ReminderToReps and NotifyReassignToManager (highlighted in the following figure).
That's it. The task is now complete with escalations, notifications, and rendering information. All that remains is to create a People Activity based on the task, and to place it in the process.

Step 6. Creating the People Activity

Now that you've defined the human task, the last step is to create a people activity in the process that uses the task. Although you've already defined most of the details of the human interaction through setting properties associated with the task, the people activity has a few properties of its own as well, and you need to set them as well.
  1. 1. In the Participants view, select the approveTask. Drag it from the Participants view to a position after the Under Review activity:
  2. 2. Select the people activity, and the associated Properties view. Edit the properties for the activity as follows:
    1. a. On the People Activity tab, change the name to ReviewLoan. Select a color, such as orange.
    2. b. On the Assignment tab, no changes are required. Note that the role assignment information that was entered during task definition has been propagated to the people activity automatically. It can be overridden here if desired.
    3. c. The Schedule tab allows you to control when the activity is executed, and how long it is allowed to take. These parameters are separate from the escalation deadlines that are part of the task definition, and all are taken into account at runtime. Set an Expiration expression for a task duration of 'PT180M', the maximum allowed duration for the people activity.
    4. d. On the Input tab:
    5. e. On the Output tab:
You have now completed the definition of both a human task for loan application review, and a people activity using that task. You've added the people activity to the process at the appropriate location. In the final part of the process, you will notify the Customer Service Department of the loan approval decision, so that they can inform the customer.