psdi.app.person

Class Person

    • Field Detail

      • toChangeStatus

        public boolean toChangeStatus
      • dateTo

        public java.util.Date dateTo
    • Constructor Detail

      • Person

        public Person(MboSet ms)
               throws MXException,
                      java.rmi.RemoteException
        Construct the Person object
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • getStatusHistory

        protected MboSetRemote getStatusHistory()
                                         throws MXException,
                                                java.rmi.RemoteException
        Return the personstatus object. Required for statefullness.
        Specified by:
        getStatusHistory in class StatefulMbo
        Returns:
        The set of PERSONSTATUS records
        Throws:
        MXException
        java.rmi.RemoteException
      • getStatusHandler

        protected StatusHandler getStatusHandler()
        Return a status handler with the help of which the person status changes can be done.
        Specified by:
        getStatusHandler in class StatefulMbo
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        This method is called by the framework when a new Person record is inserted. It defaults values of the required fields.
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        Validation prior to save. Calls super then checks for a delegate loop.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Validation routine before deleting a person. A person cannot be deleted
        1. The Person ID is named directly on an Assignment or Notification on an active Workflow process.
        2. The Person ID is named on a User record.
        3. The Person ID is named on a Labor record.
        4. The Person ID is named on a Person Group.
        5. The Person ID is named as a Supervisor or Delegate on other Person records.
        6. The Person ID is named as a Ticket Owner.
        7. The Person ID is named in a Communications Template.
        8. The Person ID is named as a Ship To Contact or Bill To Contact.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        Delete a person record. The related personcal, email, phone and commodity records will be deleted too.
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        accessModifier - The bitwise flag specified to determine if certain normal security checks are to be bypassed for this delete request. For example: if the accessModifer is NOACCESSCHECK, then the check for the object's NODELETE flag and the call to the object's canDelete() method will not be performed. If the accessModifer is NONE, then all the access checks are performed before this object is marked delete.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • skipCopyField

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws MXException,
                                        java.rmi.RemoteException
        It specifies the fields which won't get copied when the person record is being copied.
        Overrides:
        skipCopyField in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • inactivate

        protected void inactivate(java.lang.String status,
                                  java.util.Date asOfDate,
                                  java.lang.String memo)
                           throws MXException,
                                  java.rmi.RemoteException
        Inactivate the person. This is called by status handler. It is not an exposed method on the remote interface. When inactivate a person, the laborcode and user of this person will also be inactivated. If they cannot be inactivated by any reason, person cannot be inactivated, throw exception with nested exception. Person cannot be inactivated if they are a Workflow Delegate for another person.
        Throws:
        MXException
        java.rmi.RemoteException
      • isDelegateLoopCreated

        public void isDelegateLoopCreated()
                                   throws MXException,
                                          java.rmi.RemoteException
        This method first checks to see if there is a loop created by the delegate personids. If there is, then it loops through each delegate, comparing the delegates dates to a date range (initially the first person's delegation dates.) If any delegates dates do NOT fall within the date range, that means there is no loop, and we can return. Else, we update the range appropriately and continue the loop. If we get through all delegates, then all delegate's dates Have fallen within the range, and we have a delegate loop.
        Specified by:
        isDelegateLoopCreated in interface PersonRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • getSupervisees

        public java.lang.String getSupervisees()
                                        throws MXException,
                                               java.rmi.RemoteException
        This method finds all of the Person records that are supervised by this Person object. This method recursively includes all people who are supervised by people who are supervised by this person, and so on. The result is a comma separated list of personids or an empty string if there are no supervisees.
        Specified by:
        getSupervisees in interface PersonRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Person.getTimezoneStr()
      • getAvailableHours

        public double getAvailableHours(java.util.Date startDate,
                                        java.lang.String orgid,
                                        AvailCalc availCalc)
                                 throws MXException,
                                        java.rmi.RemoteException
        This will give you the number of hours available on startDate for the org provided. It will return 0.0 if there are no hours available, or that org doesn't produce a calendar. Use this method, as opposed to getAvailableMbo(Date, String), if getting multiple mbo's over a date range of a week (e.g. Assignment Manager). Passing in an already instantiated AvailCalc object will store a weeks worth of WorkPeriod and ModAvail mbos for quick retrieval.
        Specified by:
        getAvailableHours in interface PersonRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Person.getAvailableHours(java.util.Date, java.lang.String)
      • getAvailableHours

        public double getAvailableHours(java.util.Date startDate,
                                        PersonCalRemote personCal,
                                        AvailCalc availCalc)
                                 throws MXException,
                                        java.rmi.RemoteException
        This will give you the number of hours available on startDate for the org, calnum, and shiftnum provided. It will return 0.0 if there are no hours available, or that org doesn't produce a calendar. Use this method, as opposed to getAvailableMbo(Date, String), if getting multiple mbo's over a date range of a week (e.g. Assignment Manager). Passing in an already instantiated AvailCalc object will store a weeks worth of WorkPeriod and ModAvail mbos for quick retrieval.
        Throws:
        MXException
        java.rmi.RemoteException
      • getAvailableMboList

        public java.util.List getAvailableMboList(java.util.Date startDate,
                                                  java.lang.String orgid)
                                           throws MXException,
                                                  java.rmi.RemoteException
        This returns either the workperiod or modavail mbo for the given parameters. Returns null if there is no mbo available for the date or org.
        Specified by:
        getAvailableMboList in interface PersonRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Person.getAvailableMbo(Date,String)
      • getAvailableMbo

        public MboRemote getAvailableMbo(java.util.Date startDate,
                                         java.lang.String orgid,
                                         AvailCalc availCalc)
                                  throws MXException,
                                         java.rmi.RemoteException
        This returns either the workperiod or modavail mbo for the given parameters. Returns null if there is no mbo available for the date or org. Use this method, as opposed to getAvailableMbo(Date, String), if getting multiple mbo's over a date range of a week (e.g. Assignment Manager). Passing in an already instantiated AvailCalc object will store a weeks worth of WorkPeriod and ModAvail mbos for quick retrieval.
        Specified by:
        getAvailableMbo in interface PersonRemote
        Parameters:
        startDate -
        orgid -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Person.getAvailableMbo(Date,String)
      • getAvailableMboList

        public java.util.List getAvailableMboList(java.util.Date startDate,
                                                  java.lang.String orgid,
                                                  AvailCalc availCalc)
                                           throws MXException,
                                                  java.rmi.RemoteException
        This returns either the workperiod or modavail mbo for the given parameters. Returns null if there is no mbo available for the date or org. Use this method, as opposed to getAvailableMbo(Date, String), if getting multiple mbo's over a date range of a week (e.g. Assignment Manager). Passing in an already instantiated AvailCalc object will store a weeks worth of WorkPeriod and ModAvail mbos for quick retrieval.
        Specified by:
        getAvailableMboList in interface PersonRemote
        Parameters:
        startDate -
        orgid -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Person.getAvailableMbo(Date,String)
      • getAvailableMbo

        public MboRemote getAvailableMbo(java.util.Date startDate,
                                         PersonCalRemote personCal,
                                         AvailCalc availCalc)
                                  throws MXException,
                                         java.rmi.RemoteException
        This returns either the workperiod or modavail mbo for the given parameters. Returns null if there is no mbo available for the date or org. Use this method, as opposed to getAvailableMbo(Date, String), if getting multiple mbo's over a date range of a week (e.g. Assignment Manager). Passing in an already instantiated AvailCalc object will store a weeks worth of WorkPeriod and ModAvail mbos for quick retrieval.
        Parameters:
        startDate -
        orgid -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getAvailableMboList

        public java.util.List getAvailableMboList(java.util.Date startDate,
                                                  PersonCalRemote personCal,
                                                  AvailCalc availCalc)
                                           throws MXException,
                                                  java.rmi.RemoteException
        This returns either the workperiod or modavail mbo for the given parameters. Returns null if there is no mbo available for the date or org. Use this method, as opposed to getAvailableMbo(Date, String), if getting multiple mbo's over a date range of a week (e.g. Assignment Manager). Passing in an already instantiated AvailCalc object will store a weeks worth of WorkPeriod and ModAvail mbos for quick retrieval.
        Parameters:
        startDate -
        orgid -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • changeStatus

        public void changeStatus(java.lang.String status,
                                 java.util.Date date,
                                 java.lang.String memo)
                          throws MXException,
                                 java.rmi.RemoteException
        Description copied from class: StatefulMbo
        Calls the changeStatus method with an accessModifier of NONE.
        Specified by:
        changeStatus in interface StatefulMboRemote
        Overrides:
        changeStatus in class StatefulMbo
        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)
      • getDelegate

        public PersonRemote getDelegate(java.util.Date asof)
                                 throws MXException,
                                        java.rmi.RemoteException
        Returns this person's delegate person record for the date given. Returns null if there's no delegate.
        Specified by:
        getDelegate in interface PersonRemote
        Parameters:
        asof - The date to get the delegate for. Passing null will use the current date/time.
        Returns:
        The delegate's person record or null.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Person.getDelegate(java.util.Date)
      • getCalType

        public java.lang.String getCalType()
                                    throws MXException,
                                           java.rmi.RemoteException
        Get the internal string represent the user's default calendar type. The returned String is the java recognized string.
        Specified by:
        getCalType in interface PersonRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Person.getCalType()
      • getLocaleStr

        public java.lang.String getLocaleStr()
                                      throws MXException,
                                             java.rmi.RemoteException
        Get the internal string represent the user's default locale. The returned String is the java recognized string.
        Specified by:
        getLocaleStr in interface PersonRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Person.getLocaleStr()
      • updatePrimaryCalendar

        public void updatePrimaryCalendar()
                                   throws MXException,
                                          java.rmi.RemoteException
        Method to update the primary calendar of this person. For use by the non-persistent PrimaryCalNum, PrimaryShiftNum, and PrimaryCalOrg fields.
        Throws:
        MXException
        java.rmi.RemoteException
      • deletePrimaryCalendar

        public void deletePrimaryCalendar()
                                   throws MXException,
                                          java.rmi.RemoteException
        Method to delete the primary calendar of this person. For use by the non-persistent PrimaryCalNum, PrimaryShiftNum, and PrimaryCalOrg fields.
        Throws:
        MXException
        java.rmi.RemoteException
      • getValidateOrder

        public java.lang.String[] getValidateOrder()
        Description copied from class: Mbo
        Returns a String[] of field names. The validate and batchValidate() method will test the fields' validations in this order.
        Overrides:
        getValidateOrder in class Mbo
      • getStartApp

        public java.lang.String getStartApp()
                                     throws java.rmi.RemoteException,
                                            MXException
        Get the user startup application string.
        Specified by:
        getStartApp in interface PersonRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • toChangeStatusAfterInactive

        public boolean toChangeStatusAfterInactive()
                                            throws MXException,
                                                   java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException