psdi.app.item

Class ItemStatusHandler

  • All Implemented Interfaces:
    MboConstants


    public class ItemStatusHandler
    extends StatusHandler
    Handles all the status changes for an Item object.
    • Constructor Detail

      • ItemStatusHandler

        public ItemStatusHandler(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 item.
        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 item may change status.
        Throws:
        MXException - Throws a MXAccessException.
        java.rmi.RemoteException
      • canPending

        public void canPending()
                        throws MXException,
                               java.rmi.RemoteException
        Can change to pending?
        Throws:
        MXException
        java.rmi.RemoteException
      • canPlanning

        public void canPlanning()
        Can change to Planning? Can change to Planning? This is an empty method implementation. Any business rules that need to be implemented before the item can be changed to a status of PLANNING, must be coded in this method.
      • canActive

        public void canActive()
        Can change to Active? This is an empty method implementation. Any business rules that need to be implemented before the item can be changed to a status of ACTIVE, must be coded in this method.
      • canPendobs

        public void canPendobs()
        Can Change to Pendobs ? This method checks if any PO or PR exists for the item. If exists, it throws an exception.
        Throws:
        MXException
        java.rmi.RemoteException
      • canObsolete

        public void canObsolete()
                         throws MXException,
                                java.rmi.RemoteException
        Can change to Obsolete ? This method checks for WorkOrder/JobPlan/MR/PR/PO/InvBalances/Asset exists for itemnum. If exists, it throws an exception.
        Throws:
        MXException
        java.rmi.RemoteException
      • validateChangeStatus

        public void validateChangeStatus(java.lang.String currentStatus,
                                         java.lang.String desiredStatus,
                                         java.util.Date asOfDate,
                                         java.lang.String memo)
                                  throws MXException,
                                         java.rmi.RemoteException
        Validate the status from the current state to a desired state.
        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
      • 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 - Item's current status.
        memo - Memo text.
        desiredStatus - The status to change to.
        Throws:
        MXException
        java.rmi.RemoteException