psdi.app.workorder

Class AssignmentSet

    • Field Detail

      • postCommitActions

        protected java.util.List postCommitActions
      • addedAsgns

        protected java.util.Vector addedAsgns
      • showPage

        public boolean showPage
    • Constructor Detail

      • AssignmentSet

        public AssignmentSet(MboServerInterface ms)
                      throws MXException,
                             java.rmi.RemoteException
        Construct the set of assignment.
        Parameters:
        ms - The MboServerInterface for AssignmentSet.
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • getMboInstance

        protected Mbo getMboInstance(MboSet ms)
                              throws MXException,
                                     java.rmi.RemoteException
        Factory method to create an assignment object.
        Specified by:
        getMboInstance in class MboSet
        Parameters:
        ms - The assignment MboSet.
        Returns:
        an assignment Mbo object.
        Throws:
        MXException
        java.rmi.RemoteException
      • assignmentsForLaborCodeAndWorkOrder

        public void assignmentsForLaborCodeAndWorkOrder(java.lang.String labor,
                                                        java.lang.String woIDs)
                                                 throws MXException,
                                                        java.rmi.RemoteException
        Sets this AssignmentSet to assignments assigned to the laborcode, ordered by the Schedule date.
        Specified by:
        assignmentsForLaborCodeAndWorkOrder in interface AssignmentSetRemote
        Parameters:
        labor - The LaborCode to search for.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.workorder.AssignmentSet#assignmentsForLaborCodeAndWorkOrder(String labor, long[] workOrderId)
      • assignmentsForCrewAndWorkOrder

        public void assignmentsForCrewAndWorkOrder(java.lang.String amcrew,
                                                   long[] workOrderIds)
                                            throws MXException,
                                                   java.rmi.RemoteException
        Sets this AssignmentSet to assignments assigned to the crew, ordered by the Schedule date.
        Specified by:
        assignmentsForCrewAndWorkOrder in interface AssignmentSetRemote
        Parameters:
        amcrew - The crew to search for.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.workorder.AssignmentSet#assignmentsForCrewAndWorkOrder(String amcrew, long workOrderId)
      • addToUserPrefWhere

        public java.lang.String addToUserPrefWhere()
                                            throws MXException,
                                                   java.rmi.RemoteException
        Add this where clause to the MboSet's getUserPrefWhere()
        Returns:
        The where clause.
        Throws:
        MXException
        java.rmi.RemoteException
      • getUserPrefWhere

        public java.lang.String getUserPrefWhere()
        Override the MboSet getUserPrefWhere() to return a userpref where clause which is appended to th existing whereClause. This is called by the framework to allow any app specific modifications to the whereClause.
        Overrides:
        getUserPrefWhere in class MboSet
        Throws:
        MXException
        java.rmi.RemoteException
      • canAdd

        public void canAdd()
                    throws MXException
        Determines if the work order can add Asssignments.
        Overrides:
        canAdd in class MboSet
        Throws:
        MXApplicationException - Thrown with "workorder","ownerWoAssign" if this set isn't owned by a work order.
        Thrown with "workorder", "WOHistory", param (wonum) if the work order is in history.
        Thrown with "workorder", "WPLaborEdit", param (wonum, status) if the work order edit setting for plan labor isn't enabled for this work order's status.
        MXException
      • remove

        public void remove(MboRemote mbo)
                    throws MXException,
                           java.rmi.RemoteException
        remove the child mbo need remove it from the childlookup. Also informs the listeners of the removal.
        Specified by:
        remove in interface MboSetRemote
        Overrides:
        remove in class MboSet
        Throws:
        MXException
        java.rmi.RemoteException
      • setDeleteAsgnmentsOnYesNoCx

        protected void setDeleteAsgnmentsOnYesNoCx(boolean deleteAsgnmentsOnYesNoCx)
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        Description copied from class: MboSet
        Sends changes to the database for all objects in the collection. In addition to saving the members in this set, all Mbos owned by members of this set are also saved. If all goes well, commit is called, otherwise rollback is called. Once successfully saved, this MboSet is reset, ready for a requery.
        Specified by:
        save in interface MboSetRemote
        Overrides:
        save in class MboSet
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MboSet.reset()
      • fireEventsAfterDB

        public void fireEventsAfterDB(MXTransaction txn)
                               throws MXException,
                                      java.rmi.RemoteException
        If we're doing something that involves an explicit save by the user, saving or deleting rows in the Work List of Assignment Manager, where the objects are WMAssignment Mbos as opposed to regular Assignments, this will set the main MboSet on the app back to being saved at this point in the process; without this action, the WMAssignmentSet is removed from the transaction queue permanently, its status is never advanced, and no further new rows in Assignment Manager can be saved. See also WMassignment.save().
        Specified by:
        fireEventsAfterDB in interface AssignmentSetRemote
        Specified by:
        fireEventsAfterDB in interface Transactable
        Overrides:
        fireEventsAfterDB in class MboSet
        Parameters:
        txn - Transaction
        Throws:
        MXException - Error while committing
        java.rmi.RemoteException - Network error
      • getRescheduled

        public int getRescheduled()
      • getUnassigned

        public int getUnassigned()
      • setRescheduled

        public void setRescheduled(int rescheduled)
      • setUnassigned

        public void setUnassigned(int unassigned)
      • assignLabor

        public void assignLabor(LaborCraftRateRemote laborCraftRateMbo,
                                java.lang.String theDay)
                         throws MXException,
                                java.rmi.RemoteException
        This method assigns the selected labor to the selected assignments at those dates and times when hours are available, starting with the earliest available time on the selected day. If a given day does not have enough available hours for the current assignment, the assignment will be split between the current day and the next available time in the future.
        Specified by:
        assignLabor in interface AssignmentSetRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • startAssignment

        public MboSetRemote startAssignment()
                                     throws MXException,
                                            java.rmi.RemoteException
        Start the assignments -- loop through them and change their status to "STARTED" one by one, which will trigger events in fldAssignStatus.
        Specified by:
        startAssignment in interface AssignmentSetRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • interruptAssignment

        public MboSetRemote interruptAssignment()
                                         throws MXException,
                                                java.rmi.RemoteException
        Interrupt the assignments -- loop through them and change their status to "INTERPT" one by one, which will trigger events in fldAssignStatus.
        Specified by:
        interruptAssignment in interface AssignmentSetRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • finishAssignment

        public MboSetRemote finishAssignment()
                                      throws MXException,
                                             java.rmi.RemoteException
        Finish the assignments -- loop through them and change their status to "COMPLETE" one by one, which will trigger events in fldAssignStatus.
        Specified by:
        finishAssignment in interface AssignmentSetRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • getColumnValue

        public java.lang.String getColumnValue(java.lang.String columnName)
                                        throws MXException,
                                               java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getFinishDate

        public java.util.Date getFinishDate()
      • setFinishDate

        public void setFinishDate(java.util.Date finishDate)
      • getEarliestDate

        public java.util.Date getEarliestDate()
                                       throws MXException,
                                              java.rmi.RemoteException
        Finds the earliest schedule date among the assigned or completed assignments in this AssignmentSet. This is based strictly on the ones in memory, not in the database (i.e. it represents the current state of this assignmentset, not how it was formerly).
        Returns:
        The date that is the earliest schedule date of the assigned or completed assignments in this assignmentSet.
        Throws:
        MXException
        java.rmi.RemoteException
      • getLatestDate

        public java.util.Date getLatestDate()
                                     throws MXException,
                                            java.rmi.RemoteException
        Finds the latest finish date among the assigned or completed assignments in this AssignmentSet. This is based strictly on the ones in memory, not in the database (i.e. it represents the current state of this assignmentset, not how it was formerly).
        Returns:
        The date that is the latest finish date of the assigned or completed assignments in this assignmentSet.
        Throws:
        MXException
        java.rmi.RemoteException