Calling a BPM process

You will create a reusable BPM process and will call it from your SalesToContract process. Let's create a Quotation Saving process, which performs the task of saving quotes through the SaveQuote service that we have been using. You have created the CatchSLA subprocess to handle SLA errors when the timer gets expired for the Finalize task. You will call this new BPMN process in the CatchSLA subprocess, to perform quote saving.

You will create a child process that will be a reusable process and can be invoked from many processes. Reusable processes can be started only by invoking from a call activity.

Note

Reusable processes are not part of the SOA composite and hence you cannot access reusable processes from other SOA components.

How to do it...

In this section, you will learn to call a BPMN process from another BPMN process:

  1. Create a BPMN reusable process.
  2. Open JDeveloper in default mode and go to the SalesToContractDemo project in the application navigator.
  3. Navigate to Processes, right-click on Process, and select New.
  4. From Gallery, select BPM Tier as the categories and select Processes as the Items.
  5. Click on OK.
  6. In the Create BPM project dialog, enter QuotationSavingProcess as Name for the new BPM process, select Reusable Process as Type, and click on Next:
    How to do it...
  7. For Arguments Definition, supply IN as the Name, set Type to Component, and choose Quote from the Component list:
    How to do it...
  8. Click on OK twice.
  9. You will find a new process with a Start and End activity, as shown in the following screenshot:
    How to do it...
  10. Create a data object quote of component type Quote:
    How to do it...
  11. Drag-and-drop service task from Component Palette, between these two activities. This will open its properties.
  12. Enter SaveQuote as Name, and select Service Call in the Implementation drop-down. Browse for the SaveQuote service. When this is selected, process appears in the Operation field automatically:
    How to do it...
  13. Drag-and-drop the quote object as Input to the SaveQuote service.
  14. Click on OK.
  15. When you have finished this, click on Save.

    Note

    The Start event of a reusable process must always be of type none. The End event can be an error or a message event.

  16. Call Process.
  17. Go to the designer area of the SalesToContract process.
  18. Go to the contracts swimlane and expand the CatchSLA subprocess.
  19. Delete the SaveSLAVoilatedQuote service task.
  20. Drag-and-drop CallActivity from the BPM Component Palette.
  21. In the Properties for CallActivity, enter SaveSLAVoilatedQuote as the name.
  22. In the Implementation tab, select the process QuotationSavingProcess and check the data association:
    How to do it...
  23. Drag-and-drop the quote object as Input to the BPM process.
  24. Enter "SLAVoilated" for quoteRequestStatus.
  25. When you have finished, click on Save.

How it works...

When the token reaches the CatchSLA subprocess, QuotationSavingProcess becomes a child process of the invoking SalesToContract process. The parent process passes the process token to the child process as no new tokens are created. Token on completion from child process reaches back to the parent invoking process.

There's more...

You can deploy and test the process till this point. Follow the Deploying the BPM Project section in Chapter 3, Process Deployment and Testing for deployments:

  1. Log in to BPM workspace as salesrepresentative user.
  2. Enter Quote details.
  3. Advance the process till Contract Finalize.
  4. Finalize the contract.
  5. Wait for the time specified in the timer, as you need to let the timer expire, which will lead to invocation of the CatchSLA subprocess.
  6. Log in to Oracle EM console.
  7. You can find a completed instance created for the SalesToContract process.
  8. Click on the instance and go to trace.
  9. Click on the name of the process, SalesToContract.
  10. Click on the Flow tab. You will find that CatchSLA gets executed and the reusable process QuotationSavingProcess is invoked, too:
    There's more...
  11. In the audit trail, you can verify the payload modified by the QuotationSavingProcess reusable process:
    There's more...
..................Content has been hidden....................

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