psdi.app.jobplan

Class JpAssetSpLink

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


    public class JpAssetSpLink
    extends Mbo
    implements JpAssetSpLinkRemote
    MBO object that represents a JpAssetSpLink(Work Asset).
    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,JpAssetSpLinkId.

    The attributes in this object are as follows::

    Attribute NameDescription
    AssetDescriptionA non-persistent attribute that identifies the description of the asset, location, or item, if they are not null.
    Assetdescription_longdescriptionA non-persistent attribute that identifies the long description of the asset, location, or item, if they are not null.
    AssetnumIdentifier of the Asset associated with a work asset. If the work asset has an asset associated with it, both "itemnum" and "location" attributes are set to null.
    IsDefaultAssetSpA boolean field that indicates whether there is a default safety plan for an asset,location, or item.
    ItemnumIdentifier of the Item associated with a work asset. If the work asset has an item associated with it, then "location" and "asset" attributes are set to null.
    JpAssetSpLinkIdUnique identifier of the link between a Job Plan, an Asset,Location, or Item, and a Safety Plan.
    JobplanidA system generated unique identifier for the job plan. This will be copied from owner Job Plan to the Work Asset.
    JpassetsplinkidA system generated unique identifier for the Work Asset.
    JpnumIdentifier for the Job Plan. This will be copied from owner Job Plan to the Work Asset.
    LDKeyA non-persistent attribute that identifies a Long Description Key. This is a link to text stored in the LongDescription table.
    LocationIdentifier of the location associated with a work asset. If the work asset has a loation associated with it, both "assetnum" and "itemnum" attributes are set to null.
    OrgIdIdentifier of the organization for the work asset.
    SafetyPlanIdIdentifier of the Safety Plan associated with a work asset.
    SiteIdIdentifier of the site for the work asset.
    WoReqWhenPurchA boolean field that indicates whether there is a required work order when a particular item is purchased.
    WoTypeWhenPurchIdentifier of the work type for a work order.

    • Constructor Detail

      • JpAssetSpLink

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

      • init

        public void init()
                  throws MXException
        Initialize the JpAssetSpLink 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
        Overrides:
        init in class Mbo
        Throws:
        MXException
        See Also:
        JpAssetSpLink.setAssetDescription()
      • 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 JpAssetSpLink.
        When a new work asset is added, the following attributes are set to the default values. Also the jobplan number is copied from the jobplan which owns this object.
        isdefaultassetsp is set to 'true'
        woreqwhenpurch is set to 'false'
        wotypewhenpurch is set to 'null' 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:
        MboValue.generateUniqueID(), 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
      • validateItemAssetLoc

        public void validateItemAssetLoc(boolean newItem,
                                         boolean newAssetnum,
                                         boolean newLocation)
                                  throws MXException,
                                         java.rmi.RemoteException
        validates item/ asset /location fields
        If item entered, asset & location field set to null.
        If asset entered, item & location field set to null.
        If location entered, item & asset field set to null.
        when item is null, the woreqwhenpurch and wotypewhenpurch are not editable
        Parameters:
        newItem - Itemnum of a workAsset Mbo.
        newAssetnum - asset number of a workAsset Mbo.
        newLocation - location info of a workAsset Mbo.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        JpAssetSpLink.setAssetDescription()
      • getRelevantJPAssetRecords

        public MboSetRemote getRelevantJPAssetRecords(java.lang.String itemnum,
                                                      java.lang.String itemsetid,
                                                      java.lang.String assetnum,
                                                      java.lang.String location,
                                                      java.lang.String siteid)
                                               throws MXException,
                                                      java.rmi.RemoteException
        Fetches all the records for the current Job Plan that have the same asset as this JpAssetSpLink object.
        Throws:
        MXException
        java.rmi.RemoteException
      • validWorkAsset

        public void validWorkAsset(MboSetRemote dbJpAssetSet,
                                   java.lang.String item,
                                   java.lang.String itemsetid,
                                   java.lang.String asset,
                                   java.lang.String loc)
                            throws MXException,
                                   java.rmi.RemoteException
        Checks for the duplicate work assets with default 'Y' only one work asset can have 'Y' for default. The same work asset could be listed multiple times but only one can be default and the rest must have 'N' for this for a given jobplan.
        Parameters:
        item - Itemnum of a workAsset Mbo to be added.
        itemsetid - Item set for Itemnum of a workAsset Mbo to be added.
        asset - Assetnum of a workAsset Mbo to be added.
        loc - Location info of a workAsset Mbo to be added.
        Throws:
        MXException
        java.rmi.RemoteException
        MXApplicationException("jobplan", - "defaultsetOnce")
      • validWoreqWhenPruch

        public void validWoreqWhenPruch(java.lang.String item,
                                        java.lang.String itemsetid)
                                 throws MXException,
                                        java.rmi.RemoteException
        Checks for the duplicate work assets with woreqwhenpurch 'Y' for an item. only one work asset can have woreqwhenpurch as 'Y' for a given item . The same item could be listed multiple times for a job plan, but only one woreqwhenpurch can be set to 'Y'. The rest must have 'N' for this for this jobplan.
        Parameters:
        item - Itemnum of a workAsset Mbo to be added.
        itemsetid - Item set for the Itemnum of a workAsset Mbo to be added.
        Throws:
        MXException
        java.rmi.RemoteException
        MXApplicationException("jobplan", - "defaultWoreqWhenPurch")
      • 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 JpAssetSpLink to the target JpAssetSpLink.
        1. jpnum
        2. jobplanid
        3. jpassetsplinkid
        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
      • setReadOnlyFields

        public void setReadOnlyFields(java.lang.String status)
                               throws MXException,
                                      java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • delete

        public void delete(long accessmodifier)
                    throws MXException,
                           java.rmi.RemoteException
        Delete JPASSETSPLINK. If CALIBRATION is installed, also delete PLUSCJPDATASHEET.
        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 MXException,
                             java.rmi.RemoteException
        Undelete JPASSETSPLINK. If CALIBRATION is installed, also undelete PLUSCJPDATASHEET.
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • isCalibrationInstalled

        public boolean isCalibrationInstalled()
                                       throws MXException,
                                              java.rmi.RemoteException
        Return true if License Key CALIBRATION is installed.
        Returns:
        boolean
        Throws:
        MXException
        java.rmi.RemoteException