psdi.app.workorder

Class WoHazard

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


    public class WoHazard
    extends Mbo
    implements WoHazardRemote
    Mbo object to represent WoHazard. A workorder can have multiple hazards with the same hazardid and different wosafetydatasource.

    See Work Order Safety Mbos Overview.

    This object includes non-persistent attributes.

    This is a site level object.

    The key attributes for this object are SiteID, WoNum, HazardID, and WoSafetyDataSource.

    The attributes in this object are as follows:

    Attribute NameDescription
    AssetDescriptionNon-persistent attribute. If AssetNum or Location is not null, this equals the description of the asset or location.
    ContactRatingUsed only for hazardous materials.
    DescriptionFreeform description. Also accommodates a long description.
    AssetNumNon-persistent attribute for "related asset," same as WoSafetyLink AssetNum.
    FlammabilityRatingUsed only for hazardous materials.
    HazardIDMain identifier for this object. May be foreign key to Hazard.
    HazardTypeFrom valuelist HAZTYPE.
    HazMatEnabledIdentifies whether hazardous materials (items) can be associated with this hazard. If so enabled, Items can be associated with this Hazard by WPMaterial (itemnum) and Item (hazardid). See WPMaterial, Item.
    HealthRatingUsed only for hazardous materials.
    LocationNon-persistent attribute for "related location," same as WoSafetyLink Location.
    MSDSNumUsed only for hazardous materials.
    OrgIDThe organization for this site, stored on this table for ease of access. This equals the value for OrgID specified on the Site table.
    PrecautionEnabledIdentifies whether precautions can be associated with this hazard. See WoPrecaution.
    ReactivityRatingUsed only for hazardous materials.
    SiteIDThe site to which this record pertains. Foreign key to Site.
    TagOutEnabledIdentifies whether tagouts can be associated with this hazard. If this is True, then PrecautionEnabled and HazMatEnabled must both be False. See WoTagOut.
    WoNumForeign key to Workorder.
    WoSafetyDataSourceSee Work Order Safety Mbos Overview.
    Extra Fields HAZ01 thru HAZ20extra fields, crossover from Hazard
    • Method Detail

      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add a mbo, defaulting the attributes shown below. Owner can be Workorder or WoSafetyLink.
        Attribute NameAttribute Value
        HazardIDIf owner is WoSafetyLink, equals the owner's HazardID.
        HazMatEnabledFalse
        PrecautionEnabledFalse
        TagOutEnabledFalse
        WoNumOwner's WoNum
        WoSafetyDataSourceIf owner is WoSafetyLink, equals the owner's WoSafetyDataSource.
        Add field validation class FldWoHazardNonPer to "assetnum" and "location" non-persistent attributes.
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        Delete all WoHazardPrec for this WoHazard.
        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 adding a wohazard to the workorder and we do not have a WoSafetyLink virtual owner, add row to WoSafetyLink. If adding a wohazard, add precautions.
        Overrides:
        appValidate in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        WoHazard.addPrecautions()
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        If we added the same hazard to both WOHAZPRECENABLED and WOHAZMATENABLED then remove one so we don't get a duplicate key error.
        Overrides:
        save in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • isHazardEnabled

        public boolean isHazardEnabled()
                                throws MXException,
                                       java.rmi.RemoteException
        If this WoHazard hazardous-material enabled?
        Returns:
        True if hazardous-material enabled, else False
        Throws:
        MXException
        java.rmi.RemoteException
      • isPrecautionEnabled

        public boolean isPrecautionEnabled()
                                    throws MXException,
                                           java.rmi.RemoteException
        If this WoHazard precaution enabled?
        Returns:
        True if precaution enabled, else False
        Throws:
        MXException
        java.rmi.RemoteException
      • isTagOutEnabled

        public boolean isTagOutEnabled()
                                throws MXException,
                                       java.rmi.RemoteException
        If this WoHazard tagout enabled?
        Returns:
        True if tagout enabled, else False
        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 WOHAZARD to the target WOHAZARD.
        1. WONUM
        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:
        MXException
        java.rmi.RemoteException
      • setAssetDescription

        public void setAssetDescription()
                                 throws MXException,
                                        java.rmi.RemoteException
        Set the value of "assetdescription" equal to the value of description from the asset or location.
        Throws:
        MXException
        java.rmi.RemoteException