psdi.app.workorder

Class WPTool

  • All Implemented Interfaces:
    java.rmi.Remote, WorkPlanMbo, WPItemRemote, WPToolRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class WPTool
    extends WPItem
    implements WPToolRemote
    MBO to represent a WPTool object.

    See WorkOrder Package description for detail.

    There is no key attribute for this object.

    The attributes in this object are as follows:

    Attribute NameDescription
    CatalogCodeSee WPItem for details.
    DescriptionSee WPItem for details.
    DirectReqSee WPItem for details.
    IssueToSee WPItem for details.
    LineTypeThe line type of work plan tools.
    LdKeyLineCostA non-persistent attribute to calculate the total cost of the line(ToolHrs*ToolQty*Rate).
    LocationPrimary or alternate location from inventory for this work plan material/service/tool item.
    ManufacturerSee WPItem for details.
    ModelNumSee WPItem for details.
    PR}See WPItem for details.
    PRLineNumSee WPItem for details.
    RequestBySee WPItem for details.
    RequireDateSee WPItem for details.
    SiteIdIdentifier of the site for this failure.
    OrderUnitSee WPItem
    OrgIdIdentifier of the organization for this failure.
    RateTool Rate when work order was approved.
    RateHasChanged Flag tracks if the tool rate has been overwritten by user. If No - field will be overwritten by MAXIMO on Approval. If Yes - field will not be overwritten by MAXIMO on Approval.
    SiteIdIdentifier of the site for this failure.
    TaskIDA non-persistent attribute to identify the task number of the Work Order associate with this work plan tool.
    HoursNumber of hours for which a tool is used.
    ItemNumIdentification number of Tool for this work plan tool.
    ItemQtyQuantity of the tool for this Work Plan.
    WoNumIdentifier of the workorder associate with this work plan tool.
    VendorSee WPItem for details.
    VendorPackCodeSee WPItem for details.
    VendorPackQuantitySee WPItem for details.
    VendorUnitPriceSee WPItem for details.
    VendorWareHouseSee WPItem for details.
    • Constructor Detail

      • WPTool

        public WPTool(MboSet ms)
               throws MXException,
                      java.rmi.RemoteException
        Construct the WPTool.
        Parameters:
        ms - The WPTool MboSet.
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Sets Default value for some of the fields of the new WPTool. New WPTool can be created by the object that is based on Workorder.

        WONUM defaults from the parent and set WONUM of parent to read only.
        The table below shows the default values for each of the attributes listed.

        Attribute NameAttribute Value
        LINECOST0.0
        Hours0.0
        LinetypeTOOL
        StoreLocSiteOwner's SiteID
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class WPItem
        Throws:
        MXApplicationException - ownerWoWPLabor when this wptool's owner is not a workorder.
        MXException
        java.rmi.RemoteException
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        validates WPTool. If the Reservation required is true, then location and storeroom's site are needed
        Overrides:
        appValidate in class Mbo
        Throws:
        MXApplicationException - ("workorder", "NeedStoreroom") is thrown when the Reservereq is true.
        MXException
        java.rmi.RemoteException
      • canDelete

        public void canDelete()
                       throws MXException
        Can not delete if there exists an Actual Tool for this WPTool.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXAccessException - deletewptool when there exists an Actual tool for this WPTOOL
        MXException
      • refreshRate

        public void refreshRate()
                         throws MXException,
                                java.rmi.RemoteException
        If ratehaschanged is false, copy tool.toolrate to wptool.rate.
        Throws:
        MXException
        java.rmi.RemoteException
      • updateEstimateTotal

        public void updateEstimateTotal(double delta)
                                 throws MXException,
                                        java.rmi.RemoteException
        Used to update WO.EstToolCost when the Quantity, Rate, or Hours changes on a WPTool. Called by those attribute's custom classes action methods.
        Parameters:
        delta - The change in toolcost need be added to WO.EstToolCost.
        Throws:
        MXException
        java.rmi.RemoteException
      • validateToolAvailInStorerooms

        public void validateToolAvailInStorerooms()
                                           throws MXException,
                                                  java.rmi.RemoteException
        Checks to see whether this tool is available in any of the storerooms for a given storeroom's site
        Throws:
        MXException
        java.rmi.RemoteException
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        Subtracts the line cost from WO.EstToolCost. WO.EstToolCost becomes editable when the last WPTool is deleted from the set.
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        accessModifier -
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • undelete

        public void undelete()
                      throws MXException,
                             java.rmi.RemoteException
        Adds the line cost to WO.EstMatCost. If WO.EstMatCost is zero'ed out and becomes read/only when the number of WPTool objects go from none to one.
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • updateTotals

        public void updateTotals(MboRemote wo,
                                 boolean isGain)
                          throws MXException,
                                 java.rmi.RemoteException
        Updates the work order totals related to the work plan mbo.
        Specified by:
        updateTotals in interface WorkPlanMbo
        Overrides:
        updateTotals in class WPItem
        Parameters:
        wo - The work order Mbo to update.
        isGain - Is this a gain or loss for the work order.
        Throws:
        MXException
        java.rmi.RemoteException
      • 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 not. If this field does not need to be copied return true. The following is a list of fields that are not copied from the source WPTool to the target WPTool.
        1. WONUM
        2. TOOLHRS
        Overrides:
        skipCopyField in class WPItem
        Parameters:
        The - MboValueInfo object of the MboValue that needs to be copied.
        Returns:
        True if the field does not need to be copied, otherwise return false.
        Throws:
        java.rmi.RemoteException
        MXException