psdi.app.jobplan

Class JPStatusHandler

    • Field Detail

      • statusChangeMatrix

        public static boolean[][] statusChangeMatrix
        A statusChangeMatrix for the legal status changes that can be made when Job Plan Revision is enabled. Status   DRAFT    WAPPR   APPR    INACTIVE  DRAFT false true true true WAPPR true false true true APPR true true false true INACTIVE true true true 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.
      • statusChangeMatrixNoRev

        public static boolean[][] statusChangeMatrixNoRev
        A statusChangeMatrixNoRev for the legal status changes that can be made when Job Plan Revision is disabled. 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.
      • statusIndexes

        protected java.util.Map statusIndexes
        Map status names to their indexes in the change matrix
      • options

        protected java.util.Map options
        Map status names to their corresponding option names
    • Constructor Detail

      • JPStatusHandler

        public JPStatusHandler(StatefulMbo sm)
        Parameters:
        sm -
    • Method Detail

      • 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 exception is thrown. This method does not check user's security clearance.
        Overrides:
        canChangeStatus in class StatusHandler
        Parameters:
        currentStatus - The work order's current status
        desiredStatus - The status to change the job plan to. This is the synonym value.
        accessModifier - Ignored
        Throws:
        MXException - Throws an MXAccessException with a group key of "jobplan". The error key will be : "JPInUse" if the status is being changed from an ACTIVE status and the Job Plan is used on any Ticket Template Activity, Route Stop, PMSequence, MasterPMSeq, MeasurePoint or CharPointAction.
        java.rmi.RemoteException
        See Also:
        isJPInUse
      • checkStatusChangeAuthorization

        public void checkStatusChangeAuthorization(java.lang.String desiredStatus)
                                            throws MXException,
                                                   java.rmi.RemoteException
        Determines which statuses to show in the list returned by the Mbo's getStatusList method. If the Job Plan is set to DRAFT or INACTIVE make sure the Job Plan is not being used on any Ticket Template Activity, Route Stop, PMSequence, MasterPMSeq, MeasurePoint or CharPointAction.
        Specified by:
        checkStatusChangeAuthorization in class StatusHandler
        Parameters:
        desiredStatus - The status to change the work order to. This is the synonym value.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        The calling method., isJPInUse
      • checkUserSecurity

        public void checkUserSecurity(java.lang.String desiredMaxStatus)
                               throws MXException,
                                      java.rmi.RemoteException
        Check out the users security rights to call the specified status. Note the status passed in is the INTERNAL status code. Note that the SigOption Option Name doesn't always match the status name.
        Parameters:
        desiredMaxStatus - The status to check if we can change to.
        Throws:
        MXAccessException - Throws an access exception "notauthorized" if the check fails.
        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:
        currentStatus - 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