Class CancelAndReplaceOrderHook


  • public abstract class CancelAndReplaceOrderHook
    extends Object
    Abstract class created to implement hooks inside Cancel and Replace process. All hooks in that process must extend this class so they implement exec process.
    Author:
    openbravo
    • Constructor Detail

      • CancelAndReplaceOrderHook

        public CancelAndReplaceOrderHook()
    • Method Detail

      • exec

        public abstract void exec​(boolean replaceOrder,
                                  boolean triggersDisabled,
                                  Order oldOrder,
                                  Order newOrder,
                                  Order inverseOrder,
                                  org.codehaus.jettison.json.JSONObject jsonorder)
                           throws Exception
        Exec method that all hooks extending this abstract class must implement.
        Parameters:
        replaceOrder - boolean that informs if the old sales order has been replaced or not.
        triggersDisabled - boolean that informs if triggers have been disabled previous to execute this hook.
        oldOrder - Sales Order that has been replaced.
        newOrder - New Sales Order that has replaced the old Sales Order
        inverseOrder - New Sales Order equal to old sales order but with negative quantities. Cancellation Order.
        jsonorder - JSONObject with information of the order coming with values when the hook is invoked because the Cancel and Replace has been executed from Web POS.
        Throws:
        Exception
      • exec

        public void exec​(boolean replaceOrder,
                         boolean triggersDisabled,
                         Order oldOrder,
                         List<Order> newOrders,
                         Order inverseOrder,
                         org.codehaus.jettison.json.JSONObject jsonorder)
                  throws Exception
        Exec method that hooks extending this class can implement. This method is only executed when running cancel and replace flow for many replacements, using CancelAndReplaceUtils.cancelAndReplaceOrder(String, Set, String, JSONObject, boolean).
        Parameters:
        replaceOrder - boolean that informs if the old sales order has been replaced or not.
        triggersDisabled - boolean that informs if triggers have been disabled previous to execute this hook.
        oldOrder - Sales Order that has been replaced.
        newOrders - New Sales Orders that have replaced the old Sales Order
        inverseOrder - New Sales Order equal to old sales order but with negative quantities. Cancellation Order.
        jsonorder - JSONObject with information of the order coming with values when the hook is invoked because the Cancel and Replace has been executed from Web POS.
        Throws:
        Exception