psdi.app.persongroup

Class PersonGroupTeam

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


    public class PersonGroupTeam
    extends Mbo
    implements PersonGroupTeamRemote
    Mbo object to represent PersonGroupTeam. It contains information for person group primary members and alternates for each person in the group. See the Person Group package description for details.

    This is a System level object.

    The key attributes for this object are PersonGroup, ResppartyGroup and Respparty

    The attributes in this object are as follows:

    Attribute Description

    AttributeDescription
    psdi.app.persongroup.FldPersonGroup PersonGroupIdentifier of the Person Group
    {@link psdi.app.persongroup.FldRespPartyGroup RespPartyGroup}A Personid identifying a responsible party within a responsible party group. If this is a primary (non alternate) member (resppartygroup) then respparty equals resppartygroup
    {@link psdi.app.persongroup.FldRespParty RespParty}A Personid identifying a responsible party within a responsible party group. If this is an alternate for the primary member (resppartygroup) then respparty does not equal resppartygroup
    {@link psdi.app.persongroup.FldAQSeq RespPartyGroupSeq}Assignment sequence for primary members of a PersonGroupTeam... identifies which member gets assigned first.
    {@link psdi.app.persongroup.FldAQSeq RespPartySeq}Assignment sequence for a responsible party within a group.
    {@link psdi.app.persongroup.FldUseForOrg UseForOrg} Affects workflow searching for people (Not referenced for alternates)
    {@link psdi.app.persongroup.FldUseForSite UseForSite} Affects workflow searching for people (Not referenced for alternates)
    {@link psdi.app.persongroup.FldGroupDefault GroupDefault} true if this is the default for the group. There must be exactly one.
    SiteDefault true if this is the default for the site. Works with UseForSite. Zero or one person may have this true for a given non null UseForSite value.
    OrgDefault true if this is the default for the org. Works with UseForOrg. Zero or one person may have this true for a given non null UseForOrg value.
    See Also:
    PersonGroup
    • Constructor Detail

      • PersonGroupTeam

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

      • init

        public void init()
                  throws MXException
        init routine For existing rows attributes PARTYGROUPID,RESPPARTYGROUP,RESPPARTY are set readonly For existing rows attributes (usefororg,useforsite) are readonly if (orgdefault,sitedefault) are null
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add a new persongroupteam Initialise all the fields that are "required". The table below shows the default values for each of the attributes listed.
        Attribute NameAttribute Value
        resppartyseq1
        ORGDEFAULTfalse
        SITEDEFAULTfalse
        GROUPDEFAULTfalse
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Function called before delete() to check if a PersonGroupTeam is the default only non default members are allowed to be deleted
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        Delete the PersonGroupTeam record and delete associated alternates records. Do not allow deletions of the group default
        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)
      • getAlternates

        public MboSetRemote getAlternates()
                                   throws MXException,
                                          java.rmi.RemoteException
        Get the mbo set of the alternates for this personid. Return mbo set of work order person group team records sorted by respartyseq.
        Specified by:
        getAlternates in interface PersonGroupTeamRemote
        Returns:
        PersonGroupTeamSetRemote of alternates
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.persongroup.PersonGroup#getFirstAvailablePerson
      • isAvailableByCalendar

        public boolean isAvailableByCalendar(java.util.Date dateVal,
                                             java.lang.String orgID,
                                             java.lang.String siteID)
                                      throws MXException,
                                             java.rmi.RemoteException
        This immediately calls the other isAvailableByCalendar(), which now allows AvailCalc to be passed as an argument from above, thereby saving much work for the garbage collector (since that way there will be only one AvailCalc object involved, not a new one each time personRemote.getAvailableMbo is called.
        Specified by:
        isAvailableByCalendar in interface PersonGroupTeamRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • isAvailableByCalendar

        public boolean isAvailableByCalendar(java.util.Date dateVal,
                                             java.lang.String orgID,
                                             java.lang.String siteID,
                                             AvailCalc availCalc,
                                             boolean considerBreaks,
                                             int mins)
                                      throws MXException,
                                             java.rmi.RemoteException
        Check the calendar of the labor code of this member of the responsible party, determine the availability at the passed in date.
        If siteID and orgID both passed in ignore orgID and process as if only siteID was pased in. If siteID is a valid site, uses calendar rules for a site level App. Must be valid if passed in Else If siteID is not passed in and orgID is a valid org, uses calendar rules for an org level App. Must be valid if passed in. If neither is passed in, uses system calendar rules Org Calendar Rules mean siteID not passed in, orgID is passed in: Check Calendar iff
        • useforsite and usefororg are both null
        • useforsite is null AND usefororg is equal to org passed in
        Site Calendar Rules mean siteID passed in: Check Calendar iff
        • useforsite and usefororg are both null
        • useforsite is equal to site passed in
        • useforsite is in org passed in
        System Calendar Rules mean neither siteID or orgID passed in: Check Calendar iff
        • persongroupteam member does not have either useforsite or usefororg
        Specified by:
        isAvailableByCalendar in interface PersonGroupTeamRemote
        Parameters:
        java.util.Date - dateVal is the date of interest
        String - orgID organization ID
        String - siteID siteID
        Returns:
        boolean true if labor is available per the calendar
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        PersonGroup.getCurrentFirstAvailablePerson(java.util.Date, java.lang.String, java.lang.String), Person.getAvailableHours(java.util.Date, java.lang.String)
      • isAvailableByCalendarBreaks

        protected boolean isAvailableByCalendarBreaks(MboRemote availMbo,
                                                      java.util.GregorianCalendar gcCurrenttime,
                                                      java.util.GregorianCalendar gcStarttime,
                                                      java.util.GregorianCalendar gcEndtime,
                                                      int mins)
                                               throws java.rmi.RemoteException,
                                                      MXException
        Check current time before any break end for the passed workperiod. There could be more than one break record for the passed workperiod mbo.
        Throws:
        java.rmi.RemoteException
        MXException
      • 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 AssignmntParty
        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
      • makeOtherNotGroupDefault

        public void makeOtherNotGroupDefault()
                                      throws MXException,
                                             java.rmi.RemoteException
        Used to force groupdefault checkbox to function like a radiobutton. Uncheck all groupdefault boxes except the one just clicked.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.labor.LaborCraftRate#makeOtherNotPrimary
      • makeOtherNotDefault

        public void makeOtherNotDefault(java.lang.String booleanAttribute,
                                        java.lang.String useforAttribute)
                                 throws MXException,
                                        java.rmi.RemoteException
        Loop through the current set, if there are any other records for the same useforattribute value that are not this record then set their booleanAttribute to false.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.persongroup, psdi.app.persongroup
      • alreadyExists

        public boolean alreadyExists()
                              throws MXException,
                                     java.rmi.RemoteException
        Loop through the current set, if there are any other records that would be a duplicate (resppartygroup, usefororg, useforsite matches for primary members, or respparty and resppartgroup match for alternate members) return true. Only works if called from persongroup app
        Specified by:
        alreadyExists in interface PersonGroupTeamRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • alternateSameAsPrimaryParent

        protected boolean alternateSameAsPrimaryParent()
                                                throws MXException,
                                                       java.rmi.RemoteException
        Returns true if the current record is an alternate that is the same as its primary parent in this group
        Throws:
        MXException
        java.rmi.RemoteException
      • incompatibleUseForValue

        protected boolean incompatibleUseForValue(java.lang.String attribute)
                                           throws MXException,
                                                  java.rmi.RemoteException
        If this is a primary member, loop through the current set. If there are any other records that have useforsite or usefororg values which make this one invalid return true. Two mbo's are incompatible in this sense if they are in the same group, have the same resppartygroup values, and:
        • one has null usefororg and the other has a not null usefororg
        • one has null useforsite and the other has a not null useforsite
        This method only makes sense if called from the persongroup app
        Parameters:
        String - attribute. This is either #useforsite or #usefororg
        Returns:
        true if this is a primary member that is incompatible with another in this group else false
        Throws:
        MXException
        java.rmi.RemoteException
      • save

        protected void save()
                     throws MXException,
                            java.rmi.RemoteException
        Description copied from class: Mbo
        Save the object and other linked objects. Subclasses can code their save() logic to include any appropriate updates to other linked objects and call super.save().
        Overrides:
        save in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException