Posts

Showing posts from 2021

Automation scripts special functions

Some special functions are called in Automation scripts during integration script executions. These functions can be created inside the automation script and will be called by Maximo during different phases of Integration transaction processing. more info can be found in IBM Docs also  IBM Docs - Context APIs for the inbound processing of object structures e.g.  def beforeProcess(){   ... } Integration scripts: changeStatus() skipMbo() similar to skipMboRules overrideValues() similar to overrideRules() skipCols() similar to skipColRules() ObjectProcessing Scripts: beforeProcess()  similar to beforeProcess() beforeCreateMboSet() preSaveRules() afterProcess() afterCreateMboSet() mboRules() beforeMboData() afterMboData() Processing order for inbound objectstructure beforeProcess()  beforeCreateMboSet() preSaveRules() afterProcess() This article is work in progress.

Maximo OSLC query examples

Searching records using OSLC: http://10.10.10.10:9080/maximo/oslc/os/MXWO?lean=1&oslc.select=wonum&oslc.pageSize=51&oslc.where= Where clauses: oslc.where= Using Relationship: siteid="PTA" and PARENTWO.status="CLOSE" Using Dates: siteid="PTA" and reportdate>"2021-06-01T00:00:00+04:00" and PARENTWO.status="CLOSE" Saved Queries savedQuery=gettraassets Page Size: &oslc.pageSize=40 Order By Clause: &oslc.orderBy=%2Boslc%3AshortTitle

BIRT Report displaying doclink images in reports

Image
It is possible to display attached images on records in Maximo BIRT reports. To display attached images we can use an image control with the path of the image in the URI with file:// appended to the path. I tested it in linux and was able to view the output. Important to note that this only works for PDF outputs as the report is rendered on server and image paths are only accessible from server. Also for windows servers we might have to add an additional slash i.e. file:/// but I haven't tested it. Sample output is attached below. Another possible way to display images might be to request the attachment by calling an OSLC query and download the image. e.g. 1. Get record: http://10.192.200.201:9082/maximo/oslc/os/mxwo/?_lid=maxadmin&_&lpwd=maxadmin&oslc.pageSize=1&oslc.where=wonum="17911725" 2. Get doclinks/attachments list http://10.192.200.201:9082/maximo/oslc/os/mxwo/_REkvMTc5MTE3MjU-/doclinks?_lid=maxadmin&_&lpwd=maxadmin&oslc.pageSize=1 3. ...

Rebuilding Maximo Text Indexes due to Query performance issues

