com.ibm.commerce.order.commands

Class OrderProcessCheckApprovalCmdImpl

    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • OrderProcessCheckApprovalCmdImpl

        public OrderProcessCheckApprovalCmdImpl()
    • Method Detail

      • checkApproval

        public boolean checkApproval()
                              throws ECException
        This method implemented the business logic of whether the order requires approval. For each order item in the order, check the contract in the order item. If there is an OrderApprovalTC, it check the amount specified the TC. If the amount is less than the total price of the order including shipping and tax, it returns true. If all order items are checked and cannot find any OrderApprovalTCs satisfy the above condition, it returns false.
        Returns:
        true if approval is required, false if approval is not required.
        Throws:
        ECException
      • getEventIdentifier

        public java.lang.String getEventIdentifier()
        Allow the entry action to return an eventIdentifier to start an automatic transition.
        Specified by:
        getEventIdentifier in interface com.ibm.commerce.ubf.commands.EntryActionCmd
        Returns:
        The eventIdentifier for the automatic transition.
      • performExecute

        public void performExecute()
                            throws ECException
        Calls checkApproval() to find out if the approval is required. if checkApproval() returns true, it sets the eventIdentifier to be "BeginApproval". if checkApproval() returns false, it sets the eventIdentifier to be "NoApprovalNeeded".
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
      • reset

        public void reset()
        Resets all instance variables.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • setBusinessFlowEventData

        public void setBusinessFlowEventData(com.ibm.commerce.ubf.event.BusinessFlowEventData anEventData)
        The BusinessFlowEventListener will use this method to pass in all data the command needs.
        Specified by:
        setBusinessFlowEventData in interface com.ibm.commerce.ubf.commands.EntryActionCmd
        Parameters:
        anEventData - The business flow event data which includes all information, including requestPropoerties, commandContext and so forth.
      • setEntityId

        public void setEntityId(java.lang.Long anEntityId)
        Allow UBF passes an entity Id to the entry action command.
        Specified by:
        setEntityId in interface com.ibm.commerce.ubf.commands.EntryActionCmd
        Parameters:
        anEntityId - The entity Id.
      • setEntityObject

        public void setEntityObject(java.lang.Object anEntityObject)
        Allow UBF passes an entity object to the entry action command to avoid instantiating another instance of entity object.
        Specified by:
        setEntityObject in interface com.ibm.commerce.ubf.commands.EntryActionCmd
        Parameters:
        anEntityObject - The entity object.