psdi.app.safety

Class SPWorkAsset

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


    public class SPWorkAsset
    extends Mbo
    implements SPWorkAssetRemote
    Mbo object to represent SPWorkAsset. Used when applying a safety plan to a work order (WoSafetyPlan) by comparing the workorder's asset or location to the SPWorkAsset.

    See Safety Package description.

    This object includes non-persistent attributes.

    This is a site level object.

    The key attributes for this object are SiteID and SPWorkAssetID.

    The attributes in this object are as follows:

    Attribute NameDescription
    AssetDescriptionNon-persistent attribute. If WorkAsset or WorkLocation is not null, this equals the description of the asset or location.
    OrgIDThe organization for this site, stored on this table for ease of access. This equals the value for OrgID specified on the Site table.
    SafetyPlanIDForeign key to SafetyPlan.
    SiteIDThe site to which this record pertains. Foreign key to Site.
    SPWorkAssetIDUnique identifier for this object, within site.
    WorkAssetAsset number of work asset. Either WorkAsset or WorkLocation may be specified (not both). Both can be null.
    WorkLocationLocation number of work asset. Either WorkAsset or WorkLocation may be specified (not both). Both can be null.
    See Also:
    WoSafetyPlan.copyPlan(java.lang.String)
    • Constructor Detail

    • Method Detail

      • init

        public void init()
                  throws MXException
        Description copied from class: Mbo
        Called by the framework when the Mbo has been constructed and the MboValues have been initialized. This can be overridden by the programmer to provide any custom initialization they would like to do.
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add a mbo, defaulting the attributes shown below. The owner must be SafetyPlan.
        Attribute NameAttribute Value
        SafetyPlanIDThe owner's SafetyPlanID.
        SPWorkAssetIDgenerateUniqueID
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Description copied from class: Mbo
        Can the object be deleted ? This is object specific and should be overridden.
        Overrides:
        canDelete in class Mbo
        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 MXException,
                             java.rmi.RemoteException
        Description copied from class: Mbo
        Unmark the Mbo for deletion. Can only be called after a delete() and before the save() has been performed. This method will also unmark associated Long Description and Translation Mbos.
        Specified by:
        undelete in interface MboRemote
        Overrides:
        undelete in class Mbo
        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 SafetyPlanID.
        Specified by:
        propagateKeyValue in interface MboRemote
        Overrides:
        propagateKeyValue in class Mbo
        Parameters:
        keyName - The attribute name.
        keyValue - The new value of the attribute.
        Throws:
        MXException
        java.rmi.RemoteException
      • associateHazardToSafetyPlan

        public MboSetRemote associateHazardToSafetyPlan(java.lang.String hazardid,
                                                        java.lang.String relatedassetnum,
                                                        java.lang.String relatedlocation)
                                                 throws MXException,
                                                        java.rmi.RemoteException
        Create splexiconlink(s) when adding a hazard to a safetyplan. The hazard can be any type, enabled for anything (precaution, hazardous material, tagout). If hazard is tagout-enabled, then this spworkasset must specify either a workasset or worklocation.

        This method will throw an error if the splexiconlink already exists. This method also adds splexiconlink for all the relevant tagouts (if tagoutenabled and any tagouts exist). See the following in Centura safeplan: dlgSelectHazard, frmTAGOUT/tblHazards, frmHAZMAT/tblHazMat, frmHAZPREC/tblSPHazards.

        Can be called from the SafetyPlan version of this method.

        Specified by:
        associateHazardToSafetyPlan in interface SPWorkAssetRemote
        Parameters:
        hazardid - The hazard to be associated with this SPWorkAsset.
        relatedassetnum - The assetnum to be matched on the SafetyLexicon. Can be null. Not to be confused with the workasset of this SPWorkAsset! Cannot specify both assetnum and location. Both can be null.
        relatedlocation - The location to be matched on the SafetyLexicon. Can be null. Not to be confused with the worklocation of this SPWorkAsset! Cannot specify both assetnum and location. Both can be null.
        Returns:
        The full SPLexiconLink mboset, including the new mbo(s).
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SPWorkAsset.associateHazardToSafetyPlan(String, String, String, boolean)
      • removeHazardFromSafetyPlan

        public void removeHazardFromSafetyPlan(java.lang.String hazardid,
                                               java.lang.String relatedassetnum,
                                               java.lang.String relatedlocation)
                                        throws MXException,
                                               java.rmi.RemoteException
        Remove hazard from this spworkasset.

        Can be called from the SafetyPlan version of this method.

        Specified by:
        removeHazardFromSafetyPlan in interface SPWorkAssetRemote
        Parameters:
        hazardid - The hazard to be removed from this SPWorkAsset.
        relatedassetnum - The assetnum to be matched on the SafetyLexicon. Can be null. Not to be confused with the assetnum of this SPWorkAsset! Cannot specify both assetnum and location. Both can be null.
        relatedlocation - The location to be matched on the SafetyLexicon. Can be null. Not to be confused with the location of this SPWorkAsset! Cannot specify both assetnum and location. Both can be null.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SPWorkAsset.getParentSPLLforHazard(java.lang.String, java.lang.String, java.lang.String)
      • associateTagOutToSafetyPlan

        public MboSetRemote associateTagOutToSafetyPlan(java.lang.String hazardid,
                                                        java.lang.String tagoutid,
                                                        java.lang.String relatedassetnum,
                                                        java.lang.String relatedlocation)
                                                 throws MXException,
                                                        java.rmi.RemoteException
        Create splexiconlink when adding a tagout to a safetyplan. See Centura dlgSelectTagouts, frmTAGOUT/tblTagOuts in safeplan.
        Specified by:
        associateTagOutToSafetyPlan in interface SPWorkAssetRemote
        Parameters:
        hazardid - The hazardid. If this installation does not associate tagouts with hazards, then this will be null.
        tagoutid - The tagoutid.
        assetnum - The asset number. Can be null. Cannot specify both assetnum and location. Either assetnum or location must be specified for a tagout.
        location - The location. Can be null. Cannot specify both assetnum and location. Either assetnum or location must be specified for a tagout.
        Returns:
        The full SPLexiconLink mboset, including the new mbo.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SPLexiconLinkSet.addOneTagout(psdi.mbo.MboRemote, long)
      • removeTagOutFromSafetyPlan

        public MboSetRemote removeTagOutFromSafetyPlan(java.lang.String hazardid,
                                                       java.lang.String tagoutid,
                                                       java.lang.String relatedassetnum,
                                                       java.lang.String relatedlocation)
                                                throws MXException,
                                                       java.rmi.RemoteException
        Remove tagout from this spworkasset.
        Specified by:
        removeTagOutFromSafetyPlan in interface SPWorkAssetRemote
        Parameters:
        hazardid - The hazard associated with this tagoutid. If this installation does not associate tagouts with hazards, then this will be null.
        tagoutid - The tagoutid to be removed.
        relatedassetnum - The assetnum to be matched on the SafetyLexicon. Can be null. Not to be confused with the assetnum of this SPWorkAsset! Cannot specify both assetnum and location. Both can be null.
        relatedlocation - The location to be matched on the SafetyLexicon. Can be null. Not to be confused with the location of this SPWorkAsset! Cannot specify both assetnum and location. Both can be null.
        Returns:
        The SPLexiconLink mboset with the mbo marked for deletion.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SPWorkAsset.removeTagOutFromSafetyPlan(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
      • removeAllLinks

        public MboSetRemote removeAllLinks()
                                    throws MXException,
                                           java.rmi.RemoteException
        Remove all SPLexiconLink for this SPWorkAsset.
        Returns:
        The set of deleted SPLexiconLink.
        Throws:
        MXException
        java.rmi.RemoteException
      • skipCopyField

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws java.rmi.RemoteException,
                                        MXException
        This method 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 skipped.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 SPWORKASSET to the target SPWORKASSET.
          SAFETYPLANID SPWORKASSETID
        Overrides:
        skipCopyField in class Mbo
        Parameters:
        - - 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:
        java.rmi.RemoteException
        MXException