psdi.app.safety

Class SafetyPlan

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


    public class SafetyPlan
    extends Mbo
    implements SafetyPlanRemote
    Mbo object to represent SafetyPlan.

    See Safety Package description.

    This is a site level object.

    The key attributes for this object are SiteID and SafetyPlanID.

    The attributes in this object are as follows:

    Attribute NameDescription
    ChangeBy, ChangeDateself-explanatory
    DescriptionFreeform description. Also accommodates a long description.
    OrgIDThe organization for this site, stored on this table for ease of access. This equals the value for OrgID specified on the Site table.
    SafetyPlanIDUnique identifier for this object, within site.
    SiteIDThe site to which this record pertains. Foreign key to Site.
    • 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.
        Attribute NameAttribute Value
        ChangeByCurrent user
        ChangeDateCurrent date
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • modify

        public void modify()
                    throws MXException,
                           java.rmi.RemoteException
        Prepare to modify a mbo, defaulting the attributes shown below.
        Attribute NameAttribute Value
        ChangeByCurrent user
        ChangeDateCurrent date
        Overrides:
        modify 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
      • appValidate

        public void appValidate()
                         throws MXException,
                                java.rmi.RemoteException
        If toBeAdded and no row in SPWorkAsset, then add one.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • associateHazardToSafetyPlan

        public MboSetRemote associateHazardToSafetyPlan(MboSetRemote spwset,
                                                        java.lang.String hazardid,
                                                        java.lang.String relatedassetnum,
                                                        java.lang.String relatedlocation)
                                                 throws MXException,
                                                        java.rmi.RemoteException
        This is used when adding hazard(s) to a safetyplan. The hazard can be enabled for anything (precaution, hazardous material, or tagout). (See Centura safeplan frmHAZMAT, frmHAZPREC, frmTAGOUT/tblHazards, dlgSelectHazard)

        This method supports:

        • No specifying the work asset (workasset and worklocation are null).
        • Specifying the related asset via a String input parameter.
        • Specifying one HazardID via a String input parameter.

        This SafetyPlan method is the same as calling the method of the same name that's on SPWorkAsset, for the main spworkasset mbo (where workasset and worklocation are null). To attach a hazard to a non-null workasset or worklocation, you must call the SPWorkAsset version of this method (see associateHazardToSafetyPlan.

        A similar SafetyPlan method, associateHazardToSafetyPlan, supports multi-select of Hazards and specification of a work asset.

        Specified by:
        associateHazardToSafetyPlan in interface SafetyPlanRemote
        Parameters:
        spwset - MboSet of SPWorkAsset for this safety plan. Can be passed in as null. If passed in as null, this method will get the set MAINSPWORKASSET, which contains one mbo.
        hazardid - The hazard to be associated with this safety plan.
        relatedassetnum - The assetnum to be matched on the SafetyLexicon. Can be null. Not to be confused with the workasset of the SPWorkAsset! The link will be made to the main SPWorkAsset. Cannot specify both assetnum and location. Both can be null if the hazard is not tagout-enabled. Either assetnum or location must be specified for a tagout.
        relatedlocation - The location to be matched on the SafetyLexicon. Can be null. Not to be confused with the worklocation of the SPWorkAsset! The link will be made to the main SPWorkAsset. Cannot specify both assetnum and location. Both can be null if the hazard is not tagout-enabled. Either assetnum or location must be specified for a tagout.
        Returns:
        Full SPWorkAsset mboset. It will own a mboset of SPLexiconLink with new mbo(s) added.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SPWorkAsset.associateHazardToSafetyPlan(String, String, String)
      • associateHazardToSafetyPlan

        public void associateHazardToSafetyPlan(MboRemote spw,
                                                MboRemote spRelatedAsset,
                                                MboSetRemote hazardSet)
                                         throws MXException,
                                                java.rmi.RemoteException
        Apply the passed hazard set to this SafetyPlan, for the given work asset and related asset. This method supports:
        • Specifying the work asset via a MboRemote input parameter (SPWorkAsset).
        • Specifying the related asset via a MboRemote input parameter (SPRelatedAsset).
        • Applying multiple HazardIDs via multi-select from the input Hazard set.

        A similar SafetyPlan method, associateHazardToSafetyPlan. allows selection of a single HazardID for the main spworkasset mbo (where workasset and worklocation are null).

        Specified by:
        associateHazardToSafetyPlan in interface SafetyPlanRemote
        Parameters:
        spw - SPWorkAsset mbo of the work asset.
        spRelatedAsset - SPRelatedAsset mbo of the related asset, used to obtain the related assetnum and related location.
        hazardSet - The hazard set to be applied to this work asset and related asset.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SPWorkAsset.associateHazardToSafetyPlan(String, String, String)
      • associateHazardToSafetyPlan

        public void associateHazardToSafetyPlan(MboSetRemote safetyLexiconSet)
                                         throws MXException,
                                                java.rmi.RemoteException
        Apply the passed safetyLexicon set to this SafetyPlan, for the given work asset. This method supports:
        • Specifying the work asset via a MboRemote input parameter (SPWorkAsset).
        • Applying multiple HazardIDs via multi-select from the input safetyLexicon set.

        A similar SafetyPlan method, associateHazardToSafetyPlan. allows selection of a single HazardID for the main spworkasset mbo (where workequipment and worklocation are null).

        Specified by:
        associateHazardToSafetyPlan in interface SafetyPlanRemote
        Parameters:
        spw - SPWorkAsset mbo of the work asset.
        safetyLexiconSet - The safetyLexicon set to be applied to this work asset and related asset.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SPWorkAsset.associateHazardToSafetyPlan(String, String, String)
      • associateHazardToSafetyPlan

        public void associateHazardToSafetyPlan(MboRemote spw,
                                                MboSetRemote safetyLexiconSet)
                                         throws MXException,
                                                java.rmi.RemoteException
        Apply the passed safetyLexicon set to this SafetyPlan, for the given work asset. This method supports:
        • Specifying the work asset via a MboRemote input parameter (SPWorkAsset).
        • Applying multiple HazardIDs via multi-select from the input safetyLexicon set.

        A similar SafetyPlan method, associateHazardToSafetyPlan. allows selection of a single HazardID for the main spworkasset mbo (where workequipment and worklocation are null).

        Specified by:
        associateHazardToSafetyPlan in interface SafetyPlanRemote
        Parameters:
        spw - SPWorkAsset mbo of the work asset.
        safetyLexiconSet - The safetyLexicon set to be applied to this work asset and related asset.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SPWorkAsset.associateHazardToSafetyPlan(String, String, String)
      • removeHazardFromSafetyPlan

        public MboSetRemote removeHazardFromSafetyPlan(MboSetRemote spwset,
                                                       java.lang.String hazardid,
                                                       java.lang.String relatedassetnum,
                                                       java.lang.String relatedlocation)
                                                throws MXException,
                                                       java.rmi.RemoteException
        Remove a specific hazard from this safety plan. This will remove the hazard from the main spworkasset mbo. To remove a hazard from a specific workasset or worklocation, call the method on SPWorkAsset for the desired asset (see removeHazardFromSafetyPlan.

        (See Centura safeplan frmHAZMAT, frmHAZPREC, frmTAGOUT/tblHazards.)

        Specified by:
        removeHazardFromSafetyPlan in interface SafetyPlanRemote
        Parameters:
        spwset - MboSet of SPWorkAsset for this safety plan. Can be passed in as null. If passed in as null, this method will get the set MAINSPWORKASSET, which contains one mbo.
        hazardid - The hazard to be removed from this safety plan.
        relatedassetnum - The assetnum to be matched on the SafetyLexicon. Can be null. Not to be confused with the workasset of the SPWorkAsset! The link will be made to the main 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 the SPWorkAsset! The link will be made to the main SPWorkAsset. Cannot specify both assetnum and location. Both can be null.
        Returns:
        SPWorkAsset mboset linked to SPLexiconLink, with the relevant mbo(s) marked for deletion.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SPWorkAsset.removeHazardFromSafetyPlan(java.lang.String, java.lang.String, java.lang.String)
      • associateTagOutToSafetyPlan

        public MboSetRemote associateTagOutToSafetyPlan(MboSetRemote spwset,
                                                        java.lang.String hazardid,
                                                        java.lang.String tagoutid,
                                                        java.lang.String relatedassetnum,
                                                        java.lang.String relatedlocation)
                                                 throws MXException,
                                                        java.rmi.RemoteException
        This is used when adding tagout(s) to a safetyplan.

        This SafetyPlan method is the same as calling the method of the same name that's on SPWorkAsset, for the main spworkasset mbo (where workasset and worklocation are null). To attach a tagout to a non-null workasset or worklocation, you must call the SPWorkAsset version of this method (see associateTagOutToSafetyPlan.

        Parameters:
        spwset - MboSet of SPWorkAsset for this safety plan. Can be passed in as null. If passed in as null, this method will get the set MAINSPWORKASSET, which contains one mbo.
        hazardid - The hazard to be associated with this safety plan. If this installation does not associate tagouts with hazards, then this will be null.
        tagoutid - The tagoutid to be associated with this safety plan.
        relatedassetnum - The assetnum to be matched on the SafetyLexicon. Can be null. Not to be confused with the workasset of the SPWorkAsset! The link will be made to the main SPWorkAsset. Cannot specify both assetnum and location. Either assetnum or location must be specified for a tagout.
        relatedlocation - The location to be matched on the SafetyLexicon. Can be null. Not to be confused with the worklocation of the SPWorkAsset! The link will be made to the main SPWorkAsset. Cannot specify both assetnum and location. Either assetnum or location must be specified for a tagout.
        Returns:
        Full SPWorkAsset mboset. It will own a mboset of SPLexiconLink with new mbo(s) added.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SPWorkAsset.associateTagOutToSafetyPlan(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
      • removeTagOutFromSafetyPlan

        public MboSetRemote removeTagOutFromSafetyPlan(MboSetRemote spwset,
                                                       java.lang.String hazardid,
                                                       java.lang.String tagoutid,
                                                       java.lang.String relatedassetnum,
                                                       java.lang.String relatedlocation)
                                                throws MXException,
                                                       java.rmi.RemoteException
        This is used when removing tagout(s) from a safetyplan.

        This SafetyPlan method is the same as calling the method of the same name that's on SPWorkAsset, for the main spworkasset mbo (where workasset and worklocation are null). To remove a tagout from a non-null workasset or worklocation, you must call the SPWorkAsset version of this method (see removeTagOutFromSafetyPlan.

        Parameters:
        spwset - MboSet of SPWorkAsset for this safety plan. Can be passed in as null. If passed in as null, this method will get the set MAINSPWORKASSET, which contains one mbo.
        hazardid - The hazard of the tagout to be removed from this safety plan. If this installation does not associate tagouts with hazards, then this will be null.
        tagoutid - The tagoutid to be removed from this safety plan.
        relatedassetnum - The assetnum to be matched on the SafetyLexicon. Can be null. Not to be confused with the workasset of the SPWorkAsset! The link will be made to the main SPWorkAsset. Cannot specify both assetnum and location. Either assetnum or location must be specified for a tagout.
        relatedlocation - The location to be matched on the SafetyLexicon. Can be null. Not to be confused with the worklocation of the SPWorkAsset! The link will be made to the main SPWorkAsset. Cannot specify both assetnum and location. Either assetnum or location must be specified for a tagout.
        Returns:
        Full SPWorkAsset mboset. It will own a mboset of SPLexiconLink with new mbo(s) added.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SPWorkAsset.removeTagOutFromSafetyPlan(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
      • duplicate

        public MboRemote duplicate()
                            throws MXException,
                                   java.rmi.RemoteException
        Creates a duplicate safetyplan with its related objects.
        The duplicated safetyplan's safetyplanid will be an autokeyed value or just leave it blank if the autokey is off.
        The related objects being duplicated include the linked documents(Doclinks object), related SPWorkAsset and SPLexiconLink.
        Specified by:
        duplicate in interface MboRemote
        Overrides:
        duplicate in class Mbo
        Returns:
        the newly duplicated MboRemote safetyplan
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.app.safety.SPLexiconLinkSetRemote#setDupSP
      • 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 SafetyPlan to the target SafetyPlan.
          SAFETYPLANID
        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
      • initRelationship

        public void initRelationship(java.lang.String relationName,
                                     MboSetRemote mboSet)
                              throws MXException,
                                     java.rmi.RemoteException
        SPLexiconLink needs to behave differently depending on the relationship it was obtained with (hazards and precautions, hazardous materials, or tagouts). This method saves the relationship name on the SPLexiconLinkSet.
        Overrides:
        initRelationship in class Mbo
        Parameters:
        relationName - The relationship name of the related MboSet which need to initialize.
        mboSet - The related MboSet which need to initialize.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SPLexiconLinkSet.setThisRelationName(java.lang.String)