Wednesday, July 29, 2015

Duplicating a Maximo Business Object or Maximo Table (Maximo 7.5)


Duplicating a Maximo Business Object or Maximo Table (Maximo 7.5)


In Database Configuration application in Maximo, you are not allowed to Duplicate an existing Object. But if there is a requirement, you can accomplish it using database back end operation.

Though object/attributes can be created from backend, but their entry must be populated in metadata tables of Maximo which are: MAXOBJECTCFG, MAXOBJECTCFG, MAXTABLECFG

How are we going to accomplish it:
  1. We will populate the Object and Attribute Data in Maximo Metadata Tables
  2. We will run config db which will create the Object and Attributes in the database
  3. We will create a custom SEQUENCE which will be associated with ID field of the Duplicated Object using back end SQL insert query.

Before we start, detailed knowledge about how database configuration works in Maximo is required.

CHANGED flags in Configuration or Metadata Tables of Maximo
  1. when you add an Object : CHANGED field in MAXOBJECTCFG table will be set to I
  2. when you add an Attribute:  CHANGED field in MAXATTRIBUTECFG table will be set to I
  3. an entry is added in MAXTABLECFG table - no flag in this table 
Note: On Deletion: flag will be set to R, on Change: flat will be set to A

Setting above flags are required when you insert records in Maximo Meta data Tables. Now take export of following tables using SQL Developer or any other tool.

<Ex-Object> here should be replaced with the Object Name which you want to duplicate. In this case, we are going to create a duplicate object of ITEM and we'll give the name to new object as NEWITEM


select * from MAXATTRIBUTECFG where OBJECTNAME ='<Ex-Object>';
select * from MAXOBJECTCFG where OBJECTNAME ='<Ex-Object>';
select * from MAXTABLECFG where tablename ='<Ex-Object>';

Post Export: Changes in MAXATTRIBUTECFG export file

Changes in MAXATTRIBUTECFG export excel
OBJECTNAME Custom Object Name
ATTRIBUTENAME Custom Attribute Name - you may retain the existing attribute name as well
ALIAS it will be same as the ATTRIBUTENAME, change it if you have made a change in ATTRIBUTENAME
AUTOKEY if required, create an Autokey and give that name here
ATTRIBUTENO you can give in sequence
CLASS if an Autokey is associated then provide 1 else it should be 0
CANAUTONUM remove existing class names, provide custom class if any
COLUMNNAME it will be same as the ATTRIBUTENAME, change it if you have made a change in ATTRIBUTENAME
DEFAULTVALUE you may change or retain it's value
DOMAINID you may change or retain it's value
EAUDITENABLED you may change or retain it's value
ENTITYNAME will always be same as the OBJECT name
ESIGENABLED you may change or retain it's value
ISLDOWNER set it to 1 it this custom attribute will have Long Description
ISPOSITIVE applicable for Numbers
LENGTH you may change or retain it's value
MAXTYPE you may change or retain it's value
MUSTBE it's related with SAMEASOBJECT and SAMEASATTRIBUTE concept
REQUIRED you may change or retain it's value
PERSISTENT you may change or retain it's value
PRIMARYKEYCOLSEQ this sequence depends on the business logic behind your application, this is Unique Index Sequence
REMARKS Description of the Attribute which is displayed on the screen when pressed for Help
SAMEASATTRIBUTE it's related with SAMEASOBJECT and SAMEASATTRIBUTE concept
SAMEASOBJECT it's related with SAMEASOBJECT and SAMEASATTRIBUTE concept
SCALE you may change or retain it's value
TITLE Screen Lable of the Custom Attribute
USERDEFINED it will be 1 by default
CHANGED Set it to I - this is most important, I stands for Insert
SEARCHTYPE you may change or retain it's value
MLSUPPORTED you may change or retain it's value
MLINUSE you may change or retain it's value
HANDLECOLUMNNAME Name of the handle column, for supporting DB2 text search.
MAXATTRIBUTEID MAXATTRIBUTECFGSEQ.NEXTVAL - this is most important
RESTRICTED you may change or retain it's value
LOCALIZABLE you may change or retain it's value
ROWSTAMP remove this row from your excel, it's not required
TEXTDIRECTION The orientation of text that you enter into fields. - Not Important
COMPLEXEXPRESSION Type of Complex Expression - Not Important

MAXATTRIBUTECFG data is prepared in excel.

Post Export: Changes in MAXOBJECTCFG export file


Changes in MAXOBJECTCFG export excel
OBJECTNAME Custom Object name
CLASSNAME psdi.mbo.custapp.CustomMboSet OR your custom class name
DESCRIPTION Description of the custom object
EAUDITENABLED you may change or retain it's value
EAUDITFILTER you may change or retain it's value
ENTITYNAME It will be same as the new custom object name
ESIGFILTER not important
EXTENDSOBJECT applicable in case of View
IMPORTED not important, appicable in case you are importing this data through MIF
ISVIEW depends on your business scenario
PERSISTENT depends on your business scenario
SERVICENAME you may change or retain it's value
SITEORGTYPE you may change or retain it's value
USERDEFINED it will be 1 by default
CHANGED IMPORTANT - Change it I (I for Insert)
MAINOBJECT you may change or retain it's value
INTERNAL you may change or retain it's value
MAXOBJECTID MAXOBJECTCFGSEQ.NEXTVAL
ROWSTAMP Remove it, it's not required
TEXTDIRECTION not important

MAXATTRIBUTECFG data is prepared in excel.

Post Export: Changes in MAXTABLECFG export file


