Search This Blog

Tuesday, February 28, 2017

Maximo not starting , 28001 password expired maximo

Recently i faced this error.

 

I had to connect to database via command line

go to Db home /bin and execute a command prompt.

Hope you know the trick, go to any folder and in address bar type cmd ; wola it opens a command prompt in that directory. No more navigation is required.

 

sqlplus.exe  / as sysdba

it connected

select name from v$database;

 

 

In case you are not able to see your databases listed here

Please check the bottom section.

else

$ alter user maximo identified by “maximo” ;

User will be altered and new password will work.

 

To make the system stable and make the password lifetime, change the default profile.

 

image

image

 

image

 

wola , it connects.

image

 

Problem I faced

One problem i faced while doing this, i could not find my listed database and i was confused why i am not able to see my maximo database.

 

So i found out , i had to change the default instance i was trying to connect to .

By default oracle connects with the default instance.

so i had to export the ORACLE_SID to maxdb76 , as you see in net configuration assistant of oracle.

so in command prompt.

set oracle_sid=maxdb76

sqlplus.exe  / as sysdba

now i could see my database and altered it.

 

Keep reading !

Sunday, February 26, 2017

Getting started with Code chef, how to submit your first code ?

 

I have been trying code chef for a while but whenever I used to submit my code, it used to give me some non zero exit code error and I couldn’t find out the reason for this.

so here is a solution to the non zero exit code problem.

 

Try this

https://www.codechef.com/problems/TEST

///////////


import java.util.Scanner;
public class Main {
public static void main(String args[]) {
  int inputNumber;
  Scanner scanner = new Scanner(System.in);
  while (true) {
   inputNumber = scanner.nextInt();
   if (inputNumber != 42) System.out.println(inputNumber);
   else System.exit(0);
  }
}
}

///////////////////

 

If you submit this, your compile will pass.

OSLC and REST in Maximo

How to make REST work in Maximo ?

Just check your system properties for rest level properties, your url should be correct.

Now navigate to the url mentioned below.

http://host:port/maxrest/rest/os/MXWO/1?_lid=wilson&_lpwd=wilson&status=APPR&_format=json

 

This will give the current list of work orders which are in approved format and with json format.

Integrate it with your web app , call ajax or http get from your app to get json response out of maximo.

 

OSLC is also configured in Maixmo, check for oslc urls in maximo system properties.

 

Now use postman client for chrome or use in browser itself.

 

Navigate to

 

http://host:port/maximo/oslc/os/MXWO?_lid=wilson&_lpwd=wilson?lean=1&oslc.select=spi:wonum&oslc.where=spi:status=%22APPR%22

This will give the list of all the workorders in approved state.

 

Read the below urls for more on JSON api for maximo.

 

https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/IBM%20Maximo%20Asset%20Management/page/Maximo%20JSON%20API

Monday, February 20, 2017

How to connect to weblogic using WLST(Weblogic scripting tool)

 

There was a case where i was trying to find out some weblogic configuration using the console, but it was not displaying due to some memory or God knows what issue.

 

I thought of using the WLST  to connect to the running weblogic instance.

 

Step 1

Go to weblogic/bin directory

Step 2

Make sure you set your WLS environment

. ./setWLSEnv.sh

Step 3

Make sure JAVA installed.

Run

java weblogic.WLST

