psdi.app.workorder

Class WOStatusHandler

  • All Implemented Interfaces:
    MboConstants


    public class WOStatusHandler
    extends StatusHandler
    Handles all the status changes for a work order object
    • Constructor Detail

      • WOStatusHandler

        public WOStatusHandler(StatefulMbo sm)
        Constructor
        Parameters:
        sm -
    • Method Detail

      • 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. This test determines whether a status change is possible by only checking the user's security and the current status of the work order.
        Specified by:
        checkStatusChangeAuthorization in class StatusHandler
        Parameters:
        desiredStatus - The status to change the work order to. This is the synonym value.
        Throws:
        MXException - Throws an access exception with group key "access" and error key "notauthorized" if the user does not have security for a status change.
        java.rmi.RemoteException
        See Also:
        The calling method.
      • 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 work order to. This is the synonym value.
        accessModifier - If this flag is set to NOACCESSCHECK, a work flow controlled work order may change status. This also allows internal processes to set the work order's status to WSCH.
        Throws:
        MXException - Throws a MXAccessException with a group key of "workorder". The error key will be one of: "unappr", "wappr", "wmatl", "inprg", "comp", "close", "can", "wsch" depending on the desired status parameter.
        java.rmi.RemoteException
      • getStatusProgression

        public static java.util.Vector getStatusProgression()
        Create the status progression vector when required.
      • getOptionName

        public static java.lang.String getOptionName(java.lang.String status)
        Given a WO 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.
      • changeStatus

        public void changeStatus(java.lang.String currentStatus,
                                 java.lang.String desiredStatus,
                                 java.util.Date asOfDate,
                                 java.lang.String memo)
                          throws MXException,
                                 java.rmi.RemoteException
        Change the status from the current state to a desired state.
        Overrides:
        changeStatus in class StatusHandler
        Parameters:
        asOfDate - The date as of the status change is to be made. If null, set to the current date/time.
        currentStatus - The parent WO's status now.
        memo - Memo text.
        desiredStatus - The status to change to.
        Throws:
        MXException
        java.rmi.RemoteException
      • materialsReceiptsCompleted

        public boolean materialsReceiptsCompleted()
                                           throws MXException,
                                                  java.rmi.RemoteException
        Verify whether materials receipts are completed or not. This method is called by #approve that should verify this restriction to perform the approval or perform "Waiting for Material" status change.
        Returns:
        returns true whether materials receipts for the current WO are completed.
        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
        Process post status change logic. Currently calls updateAssetDataAfterStatusChange() if the updateAssetData flag is true
        Overrides:
        postStatusChange in class StatusHandler
        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
        Overrides:
        updateMboForStatus in class StatusHandler
        Parameters:
        status -
        Throws:
        MXException
        java.rmi.RemoteException
      • resetUsingAssetWorkType

        public void resetUsingAssetWorkType()
                                     throws MXException,
                                            java.rmi.RemoteException
        Reset AssetMeter Settings Since Last Repair, Since Last Overhaul, Since Last Inspection when completing a record.
        Parameters:
        type - This variable represents the worktype synonymdomain (NONE,REPAIR,INSPECTION,OVERHAUL)
        metertype - The type of meter (CONTINUOUS,GAUGE,CHARACTERISTIC), for the selected meter.
        Throws:
        MXException
        java.rmi.RemoteException
      • resetUsingLocationWorkType

        public void resetUsingLocationWorkType()
                                        throws MXException,
                                               java.rmi.RemoteException
        Reset LocationMeter Settings Since Last Repair, Since Last Overhaul, Since Last Inspection when completing a record.
        Parameters:
        type - This variable represents the worktype synonymdomain (NONE,REPAIR,INSPECTION,OVERHAUL)
        metertype - The type of meter (CONTINUOUS,GAUGE,CHARACTERISTIC), for the selected meter.
        Throws:
        MXException
        java.rmi.RemoteException
      • validatePlannedLaborCraftRate

        public void validatePlannedLaborCraftRate()
                                           throws MXException,
                                                  java.rmi.RemoteException
        Check to be sure all the planned labor records have valid contracts
        Throws:
        MXException
        java.rmi.RemoteException
      • validateAssignAMCrew

        public void validateAssignAMCrew()
                                  throws MXException,
                                         java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • alertPMStatus

        public boolean alertPMStatus(java.lang.String currentStatus,
                                     java.lang.String desiredStatus)
                              throws MXException,
                                     java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • canChangePFCStatus

        public boolean canChangePFCStatus(java.lang.String currentStatus,
                                          java.lang.String desiredStatus,
                                          long accessModifier,
                                          boolean throwExceptions)
                                   throws MXException,
                                          java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • compareStatusPosition

        public static int compareStatusPosition(java.lang.String status1,
                                                java.lang.String status2,
                                                Translate translator)
                                         throws MXException,
                                                java.rmi.RemoteException
        Compare the position of one work order status to the position of another work order status in the status hierarchy.
        This method expects the external status values that.
        Parameters:
        String - - External value of the first status
        String - - External value of the second status
        Translate - - Translator to be used to convert from the external value to the internal value
        Returns:
        STATUSISBEFORE - The first status is before the second status in the status hierarchy
        Throws:
        MXException
        java.rmi.RemoteException
      • canChangeStatusCal

        public void canChangeStatusCal(java.lang.String currentStatus,
                                       java.lang.String desiredStatus,
                                       long accessModifier)
                                throws MXException,
                                       java.rmi.RemoteException
        Can change status for calibration.
        Parameters:
        currentStatus - the current status
        desiredStatus - the desired status
        accessModifier - the access modifier
        Throws:
        MXException - the mX exception
        java.rmi.RemoteException - the remote exception
      • hasTools

        protected boolean hasTools()
                            throws java.rmi.RemoteException,
                                   MXException
        Tell whether the parent Workorder has tool associated.
        Returns:
        true if there are associated tools.
        Throws:
        MXException
        java.rmi.RemoteException
      • hasDS

        protected boolean hasDS()
                         throws java.rmi.RemoteException,
                                MXException
        Tell whether the parent Workorder has data sheets associated. Issue 08-16400
        Returns:
        true if there are associated tools.
        Throws:
        MXException
        java.rmi.RemoteException
      • postStatusChangeCal

        public void postStatusChangeCal(java.lang.String currentStatus,
                                        java.lang.String status,
                                        java.util.Date asOfDate,
                                        java.lang.String memo)
                                 throws MXException,
                                        java.rmi.RemoteException
        Handle actions after the status change. Warn if there are blank function checks or dynamic checks.
        Throws:
        MXException
        java.rmi.RemoteException
      • cancelYesNOMessage

        public void cancelYesNOMessage(java.lang.String message)
                                throws MXException,
                                       java.rmi.RemoteException
        This method displays the appropriate message to be displayed to the user. The messagekey
        Parameters:
        message - - messagekey for message to be displayed to the user.
        Throws:
        MXException
        java.rmi.RemoteException
      • timerIsActive

        public void timerIsActive()
                           throws MXException,
                                  java.rmi.RemoteException
        This method is called while completing work orders with active labor transactions. An error message or warning is thrown. In case of a warning message the user can choose to go ahead with the work order completion or stop the process.
        Throws:
        MXException
        java.rmi.RemoteException
      • toIncludeTaskLabTrans

        public int toIncludeTaskLabTrans()
                                  throws MXException,
                                         java.rmi.RemoteException
        144438: Per David Havican, include a system property mxe.app.workorder.includeTaskLabTrans to determine if we should consider the labtrans records from the task work orders when calculating the current wo's actual start time and actual finish time. This method is to conditionally use IV63558, since this is expensive for clients who do not want this functionality.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException