psdi.app.ci

Class CISpec

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


    public class CISpec
    extends SpecificationMbo
    implements CISpecRemote
    Mbo object to represent CI Specification. See CI Package description for details.

    This is a system level object.

    The key attributes in this object are as follows: CINum, AssetAttrID, Section.

    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.
    ChangeByName of the user who last modified this object. This attribute defaults to the current user unless another value is provided.
    ChangeDateThe date and time when this object was last modified. This attribute defaults to the MXServer date/time unless another value is provided.
    CINumIdentifier for the CI.
    CISpecIDSystem generated unique identification of this object.
    ClassSpecIDThe identifier of the classification specification from which the attributes are copied.
    ClassStructureIDIdentifier of the class structure associated with this CI 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 CI's specification. Value is copied from corresponding class specification when the CI specificition is created.
    LinkedToAttributeThe attribute to which this object is linked.
    LinkedToSectionThe section to which this object is linked.
    MandatoryIndicates whether value is needed.
    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.
    RefObjectIDIdentifier of the CI to which this CISpec is linked.
    RefObjectNameThe name or object (CI) to which this CISpec is linked.
    SectionSection for a group of attributes.
    • Constructor Detail

      • CISpec

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

      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Set default values for a new CISpec object. The table below shows the default values for each of the attributes listed.
        Attribute NameAttribute Value
        changebyCurrent username
        changedateCurrent date
        cinumOwner CI identifier
        classstructureidOwner classstructureid
        refobjectidOwner unique identifier
        refobjectnameOwner object name
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class SpecificationMbo
        Throws:
        MXException
        java.rmi.RemoteException
      • loadSkipFieldCopyHashSet

        protected static void loadSkipFieldCopyHashSet()
        Loads the static HashSet with the names of the fields whose values need not be copied from the source Mbo to the target Mbo when a duplicate action is performed. As an example the changedate is one of the fields that need not be copied and the hashSet is loaded in the following way: skipFieldCopy.add("CHANGEDATE") The following is a list of fields that are not copied from the source to the target and are loaded into the HashSet.
        1. CINUM
        2. REFOBJECTID
        3. CHANGEDATE
        4. CHANGEBY
        See Also:
        Mbo.skipCopyField(psdi.mbo.MboValueInfo)
      • 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. The following are the CISpec fields will be skipped without being copied to the newly duplicated object:
        1. CINUM
        2. REFOBJECTID CHANGEBY CHANGEDATE
        Overrides:
        skipCopyField in class Mbo
        Parameters:
        mvi - The MboValueInfo object of the MboValue that needs to be copied.
        Returns:
        true If the field does not need to be copied return true, in all other cases return false.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        CI.loadSkipFieldCopyHashSet()
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        Override the super class save. If this is a newly added CI specification add a CI specification history record. If the user is modifying the record, set the existing history record's end date and create a new one with the new values. In case of deleting the CI specification just set the end date to current date.
        Overrides:
        save in class SpecificationMbo
        Throws:
        MXException
        java.rmi.RemoteException
      • isCISpecModified

        protected boolean isCISpecModified()
                                    throws MXException,
                                           java.rmi.RemoteException
        Checks if the CI specification is modified. We cannot rely on the Mbo's isModified() method in this case as because a mbo is flagged isModified as soon as a setValue() is done on it. The user may decide not to change anything on the mbo.
        Returns:
        boolean
        Throws:
        MXException
        java.rmi.RemoteException
      • populateSpecHisWithInitialValues

        protected void populateSpecHisWithInitialValues(CISpecHisRemote ciSpecHisMbo)
        Used initial information from the CISpec to create the CISPECHIS record needed create the spec history "on demand". Spec history is no longer created during a CISPEC add.
        Parameters:
        CISpecHisRemote - The CISpec History MBO to modify
        Throws:
        MXException
        java.rmi.RemoteException
      • init

        public void init()
                  throws MXException
        IV35721: if the CI application is no SAVE (via security), all the mbosets look readonly but they are not readonly in the object level
        Overrides:
        init in class SpecificationMbo
        Throws:
        MXException