psdi.app.persongroup

Class PersonGroup

  • java.lang.Object
  • All Implemented Interfaces:
    java.rmi.Remote, PersonGroupRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class PersonGroup
    extends Mbo
    implements PersonGroupRemote
    Mbo object to represent PersonGroup. See the Person Group package description for details.

    This is a Database level object.

    The key attribute for this object is PersonGroup.

    The attributes in this object are as follows:

    Attribute Description

    AttributeDescription
    PersonGroupThe id of the Person Group (Autonumber is enabled by default).
    DescriptionThe description of the person group. This is a long description owner.
    Persongroupid key autogenerated by the system
    See Also:
    PersonGroup
    • Constructor Detail

      • PersonGroup

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

      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Function called before delete() to check if a PersonGroup mbo can be deleted. A persongroup can be deleted only if it is not referenced by:
      • Work orders that are not closed
      • Tickets which are not closed
      • Job Plans
      • PMs
      • Work Flow
      • Ticket Templates and their activities
      *
Overrides:
canDelete in class Mbo
Throws:
MXException
java.rmi.RemoteException
  • delete

    public void delete(long accessModifier)
                throws MXException,
                       java.rmi.RemoteException
    Delete the persongroup record and delete associated persongroupteam records
    Specified by:
    delete in interface MboRemote
    Overrides:
    delete in class Mbo
    Parameters:
    access - modifier used for the delete passed to super.delete
    Throws:
    MXException
    java.rmi.RemoteException
    See Also:
    Mbo.delete(long)
  • appValidate

    public void appValidate()
                     throws MXException,
                            java.rmi.RemoteException
    Validate the person group. Ensure there is exactly one group default for any given persongroup. Ensure that there are no group/site/org level inconsistencies
    Overrides:
    appValidate in class Mbo
    Throws:
    MXApplicationException
    MXException
    java.rmi.RemoteException
  • validateLevels

    public void validateLevels()
                        throws MXException,
                               java.rmi.RemoteException
    Checks for the PersonGroupTeam members to ensure that if any members are at the group level that they are also not at another level. This is normally caught by field validation, but some situations are not, so they are caught here. issue 65866
    Throws:
    MXException
    java.rmi.RemoteException
    MXApplicationException("persongroup","incompatibleusefororg")
    MXApplicationException("persongroup","incompatibleuseforsite")
  • validGroupDefault

    public MboRemote validGroupDefault()
                                throws MXException,
                                       java.rmi.RemoteException
    Checks for the PersonGroupTeam members DefaultGroup 'Y' only one PersonGroupTeam for a PersonGroup can have 'Y' for GroupDefault. Throws an exception if none or more than one is the GroupDefault.
    Returns:
    MboRemote of the primary member that is the group default
    Throws:
    MXException
    java.rmi.RemoteException
    MXApplicationException("persongroup","MoreThanOneGroupDefault")
  • duplicateCheck

    public void duplicateCheck()
                        throws MXException,
                               java.rmi.RemoteException
    Checks for the PersonGroupTeam members to see if there are any duplicates. Throws an exception if there is a duplicate.
    Throws:
    MXException
    java.rmi.RemoteException
    MXApplicationException("persongroup","groupmemberAlreadyExists")
  • skipCopyField

    protected boolean skipCopyField(MboValueInfo mvi)
                             throws java.rmi.RemoteException,
                                    MXException
    Overrides the skipCopyField() in the Mbo. Since this method takes the MboValueInfo as its parameter just check to see if this field needs to be copied or skipped by using the data from the static HashTable. If this field does not need to be copied return true. The following are PERSONGROUP field will be skipped without being copied to the newly duplicated PersonGroup
    1. PERSONGROUP
    Overrides:
    skipCopyField in class Mbo
    Parameters:
    - - The MboValueInfo object of the MboValue that needs to be copied.
    Returns:
    - True,if the field does not need to be copied.In all other cases return false.
    Throws:
    MXException
    java.rmi.RemoteException
  • getResponsibleParty

    public PersonGroupTeamSetRemote getResponsibleParty()
                                                 throws MXException,
                                                        java.rmi.RemoteException
    Obtain the initial responsible party (primary members not alternates) for this persongroup. Used by communications templates etc... It returns the mbo set of PersonGroupTeam sorted by respartygroupseq.
    Specified by:
    getResponsibleParty in interface PersonGroupRemote
    Throws:
    MXException
    java.rmi.RemoteException
    See Also:
    psdi.app.persongroup.getCurrentFirstAvailablePerson().
  • getAvailablePersonforBroadcast

    public PersonSetRemote getAvailablePersonforBroadcast(java.lang.String orgID,
                                                          java.lang.String siteID)
                                                   throws MXException,
                                                          java.rmi.RemoteException
    Obtain the available PersonGroupTeam for workflow assignment(w/broadcast) by checking useforsite and usefororg values
    • site default equal to input site
    • org default equal to input org
    It returns the mbo of the person group team records based on useforsite and usefororg values. If there is no available person found with the OrgID or SiteId , it returns person with groupdefault = 'Y'.
    Specified by:
    getAvailablePersonforBroadcast in interface PersonGroupRemote
    Returns:
    PersonRemote (can be null when no person records exist for the PersonGroup) of available members by above rules
    Throws:
    MXException
    java.rmi.RemoteException
    See Also:
    PersonGroup.getResponsibleParty()
  • getCurrentFirstAvailablePerson

    public PersonRemote getCurrentFirstAvailablePerson(java.util.Date date,
                                                       java.lang.String orgID,
                                                       java.lang.String siteID)
                                                throws MXException,
                                                       java.rmi.RemoteException
    Obtain the first available PersonGroupTeam for this work order by checking the calendar of the Person Group members in this order
    • primary members by sequence number
    • alternates by the same primary member order and the alternate sequence number
    if no valid member is found one is selected in this order:
    • site default equal to input site
    • org default equal to input org
    • group default
    It returns the mbo of the person group team record. If there is no available person found, it returns null.
    Parameters:
    Date - of interest
    Returns:
    PersonRemote (can be null) of first available member by above rules
    Throws:
    MXException
    java.rmi.RemoteException
    See Also:
    PersonGroup.getResponsibleParty()
  • getCurrentFirstAvailablePerson

    public PersonRemote getCurrentFirstAvailablePerson(java.util.Date date,
                                                       java.lang.String orgID,
                                                       java.lang.String siteID,
                                                       boolean treatNoCalAsAvailable)
                                                throws MXException,
                                                       java.rmi.RemoteException
    Throws:
    MXException
    java.rmi.RemoteException
  • getCurrentResponsiblePerson

    public PersonRemote getCurrentResponsiblePerson(java.util.Date date,
                                                    java.lang.String orgID,
                                                    java.lang.String siteID)
                                             throws MXException,
                                                    java.rmi.RemoteException
    Get the responsible person in the persongroup. It will look for the first available person according to the calendar. If no one is available, the default assignment will be returned.
    Specified by:
    getCurrentResponsiblePerson in interface PersonGroupRemote
    Parameters:
    Date - of interest
    String - orgID - organization ID
    String - siteID - site ID
    Returns:
    PersonRemote for the person (can be null)
    Throws:
    MXException
    java.rmi.RemoteException
  • hasCalendar

    protected boolean hasCalendar(MboRemote pgTeamMbo,
                                  java.lang.String orgID)
                           throws MXException,
                                  java.rmi.RemoteException
    Return boolean true if person is available in the calendar
    Parameters:
    PersonGroupTeam -
    Returns:
    Throws:
    MXException
    java.rmi.RemoteException
  • getNextAvailablePerson

    public PersonRemote getNextAvailablePerson(java.util.Date date,
                                               java.lang.String skipPersonId)
                                        throws MXException,
                                               java.rmi.RemoteException
    Returns the next available Person in the person group in the sequence after the given Person. Note that the logic behind this method does not return any SITE default person or ORG default person or Group default person. The code simply loops through the list of persons in the sequence defined for the person group and finds the next available person. If no person is available, returns null. If skipPersonId is set to null, then finds the available person in the sequence order from first to last. If no person is available, returns null. If a person in the person group does not have a calendar/shift, then it is assumed that the person is available.
    Specified by:
    getNextAvailablePerson in interface PersonGroupRemote
    Parameters:
    date - date for which avaialbility needs to be checked.
    skipPersonId - Person Id in the sequence from which to find the next available person in the person group. If null is specified for this, returns the first available person in the person group.
    Returns:
    PersonRemote Returns the next available person, otherwise returns null.
    Throws:
    MXException
    java.rmi.RemoteException
  • getNextAvailablePerson

    public PersonRemote getNextAvailablePerson(java.util.Date date,
                                               java.lang.String orgID,
                                               java.lang.String siteID,
                                               java.lang.String skipPersonId)
                                        throws MXException,
                                               java.rmi.RemoteException
    Returns the next available Person in the person group in the sequence after the given Person. Note that the logic behind this method does not return any SITE default person or ORG default person or Group default person. The code simply loops through the list of persons in the sequence defined for the person group and finds the next available person. If no person is available, returns null. If skipPersonId is set to null, then finds the available person in the sequence order from first to last. If no person is available, returns null. If a person in the person group does not have a calendar/shift, then it is assumed that the person is available. If siteID is passed, then only finds the available person based on the following - person defined with useforsite that matches the siteID or - persons that do not have the useforsite specified or usefororg specified and skipping the passed skipPersonID in the sequence order. If orgID is passed, then only finds the available person based on the following - person defined with usefororg that matches the orgID or - person defined with useforsite that belongs to the orgID - persons that do not have the useforsite specified or usefororg specified and skipping the passed skipPersonID in the sequence order. If both siteID and orgID are specified, then the behavior is same as just passing in orgID NOTE: For a person within a person group, you can only specify either useforsite or usefororg and not both.
    Specified by:
    getNextAvailablePerson in interface PersonGroupRemote
    Parameters:
    date - date for which avaialbility needs to be checked.
    orgID - organization id
    siteID - site id
    skipPersonId - Person Id in the sequence from which to find the next available person in the person group. If null is specified for this, returns the first available person in the person group.
    Returns:
    PersonRemote Returns the next available person, otherwise returns null.
    Throws:
    MXException
    java.rmi.RemoteException