psdi.app.jobplan

Class JobTask

  • All Implemented Interfaces:
    java.rmi.Remote, JobTaskRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class JobTask
    extends Mbo
    implements JobTaskRemote
    MBO object that represents a Job Task.
    See JobPlan Package description for details.

    This is system level object that can be defined to exist at the system level, organization level or site level.

    The key attributes for this object are OrgId,SiteId,Jpnum,Jptask.

    The attributes in this object are as follows::

    Attribute NameDescription
    DescriptionDescription of the task.
    JobplanidA system generated unique identifier for the job plan that owns this Job Task. This will be copied from owner Job Plan to this Job Task.
    JobtaskidA system generated unique identifier for this Job Task.
    JpnumIdentifier for the Job Plan. This will be copied from owner Job Plan to this Job Task.
    JpTaskIdentifier of the the Job Plan Task number.
    MeterNameGeneric meter name to associate with the job task. Point Number on a work order is established through the combination of this Meter Name and the work order's asset or location.
    OrgIdIdentifier of the organization for the Job Task.
    SiteIdIdentifier of the site for the Job Task.
    TaskDurationRepresents the estimated duration for the Task in Hours.
    TaskSequenceTask Sequence
    JO1 through JO8Extra Fields.

    • Constructor Detail

      • JobTask

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

      • init

        public void init()
                  throws MXException
        Initialization routine.
        Set the orgid READONLY flag to true if there is an orgid on the jobplan
        Set the siteid READONLY flag to true if there is a siteid on the jobplan
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        Validate the task's org and site against the nestedjobplans org and site.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add a new Job Task.
        When a new job task is added, the jobplan number, jobplanid, orgid and siteid are copied from the jobplan which owns this object.
        Set the orgid READONLY flag to true if there is an orgid on the jobplan
        Set the siteid READONLY flag to true if there is a siteid on the jobplan
        Notify the owning job plan that a new component is being added
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        JobPlan.componentAdded()
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Determines whether this record can be deleted.
        A user who does not have access to all the components of this task will not be allowed to delete this task.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXApplicationException("jobplan", - "taskhascomponents") - thrown if this task has components that the user cannot see
        java.rmi.RemoteException
        MXException
        See Also:
        delete
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        Deletes the Job Task.
        Also deletes corresponding references to this Job Task in jobtool, jobmaterial, jobservice and joblabor by calling the deleteJobTaskComponents() method on the owning job plan.
        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:
        JobPlan.deleteJobTaskComponents(int jptask, String taskorg, String tasksite), psdi.app.jobplan.JobMaterialSet#deleteJobMaterial(int jptask), psdi.app.jobplan.JobLaborSet#deleteJobLabor(int jptask), psdi.app.jobplan.JobToolSet#deleteJobTool(int jptask)
      • undelete

        public void undelete()
                      throws MXException,
                             java.rmi.RemoteException
        Undeletes the job Task.
        Also undeletes corresponding references to this Job Task in jobtool, jobmaterial, jobservice and joblabor by calling the undeleteJobTaskComponents() method on the owning job plan.
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        JobPlan.deleteJobTaskComponents(int jptask, String taskorg, String tasksite), psdi.app.jobplan.JobMaterialSet#deleteJobMaterial(int jptask), psdi.app.jobplan.JobLaborSet#deleteJobLabor(int jptask), psdi.app.jobplan.JobToolSet#deleteJobTool(int jptask)
      • skipCopyField

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws java.rmi.RemoteException,
                                        MXException
        This method overrides the skipCopyField() in the Mbo. This method takes the MboValueInfo as its parameter to see if this field needs to be copied or skipped.If this field does not need to be copied, it returns true. The following fields do not get copied from the source JobTask to the target JobTask.
        1. jpnum
        2. jobplanid
        3. pluscrevstatus
        Overrides:
        skipCopyField in class Mbo
        Parameters:
        mvi - 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
      • propagateKeyValue

        public void propagateKeyValue(java.lang.String keyName,
                                      java.lang.String keyValue)
                               throws MXException,
                                      java.rmi.RemoteException
        Set value for Jpnum.
        Specified by:
        propagateKeyValue in interface MboRemote
        Overrides:
        propagateKeyValue in class Mbo
        Parameters:
        keyName - Should equal "jpnum" or else nothing will be propagated.
        keyValue - The new value of jpnum.
        Throws:
        MXException
        java.rmi.RemoteException
      • generateTaskID

        protected int generateTaskID()
                              throws MXException,
                                     java.rmi.RemoteException
        Generates a unique Task ID with an interval.
        Throws:
        MXException
        java.rmi.RemoteException
      • validateJPTaskKey

        public void validateJPTaskKey()
                               throws MXException,
                                      java.rmi.RemoteException
        Validates the Task Number:Orgid:Siteid key combination for uniqueness
        Specified by:
        validateJPTaskKey in interface JobTaskRemote
        Throws:
        MXApplicationException("jobplan", - "duplicateTaskkey") - thrown if the key combination is not unique
        MXException
        java.rmi.RemoteException
        See Also:
        JobTask.validateJPTaskKey()
      • copy

        public MboRemote copy(MboSetRemote mboSet)
                       throws MXException,
                              java.rmi.RemoteException
        Overwrite the copy method in MboSet. This method is used by the invoice duplicate to duplicate the invoice line mbos. The invoice cost is also duplicated.
        Specified by:
        copy in interface MboRemote
        Overrides:
        copy in class Mbo
        Parameters:
        mboSet - The set into which the new mbo will be added.
        Returns:
        The new mbo, with values copied from this mbo.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.copy(MboSetRemote, long)
      • save

        protected void save()
                     throws MXException,
                            java.rmi.RemoteException
        Sets revision status to CHANGED if necessary before saving
        Overrides:
        save in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • isDifferentFromPreviousRevision

        protected boolean isDifferentFromPreviousRevision()
                                                   throws MXException,
                                                          java.rmi.RemoteException
        Determines if this task is different from a previous revision
        Returns:
        true if this task has a previous revision and is different from it, false othewise
        Throws:
        MXException
        java.rmi.RemoteException
      • validateCondPredExist

        public void validateCondPredExist(java.lang.String attributeName)
                                   throws java.rmi.RemoteException,
                                          MXException
        This method is called from the PREDECESSORTASKS and CONDITIONNUM fields on a job task. A check is done here to see if there are any existing predecessors or conditions for the tasks on this job plan if either of these two fields are getting a value for the first time within the whole task set. The user is warned that conditions or predecessors exist on one or more job tasks for this job plan so they can set up tasks accordingly. This is done so that there are no gaps left sequentially in case a task is not copied for example if the condition is evaluated false.
        Parameters:
        attributeName - The attribute name from which this is called
        Throws:
        MXException
        java.rmi.RemoteException