psdi.app.pr

Class PRStatusHandler

  • All Implemented Interfaces:
    MboConstants


    public class PRStatusHandler
    extends StatusHandler
    Handles all the status changes for a pr object
    • Field Detail

      • statusChangeMatrix

        public static boolean[][] statusChangeMatrix
        A statusChangeMatrix for the legal status changes that can be made.

        Status   WAPPR   APPR    COMP   CANCEL 
        WAPPR false true true true
        APPR true false true true
        COMP false true false false
        CANCEL false false false false
        The above table must be read from right to left only.
        For example , if you want to change the status from COMP to WAPPR , look at the left for the COMP row and look at the intersecting WAPPR column. The value is false. This means that this status change is not allowed.
    • Constructor Detail

      • PRStatusHandler

        public PRStatusHandler(StatefulMbo sm)
        Constructor
    • Method Detail

      • checkStatusChangeAuthorization

        public void checkStatusChangeAuthorization(java.lang.String desiredExternalStatus)
                                            throws MXException,
                                                   java.rmi.RemoteException
        Checks to see if the user is authorised to make a status changes. In other words , it checks if the user has the required privilege to change the status. After ensuring that the user has the required privilege, this methods checks if the status change is legal.
        Specified by:
        checkStatusChangeAuthorization in class StatusHandler
        Parameters:
        currentExternalStatus - The current external status of the PO.
        desiredExternalStatus - The desired external status of the PO.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        checkUserSecurity, possibleStatusChange
      • getOptionName

        public static java.lang.String getOptionName(java.lang.String status)
        Given a PR Status, return the optionName Note the status passed in is the INTERNAL status code.
        The SigOption Option Name doesn't always match the status name.
        Parameters:
        status - The status to return the optionName of.
        Returns:
        optionName The Option Name.
      • canChangeStatus

        public void canChangeStatus(java.lang.String currentStatus,
                                    java.lang.String desiredStatus,
                                    long accessModifier)
                             throws MXException,
                                    java.rmi.RemoteException
        Defines which status changes are legal. If a status change is not legal, an MXAccessException is thrown.
        Overrides:
        canChangeStatus in class StatusHandler
        Parameters:
        currentMaxStatus - the PR's current status
        desiredStatus - the status to change to
        accessModifier - If this flag is set to NOACCESSCHECK, a work flow controlled purchase requisition may change status.
        Throws:
        MXApplicationException - (pr, invalidstatus) is thrown if the desired status is not legal.
        MXException
        java.rmi.RemoteException
      • changeStatus

        public void changeStatus(java.lang.String currentStatus,
                                 java.lang.String desiredStatus,
                                 java.util.Date date,
                                 java.lang.String memo)
                          throws MXException,
                                 java.rmi.RemoteException
        Changes the status from the current state to a desired state.
        Overrides:
        changeStatus in class StatusHandler
        Parameters:
        currentMaxStatus - the PR's current status
        desiredStatus - the status to change to
        date - the date as of the status change is to be made
        memo - memo text
        Throws:
        MXException
        java.rmi.RemoteException
      • updateMboForStatus

        public void updateMboForStatus(java.lang.String status)
                                throws MXException,
                                       java.rmi.RemoteException
        Set the relevant fields to be read-only based on the status. If the status of the PR is not WAPPR set the fields of PR as read only.
        Overrides:
        updateMboForStatus in class StatusHandler
        Parameters:
        status - any PR status
        Throws:
        MXException
        java.rmi.RemoteException
      • deletePRReferencesFromWO

        public void deletePRReferencesFromWO()
                                      throws MXException,
                                             java.rmi.RemoteException
        Gets all the WPItem records that contains the PRNUM. This method is called from the PR cancel method. It will wipe out prnum and prlinenum references on any
        Throws:
        MXException
        java.rmi.RemoteException
      • postStatusChange

        public void postStatusChange(java.lang.String currentStatus,
                                     java.lang.String status,
                                     java.util.Date asOfDate,
                                     java.lang.String memo)
                              throws MXException,
                                     java.rmi.RemoteException
        This method is called by the framework's changestatus method. Any post processing that needs to be done after status changes must be included in this method. Closes the PR if all lines that belong to the PR have been assigned to a PO.
        Overrides:
        postStatusChange in class StatusHandler
        Throws:
        MXException
        java.rmi.RemoteException