Thursday, April 8, 2021

Fuel Consumption Import in Maximo Transportation

Maximo Transportation Solution has an application Fuel Transaction Import (Tr) which is used to import Inventory transactions plus meter readings from Maximo.

Steps to be followed to import Fuel Transactions.

  • Create a template
  • Import file
  • Edit records for corrections (optional)
  • Reconcile and create Inventory record

Create a template

We need to create a template for loading fuel consumption data.  It need to be defined in Organization (Tr) application, Select Action -> Transportation Options -> Fuel Transactions Import Setup.





Sample template file can be found in https://gitlab.com/bysurendar/maximo/-/blob/master/templates/fuelconsumption.csv

Import file
After we define the template, we can import the data file from Data Import (Tr) -> Fuel Transactions Import (Tr) application. Click on Import File option under More Actions Section. 

In the Import File dialog, choose Template ,defined in Organization (Tr) application. 
Select whether the imported file has Inventory Transactions & Meter Readings. 
Choose the Site for Imported Readings. 

Once you upload the file, you will get a couple of system messages. The loaded transaction will be created in PENDING status.


Edit records for corrections
We can edit the records before committing the Meter reading and fuel transactions. It can be done by Imported Transactions --> Edit Records.



Reconcile and create Inventory record

In order to commit the transaction, we need to use option Imported transactions -> Create Inventory Transactions.

First Stage of committing to database is to reconcile the transactions. You can do it by choosing the Site, selecting the records and click on Reconcile button.

 
The Status of the transaction goes to "RECONCILED" Status.

Second stage is to Create Inventory transactions for reconciled records from the same dialog. It will create the Inventory transaction for item in a storeroom. 


The loaded fuel transaction of item DIESEL is recorded as ISSUE in Inventory application. 

Since we have loaded meter readings along with fuel transactions in the same file, we can create Meter readings from Fuel transactions Import (Tr) application. The detailed explanation is given in this website  Bulk Meter reading Load


Advantage: Ease of use. We don’t need to configure MIF related object structure, enterprise service or external system to import data. It is very helpful for end users to collect fuel consumption readings from external system, validate and upload them.

Thursday, February 4, 2021

Maximo DBC - Database Configuration Scripts

What is DBC?   
Database Configuration Scripts (DBCs) are xml-formatted instructions for making changes to Maximo Database using updatedb command. 

What DBC used for?
We can perform Maximo changes related to Database configuration application, security options, application or UI, domains, menus, system properties, MAXVARS and loading .sql files using DBC. It is one way of deploying our changes to a Maximo Environment.

How to create DBCs for your project? 
i) Create a new product xml file in <MaximoInstalledFolder>/applications/maximo/properties/product/ to store information about your enhancement
ii) Create a scripts directory in <MaximoInstalledFolder>/tools/maximo/en to place dbc files
iii) Each dbc script should be numbered sequentially. DBC file extensions - .mxs (application screen changes), .msg (maxmessages), .sql (file with sql scripts) & .dbc
iv) DBCs can be created manually by referring to existing dbcs in folders (tools/maximo/en), or, by ScriptBuilder.bat (tools/maximo/internal) or mxdiff.bat for .mxs file or geninsertdbc.bat
v) During the development phase, update product xml with information about your script
vi) This information is used by the “updatedb” command to determine from which dbc to run

Where to add DBCs? 

  • Scripts are sequential. They start with name V followed by values in major,minor. modlevel & patch fields in product XML followed by underscore ( _ ), a sequential number and ending with extension (dbc/sql/mxs/msg)
  • First script in every new version is numbered as 01. for example, V7611_01.dbc
  • After the DBCs are added in scripts folder and product.xml is updated with latest script number in <dbmaxvarname> tag, run updatedb command
  • The dbcs for our customization should be placed in the folder   <MaximoInstalledFolder>/tools/maximo/en/<folder in dbscripts tag>/ , for example, C:/IBM/SMP/maximo/tools/maximo/en/myproject


Product XML
  • Uniquely named XML file in "applications/maximo/properties/product" directory
  • <dbmaxvarname> is MAXVAR id that will be created to store last script number for our development
  • <dbscripts> is the folder name located in tools\maximo\en
  • <dbversion> - specifies the most recent script in the scripts folder
  • <lastdbversion> - specifies the last committed dbc
  • Script version in product.xml file has dash (-), but file system has  ( _ ) underscore (V7611_00.dbc) with an extension 

 



updatedb process
  • Updatedb tool is present in tools\maximo folder
  • Maximo servers should be stopped when you run updatedb
  • updatedb command will fail, if there is a gap in sequential numbering of scripts. To fix it, we can add empty script files to fill the gap
  • Addition of new scripts to product directory need to be followed by update of dbversion element in product XML file to match the most recent script number
  • After running updatedb, last processed script will be shown in Maximo System Information. We need to build ear to include custom product.xml to view them in Maximo System Information.


Testing DBCs
runscriptfile command is present in "tools\maximo\internal" folder
runscriptfile.bat –c<foldername> –f<filename>
runscriptfile.bat –cmyproject –fV7611_01
   <foldername> is where the scripts are stored in. It is optional parameter. if -c is not specified, Maximo will look for dbc file in this default folder tools\maximo\en\script
   <filename> – dbc file name without any extension



