Defining an Interactive task

An Interactive task adds human interaction in the BPMN process. This recipe will delve into defining an Interactive task.

Getting ready

User tasks are tasks that need user interactions. Check the model that you have created. Rectangle green boxes represent the User tasks. They are also called Interactive tasks.

How to do it...

To implement a User task, you need to define a service component called Human Task, associate it with the activity, and then map data into and out of the activity. As we mentioned earlier, you must have already defined the Business and Data objects. As a developer, you will perform the following activities for implementing a User/Interactive task:

  • Defining a Human Task
  • Binding it to an activity
  • Mapping data input and output to the activity

There are two approaches to working with Human Tasks in Oracle BPM:

  • Creating the Human Task using the SOA Human Task editor
  • Creating the Human Task using the simplified interface that Oracle BPM provides

You will be using the second option of creating a Human Task using the simplified interface that Oracle BPM provides. BPM Studio offers a number of Human Task patterns such as simple patterns for individual users/groups and initiator patterns for those who initiate the process (in this case, it's the sales representative). Swimlane roles are used to determine assignments.

In Chapter 1, Process Modeling, you defined the outline of the process and specified only the name and description for the activities. Now, in order to execute the process, you need to implement the process activities. Every Interactive task has to be bound to a Task Service. You can either browse for existing Task Services or create one on the fly. Multiple Interactive tasks can share the same Task Service.

Let's create a new Task Service for the Enter Quote activity.

  1. Launch BPM Studio.
  2. Select Default Roles when asked for the developer type.
    How to do it...
  3. Click on the Project name in the project navigator, as shown in the following screenshot. This will open the modeled project in the designer.
    How to do it...
  4. Right-click on the Enter Quote Details User activity and select Properties.
    How to do it...
  5. In the Properties dialog, click the Implementation tab.
  6. Click the + sign next to Human Task to add a Human Task.
    How to do it...
  7. In the Create Human Task dialog, enter the name EnterQuoteDetails.
  8. Select Initiator as Pattern. This will automatically set the outcome to SUBMIT.
  9. Type in Enter Quote as the title.
  10. Click on the green + next to Parameters to launch the Data object dialog.
  11. Drag quote from the Data object navigator window to the Parameters section.
  12. Set the Parameter to Editable.
  13. Click OK twice.
    How to do it...
  14. You have just finished creating the EnterQuoteDetails Task Service.
  15. When you have finished following the preceding steps, click Save.

How it works...

The Human Task automatically appears in the predefined module, Human Tasks, in the business catalog. You can use the Human Task to implement the User task you are editing or other user tasks in the BPM project. You can edit the created Human Task using the SOA Human Task editor to configure implementation details.

At runtime, when a token arrives at a User task, control is passed from the BPMN process to the Oracle Human Workflow. Although both are part of Oracle BPM runtime, control is not passed back to the BPMN process until the Human Tasks are completed.

After the workflow is complete, control is passed back to the BPMN process. Any required Data objects are passed back to the user task, and the token moves to the next sequence flow of the process.

However, Human Tasks are independent from BPMN processes. If you terminate a BPMN process while it runs a User task, the associated Human Task keeps running independently. When you define a Human Task in BPM, the callback is implicitly defined.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.79.33