Interface CopyFromOrdersProcessImplementationInterface


  • public interface CopyFromOrdersProcessImplementationInterface
    Interface to be implemented by the hooks to be executed on the Copy From Orders process. Example of a hook:
     import javax.enterprise.context.Dependent;
     import org.openbravo.client.kernel.ComponentProvider.Qualifier;
     import org.openbravo.common.actionhandler.copyfromorderprocess.CopyFromOrdersProcessImplementationInterface;
     import org.openbravo.model.common.order.Order;
     import org.openbravo.model.common.order.OrderLine;
     
     @Dependent
     @Qualifier(CopyFromOrdersProcessImplementationInterface.COPY_FROM_ORDER_PROCESS_HOOK_QUALIFIER)
     public class TestHook implements CopyFromOrdersProcessImplementationInterface {
     
       @Override
       public int getOrder() {
         return 10;
       }
     
       @Override
       public void exec(Order processingOrder, OrderLine orderLine, OrderLine newOrderLine) {
         newOrderLine.setDescription("Test");
       }
     }
     
    • Field Detail

    • Method Detail

      • getOrder

        int getOrder()
        Returns the order when the concrete hook will be implemented. A positive value will execute the hook after the core's logic
      • exec

        void exec​(Order newOrder,
                  OrderLine oldOrderLine,
                  OrderLine newOrderLine)
        Executes the hook logic on the Copy From Orders process
        Parameters:
        newOrder - the new order we are creating
        oldOrderLine - the order line from which we are creating the line
        newOrderLine - the new line created within the newOrder