psdi.app.item

Class ItemSpec

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


    public class ItemSpec
    extends SpecificationMbo
    implements ItemSpecRemote
    Mbo object to represent Item Specification. See Item Package description for details.

    This is a organization level object.

    The key attributes in this object are as follows: OrgId, ItemNum, ItemSetID, AssetAttrId

    The attributes in this object are as follows:

    Attribute NameDescription
    AllAsSpecUseValueSpecifies whether this object's ALN or Numeric value is used by asset specifications that originated from this item specifications.
    AllLocSpecUseValueSpecifies whether this object's ALN or Numeric value is used by location specifications that originated from this item specications.
    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.
    ChangeBy,ChangeDateName of the user who last modified this object. This attribute defaults to the current user unless another value is provided. Date this object was last modified.This attribute defaults to the MXServer date/time unless another value is provided.
    ClassStructureidIdentifier of the class structure associated with this item 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 item's specification. Value is copied from corresponding class specification when the item specificition is created.
    ItemnumItem Number.
    ItemSetIDIdentifier of the itemset identifier for this object. *
    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.
    RotatingUsed for asset catalog search, specifies whether or not item is a rotating asset.
    IS01 - IS05Cross-over fields from ClassSpec.CS01 to ClassSpec.CS05, respectively
    • Constructor Detail

      • ItemSpec

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

      • add

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

        public java.lang.String getValueToCrossOver(java.lang.String srcAttrISNN,
                                                    java.lang.String tgtSpecObj,
                                                    java.lang.String tgtSpecAttr)
                                             throws MXException,
                                                    java.rmi.RemoteException
        Handles the setting of values from ITEMSPEC.IS01 through IS05 to ASSETSPEC.ES01 through ES05 and LOCATIONSPEC.LS01 through LS05. when propagating a newly added ITEMSPEC attribute to assets and locations associated with the item.
        Specified by:
        getValueToCrossOver in interface ItemSpecRemote
        Parameters:
        srcAttrISNN - source crossover value. Can be ITEMSPEC.IS01 through ITEMSPEC.IS05
        tgtSpecObj - ASSETSPEC, LOCATIONSPEC
        tgtSpecAttr - target to receive the crossover value. Can be ASSETSPEC.ES01 through ASSETSPEC.ES05 or LOCATIONSPEC.LS01 through LOCATIONSPEC.LS05.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        ItemSpec.getValueToCrossOver(String, String, String)
      • canGenerateDesc

        public MboRemote canGenerateDesc()
                                  throws MXException,
                                         java.rmi.RemoteException
        Returns the classspec mbo if the assetattrid, alnvalue/numvalue, and or measureunitid can be included in the description generation process for the item;null otherwise.
        Overrides:
        canGenerateDesc in class SpecificationMbo
        Returns:
        MboRemote
        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 item can delete this itemspec object. throws MXException if it cannot be deleted
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        Save this itemspec object; if the item is rotating, changes to alnvalue or numvalue in this itemspec should result in value changes in the corresponding AssetSpec or locationspec.
        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 skipped by using the data from the static HashSet. If this field does not need to be copied return true. Only itemnum,changedate,and changeby will be will be skipped in copying this itemspec.
        1. ITEMNUM
        2. ITEMSETID CHANGEBY 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.In all other cases return false.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        Item.loadSkipFieldCopyHashSet()
      • modify

        public void modify()
                    throws MXException,
                           java.rmi.RemoteException
        Description copied from class: SpecificationMbo
        Called whenever a change is made to the attributes of SpecificationMbo. Updates changeby and changedate attributes.
        Overrides:
        modify in class SpecificationMbo
        Throws:
        MXException
        java.rmi.RemoteException
      • prepareInsertAssetSpec

        protected void prepareInsertAssetSpec()
                                       throws MXException,
                                              java.rmi.RemoteException
        08-23855
        Throws:
        MXException
        java.rmi.RemoteException
      • prepareInsertAssetSpecHist

        protected void prepareInsertAssetSpecHist()
                                           throws MXException,
                                                  java.rmi.RemoteException
        08-23855
        Throws:
        MXException
        java.rmi.RemoteException
      • prepareUpdateAssetSpec

        protected void prepareUpdateAssetSpec()
                                       throws MXException,
                                              java.rmi.RemoteException
        10-14955: when itemspec.alnvalue,numvalue,or tablevalue is changed if it is rotating, then need to update assetspec
        Throws:
        MXException
        java.rmi.RemoteException
      • prepareInsertAssetSpecHistForUpdate

        protected void prepareInsertAssetSpecHistForUpdate()
                                                    throws MXException,
                                                           java.rmi.RemoteException
        10-14955: copy prepareInsertAssetSpecHist - only to store the insert statement in a different vector - safe way - don't want to break the code for 08-23855 and 09-14572
        Throws:
        MXException
        java.rmi.RemoteException
      • prepareUpdateAssetSpecHist

        protected void prepareUpdateAssetSpecHist()
                                           throws MXException,
                                                  java.rmi.RemoteException
        10-14955: when itemspec.alnvalue,numvalue,or tablevalue is changed if it is rotating, then need to update assetspec and when assetspec is updated, assetspechist.removeddate is populated.
        Throws:
        MXException
        java.rmi.RemoteException
      • getNumberOfRotatingAssets

        public int getNumberOfRotatingAssets()
                                      throws MXException,
                                             java.rmi.RemoteException
        10-14955: get the number of rotating assets for the item - determines if we want to use direct prepared statements when itemspec.alnvalue/numvalue/tablevalue is changed.
        Throws:
        MXException
        java.rmi.RemoteException
      • assetSpecExists

        public boolean assetSpecExists()
                                throws MXException,
                                       java.rmi.RemoteException
        IV36836/76784: If item is rotating and the itemspec has associated assetspec, deleting itemspec by the user does not delete itemspec - this has been the behavior. However, if user manually clicks the New Row to add a new ItemSpec in the Item Application, it tries to add AssetSpec. I don't feel comfortable deleting assetspecs when itemspec is manually deleted by the user because in Classifications app, if user deletes an attribute, it will delete itemspec/assetspec/locationspec. checks if assetSpecExists before inserting assetspec in the save() method
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getUserDefinedRequired

        public java.lang.String[] getUserDefinedRequired(java.lang.String specName,
                                                         int startingIndex)
                                                  throws MXException,
                                                         java.rmi.RemoteException
        IJ20830
        Parameters:
        specName -
        startingIndex - - the last harded is 14 so the passed is 16
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException