psdi.app.asset

Class AssetSpec

  • All Implemented Interfaces:
    java.rmi.Remote, AssetSpecRemote, SpecHistoryInterface, SpecificationMboRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class AssetSpec
    extends SpecificationMbo
    implements AssetSpecRemote, SpecHistoryInterface
    MBO object to represent an attribute and value of a specifiation. See Asset package description for details.

    This is a site level object.

    The key attributes for this object are as follows: SiteId, Assetnum, AssetAttrId.

    The attributes in this object are as follows:

    Attribute NameDescription
    ALNValueAlphanumeric(text) value in entered units for the attribute specified. Editable only when the attribute is of ALN type. Defaults from ClassSpec.DefaultALNValue.
    AssetAttridAsset attribute identifier.Unique to the asset.
    ChangeBy, ChangeDateName of the user who last updated this object and date of last change. The ChangeBy attribute defaults to the current user unless a value is provided. The ChangeDate attribute defaults to the MXServer date/time unless a value is provided.
    ClassStructureidIdentifier of the class structure associated with this asset specification.Class structures are the hierarchies of classifications (for example, centrifugal or rotarty pumps) around which assets can be organized.
    DisplaySequenceA number to indicate this object's display sequence in the asset's specification. Value is copied from corresponding class specification when the asset specificition is created.
    AssetNumAsset Number.
    InheritedFromItemBoolean flag to indicate whether or not asset specification is inherited from an asset's rotating item specification. Default value is No.
    ItemSpecValueChangedIndicates whether or not the corresponding item specification value has changed after being inherited. N indicates if AlnValue or NumValue has not been changed; Y indicates the value has been changed since its inheritance from the Item Specification.
    MeasureUnitIdUnit of Measure for the AlnValue or NumValue entered. Value is initially copied from ClassSpec but can be edited after the copy.
    NUMValueNumeric value in entered units for the attribute specified. Editable only when the attribute is of NUMERIC type.
    OrgIdIdentifier of the organization for this specification.
    SiteIdIdentifier of the site for this specification.
    ES01 - ES05Cross-over fields from ClassSpec.CS01 to ClassSpec.CS05, respectively
    See Also:
    ClassStructure, MeasureUnit
    • Constructor Detail

      • AssetSpec

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

      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        sets defaults values for a new AssetSpec object.
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class SpecificationMbo
        Throws:
        MXException - MAXIMO System error
        java.rmi.RemoteException - RMI error
      • addDetailInfor

        public void addDetailInfor(MboRemote asset,
                                   MboRemote mbo)
                            throws MXException,
                                   java.rmi.RemoteException
        copies additional information from Asset and ClassSpec to this AssetSpec object. This method implements the abstract method addDetailInfor on psdi.app.assetcatalog.SpecificationMbo
        Specified by:
        addDetailInfor in interface SpecificationMboRemote
        Overrides:
        addDetailInfor in class SpecificationMbo
        Parameters:
        asset - Asset mbo from which additional information is obtained for this AssetSpec object
        mbo - ClassSpec mbo from which additional information is obtained for this AssetSpec object
        Throws:
        MXApplicationException("asset","notAnAssetRecord") - if mbo passed in first parameter is not an Asset mbo
        MXException
        java.rmi.RemoteException
      • init

        public void init()
                  throws MXException
        06-12701: linear assets: make the linear asset fields editable only when the asset.isLinear is true
        Overrides:
        init in class SpecificationMbo
        Throws:
        MXException
      • setCopyValueChanged

        public void setCopyValueChanged(boolean changed)
                                 throws MXException,
                                        java.rmi.RemoteException
        sets instance variable copyValueChanged for a rotating AssetSpec. When values are initially copied from ItemSpec, this should be set to false. Any subsequent changes to AlnValue or NumValue should result in setting this boolean to true. This implements the abstract method defined in psdi.app.assetcatalog.SpecificationMbo.
        Overrides:
        setCopyValueChanged in class SpecificationMbo
        Parameters:
        changed - boolean value to set this instance variable to true or false.
        Throws:
        MXException
        java.rmi.RemoteException
      • canGenerateDesc

        public MboRemote canGenerateDesc()
                                  throws MXException,
                                         java.rmi.RemoteException
        Returns a ClassSpec mbo if the AssetAttrID, AlnValue/NumValue, or MeasureUnitID can be included in the description generation process for the asset. Otherwise, null is returned.
        Overrides:
        canGenerateDesc in class SpecificationMbo
        Returns:
        ClassSpec MBO containing attributes that can be used in the Asset object's Description
        Throws:
        MXException
        java.rmi.RemoteException
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Checks to see if this object can be deleted,only classspec or asset can delete this assetspec object. throws MXException if it cannot be deleted
        Overrides:
        canDelete in class Mbo
        Throws:
        MXApplicationException("asset","noDeleteAssetSpec") - if the object attempting to delete this object is not an Asset or ClassSpec object
        MXException
        java.rmi.RemoteException
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        save the assetSpec object. If the Item for the Asset is rotating and either AlnValue or NumValue has been changed, ItemSpecValChanged should be set to true. This ensures that the AssetSpec.AlnValue or NumValue will not be changed when there is a value change in the corresponding ItemSpec.
        Overrides:
        save in class SpecificationMbo
        Throws:
        MXException
        java.rmi.RemoteException
      • skipCopyField

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws java.rmi.RemoteException,
                                        MXException
        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 not. 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 AssetSpec to the target AssetSpec.
        1. ASSETNUM
        2. CHANGEBY
        3. CHANGEDATE
        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, otherwise return false.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        Asset.loadSkipFieldCopyHashSet()
      • propagateKeyValue

        public void propagateKeyValue(java.lang.String keyName,
                                      java.lang.String keyValue)
                               throws MXException,
                                      java.rmi.RemoteException
        Set value for assetnum.
        Specified by:
        propagateKeyValue in interface MboRemote
        Overrides:
        propagateKeyValue in class Mbo
        Parameters:
        keyName - Should equal "assetnum" or else nothing will be propagated.
        keyValue - The new value of assetnum.
        Throws:
        MXException
        java.rmi.RemoteException
      • isChangeByUserWhenSetFromLookup

        public boolean isChangeByUserWhenSetFromLookup(java.lang.String lookupAttrName,
                                                       java.lang.String attributeName)
        Indicate whether the changeed by user flag should be set to the attribute when it is set along with other key field when the lookup attribute is being set on this Linear Mbo.
        Overrides:
        isChangeByUserWhenSetFromLookup in class Mbo
        Parameters:
        lookupAttrName - the attribute whose lookup is being called.
        attributeName - the attribute that is not the lookup attribute.
        Returns:
      • updateSpecHistory

        public void updateSpecHistory()
                               throws MXException,
                                      java.rmi.RemoteException
        Description copied from interface: SpecHistoryInterface
        Update the history object for the impelementing object. The update could happen if the specification record is deleted or modified.
        Specified by:
        updateSpecHistory in interface SpecHistoryInterface
        Throws:
        MXException
        java.rmi.RemoteException