com.ibm.commerce.approval.commands

Class ApprovalProcessRecordsCmdImpl

  • java.lang.Object
    • com.ibm.websphere.command.CacheableCommandImpl
      • com.ibm.commerce.command.MeasuredCacheableCommandImpl
        • com.ibm.commerce.command.AbstractECTargetableCommand
          • com.ibm.commerce.command.TaskCommandImpl
            • com.ibm.commerce.approval.commands.ApprovalProcessRecordsCmdImpl
  • All Implemented Interfaces:
    ApprovalProcessRecordsCmd, com.ibm.commerce.command.CacheableECCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, com.ibm.commerce.command.TaskCommand, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command


    public class ApprovalProcessRecordsCmdImpl
    extends com.ibm.commerce.command.TaskCommandImpl
    implements ApprovalProcessRecordsCmd
    Processes an approval action with respect to the approval records. Approval actions include the approver approving or rejecting or the submitter canceling. The approver may supply an optional comment which will be stored in the approval request's record in the APRVSTATUS table.

    Before executing this task command the following sets should be performed:

  • setBusinessFlowId(): the flow being used for this approval
  • setBusinessEntityId(): the entity on which the approval is being done
  • setActorId(): the user acting on the approval
  • setAction(): the action being performed: approve, reject, or cancel
  • setComment(): the reason supplied by actor for performing the action
  • Behaviour

    This command loop through the records in the APRVSTATUS table for the given entity. Records that are for the given entity, but whose approver ID does not match the actor, get deleted. If there is a record whose approver ID matches the actor for the given entity, the status and action timestamp are updated.

See Also:

This command uses the following AccessBeans:, ApprovalStatusAccessBean

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean isReadyToCallExecute()
      Check if the command is ready to be executed.
      void performExecute()
      The main logic.
      void setAction(java.lang.Integer newAction)
      Sets the action being performed: approve, reject, or cancel.
      void setActorId(java.lang.Long newActorId)
      Sets the user performing the action.
      void setBusinessEntityId(java.lang.Long newBusinessEntityId)
      Sets the ID of the object being acted on.
      void setBusinessFlowId(java.lang.Long newBusinessFlowId)
      Sets the flow being used for this approval process.
      void setComment(java.lang.String newComment)
      Sets a comment that the actor wants included with the action.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand

        accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
      • Methods inherited from interface com.ibm.commerce.command.CacheableECCommand

        execute
      • Methods inherited from interface com.ibm.commerce.command.ECCommand

        checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
    • Field Detail

      • COPYRIGHT

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

      • ApprovalProcessRecordsCmdImpl

        public ApprovalProcessRecordsCmdImpl()
        Default constructor.
    • Method Detail

      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        Check if the command is ready to be executed.
        Overrides:
        isReadyToCallExecute in class com.ibm.commerce.command.AbstractECTargetableCommand
        Returns:
        boolean
      • performExecute

        public void performExecute()
                            throws com.ibm.commerce.exception.ECException
        The main logic.
        Specified by:
        performExecute in interface com.ibm.commerce.command.ECCommand
        Overrides:
        performExecute in class com.ibm.commerce.command.AbstractECTargetableCommand
        Throws:
        ECException.
        com.ibm.commerce.exception.ECException
      • setAction

        public void setAction(java.lang.Integer newAction)
        Sets the action being performed: approve, reject, or cancel. Represented as an integer.
        Specified by:
        setAction in interface ApprovalProcessRecordsCmd
        Parameters:
        newAction - The action being performed: approve, reject, or cancel
      • setActorId

        public void setActorId(java.lang.Long newActorId)
        Sets the user performing the action.
        Specified by:
        setActorId in interface ApprovalProcessRecordsCmd
        Parameters:
        newActorId - The user acting on the approval
      • setBusinessEntityId

        public void setBusinessEntityId(java.lang.Long newBusinessEntityId)
        Sets the ID of the object being acted on.
        Specified by:
        setBusinessEntityId in interface ApprovalProcessRecordsCmd
        Parameters:
        newBusinessEntityId - The entity on which the approval is being done
      • setBusinessFlowId

        public void setBusinessFlowId(java.lang.Long newBusinessFlowId)
        Sets the flow being used for this approval process.
        Specified by:
        setBusinessFlowId in interface ApprovalProcessRecordsCmd
        Parameters:
        newBusinessFlowId - The flow being used for this approval
      • setComment

        public void setComment(java.lang.String newComment)
        Sets a comment that the actor wants included with the action.
        Specified by:
        setComment in interface ApprovalProcessRecordsCmd
        Parameters:
        newComment - The reason supplied by actor for performing the action