psdi.app.workorder

Class WoSafetyLink

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


    public class WoSafetyLink
    extends Mbo
    implements WoSafetyLinkRemote
    Mbo object to represent WoSafetyLink. This can be thought of as the central hub that identifies the interrelatedness of all the workorder safety data.

    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 and WoSafetyLinkID.

    The attributes in this object are as follows:

    Attribute NameDescription
    ApplySeqIf TagOutID is not null, this can specify the sequence in which TagOuts should be applied.
    AssetDescriptionNon-persistent attribute. If AssetNum or Location is not null, this equals the description of the asset or location.
    ContactRatingNon-persistent attribute. If HazardID is not null, this equals the hazard's contactrating.
    AssetNumRelates a Hazard to a piece of asset. Foreign key to Asset.
    Either AssetNum or Location may be specified (not both). Both can be null.
    FlammabilityRatingNon-persistent attribute. If HazardID is not null, this equals the hazard's flammabilityrating.
    HazardDescriptionNon-persistent attribute. If HazardID is not null, this equals the description of the hazard.
    HazardIDForeign key to WoHazard.
    HazardTypeNon-persistent attribute. If HazardID is not null, this equals the hazard's hazardtype.
    HazardDescriptionNon-persistent attribute. If HazardID is not null, this equals the description of the hazard.
    HazMatEnabledNon-persistent attribute. If HazardID is not null, this equals the hazard's hazmatenabled.
    HealthRatingNon-persistent attribute. If HazardID is not null, this equals the hazard's healthrating.
    LocationRelates a Hazard to a location. Foreign key to Location.
    Either AssetNum or Location may be specified (not both). Both can be null.
    MSDSNumNon-persistent attribute. If HazardID is not null, this equals the hazard's msdsnum.
    OrgIDThe organization for this site, stored on this table for ease of access. This equals the value for OrgID specified on the Site table.
    PrecautionEnabledNon-persistent attribute. If HazardID is not null, this equals the hazard's precautionenabled.
    ReactivityRatingNon-persistent attribute. If HazardID is not null, this equals the hazard's reactivityrating.
    RemoveSeqIf TagOutID is not null, this can specify the sequence in which TagOuts should be removed.
    RequiredStateNon-persistent attribute. If TagoutID is not null, this equals the tagout's requiredstate.
    SiteIDThe site to which this record pertains. Foreign key to Site.
    TagoutAssetDescriptionNon-persistent attribute. If TagoutID is not null, this equals the descripton of the tagout's assetnum or location.
    TagoutDescriptionNon-persistent attribute. If TagoutID is not null, this equals the tagout's description.
    TagOutEnabledNon-persistent attribute. If HazardID is not null, this equals the hazard's tagoutenabled.
    TagoutAssetnumNon-persistent attribute. If TagoutID is not null, this equals the tagout's Assetnum.
    TagOutIDForeign key to WoTagOut.
    TagoutLocationNon-persistent attribute. If TagoutID is not null, this equals the tagout's location.
    WoNumForeign key to Workorder.
    WoSafetyDataSourceSee Work Order Safety Mbos Overview.
    WoSafetyLinkIDUnique identifier for this object, within site.
    Extra Fields HAZ01 thru HAZ20Non-persistent attributes. Same as extra fields on WoHazard.
    Extra Fields TAG01 thru TAG08Non-persistent attributes. Same as extra fields on WoTagOut.
    • Constructor Detail

    • Method Detail

      • setAssetDescription

        public void setAssetDescription(boolean tagout)
                                 throws MXException,
                                        java.rmi.RemoteException
        Set the value of "assetdescription" equal to the value of description from the asset or location.
        Parameters:
        tagout - True if we're setting non-persistent tagoutasset description.
        Throws:
        MXException
        java.rmi.RemoteException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add a mbo, defaulting the attributes shown below. Owner can be Workorder, WoSafetyLink, WoHazard, or WoTagOut.

        If this is a hazard link, the owner is Workorder or WoHazard. If this is a tagout link, the owner is normally the WoSafetyLink for the hazard, but can also be Workorder or WoHazard.

        Attribute NameAttribute Value
        AssetDescriptionIf owner is WoSafetyLink or WoHazard, equals the owner's assetdescription. If the owner is WoTagOut and the wotagout's owner is WoHazard, equals the wohazard's assetdescription.
        AssetNumIf owner is WoSafetyLink or WoHazard, equals the owner's AssetNum. If owner is WoTagOut, equals its WoHazard's AssetNum.
        HazardDescriptionIf owner is WoHazard, equals the owner's hazarddescription. If the owner is WoTagOut and the wotagout's owner is WoHazard, equals the wohazard's hazarddescription.
        HazardIDIf owner is WoSafetyLink, WoHazard, or WoTagOut, equals the owner's HazardID.
        HazardTypeIf owner is WoHazard, equals the owner's hazardtype. If the owner is WoTagOut and the wotagout's owner is WoHazard, equals the wohazard's hazardtype.
        HazMatEnabledIf owner is WoHazard, equals the owner's hazmatenabled. If the owner is WoTagOut and the wotagout's owner is WoHazard, equals the wohazard's hazmatenabled.
        LocationIf owner is WoSafetyLink or WoHazard, equals the owner's Location. If owner is WoTagOut, equals its WoHazard's Location.
        TagOutIDIf owner is WoTagOut, equals the owner's TagOutID.
        WoNumOwner's WoNum
        WoSafetyDataSourceIf owner is WoSafetyLink, equals the owner's WoSafetyDataSource.
        WoSafetyLinkIDUniqueID
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • 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 Wonum.
        Specified by:
        propagateKeyValue in interface MboRemote
        Overrides:
        propagateKeyValue in class Mbo
        Parameters:
        keyName - Should equal "wonum" or else nothing will be propagated.
        keyValue - The new value of wonum.
        Throws:
        MXException
        java.rmi.RemoteException
      • initRelationship

        public void initRelationship(java.lang.String relationName,
                                     MboSetRemote mboSet)
                              throws MXException,
                                     java.rmi.RemoteException
        If the owner is Wosafetylink and the child is Wosafetylink, then store the relation name. This pertains to the Wotrack UI, Safety / Tagout tab and HazardPrec tab.
        Overrides:
        initRelationship in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • toBeSaved

        public boolean toBeSaved()
                          throws java.rmi.RemoteException
        Does the object need to be saved to persistent storage ? This will also check for change of non-persistent attributes.
        Specified by:
        toBeSaved in interface MboRemote
        Overrides:
        toBeSaved in class Mbo
        Throws:
        java.rmi.RemoteException
      • save

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

        public MboSetRemote getMboSet(java.lang.String name)
                               throws MXException,
                                      java.rmi.RemoteException
        The override logic is used ONLY for the Wotrack Hazards and Precautions subtab, for parent WoSafetyLink (Hazard) retrieving WoHazardPrec via relationship "WOHAZARDPREC". In this situation, this method calls findWoHazToUpdate. (super will be called if this mbo is a zombie mbo)

        All other relationships call super.

        Specified by:
        getMboSet in interface MboRemote
        Overrides:
        getMboSet in class Mbo
        Parameters:
        name - Relationship name
        Returns:
        MboSetRemote
        Throws:
        MXException - "A relationship called {0} does not exist for the {1} business object" exception will be thrown if the relationship was not found. "Unknown Object" exception will be thrown if the database object can not be found through the relationship.
        java.rmi.RemoteException
        See Also:
        WoSafetyLink.findWoHazToUpdate(boolean), WoSafetyLinkSetRemote.WOHAZARDPREC
      • 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 WOSafetyLink to the target WOSafetyLink.
        1. WONUM
        2. WOSAFETYLINKID
        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