Changes in MAXTABLECFG export excel
TABLENAME Custom Object Name
ADDROWSTAMP 1
EAUDITTBNAME you may change or retain it's value
ISAUDITTABLE you may change or retain it's value
RESTOREDATA 0
STORAGEPARTITION don't change
TEXTSEARCHENABLED don't change
LANGTABLENAME you may remove it or change the value to create LANG table
LANGCOLUMNNAME change it if given value for LANGTABLENAME
UNIQUECOLUMNNAME NEWITEMID - Unique Column Name of the Object
ISLANGTABLE depends
MAXTABLEID MAXTABLECFGSEQ.NEXTVAL
ALTIXNAME not required
TRIGROOT NEWITEM - it's important
CONTENTATTRIBUTE not required
ROWSTAMP not required

 
MAXTABLECFG data is also prepared in excel.


As we have all the data prepared in excel, we have to create the Insert SQL Queries. This can be easily done by using Excel functions such as Concatenate.

Once you are done with all the prerequisite tasks described above, run the prepared SQL Insert Query in you database (take database backup first to avoid any issues).

Sequence: Using the folllowing query, create a Sequence which will be associated with NEWITEMID field in MAXATTRIBUTECFG.

1. Insert an entry into Maximo Metadata table
insert into MAXSEQUENCE (TBNAME,NAME,MAXRESERVED,SEQUENCENAME,MAXSEQUENCEID)
values

('OTECPRODMASTER','OTECPRODMASTERID',0,'OTECPRODMASTERSEQ',
MAXSEQUENCESEQ.NEXTVAL);
2. Create a sequence in database
CREATE SEQUENCE OTECPRODMASTERSEQ
      START WITH 1 INCREMENT BY 1 NO MAXVALUE NO CYCLE CACHE 24;

3. It's done now, SEQUENCENAME field in MAXATTRIBUTECFG is Non-persistent i.e. it's not in DB, Maximo business will fetch it's value using relationship and show it in DB Config application.

Once you commit the DB Changes, go to Database Configuration application in Maximo. When you hit Enter on the List tab, you will see newly created custom/duplicated Object NEWITEM and which will be marked for 'To be Added' and in Attributes tab, all the duplicated Attributes will be marked for 'To be Added'.

Now you can start the Admin Mode and run Configure Database. After the configuration is complete, duplicated object NEWITEM is ready to use.

I know this is a lengthy way but I just wanted to document it that duplication of an Object in Maximo can be accomplished using backend.

Thank you for reading...

Thursday, July 9, 2015

CWSIP0362W: The message with id 121332324 can not be deleted from destination CQINBD as the message has been delivered to a consumer.


JMS Messages are stuck in Queue with Removing Status

To Delete these messages:

Stop only the Enterprise Application (the place where you deploy EAR) and keep the Application Instance (MXServer) running.
This will allow you to get access to Bus and Queue with runtime check and then you can delete the messages you want.

Wednesday, July 8, 2015

build all-dist failed while running build for Maximo Anywhere

Error while running build.cmd all dist command

Maximo Anywhere build getting failed

After successful installation of Maximo Anywhere, you need to run 3 build commands in the following sequence:



1)     From MaximoAnywhere\platform\mobile run

build all-gen

2)     From MaximoAnywhere\platform\mobile run

build all-dist

      Deploy the worklight.war file created under your MaximoAnywhere\platform\mobile\target\dist folder to your Worklight Server in WebSphere
       3)  From MaximoAnywhere\platform\mobile run

             build all-deploy

 
But, while running build all-dust command you may get few errors as follows:

1) java.security.NoSuchAlgorithmException: MessageDigest SHA-1 implementation not found

Cause: Your JAVA_HOME is set to JRE or SDK path

Solution: Set JAVA_HOME to JDK folder. This should resolve the issue. You will have to restart the physical machine after applying these changes.

P.S. I appended the JDK folder path in the existing JAVA_HOME path which was having SDK path, but this didn't work for me, so I removed the earlier SDK path and kept only JDK path, then it worked.

After machine gets re-booted, try running build.cmd all-dist it will run successfully.

Tuesday, July 7, 2015

Lost or Forgot WebSphere Console Password

Lost or Forgot WebSphere Console Password


If by any chance you do not know the password for wasadmin to access WebSphere Console, there is a simple trick to get out of this situation.

You just have make a small change in security.xml file which resides under WebSphere Deployment Manager Profile folder, path is:

\ibm\WebSphere\AppServer\profiles\ctgDmgr01\config\cells\ctgCell01

Open security.xml file and search for following keyword:

useDomainQualifiedUserNames="false" enabled=

you will see that enabled is set to "true" as below

useDomainQualifiedUserNames="false" enabled="true"

Change the value of enabled attribute to "false".

Open WebSphere console and you will see that only username is being asked.

After you log in to WebSphere console, you can reconfigure the Security.

Friday, July 3, 2015

Error 403: AuthorizationFailed

Error 403: AuthorizationFailed


After starting MXServer (or any other Application Server in WebSphere), you get the following error:

Error 403: AuthorizationFailed

This is because you have Application Server Security configured in your environment and there seems to be an issue with Security role to user/group mapping configuration.

Solution:

  1. Login to WebSphere
  2. Stop the application server (MXServer in my case)
  3. Go to Applications >> WebSphere enterprise applications
  4. Click on your application (MAXIMO in my case)
  5. Click on Security role to user/group mapping
  6. Check the checkbox for Role - maximouser (in my case)
  7. Select the value as All Authenticated in Application's Realm from the Map special Subjects drop down menu 
  8. Restart the Application Server

It should work now.