psdi.app.jobplan

Class JobLabor

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


    public class JobLabor
    extends Mbo
    implements JobLaborRemote
    MBO object that represents a Job Labor.
    See JobPlan Package description for details.

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

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

    The attributes in this object are as follows::

    Attribute NameDescription
    ContractnumThe crafts Contract Number
    psdi.app.jobplan.FldJobLaborCraftRate Craft)Identifier of the craft who will perform this task.
    JoblaboridA system generated unique identifier for this Job Labor.
    JobplanidA system generated unique identifier for the job plan that owns this Job Labor. This will be copied from owner Job Plan to this Job Labor.
    {@link psdi.app.jobplan.FldJpnum Jpnum}Identifier for the Job Plan. This will be copied from owner Job Plan to this Job Labor.
    {@link psdi.app.jobplan.FldJpTask JpTask}Identifier of the the Job Plan task for which this labor is used.
    {@link psdi.app.jobplan.FldJobLaborLaborCode LaborCode}Identifier of the labor who will perform this task.
    {@link psdi.app.jobplan.FldJobLaborLaborHrs LaborHrs}Indicates the number of hours needed for this craft or labor to complete the task.
    {@link psdi.app.jobplan.FldJobLaborLineCost LineCost}A non-persistent attribute that indicates the estimated total cost of the labor or craft.
    OrgIdIdentifier of the {@link psdi.app.site.Organization organization} for this Job Plan.
    {@link psdi.app.jobplan.FldJobLaborPayRate PayRate}A non-persistent attribute that indicates the hourly pay rate for the labor or craft.
    {@link psdi.app.jobplan.FldJobLaborQty Quantity}Indicates the number of labor or crafs needed for this Job Plan. The default quantity is 1. For a labor, the quantity will always be 1.
    SiteIdIdentifier of the {@link psdi.app.site.Site site} for the Job Plan.
    {@link psdi.app.jobplan.FldJobLaborCraftRate Skilllevel}The crafts Skill Level
    {@link psdi.app.jobplan.FldJobLaborCraftRate Vendor}Identifier of the Company or Contractor who supplies the craft.
    JL1 through JL9Extra Fields.

    • Constructor Detail

      • JobLabor

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

      • init

        public void init()
                  throws MXException
        Initialize the Job Labor object.
        Set the linecost and payrate fields READONLY flag to true
        Set the orgid READONLY flag to true if there is an orgid on the jobplan or task
        Set the siteid READONLY flag to true if there is a siteid on the jobplan or task
        Set the laborcode and craftrate fields READONLY flags based on values in laborcode and craft
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • initFieldFlagsOnMbo

        public void initFieldFlagsOnMbo(java.lang.String attrName)
                                 throws MXException
        Description copied from class: Mbo
        The logic of setting the readonly and required field flags to the mbo. Any setting of the field flags that require expensive operation, such as database query should be moved from init() to this method. However, those which don't require steps such as fetching Mbos can be left in init(). You can group the logic for a few attributes together if logic of deciding their flag is the same, or in other words, can be handled at once.
        Overrides:
        initFieldFlagsOnMbo in class Mbo
        Throws:
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add a new Job Labor.
        When a new job labor is added, the jobplan number, jobplanid,pluscrevnum 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()
      • 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
      • setLineCost

        public void setLineCost()
                         throws MXException,
                                java.rmi.RemoteException
        Set linecost value The linecost represents the estimated total cost of the labor or craft. It is calculated using the formula
        linecost = laborhrs * quantity * payrate
        This attribute is always read-only.
        Throws:
        MXException
        java.rmi.RemoteException
      • getValidateOrder

        public java.lang.String[] getValidateOrder()
        Validation Order for job labor attributes.
        Overrides:
        getValidateOrder in class Mbo
      • 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 donot get copied from the source JobLabor to the target JobLabor.
        1. jpnum
        2. jobplanid
        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
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        Description copied from class: Mbo
        Mark the object to be deleted depending on the access modifier. This will usually be overridden in the subclass of Mbo as there may be application specific rules as to if and when an object can be deleted. Object is not actually deleted in the database until save() is called. This method will also mark all associated Long Description and Translation Mbos for deletion.
        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)
      • undelete

        public void undelete()
                      throws java.rmi.RemoteException,
                             MXException
        undeletes the job Labor.
        If the Task Number:Orgid:Siteid key combination does not exist or is marked for deletion, the jptask field on the job labor is set to null.
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • updateAssociatedToolData

        public void updateAssociatedToolData()
                                      throws MXException,
                                             java.rmi.RemoteException
        Specified by:
        updateAssociatedToolData in interface JobLaborRemote
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.plusd.app.jobplan.PlusDJobLaborRemote#updateAssociatedToolData()
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        This method will be called to make sure (1) The Task Number:Orgid:Siteid key combination is a valid JobTask key combination.
        (2) If there is a craft make sure the craft,skilllevel,vendor&contractnum combination returns exactly 1 craftrate row.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXApplicationException - If there is no labor or craft then MXApplicationException("jobplan","nolabororcraft")
        MXException - If JobTask key is invalid then MXApplicationException("jobplan","notvalidjptask")
        MXApplicationException - If the craftrate fields can return more than 1 CRAFTRATE row MXApplicationException("jobplan","morethanonecraftrate")
        java.rmi.RemoteException
        See Also:
        psdi.app.jobplan.JobTask#iisValidTaskComponentKey(MboRemote mbo)