Faulting the process

Deploy the process, following the deployment methods in Chapter 3, Process Deployment and Testing.

Now that you have implemented exception handling for the business and system exception points, it's time to test whether they are working.

  • When process token reaches the task ValidateStock, which calls StockValidator_EBS, StockValidator_EBS will raise a SOPFault business exception, if stock is not available.
  • When process token reaches the ValidateStock service task and invokes the StockValidator_EBS service, if the service throws binding/remote fault, it gets propagated as no boundary catch events are defined. For this component, Fault Policies are defined, and hence the Fault Policy framework will handle the exception. You have defined in fault-policy.xml that, on infusion of binding or remote fault, you will just terminate the process. Thus, on error, this process will get terminated.
  • When the Business Analyst rejects the quote, the process token will reach Error End Event and throw BusinessReviewRejectionFault. BPMN Service Engine interrupts the process and throws the exception to the parent process. The parent process has the event subprocess CatchBusinessFault defined, which can catch BusinessReviewRejectionFault, and hence the subprocess CatchBusinessFault will handle the exception.
  • The process token reaches the Finalize Contract Human Task, and the task is assigned to Contracts user to finalize it. A timer checks if the task is not completed in one hour, and if so, the Catch Timer event will execute and the process token will follow via the sequence path defined for Timer Catch event and will reach the CatchSLA subprocess. This subprocess will save the quote with the SLAVoilated request status.

How to do it...

In this section, you will learn to test business exceptions.

I. Test the SOPFault Business Exception

  1. Go to Oracle BPM Workspace and log in as the user salesrepresentative.
  2. Initiate the process and enter quote information.
  3. Enter a PRODUCTID value that you are aware is unavailable.

    For instance, let's enter 1030 as PRODUCTID, for which AVAILABILITY is N.

    How to do it...
  4. StockValidator_EBS will raise a SOPFault business exception. Boundary Catch Event will handle the exception, in this case. And the process token reaches Stockvalidation_ExceptionHandler.
  5. Log in to the Oracle EM console and click on the instance created.
  6. Go to the flow; you can trace the process token movement with the green lines.
    How to do it...
  7. You will find that the StockValidationNotification task is assigned to the user salesrepresentative, as defined in the subprocess.
    How to do it...

II. Handle system exceptions with the Fault Policy framework

  1. Go to the Oracle EM console and shut down the StockValidator_EBS service.
  2. Go to Oracle BPM workspace, log in as salesrepresentative, and initiate the SalesToContract process. Enter quote data.
  3. The service task ValidateStock will invoke the StockValidator_EBS service. As this service is down, it will raise fault, and as no boundary catch event is defined, it gets propagated. For this component, Fault Policies are defined and hence Fault Policy framework will handle the exception.
  4. You have said that, in fault-policy.xml, on infusion of a binding or remote fault, you would just terminate the process. Hence, on an error, this process will get terminated.
  5. Log in to Oracle EM Console and verify the same in Traces.
    How to do it...

III. Handle a business exception in a subprocess

  1. Go to Oracle BPM workspace, log in as salesrepresentative, and initiate the SalesToContract process. Enter quote data.
  2. Log in as the user BusinessAnalyst and reject the quote.
  3. Log in to the Oracle EM console, and verify that there is a BusinessReviewRejectFault exception.
    How to do it...
  4. The parent process has the event subprocess CatchBusinessFault defined to catch BusinessReviewRejectionFault.
    How to do it...

IV. Handle Timeout exception

  1. Log in to Oracle BPM workspace as the user salesrepresentative and enter quote data with a PRODUCTID value that is available. In this case it can be 1029.
  2. Log in as the user BusinessAnalyst and approve the quote.
  3. Log in as the users Approver and Contracts to perform the Approve Terms and Contracts tasks respectively.
  4. Now, you will find that the Finalize Contracts task is assigned to user Contracts.
  5. Do not perform any action for one hour. The Catch Timer event will execute and the process token will follow the sequence path and reach the CatchSLA subprocess.
    How to do it...
  6. The CatchSLA subprocess will save the quote with the SLAVoilated request status.
..................Content has been hidden....................

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