Pros and Cons
  • Database independent way of making changes to Maximo irrespective of type of database (Oracle, DB2 & Microsoft SQL Server)
  • Lesser Development time
  • Need system downtime for deployment
Best Practices
  • Group structural changes together in the same script
  • Update the version and build date with each release
  • Don’t modify a script after it is released to a customer

References: 

Thursday, January 21, 2021

Maximo Service Provider - Internal & External

Internal Service Provider & External Service provider - There is no difference in functionality or feature between them. These are just 2 different license models for the Maximo Service Provider add-on.

Internal Service Provider would be for customers that are managing services for their own organization. For example maybe Client has IT or Facility services departments which provide services to other departments like Sales within their organization.

In this case IT department internally charges sales for IT services using a chargeback. If this is how you want to use Maximo for Service Provider then you would purchase an Internal license.

External Service Provider would be for customers that manage assets and services for other 3rd parties outside of their organization.

For example CompanyA providing IT services to Client and other third parties. In this case, CompanyA is the Service Provider which uses Maximo for Service Provider to deliver services to client.

These customers pay CompanyA for those services. If this is how you want to use Maximo for Service Provider then you would purchase an External license. 

Thursday, November 5, 2020

MXDIFF & MXAPPLY tools to update application screen presentation

As DevOps practices have evolved in recent years in many organizations, we plan to apply screen changes in Maximo applications using a .mxs file. 

.mxs files - files used for applying screen (or application or presentation) changes in Maximo. 

 mxdiff tool - The out of box comparison utility used to generate a differential transactional output file between existing presentation and new presentation changes(add/remove/modify/move). 

Parameters 

-b: Existing version baseline file or individual presentation file.

This file is the consolidated single file for all presentation xml in a Maximo version

-f: (optional) baseline file is available in this path maximo\tools\maximo\screen-upgrade\basexxx.xml 

-m: New version of baseline file or modified individual presentation file.

-t: output file with differential changes between existing & new file of .mxs extension

In our example, we choose an individual presentation file instead of complete presentation set as baseline.xml

 

poc\base\inventor.xml is the existing Inventory application presentation file. 

poc\inventor.xml is the modified Inventory file with screen changes

Run mxdiff.bat file against these two files to generate a transactional file. 

   mxdiff.bat -bC:\Users\surendar\Desktop\poc\base\inventor.xml -mC:\Users\surendar\Desktop\poc\inventor.xml -tC:\Users\surendar\Desktop\poc\testapp.mxs

  ./mxdiff.sh -b"/opt/IBM/SMP/maximo/tools/maximo/en/custom/release/26447_MaximoManage_UserStory/xml/base/LOOKUPS.xml" -m"/opt/IBM/SMP/maximo/tools/maximo/en/custom/release/26447_MaximoManage_UserStory/xml/LOOKUPS.xml" -t"/opt/IBM/SMP/maximo/tools/maximo/en/custom/release/26447_MaximoManage_UserStory/xml/testapp.mxs"   

It generates testapp.mxs file with a differential content - removal of a tag from Inventory List tab.

mxapply.bat in maximo\tools\maximo\screen-upgrade path or runscriptfile.bat file in tools\maximo\en\script path can be used to apply the changes to Maximo system using .mxs file

i) mxapply.bat - Utility to apply screen upgrade changes

  mxapply.bat -tC:\Users\surendar\Desktop\poc\testapp.mxs    

ii) runscriptfile.bat 

We need to place the testapp.mxs file in tools\maximo\en\script folder. 

Execute this command - runscriptfile.bat -ftestapp  (filename without an extension)

Courtesy: Siddhartha Upadhyaya

Thursday, October 1, 2020

Multiplication control to create records for multiple Sites or Orgs in Enterprise service

There are scenarios wherein we need to create a record to multiple Organizations or Sites from a single payload.

A multiplication control is a cross-reference control that copies, or multiplies, an inbound message for multiple organizations or sites. 

We can create Cross Reference Control from the Enterprise Services application --> Select Action menu --> Create Integration Controls.
 
In the dialog box, click the button "Add New Control" -->  Select Cross Reference Control (Add New Xref Control).

It has one Default External value and multiple Maximo Default values.


Associate ORGMUL to Enterprise Service. Open an enterprise service from Enterprise Services application. From the Select Action menu --> Associate integration controls
select ORGMUL, then click OK.

Assign Multiplication Control: Open an enterprise service from Enterprise Services application.
Select ORGMUL as the Multiplication Control in the Multiplication Control field.

Create an Enterprise Service Rule to replace the value on an inbound transaction using a key value pair.

Create a Rule, for example, SETORG. Action=Replace. 
Click Add/Modify Conditions. Click New Row in the Conditions section. Click New Row in the XML Field Section. Choose the Field you wish to do the replace on and leave the Evaluation Type as NOTEQUALS and the Evaluate When as ALWAYS. Choose the Value Radio Button and click OK.

Click the Sub-Record Fields button. Click New Row, choose the field you wish to do the Replace on and then choose the Integration Control.


Input XML for testing: 

Reference: https://rb.gy/urcuxa

https://www.ibm.com/support/pages/using-rules-replace-value-list-inbound-transaction