Generating a Task Form for an Interactive task

Now we have a Human Task created for the User task and they are connected as well. However, when this task is assigned to someone who performs an action on it, he/she must have a user interface to interact with. We will now develop a user interface like an ADF Form for interaction.

How to do it...

In this section, you will learn how to create a Task Form for an Interactive task:

  1. Launch BPM Studio.
  2. Navigate to BPM Project Navigator.
    How to do it...
  3. Expand the SalesToContractDemo | Business Catalog | Human Tasks folder to examine the newly created Task Service. You can click on the Types folder to see the associated types.
  4. Double-click the EnterQuoteDetails.task file to open the Task editor with the Task Service definition.
    How to do it...
  5. Click on Auto Generate Task Form from the Create Form pop-up, found at the top of the Task Form.
    How to do it...
  6. Task Forms are kept in a separate project, as they have different dependencies and deployment requirements. Hence it will open a Create Project form to create a separate project for the user interface. You need to provide a name for the project, say EnterQuoteUI.
    How to do it...
  7. Click OK.

    When you click OK, several actions will take place such as creating a new project, creating necessary files, and so on. This will take few minutes and you need to wait until it's done. The user interface for the Task Service is generated automatically. Many dialogs will open to give you an opportunity to do some customization. For the time being, you can click OK on them too.

    How to do it...
  8. The designer will get initiated in the course of action. Hence you are advised to wait for some time.
  9. When you have finished following the above steps, click Save. You should see a screen as follows:
    How to do it...
  10. You will find a new project created in the Application, as shown in the following screenshot:
    How to do it...

How it works...

As your SOA Composite includes a Human Task, you need a way for users to interact with the task. 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.

If you check in the Project navigator into the newly created project, EnterQuoteUI, you will find:

  • The Task Form generated is a Java Server Page XML (.jspx) file.
  • The hwtaskflow.xml file is created to capture the details on connecting with the service engine. By default, it uses remote EJB to connect to the workflow server. Oracle SOA server URL and port are automatically determined by using the WebLogic server runtime MBeans. However, you can override these by explicitly specifying the URL and port information here.

There's more...

You can create a Task Form by using either the Auto-Generate Task Form option or the Launch Task Form Wizard.

Generating a Task Form using Launch Task Form

Here you will learn how to initiate a Task Form generation using wizards, as follows:

  1. Expand the SalesToContractDemo | Business Catalog | Human Tasks folder to examine the newly created Task Service. You can click on the Types folder to see the associated types.
  2. Double-click the .task file to open the Task Editor with the Task Service definition.
  3. Click on Launch Task Form Wizard from the pop-up Create Form, found at the top of the Task Form.
    Generating a Task Form using Launch Task Form
  4. Provide a Project name, a directory path, and click OK.
  5. Once you complete the wizard, a form is generated. (Refer to the section Generating Task Form using Wizard in Chapter 3, Process Deployment and Testing).
  6. When you have finished following the preceding steps, click Save.
  7. Defining an Interactive task for the Finalize Activity

The last User task in the process is to finalize the contract with the Contracts role. Input and Output Business Data is saved in "Quote" (Quote.xsd), and finally the quote is saved in the Enterprise database by an external service call.

How to do it...

In this section, you will create an Interactive task:

  1. Right-click the Finalize Contract User task in the designer.
    How to do it...
  2. Go to the Properties and Implementation tab.
  3. Click the green + plus sign to create a new Human Task.
  4. Give the Name as FinalizeContracts and Title as Finalize Contracts.
  5. Click on the browsing icon to the right of Outcomes to change the outcome from APPROVE or REJECT to OK.
    How to do it...
  6. In the Human Task dialog, click the green plus(+) icon next to Parameters, drag in the quote Data object, select Editable, and click OK.
    How to do it...
  7. Click OK.
  8. When you have finished following the preceding steps, click Save.

How it works...

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 the 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.

There's more...

We can also create a Task Form for the Finalize Contract task, as described in the following section.

Creating a Task Form for the Finalize Contract task

In this section, you will learn to create a Task Form:

  1. Go to BPM Project navigator.
  2. Double-click the FinalizeContracts.task file under Business Catalog | Human Tasks.
  3. Select Auto-Generate Task Form from the Create Form drop-down menu. Name the project FinalizeContractsUI and click OK.
    Creating a Task Form for the Finalize Contract task
  4. When you have finished following the above steps, click Save. You will see a screen as follows:
    Creating a Task Form for the Finalize Contract task
..................Content has been hidden....................

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