psdi.iface.mos

Class MosProcessImpl

    • Field Detail

      • actionInd

        protected java.lang.String actionInd
        Action Indicator of transaction
      • messageType

        protected java.lang.String messageType
        Integration Service messageType
      • processTable

        protected java.lang.String processTable
        Action Indicator of transaction
      • struc

        protected StructureData struc
        Structure Data class of all data from External System
      • updatedSet

        protected java.util.ArrayList updatedSet
        List of all the Mbo Sets updated in the transaction
      • validOrgSite

        protected boolean validOrgSite
        Boolean to check if org and site has been validated
      • targetMboSet

        protected MboSetRemote targetMboSet
        Target MboSet for Invoke Channel
      • targetMbo

        protected MboRemote targetMbo
        Target Mbo for Invoke Channel
      • metaData

        protected java.util.Map metaData
        MetaData for Invoke Channel
      • targetMbos

        protected java.util.Map targetMbos
        Haold all target Mbo for target MboSet
      • responseMbos

        protected java.util.List responseMbos
        Hold all response Mbos
      • replyRequired

        protected boolean replyRequired
        Is reply required for Integration Service
      • accessModifier

        protected long accessModifier
        Access Modifier
      • action

        protected int action
      • toBeSaved

        protected boolean toBeSaved
      • selfRef

        protected boolean selfRef
      • writer

        protected javax.xml.stream.XMLStreamWriter writer
      • byteOutputStream

        protected java.io.ByteArrayOutputStream byteOutputStream
    • Constructor Detail

      • MosProcessImpl

        public MosProcessImpl()
                       throws MXException,
                              java.rmi.RemoteException
        Construct the set
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
    • Method Detail

      • processObjectStructureService

        public byte[] processObjectStructureService(StructureData data,
                                                    java.lang.String mosName,
                                                    java.lang.String msgType,
                                                    UserInfo info,
                                                    MXTransaction trans)
                                             throws MXException,
                                                    java.rmi.RemoteException
        Process Object Structure Service XML.
        Parameters:
        data - Give reference to StructureData class with data from external system.
        mosName - Give object structure name.
        msgType - Give operation.
        info - Give User Info reference.
        trans - Give reference to MAXIMO Transaction object.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • processExternalData

        public byte[] processExternalData(StructureData data,
                                          java.lang.String mosName,
                                          UserInfo info,
                                          MXTransaction trans)
                                   throws MXException,
                                          java.rmi.RemoteException
        Process data coming from external systems using Enterprise Service definition.
        Parameters:
        data - Give reference to StructureData class with data from external system.
        mosName - Give object structure name.
        info - Give User Info reference.
        trans - Give reference to MAXIMO Transaction object.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • processMboSet

        public MboSetRemote processMboSet(boolean isPrimaryMbo,
                                          MboRemote parentMbo,
                                          MosDetailInfo mdi,
                                          java.lang.String processTable)
                                   throws MXException,
                                          java.rmi.RemoteException
        Create Mbo set sets for all levels in XML for incoming transactions If MboSet already exit (Invocation Channel) use it.
        Parameters:
        isPrimaryMbo - Give indicator for Main vs. additional tables
        parentMbo - Give reference to parent Mbo.
        mdi - Give MosDetailInfo for the current level.
        processTable - Give name of table to process
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • createMboSet

        public MboSetRemote createMboSet(boolean isPrimaryMbo,
                                         MboRemote parentMbo,
                                         MicSetInfo micInfo,
                                         java.lang.String processTable)
                                  throws MXException,
                                         java.rmi.RemoteException
        Deprecated. please use method with MosDetailInfo
        Create mbo set sets for all levels in XML for incomig transactions
        Parameters:
        isPrimaryMbo - Give boolean to specify is it primary table or additional table
        parentMbo - Give reference to parent Mbo.
        micInfo - Give MicSetInfo for the current level.
        processTable - Give name of table to process
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • copyParentKey

        public void copyParentKey(java.lang.String attributeName,
                                  java.lang.String value)
                           throws MXException,
                                  java.rmi.RemoteException
        Copy parent key to a child if value does not exists in the child
        Parameters:
        attributeName - attribute name in child
        val - value from parent mbo to set
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • createMboSet

        public MboSetRemote createMboSet(boolean isPrimaryMbo,
                                         MboRemote parentMbo,
                                         MosDetailInfo mdi,
                                         java.lang.String processTable)
                                  throws MXException,
                                         java.rmi.RemoteException
        Create Mbo set sets for all levels in XML for incoming transactions
        Parameters:
        isPrimaryMbo - Give boolean to specify is it primary table or additional table
        parentMbo - Give reference to parent Mbo.
        mdi - Give MicSetInfo for the current level.
        processTable - Give name of table to process
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • delete

        public void delete(MboRemote mbo,
                           MosDetailInfo mdi)
                    throws MXException,
                           java.rmi.RemoteException
        Update row in MAXIMO table for the main table
        Parameters:
        mbo - Give Mbo for the current level.
        mdi - Give MosDetailInfo for the current level.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • checkForEsig

        protected void checkForEsig(java.lang.String optionName)
                             throws MXException,
                                    java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • checkValidateErrors

        public void checkValidateErrors()
                                 throws MXException,
                                        java.rmi.RemoteException
        Default method to check all validation errors
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • compareMboKeyValues

        public boolean compareMboKeyValues(MboSetRemote mboSet,
                                           MicSetInfo micInfo,
                                           java.lang.String[] keys)
                                    throws MXException,
                                           java.rmi.RemoteException
        Deprecated. please use method with MosDetailInfo
        Default method to try to find in memory MBO with the keys matched with XML data for the current level
        Parameters:
        mboSet - Give reverence to current MboSet
        micInfo - The integration object info
        keys - Keys of the object
        Returns:
        Boolean indicating that compare was successful or not
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • compareMboKeyValues

        public boolean compareMboKeyValues(MboSetRemote mboSet,
                                           MosDetailInfo mdi,
                                           java.lang.String[] keys)
                                    throws MXException,
                                           java.rmi.RemoteException
        Default method to try to find in memory MBO with the keys matched with XML data for the current level
        Parameters:
        mboSet - Give reverence to current MboSet
        mdi - Give MosDetailInfo for the current level.
        keys - Keys of the object
        Returns:
        Boolean indicating that compare was successful or not
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • deleteAll

        public void deleteAll(MboRemote owner,
                              MboSetRemote mboSet)
                       throws MXException,
                              java.rmi.RemoteException
        Default method to call back delete all Mbo's in MboSet
        Parameters:
        owner - Give reference to parent Mbo.
        mboSet - Give MboSet for the current level.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • addMbo

        public MboRemote addMbo(MboSetRemote mboSet)
                         throws MXException,
                                java.rmi.RemoteException
        Default method to call back and add Mbo's in MboSet
        Parameters:
        mboSet - Give MboSet for the current level.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • save

        public void save()
                  throws MXException,
                         java.rmi.RemoteException
        Default method to call back and save transaction
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • checkAdditionalRules

        public void checkAdditionalRules()
                                  throws MXException,
                                         java.rmi.RemoteException
        Default method to call at the end of processing can be used to set data for the whole object.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • cleanup

        public void cleanup()
                     throws MXException,
                            java.rmi.RemoteException
        Default method to call at the end of processing to cleanup all private variable create during the process of the noun.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • checkForUpdate

        public boolean checkForUpdate()
                               throws MXException,
                                      java.rmi.RemoteException
        Default method to call and change for status update.
        Returns:
        false
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • resetMboSet

        public MboSetRemote resetMboSet(MboSetRemote childMboSet)
                                 throws MXException,
                                        java.rmi.RemoteException
        Default method to be overridden by the individual modules to reset MboSet to be processed. By default will return MboSet which was passed in.
        Parameters:
        childMboSet - Give reverence to current MboSet
        Returns:
        MboSet created by individual modules
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • getLanguage

        public java.lang.String getLanguage()
                                     throws MXException
        This method will return Language of the transaction
        Returns:
        Language code
        Throws:
        MXException
      • checkBusinessRules

        public int checkBusinessRules()
                               throws MXException,
                                      java.rmi.RemoteException
        Default method to call back and find out can we process data. This method will return always PROCESS and can be overridden in MicSet
        Returns:
        PROCESS (means continue to process)
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • presetMboRules

        public int presetMboRules()
                           throws MXException,
                                  java.rmi.RemoteException
        Default method to call back and find out do we need to set data. This method will return always PROCESS and can be overridden in MicSet
        Returns:
        PROCESS (means continue to process)
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • checkBusinessRules

        public int checkBusinessRules(MboSetRemote mboSet,
                                      java.lang.String tableName)
                               throws MXException,
                                      java.rmi.RemoteException
        Default method to call back and find out can we process data.
        Parameters:
        mboSet - Give MboSet for the current level.
        tableName - Give of the table to process.
        Returns:
        PROCESS (means continue to process)
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • setAdditionalData

        public void setAdditionalData(MboSetRemote MboSet,
                                      java.lang.String tableName)
                               throws MXException,
                                      java.rmi.RemoteException
        Default method to set all addition data from XML to MBO which was not set thru Integration DD
        Parameters:
        MboSet - Give MboSet for the current level.
        tableName - Give name of process MAXIMO table
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • setAttachments

        public void setAttachments()
                            throws MXException,
                                   java.rmi.RemoteException
        Set fields for attachment processing. Save DOCUMRENTDATA in the Map to be written to the file at the end of the processing
        Throws:
        MXException - Maximo Exception
        java.rmi.RemoteException - Remote Exception
      • checkDocumnetMaxSize

        public void checkDocumnetMaxSize(byte[] document)
                                  throws MXException,
                                         java.rmi.RemoteException
        Checks size of the attachment against system property "mxe.int.doclink.maxfilesize"
        Parameters:
        document - Attachment byte array.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • getAttachmentFileName

        public java.lang.String getAttachmentFileName(java.lang.String directory,
                                                      java.lang.String fileName)
                                               throws MXException,
                                                      java.rmi.RemoteException
        Create unique file name for attachment. Use original file name and add unuque identifier
        Parameters:
        directory - Give attachment directory name.
        fileName - Give original file name
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • applyXMLRules

        protected void applyXMLRules()
                              throws MXException,
                                     java.rmi.RemoteException
        Default method to apply XML rules. Is overridden in MicSetIn
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • applyDMRules

        protected void applyDMRules(StructureData data,
                                    UserInfo info)
                             throws MXException,
                                    java.rmi.RemoteException
        Default method to apply XML rules. Is overridden in MicSetIn
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • applyMboRules

        protected int applyMboRules(MboRemote ruleMbo,
                                    java.lang.String hpath)
                             throws MXException,
                                    java.rmi.RemoteException
        Default method to apply Mbo rules. Is overridden in MicSetIn
        Parameters:
        ruleMbo - Give Mbo to apply rule.
        hpath - Give location path of the level.
        Returns:
        action result of the rules
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • callMboExit

        protected void callMboExit()
                            throws MXException,
                                   java.rmi.RemoteException
        Default method to cal Mbo User Exit
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • skipSelfreferencing

        protected boolean skipSelfreferencing(MosDetailInfo childInfo,
                                              MosDetailInfo mdi)
                                       throws MXException,
                                              java.rmi.RemoteException
        Default method to skip object with same name for self-referencing object structures
        Parameters:
        childInfo - current level MosDetailInfo
        mdi - parent level MosDetailInfo
        Returns:
        indicator to skip when object names are same in parent and child level
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • setAutokeyFlag

        public void setAutokeyFlag(MboSetRemote set,
                                   MosDetailInfo info)
                            throws MXException,
                                   java.rmi.RemoteException
        Default method to be overridden by the individual modules to set autokey flag. This method will determine if one of the keys have autokey associated with it and if value is provided for this field in XML it will set autokey flag to false. In this case autokey will not be generated for this record
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • getOrg

        public java.lang.String getOrg()
        Default method to get name of the field which has value for organization
        Returns:
        Column name with value for the Organization
      • getSite

        public java.lang.String getSite()
        Default method to get name of the field which has value for site
        Returns:
        Column name with value for the Site
      • getItemSet

        public java.lang.String getItemSet()
        Default method to get name of the field which has value for item set.
        Returns:
        Column name with value for the Item Set
      • getCompanySet

        public java.lang.String getCompanySet()
        Default method to get name of the field which has value for company set.
        Returns:
        Column name with value for the Organization
      • getAccessModifier

        public long getAccessModifier()
        Return Access modifier.
        Returns:
        Access modifier
      • setAccessModifier

        public void setAccessModifier(long amd)
        Sets Access modifier.
        Parameters:
        amd - Give Access modifier.
      • setSkipSetFields

        public void setSkipSetFields(java.lang.String field)
        Sets Access modifier.
        Parameters:
        amd - Give Access modifier.
      • setValidOrgSite

        public void setValidOrgSite(boolean v)
        Method to set a swith after org and site is validated.
        Parameters:
        v - Give validate org and site swith.
      • findTargetMbo

        public MboRemote findTargetMbo(MosDetailInfo mdi)
                                throws MXException,
                                       java.rmi.RemoteException
        Find target Mbo in MboSet for Invacation Channel.
        Parameters:
        mdi - Give MosDetailInfo reference
        Returns:
        Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • buildResponse

        protected void buildResponse(MboRemote mbo,
                                     int itr,
                                     int size)
                              throws MXException,
                                     java.rmi.RemoteException
        Build Invocation response
        Parameters:
        mbo - Give Mbo for the current level.
        itr - Give position in the set.
        size - Give size of the set.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • buildResponseEnd

        protected void buildResponseEnd()
                                 throws MXException,
                                        java.rmi.RemoteException
        Build Invocation response
        Parameters:
        mbo - Give Mbo for the current level.
        itr - Give position in the set.
        size - Give size of the set.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • processResponse

        protected byte[] processResponse()
                                  throws MXException,
                                         java.rmi.RemoteException
        Converts response to byte array
        Returns:
        response in byte[] format.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • afterProcess

        public void afterProcess()
                          throws MXException,
                                 java.rmi.RemoteException
        Called after processing while XML (can be called to change status in the hierarchy)
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • writeAttachments

        public void writeAttachments()
                              throws MXException,
                                     java.rmi.RemoteException
        Called after processing to write all attachments to the file
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • afterReplace

        public void afterReplace(MboRemote child)
                          throws MXException,
                                 java.rmi.RemoteException
        Called for action Replace or null scenario after processing while XML to delete data which did not come in XML
        Parameters:
        child - Give Mbo for the current level.
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • getOrgSiteColumn

        protected java.lang.String getOrgSiteColumn()
                                             throws MXException,
                                                    java.rmi.RemoteException
        Get the org-site-set column
        Returns:
        Column Name with value for Organization or Site or Set depending of the table level.
        Throws:
        MXException
        java.rmi.RemoteException
      • setClassStructureId

        protected void setClassStructureId()
                                    throws MXException,
                                           java.rmi.RemoteException
        Sets the ClassStructureId column on the mbo. This method should only be called from setAdditionalData() method for those objects which have a classstructureid column, and have added a user column 'HIERARCHYPATH' for(eg, Item, Asset)
        Throws:
        MXException - Maximo Exception
        java.rmi.RemoteException - Remote Exception
      • isBranchFilterOn

        public boolean isBranchFilterOn()