Use Compensation Patterns to Manage Purchase Orders

You can add a compensation pattern to your orchestration process to manage purchase orders when you don't use Oracle Global Order Promising.

Assume an order line contains an item that you drop ship and you already submitted the line to fulfillment. You revise the sales order, the line's status is Awaiting Shipping, you change the supplier or the supplier site, and then submit the revision. You now need to cancel the old purchase order and create a new one that has your revised supplier or supplier site.

If you use Global Order Promising, then it will automatically send a request to Oracle Purchasing to manage the purchase order. If you don't use Global Order Promising, then you can use this compensation pattern to send the request instead:

If you don't use Global Order Promising, then you can use this compensation pattern to send the request instead:

Here's what you need to do:

  1. Use the Manage Orchestration Process Definitions task in the Setup and Maintenance work area to open your orchestration process for editing.
  2. Add the compensation pattern to the Create Purchase Request step. If your orchestration process doesn't have a step that creates a purchase request, then add one. For an example that has a Create Purchase Request step, examine the predefined OrderFulfillmentGenericProcess orchestration process.
  3. Validate, release, and deploy your orchestration process.

If all the tests evaluate to true at run time, then the assert new action creates a new CANCEL_CREATE object, and the orchestration process sends that object to Oracle Purchasing with a request to cancel the old purchase and create a new one that has your revised supplier or supplier site. The orchestration process also sends other data that Purchasing needs to manage the purchase order, such as the SupplierId, SupplierSiteId, and so on.

To simplify your life, we've created an orchestration process named OrderFulfillmentGenericProcessWithoutSchedule for you that already has this compensation pattern. You can upload it to your Order Management environment. Here's how:

  1. Go to Technical Reference for Order Management (Doc ID 2051639.1).
  2. Download the Payloads and Files attachment.
  3. Open the file that you downloaded, locate the Implementation Project-40_1_20230601_2143.zip file, then save that zip file to your computer.
  4. Upload the Implementation Project-40_1_20230601_2143.zip file to your Order Management environment. For details, see Migrate Orchestration Processes in Order Management.
  5. Use the Manage Orchestration Process Definitions task to search for and open OrderFulfillmentGenericProcessWithoutSchedule.
  6. Examine the compensation pattern on the Create Purchase Request step.

For details about compensation patterns, including guidelines and how to set them up, see Compensate Sales Orders That Change.

Here's a text version of the compensation pattern.

Root: DooSeededOrchestrationRules.DOOHeader
  IF the following test is true
    DooSeededOrchestrationRules.DOOHeader.childFLines RL.contains   DooSeededOrchestrationRules.DOOHeader/childFLines and
    DooSeededOrchestrationRules.DOOHeader/childFLines.attributeChanged("SupplierId") is true or
    DooSeededOrchestrationRules.DOOHeader/childFLines.attributeChanged("SupplierSiteId") is true or
    DooSeededOrchestrationRules.DOOHeader/childFLines.attributeChanged("InventoryItemId") is true or
    DooSeededOrchestrationRules.DOOHeader/childFLines.attributeChanged("OrderedUom")is true or
    the following test is true
      "ATO" equals ignore case DooSeededOrchestrationRules.DOOHeader/childFLines.itemSubTypeCode and
      DooSeededOrchestrationRules.DOOHeader/childFLines.attributeChanged("ConfigInventoryItemId") is tr
    or
    the following test is true
      the following test is true
        "query" equals ignore case DooSeededOrchestrationRules.DOOHeader.operationMode or
        "UPDATE" equals ignore case DooSeededOrchestrationRules.DOOHeader.operationMode
      and
      the following test is true
        "CREATE" equals ignore case DooSeededOrchestrationRules.DOOHeader/childFLines.lineOperation and
        "Y" equals ignore case DooSeededOrchestrationRules.DOOHeader/childFLines.purchasingEnabledFlag and
        the following test is true
          DooSeededOrchestrationRules.DOOHeader/childFLines.shipSetName isn't null or
          the following test is true
            "OPTION" equals ignore case DooSeededOrchestrationRules.DOOHeader/childFLines.itemSubTypeCode or
            "INCLUDED" equals ignore case DooSeededOrchestrationRules.DOOHeader/childFLines.itemSubTypeCode	
THEN
  assert new DooSeededOrchestrationRules.Result ( resultObj:"CANCEL_CREATE", resultObjKey:DooSeededOrchestrationRules.DOOHeader/childFLines.fulfillLineId )