Image
Sometimes it is necessary to rebuild text indexes after database move or copy from Prod to other instances. IBM does have an article for Rebuilding Oracle Text Indexes . Basically this process drops all the domain indexes and recreates them.  These are the steps are just walkthrough with the same process in detail. 1. Follow the steps in the above article to remove any DBMS jobs Remove any occurrences of DBMS_JOB Determine how many DBMS_JOBS are running by executing this from SQLPLUS logged in as the schema owner: select job, substr(what,1,80) from user_jobs; For each result where "what" contains maximo_ts_job, execute the following commands: begin dbms_job.remove(####); commit; end; / Substituting one of the job numbers from the select for the ####. 2. Change the job  Change to use DBMS_SCHEDULER Recreate the job submission procedure and run it: CREATE OR REPLACE PROCEDURE maximo_ts_job_call AS BEGIN   dbms_scheduler.create_job(   job_name => 'MAXIMOTSSYNC', ...

List of things checked by Maximo Integrity checker

Maximo Integrity checker is a pretty useful tool to identify issues in Maximo database  Below are some of the things checked by integrity checker and the sample errors returned. 1. Extra tables in database which are not part of Maximo BMXAA0442W -- Warning - BMXAA0475W -- The following tables should be removed from the database because they do not exist in the schema: Sun May 30 12:08:47 GST 2021    APPLICATIONAUTH_BKP    DOCLINKS_POBKP    ABC_MIGR_TEST 2. Missing Indexes BMXAA0443E -- Error - BMXAA0465E -- The following indexes are missing from the database. Use the Database Configuration application to remove the index definition. 3. Missing user groups, invalid users etc BMXAA0455E -- The following users should be removed because they are not authorized. To correct this error, run the Integrity Checker in repair mode. BMXAA0458E -- The following user groups were not found in the MAXGROUPS table. Run the Integrity Checker in repair mode. 4. Invalid M...

Automation script to implement Yes/No confirmation messages in Maximo

Below script can be used to implement Yes/No prompt message taken from IBM documentation . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 # Business logic implementation if user selects Yes choice (clicks Yes button) def yes (): service . log( "Sending Email" ) # Business logic implementation if user selects No choice (clicks No button) def no (): service . log( "Not Sending Email" ) # Business logic to present the choice message initially def dflt (): params = [ str (priority)] service . log( "Throw ERROR" ) # Use the service utility's yncerror() method to push the choice message # The below key and group combination should be added in Database configuration -> Messages service . yncerror( "asset" , "assetpriorityemail" ,params); service . log ( '$$SAM$ - entering ASSETPRIORITYVAL' ) # Declare the user input choices and the corresponding functions impleme...

Maximo Spatial Update field with current displaying error

Image
While creating a work order using the pop up map to select asset it is usually possible to select the asset directly from map and update the field using the selected Asset on the Map using the Update field with current Option from the Results dialog box. Unfortunately we were getting below error as popup as well as in the error logs. Application/exception loggers need to be in debug mode for it to appear in logs. 1.   [DEBUG] [MXServer] [] Generated exception psdi.util.MXApplicationException: BMXAA0090E - Asset ACE is not a valid asset, or its status is not an operating status. Instead of trying to set the asset num of the selected Asset it was trying to set the Site ID of the asset on the map the the se lected field. For example in the below error ACE would be the Site ID. After digging deeper it turned out that Maximo was trying to set the 2nd attribute of the  PRIMARYKEYCOLSEQ on the Asset Object. Source of the issue seemed to originate from below OOB file Line:2019 - ps...

Config DB error during Alter column, modifying Maximo Attribute

Config DB can sometimes fail while altering columns if the attributes names are oracle keywords. Usually its a good idea to make sure attribute names and objects in Maximo are not same as one of oracle keywords. Recently we faced an error while using a scope as an attribute name. We were trying to modify size. Error starting at line 34 in command: ALTER TABLE INSPECTPROCESS MODIFY SCOPE VARCHAR2 (100) Error report: SQL Error: ORA-00904: : invalid identifier 00904. 00000 -  "%s: invalid identifier" *Cause:     *Action: As SCOPE is an oracle keyword with special meaning, the alter statement was failing. To fix it we had to run the below statement manually instead. Note the extra set of brackets. ALTER TABLE INSPECTPROCESS MODIFY ( SCOPE VARCHAR2(100BYTE) ) ;

BMXAA6713E - The record could not be retrieved from the database. Error

Getting below error in Maximo System Logs [ERROR] [MAXIMO] [] BMXAA6713E - The MBO fetch operation failed in the mboset with the SQL error code 17006. The record could not be retrieved from the database. See the log file for more details about the error. java.sql.SQLException : Invalid column name at oracle.jdbc.driver.OracleStatement.getColumnIndexPrimitive(OracleStatement.java : 3810 ) at oracle.jdbc.driver.OracleStatement.getColumnIndex(OracleStatement.java : 3777 ) at oracle.jdbc.driver.InsensitiveScrollableResultSet.findColumn(InsensitiveScrollableResultSet.java : 268 ) at oracle.jdbc.driver.GeneratedResultSet.getObject(GeneratedResultSet.java : 570 ) at psdi.mbo.MboSet.getNextRecordData(MboSet.java : 3457 ) at psdi.mbo.MboSet.fetchMbosActual(MboSet.java : 2941 ) at psdi.mbo.MboSet.fetchMbos(MboSet.java : 2898 ) at psdi.mbo.MboSet.getMbo(MboSet.java : 2114 ) at psdi.app.common.purchasing.FldPurContractRefNum.validate(FldPurContractRefNum.java : 86 ) at psdi.mbo.MboVa...

Maximo Spatial

Image
Sometimes it might be useful to check ArcGIS token service and credentials by sending a POST request to get Token for further requests. The ArcGIS provides a GenerateToken service which can be used to Generate Token. More info can be found about the parameters in ArcGIS documentation .  Below is a sample POST request data: 

Spatial Maps not loading after applying IFIX

Maximo Spatial maps were not loading after applying a recent Maximo Spatial IFIX 7.6.0.5-TIV-MAMST-IF015  The below exception was being generated in the logs [ 4 / 22 / 21 1 : 42 : 17 : 765 GST] 0000010 9 ServletWrappe E com . ibm . ws . webcontainer . servlet . ServletWrapper service SRVE0068E: An exception was thrown by one of the service methods of the servlet [ / webclient / components / mxmap / map . jsp] in application [MAXIMOSTG] . Exception created : [java . lang . NullPointerException at psdi . pluss . app . plussgis . SpatialConfHelper . getExpressionQuery(SpatialConfHelper . java: 363 ) at psdi . pluss . app . plussgis . SpatialConfHelper . hasSigotion(SpatialConfHelper . java: 230 ) at psdi . pluss . app . plussgis . SpatialConfHelper . getMapServicesArray(SpatialConfHelper . java: 162 ) at psdi . pluss . app . plussgis . SpatialConfHelper . getSpatialMapConf(SpatialConfHelper . java: 460 ) at psdi . pluss . app . plussgis . PlusSGISService . getSpatialMapCon...

Maximo Anywhere iOS build Error Archive Failed due to certificate issue

Image
During the iOS Build after resolving the Build System issue we were getting below error causing Archive Failed error. [INFO] 2021-4-15 12:59:23   note: Planning build note: Constructing build description [INFO] 2021-4-15 12:59:25   note: Constructing build description error: No signing certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID "XXXXXXXCSG" with a private key was found. (in target 'AssetManager' from project 'AssetManager') [INFO] 2021-4-15 12:59:27   error: No signing certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID "XXXXXXXCSG" with a private key was found. (in target 'AssetManager' from project 'AssetManager') [INFO] 2021-4-15 12:59:27   [ERROR] 2021-4-15 12:59:27   ** ARCHIVE FAILED ** [ERROR] 2021-4-15 12:59:27   xcodebuild: Command failed with exit code 65 [ERROR...

Maximo Anywhere iOS Build Archive error due to new build system

Image
 During Maximo Anywhere App Container build for iOS I was getting the below error  Reems-Air : ios sreeja$ xcodebuild -workspace AssetManager.xcworkspace -scheme AssetManager -configuration Release -destination generic/platform=iOS -archivePath AssetManager.xcarchive archive CONFIGURATION_BUILD_DIR=/Users/sreeja/IBM/Anywhere/MaximoAnywhereAppCntr/output/AssetDataManager/platforms/ios/build/device SHARED_PRECOMPS_DIR=/Users/sreeja/IBM/Anywhere/MaximoAnywhereAppCntr/output/AssetDataManager/platforms/ios/build/sharedpch "VALID_ARCHS=arm64 CURRENT_ARCH=arm64 ONLY_ACTIVE_ARCH=YES" Command line invocation : /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace AssetManager.xcworkspace -scheme AssetManager -configuration Release -destination generic/platform = iOS -archivePath AssetManager.xcarchive archive CONFIGURATION_BUILD_DIR = /Users/sreeja/IBM/Anywhere/MaximoAnywhereAppCntr/output/AssetDataManager/platforms/ios/build/device SHARED_PRECOMPS_DIR = /Us...

BIRT generates error while reading Long Datatype

If you are reading a Long datatype in a data set in a BIRT report you might receive the below error while executing the report in the fetch function is executed in the report. Fri Mar 26 16:02:58 GST 2021  ERROR  getString(LONGDATATYPECOL) failed. java.sql.SQLException: Stream has already been closed at oracle.jdbc.driver.LongAccessor.getBytesInternal(LongAccessor.java:131) at oracle.jdbc.driver.Accessor.getBytes(Accessor.java:951) at oracle.jdbc.driver.LongAccessor.getString(LongAccessor.java:166) at oracle.jdbc.driver.GeneratedStatement.getString(GeneratedStatement.java:327) at oracle.jdbc.driver.GeneratedScrollableResultSet.getString(GeneratedScrollableResultSet.java:882) at oracle.jdbc.driver.GeneratedResultSet.getString(GeneratedResultSet.java:1460) at com.ibm.tivoli.maximo.report.script.MXReportResultSet.getString(MXReportResultSet.java:541) at com.ibm.tivoli.maximo.report.script.MXReportDataSetImpl.getString(MXReportDataSetImpl.java:434) at sun.reflect...