Connect(‘weblogic’,’password,’t3://host:port’)

Connect to host using your credentials and password.

domainRuntime()

cd(‘ServerRuntimes/Sservername’)

You can traverse the tree with CD commands and get properties from command line.

whatever is with –r

 

do a get(propertyName)

 

*Items in bold need to run in command line, normal ones are comments.

Keep reading !

How to load data in Maximo the simple way using MIF and data loader ?


The first thing to start for a Maximo project is data collection templates and the data loading part.Most of the clients have data in excel sheets or CSVs, but the format is not as per the maximo acceptable format.

I have worked for various clients, and used Maximo object structures extensively to generate templates.

There are two ways currently, to do data load in Maximo :
First we need to get a template out of maximo so that it can be given to client and it can be
reimported with the client’s data.To do this, lets generate a default template.

One of the most popular ways is with MIF and another is with the data loader tools.
We will discuss both in detail, lets start with MIF First.

Using Maximo Integration framework called MIF

Identify the object that need to be exported. e.g PERSON
maximo object structure person
Go to Object structures in external systems and create an Object structure for PERSON.

Attach it to a publish channel and attach that publish channel to an External System.

maxim publish channel os
Lets change the End point to a flat file handler so that exported CSV can be located on the file system.
Make sure you give existing path on the drive , if linux – please check if path exists.

image

After all this , make sure you have configured the sequential queues and the JMSSEQCONSUMER Cron task is active.

image

Configuring queues is out of scope of this article, please refer the ibm guides for configuring queues on websphere or weblogic.

image


Now to export the maximo data go to –> publish channel –>Data export button
Choose selector 1=1 to export all data.
image

Now go to the file system where your flat file end point will send the data.
image
image
Now you will get a CSV file and , you can remove the first line and save it in excel in CSV format. Now this is ready to be served to client for data collection.
Similarly do this for all objects for master data collection.
Once clients provides data back in these templates, use the enterprise service for the same object structure and import it back.
Use the same path , except that while pushing out data you need publish channel and while pulling in maximo, you will need Enterprise service.

Another fast way to get up and running with working data templates for maximo in no time is via MXLoader tool. I recently came across this tool and thought of documenting it.

Data load via MXLOADER


Download this xl based tool from
https://www.ibm.com/developerworks/community/groups/community/MxLoader
User guide

Enter the details of your maximo server in the config sheet of this tool.

image
Enter server details and click test connection.
If the test succeeds, the connection is established and you are ready to query maximo resources via the excel sheets. No need to touch any MIF components like Publish channel/ES/External Systems.

MXLoader maximo data load
Now open the person object from the import sheets button, this tool comes with two kool buttons on the top
Execute the action and try a new template button.
image

So lets open a new person template which will bring prepopulated PERSON fields.
image


Import administration – people ( this will automatically be mapped to person table in maximo via the object structure, you need not do any thing here because it will use OOB structure)


image

Now click on the run button on the top of the sheet and it will fetch the records from maximo.
image

Results will be displayed and you will have ready made xl sheets ready to be imported to maximo.
One observation i would like to share with you guys , this can be a tip and life saver if you getting engaged with a client soon for the data loading activities.
Before giving this sheet to client and after getting the filled sheet back from client.
Always make sure first row of this sheet doesn’t contain any special character, else you will not be able to use the same template in the MXloader tool.
You can use XL trim or format options to detect any special character, i found out using notepad ++ –>View—>show all symbols options.

I was scratching my head for a long time on whey, the fields are not getting data from the loader tool.
Also, you will be able to create custom sheets in this tool as long as your object structures you specify in header is present in Maximo.
This tool’s import option has lot of custom sheets, OS for those sheets won’t be available for Maximo, you will have to create them yourself.
In next post I will cover , how to load data from multiple objects in one sheet, lets say Asset+Asset meter/ Job plan with tasks / PM with job plans .. all in one sheet.

Keep reading !

Thursday, February 16, 2017

How to create a new Maximo application using application designer ?

 

Maximo presentation layer is controlled by various controls which are made up of jsp and are rendered via the xml definitions.

The maximo ui layer can be changed either by exporting the xml files from the application designer or by dragging and dropping the controls on the application designer canvas.

 

The GUI components of maximo are a part of presentation.xml and are stored in MAXPRESENTATION table in the database.

 

I will be explaining you how to create a new tab and add a new child table to this new tab, which brings data from another custom child object and  persists the data in relation to the parent table.

 

For this example i will be create a custom object called city and will add this to another tab in my dummy application, i will also be showing you how to persist the data in this tab.

Steps to create a new application in Maximo.

 

Step 1 Duplicate maximo application

Duplicate an existing application in application designer and use the existing object, lets say wotrack and name it DUMMY.

image

you might not be able to see your new cloned application in maximo until you add maxmenu entries(explained later) , for development purpose you can directly access the application in browser.

http://192.168.83.141:7001/maximo/ui/?event=loadapp&value=dummy&uisessionid=24&csrftoken=o02o2khubjfk2jp2siu5hunbk3

 

 

Step 2 New maximo tab

Now create a new tab in the dummy application, open the toolbar and add a new tab to the existing tab group.

maximo application designer

Make sure , table control goes over tab and table column goes inside table.

textboxes will go over section control and you need to have a section row and column before you start pushing textboxes to it.

 

Step 3 New custom object

Create a new custom object in the database configuration named city, add a new field with name wonum, this will help us persist the data whenever we add a new record in dummy application which has main object as workorder.

maximo database configuration

Create 4 new classes:

CityMboSet,CityMbo,CityMboSetRemote,CityMboRemote.

Source

CityMboSet

/////////////////

package cust.psdi.mbo.custapp;

 

import java.rmi.RemoteException;
import psdi.mbo.*;
import psdi.util.MXException;


public class CityMboSet extends MboSet
    implements CityMbosetRemote
{

    public CityMboSet(MboServerInterface ms) throws RemoteException {
        super(ms);
        // TODO Auto-generated constructor stub
    }


   

   
    protected Mbo getMboInstance(MboSet ms)
        throws MXException, RemoteException
    {
        return new CityMbo(ms);
    }

  
}

////////////////////

 

CityMbo.java

 

/////////////////////

package cust.psdi.mbo.custapp;

import java.rmi.RemoteException;

import psdi.mbo.Mbo;
import psdi.mbo.MboSet;
import psdi.mbo.MboSetRemote;
import psdi.mbo.StatefulMbo;
import psdi.mbo.StatusHandler;
import psdi.util.MXException;

public class CityMbo extends Mbo implements CityMboRemote {

    public CityMbo(MboSet ms) throws RemoteException {
        // TODO Auto-generated constructor stub
        super(ms);
    }


}

//////////////////

CityMboRemote.java

/////////////

package cust.psdi.mbo.custapp;

public interface CityMboRemote {

}

/////////////////

 

CityMboSetRemote.java

 

///////////

package cust.psdi.mbo.custapp;

public interface CityMbosetRemote {

}

 

///////////

Put these for classes in the package cust.psdi.mbo.custapp inside the businessobjects/classes/ folder.

Rebuild and redeploy the maximo.ear

 

Step 4

Create a new relationship in the wotrack table with city table and name it city.

image

Now use this relationship in the table control inside the application designer, else you won’t be able to bind the CITY Fields inside the dummy application and it will give invalid bindings.

Since the main object inside your custom application(DUMMY) is workorder, it needs to know the fields on the city table. This city relationship will help bring those fields.

Step 5

Add a new section and a button group , which automatically ads a default button (New)

image

 

This will help you add new city mbos which have relation to the main workorder.

For e.g if you add 3 cities each will have 1005 as wonum , if parent workorder number is 1005.

 

Now we need to map  a default control on the child object (CITY) to the main object (WORKORDER)

To do this , create a default control and add the following properties

do – >select action – toggle show all controls

image

create a default value control and add the properties as shown above, to create a parent child relationship, this will populate the default value of wonum in city object with the wonum value of the workorder. – > ref

 

 

 

Step 6

Save the application and re login, you will be able to add new records to your dummy application and you will be able to add new cities and view them.

Hope you are maxadmin and you have all the access,if you don’t have all access to maxadmin.

Checkout this article to provide all access to maxadmin at once with single script.

image

To add toggle show details arrow , you need to have a table column which has

toggledetailstate event in the event section, it needn’t be bound to an attribute.

image

 

Add your new application permanently to the  go to menu,

Follow this link

http://www.edatai.com/blog/2015/03/08/cloned-application-does-not-appear-on-the-menu/

 

This was my understanding of the subject, references are marked in the above article.

Keep reading , comments are welcome.

Tuesday, February 14, 2017

Hide or change fields behavior on Maximo screen using Conditional Expression

 

A very useful utility to hide,disable,change properties to any element on Maximo screen is via conditional expression.

 

For example, you want to change color of status field to red in case if the asset is in  decommissioned status.

To achieve this you will create a condition to test the decommissioned status and use this in the application designer application.

 

Go to conditional expression manager to create a new condition

Create a new condition

  1. Give name of condition (For e.g status color)
  2. expression – status=’DECOMMISSIONED’
  3. enable the evaluate condition checkbox

 

Now navigate to application designer and select the field we want to hide or disable.

Click on the control properties and navigate to advanced tab.

You will see conditional properties tab at the bottom, click on it and a new dialog will appear.

 

image

Now click ok and move out of app designer.

Navigate to one of the asset which is in decommissioned status, you will see the color of status is red.

 

image

Similarly there are hundred other properties of a field which can be changed via a conditional expression.

 

 

Please help improve this by your valuable comments.

Monday, February 13, 2017

Grant all access to maxadmin at once in maximo

Its very painful to go to each security group and assign access to each permission for maximo.

i have been struggling with this for quite some time. 

Please run this query if you have oracle as backend for maximo, maximo installation automatically creates sequences by default and below statement will run fine for oracle users.



insert into applicationauth (app, optionname, groupname, applicationauthid) select app, optionname, 'MAXADMIN', applicationauthseq.nextval from sigoption s where optionname != 'NOPORTLET' and not exists (select * from applicationauth a where a.app = s.app and a.optionname = s.optionname and a.groupname ='MAXADMIN');



in case you are using sql server , please follow below method. 


 The applicationauthseq will only be available in oracle , for sql server you need to create a sequence on your own. 








 insert into applicationauth (app, optionname, groupname, applicationauthid) select app, optionname, 'MAXADMIN', NEXT VALUE FOR dbo.appauthseq from sigoption s where optionname != 'NOPORTLET' and not exists (select * from applicationauth a where a.app = s.app and a.optionname = s.optionname and a.groupname ='MAXADMIN');




Another important step to make it work.

update the maxsequence table with new maxreserve values.

Do a

select max(applicationauthid)+1 from applicationauth table and find out the max value for the applicationauth id


for me it was 

SELECT max(applicationauthid)+1
  FROM [dbo].[applicationauth] 
GO

Result 

73535



This needs to be inserted in maxsequence table, else you wont be able to insert any new signature options or duplicate applications.


Update the maxsequence table, mine looks like this.

APPLICATIONAUTH APPLICATIONAUTHID 73535 NULL NULL APPLICATIONAUTHSEQ 342 <Binary data>


That’s it , restart and re login, all the access will be available to maxadmin.

Error

BMXAA4211E - Database error number 2601 has occurred when operating on XXXX will appear if you dont follow last step mentioned above, maximo running on sql server need to update sequences.



Friday, February 10, 2017

Configure yahoo mail for Maximo 7.6

To use yahoo mail for maximo workflows and other stuff, follow the below steps.

First create a communication template for that object, from which you would test and trigger the mail.

Lets say workorder.

Step 1

Create a communication template , fill the subject and from section , add some recipients

Step 2  

Update smtp properties for yahoo.


Enter username and password  in mail.smtp.user and mail.smtp.password property( make sure only username without @yahoo)
If mail.smtp.port not available, manually create it  and ssl has to be true.


Step 3

Go to workorder and select action àcreate communication
Include your template and make sure send from has to be the smtp user , To/cc/bcc can be any thing.


That’s is it you will receive the mail in mailbox.

Also make sure yahoo’s less secure apps option is enabled in account security settings .




Friday, February 3, 2017

hotswap jdk 8 with eclipse

Patch the jdk which is being used by your eclipse and your app server.

lets say jdk8

run the jar to patch the jvm

https://github.com/dcevm/dcevm/releases/download/light-jdk8u66%2B5/DCEVM-light-8u66-installer.jar


java -jar abovejar

use the altjvm option , it will create another folder in the jdk8 with name dcem



step2

download the hotswap agent which will go as a parameter in the app server start script. .e.g weblogic.


https://github.com/HotswapProjects/HotswapAgent/releases/download/RELEASE-0.3/HotswapAgent-0.3.zip



add this to java options of the start server

-XXaltjvm=dcevm -javaagent:/usr/local/hotswapagent/hotswap-agent.jar=autoHotswap=true


now restart the app server and develop your java project in eclipse using the same jdk.


Now click on run -- debug configuration and attach to the process of app server, you need to run the app server in debug mode with proper arguments in setDomain script for weblogic.




Thats it , change code compile in eclipse and its auto reflected in the target app server..

If you are working on an EAR deploy it normally from the console and check the location of exploded ear in the _WL_user folder inside tmp and locate your WARS and JARS over there.

Now change the JAR or WAR from archive to the folder keeping the name same.
Use the direct path of this folder in the build path of the eclipse project (Target folder for class files)

So if deployer has exploded your demo.ear in /domain/servers/tmp/_wluser/sdfd/demo.jar 


give this path in the output folder section on the java buld path of the project.