psdi.mbo

Class StatefulMbo

    • Field Detail

      • targetStatusOption

        public java.lang.String targetStatusOption
        This is the status we are planning to change to
      • onListTab

        public boolean onListTab
        This is the indicator on List tab
      • statusChangeButtonSigoption

        public java.lang.String statusChangeButtonSigoption
        This is the status change button sigoption
    • Constructor Detail

      • StatefulMbo

        public StatefulMbo(MboSet ms)
                    throws java.rmi.RemoteException
        Construct the Mbo
        Throws:
        java.rmi.RemoteException
    • Method Detail

      • getStatusHandler

        protected abstract StatusHandler getStatusHandler()
        Return the status handler object to be used for the actual changing of the status. This is only called once by the framework. This method must be provided by the Mbo programmer.
      • getStatusHistory

        protected abstract MboSetRemote getStatusHistory()
                                                  throws MXException,
                                                         java.rmi.RemoteException
        Return the MboSet object used for storing the status change history. This method must be provided by the Mbo programmer.
        Throws:
        MXException
        java.rmi.RemoteException
      • getInternalStatus

        public java.lang.String getInternalStatus()
                                           throws MXException,
                                                  java.rmi.RemoteException
        Returns the Internal value for the current status of the object.
        Specified by:
        getInternalStatus in interface StatefulMboRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • changeMaxStatus

        public void changeMaxStatus(java.lang.String internalStatus,
                                    java.util.Date date,
                                    java.lang.String memo,
                                    long accessModifier)
                             throws MXException,
                                    java.rmi.RemoteException
        Changes the status with an internal maximo status value.
        Specified by:
        changeMaxStatus in interface StatefulMboRemote
        Parameters:
        status - The new desired status. This is the non-translated status, the internal status value (valuelist.maxvalue).
        date - The effective date of the new status (java.util.Date).
        memo - A string briefly describing the circumstances of the change. The memo can be null.
        Throws:
        MXException - Thrown if there is a problem, or the status cannot be changed, as determined by canChangeStatus(String).
        java.rmi.RemoteException
        See Also:
        StatefulMbo.changeStatus(String,java.util.Date,String,long)
      • changeMaxStatus

        public void changeMaxStatus(java.lang.String internalStatus,
                                    java.util.Date date,
                                    java.lang.String memo)
                             throws MXException,
                                    java.rmi.RemoteException
        Changes the status with an internal maximo status value.
        Specified by:
        changeMaxStatus in interface StatefulMboRemote
        Parameters:
        status - The new desired status. This is the non-translated status, the internal status value (valuelist.maxvalue).
        date - The effective date of the new status (java.util.Date).
        memo - A string briefly describing the circumstances of the change. The memo can be null.
        Throws:
        MXException - Thrown if there is a problem, or the status cannot be changed, as determined by canChangeStatus(String).
        java.rmi.RemoteException
        See Also:
        StatefulMbo.changeStatus(String,java.util.Date,String,long)
      • changeStatus

        public void changeStatus(java.lang.String status,
                                 java.util.Date date,
                                 java.lang.String memo)
                          throws MXException,
                                 java.rmi.RemoteException
        Calls the changeStatus method with an accessModifier of NONE.
        Specified by:
        changeStatus in interface StatefulMboRemote
        Parameters:
        status - The new desired status. This is the translated status (that is, the status code as it would have been entered by a user, or valuelist.value), not the internal status value (valuelist.maxvalue).
        date - The effective date of the new status (java.util.Date).
        memo - A string briefly describing the circumstances of the change. The memo can be null.
        Throws:
        MXException - Thrown if there is a problem, or the status cannot be changed, as determined by canChangeStatus(String).
        java.rmi.RemoteException
        See Also:
        StatefulMbo.changeStatus(String,java.util.Date,String,long)
      • changeStatus

        public void changeStatus(java.lang.String status,
                                 java.util.Date asOfDate,
                                 java.lang.String memo,
                                 long accessModifier)
                          throws MXException,
                                 java.rmi.RemoteException
        Changes the status of the object. This method compares the requested status and the current status by calling canChangeStatus before the change is performed. If the status change is allowed, the status change is performed and a status history record is written. If the status change is not allowed, an exception is thrown.

        If the new status has the same MaxValue as the current status, then only the status and statusDate attributes are updated, and the StatusHandler is not used.

        Specified by:
        changeStatus in interface StatefulMboRemote
        Parameters:
        status - The new desired status. This is the translated status (that is, the status code as it would have been entered by a user, or valuelist.value), not the internal status value (valuelist.maxvalue).
        asOfDate - The effective date of the new status (java.util.Date). If this value is null, the current date/time of the server will be used.
        memo - A string briefly describing the circumstances of the change. The memo can be null.
        accessModifier - A value of NOACCESSCHECK will cause the method not to call canChangeStatus. Callers using this flag are responsible for ensuring that they are attempting a valid status change.
        Throws:
        MXException - Thrown if there is a problem, or the status cannot be changed, as determined by canChangeStatus(String).
        java.rmi.RemoteException
        See Also:
        StatefulMbo.canChangeStatus(String)
      • changeStatus

        public void changeStatus(java.lang.String status,
                                 java.lang.String progressStatus,
                                 java.util.Date asOfDate,
                                 java.lang.String memo,
                                 long accessModifier)
                          throws MXException,
                                 java.rmi.RemoteException
        Changes the status of the object. The difference from previous method is this method takes another status value progressstatus. Progressstatus is not a real status. But if progreestatus changes it inserts a value in status table.
        Specified by:
        changeStatus in interface StatefulMboRemote
        Parameters:
        status - Target status
        progressStatus - Just a new status string in status table
        asOfDate - The effective date of the new statusThe effective date of the new status
        memo - A string briefly describing the circumstances of the change
        accessModifier - he bitwise flags such as NOACCESSCHECK, NOVALIDATION_AND_NOACTION, and DELAYVALIDATION.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        * @param status
      • canChangeStatus

        public void canChangeStatus(java.lang.String changeToStatus,
                                    java.lang.String progressStatus,
                                    long accessModifier)
                             throws MXException,
                                    java.rmi.RemoteException
        Identifies whether the status of this object be changed to the specified value. If status change is not allowed, an exception is thrown. Status changes to same status as the current status are denied if progressstatus is same. else we allow to cjhange status so that a new row will be created in status table for progressstatus.Status changes to another synonym of the current status's MaxValue are always allowed.
        Specified by:
        canChangeStatus in interface StatefulMboRemote
        Parameters:
        changeToStatus - The new desired status. This is the translated status (that is, the status code as it would have been entered by a user, or valuelist.value), not the internal status value (valuelist.maxvalue).
        progressStatus - sub status progressStatus for a status
        accessModifier - If set to NOACCESSCHECK, allows status changes when not normally allowed.
        Throws:
        MXException - Thrown if the status cannot be changed.
        java.rmi.RemoteException
        See Also:
        StatefulMbo.canChangeStatus(String changeToStatus,String progressStatus, long accessModifier)
      • checkStatusChangeAuthorization

        public void checkStatusChangeAuthorization(java.lang.String changeToStatus,
                                                   boolean single)
                                            throws MXException,
                                                   java.rmi.RemoteException
        Determines if it is possible for this work order to change to this status. Only security and the current status of the work order are looked at. This method throws an exception if the status change is not allowable.
        Parameters:
        changeToStatus - The new desired status. This is the translated status (that is, the status code as it would have been entered by a user, or valuelist.value), not the internal status value (valuelist.maxvalue).
        Throws:
        Can - throw access exception with key "samestatus" or "UnrecogStatus".
        MXException
        java.rmi.RemoteException
        See Also:
        This method is called to create the list returned by getStatusList.
      • canChangeStatus

        public void canChangeStatus(java.lang.String status)
                             throws MXException,
                                    java.rmi.RemoteException
        Calls the canChangeStatus method with the flag set to NONE.
        Specified by:
        canChangeStatus in interface StatefulMboRemote
        Parameters:
        status - The new desired status. This is the translated status (that is, the status code as it would have been entered by a user, or valuelist.value), not the internal status value (valuelist.maxvalue).
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        StatefulMbo.canChangeStatus(String, long)
      • canChangeStatus

        public void canChangeStatus(java.lang.String changeToStatus,
                                    long accessModifier)
                             throws MXException,
                                    java.rmi.RemoteException
        Identifies whether the status of this object be changed to the specified value. If status change is not allowed, an exception is thrown. Status changes to same status as the current status are denied. Status changes to another synonym of the current status's MaxValue are always allowed.
        Parameters:
        changeToStatus - The new desired status. This is the translated status (that is, the status code as it would have been entered by a user, or valuelist.value), not the internal status value (valuelist.maxvalue).
        accessModifier - If set to NOACCESSCHECK, allows status changes when not normally allowed.
        Throws:
        MXException - Thrown if the status cannot be changed.
        java.rmi.RemoteException
      • save

        protected void save()
                     throws MXException,
                            java.rmi.RemoteException
        Overrides the save of Mbo so that a row is added to the status history table when a new object is saved.
        Overrides:
        save in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • getStatusListName

        public abstract java.lang.String getStatusListName()
        Return the name of the value list which contains the list of status's. This MUST be overridden by the Mbo programmer.
        Specified by:
        getStatusListName in interface StatefulMboRemote
      • getStatusList

        public MboSetRemote getStatusList()
                                   throws MXException,
                                          java.rmi.RemoteException
        Returns a remote reference to a ValueList MboSet representing the possibly valid status codes that the logged-in user is permitted to use. This list is created with out reference to any particular StatefulMbo. A status must be possible as determined by checkStatusChangeAuthorization in order to be included in the set.
        Specified by:
        getStatusList in interface StatefulMboRemote
        Returns:
        The MboSetRemote of ValueList containing the allowable new status codes.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Used to create the list. This method only checks user privileges and rules not involving details of the object changing status. The method canChangeStatus can reject some of the members of this list.
      • getValidStatusList

        public MboSetRemote getValidStatusList()
                                        throws MXException,
                                               java.rmi.RemoteException
        Get the list of those statuses that the current record is allowed to changed to from the current status. If no status can be changed from the current status, an empty MBO set will be returned.
        Specified by:
        getValidStatusList in interface StatefulMboRemote
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • filterByValidStatusList

        public void filterByValidStatusList(boolean onlyCanBeChanged,
                                            MboSetRemote values)
                                     throws MXException,
                                            java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • fireEvent

        public void fireEvent(java.lang.String type)
                       throws MXException,
                              java.rmi.RemoteException
        fires events for the different types of events for all status changes. The possible different types are - validate, preSaveEventAction, eventAction, postCommitEventAction
        Overrides:
        fireEvent in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • statusToOptionName

        public java.lang.String statusToOptionName(java.lang.String status)
        Return the sigoption name for the status.
        Parameters:
        status - The external status
        Returns: