Search This Blog

Showing posts with label maximocustomization. Show all posts
Showing posts with label maximocustomization. Show all posts

Friday, November 3, 2017

Write an escalation in Maximo and migrate it

Plan for migration before creating the escalation.


Go to MM and create a change package and include BPM group , approve and activate.

Make sure its capturing the records by using Selection action and event tracking records.

Lets talk about escalations now, hope your mm package is active and listening to changes.

Escalation is an action or a group of actions on the escalation points which can be triggered on predefined conditions.

You use Escalation condition to filter records out of the table.

image

Write a name and object it applies to (WO) and a condition to do filter records.

status in (select value from synonymdomain where domainid = 'WOSTATUS' and maxvalue not  IN ('COMP','CLOSE') ) and pmnum is not null

This is first level of filtering.

Now we can have multiple escalation points,different conditions basically on those records filtered above.

If you have a field which of of type date and you want to make different alerts according to the time interval, elapsed time interval is of a lot of use.

image

Your date attribute X                                                                  -7                          days


So elapsed time interval negative means in future. So this will fire 7 days before the date attribute. lets say your date attribute X has value( 9 June) and system date of Maximo server is 2nd june, this condition is satisfied and it will evaluate the escalation point condition. You can also give escalation point condition as an add on filter at this level.

If elapsed time interval is positive its in past, so if it would have been +7 days, so it will fire if X is 2nd June and sys date is 9th june.


First thing you need to create is roles, which are attached to communication templates and those are attached to the Notifications sub tab of the escalations application.


image

Roles can be of multiple types:

Custom

Custom class where you extend the

CustomRoleAdapter and implement the CustomRoleInterface

Sample Code

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

package xx.common.role;

import java.rmi.RemoteException;

import psdi.common.role.CustomRoleAdapter;
import psdi.common.role.CustomRoleInterface;
import psdi.common.role.MaxRole;
import psdi.mbo.MboRemote;
import psdi.mbo.MboSetRemote;
import psdi.server.MXServer;
import psdi.util.MXApplicationException;
import psdi.util.MXException;

public class xx extends CustomRoleAdapter implements CustomRoleInterface

{


public MboRemote evaluateCustomRole(MaxRole roleMbo, MboRemote currentMbo)
               throws MXException, RemoteException
           {

// play with currentMbo – the object specified on the Role creation panel in application

}


}



A Set of Data related to the record

If you want to get value of any related object via a relationship you can use this role.

image

You can get the gui for fetching the relationship and the required field, just click the arrow.



Email Address

Direct Email address punch

Person

Person id value(e.g maxadmin)

Person Group

Persongroup value (e.g admin)

A set of data related to login user

Any data from the logged in user.


Ok once roles are ready, check if they are getting tracked in the MM package.

Now create the communication templates and punch in roles.

Please note you can use the variables from the main object like :wonum in our case

make sure to check

image


Subject can be

Work Order :wonum is not approved

I think relationships also work, try it out.


Now our communication templates ready, punch them in the notification tab of the escalation.

Please note different escalations will have different notifications and different actions.


If you want to check if the escalation running make sure the master condition is attained, if not use sql developer and update records to bring some records in that condition.


If you want to debug your custom role, make sure you put the breakpoint on the evaluateCustomRole method and check the repeat option in the escalation point to true. That way you will be able to hit the breakpoint multiple times and test your custom role class.

*If you dont know how to debug, try putting system out in role class and check systemout logs.


I think that is it for the escalations part, you can also check the cron history for your escalation in the history tab of your escalation crontab.

If you want to see who all received emails, you can go to workorder log tab and check the communication log tab ,it will mention which all communication was triggered out of the work order.

Friday, September 29, 2017

Import and Merge XLS/CSV data into Maximo Database on Oracle

If you want to update values of certain fields inside database, one option is to make individual update statements in xl formulas as explained in another post and another option if you have huge datasets is to use MERGE commands from Oracle.


Steps:

Create a temporary table in database which will hold our data from CSV/XL

In Oracle SQL developer, click on Table and click data tab-- click action and import.

Navigate to xls/csv make sure column names match and first header has column names.

Import and accept defaults.


Now you have the database with your xl/csv data in table.
Now we will merge it with our actual table.

with below statement.



MERGE into prodtable t using ( select * from temptable) s on (t.location=s.location) 
when matched then
UPDATE SET t.fieldtoupdate = s.fieldtoupdate;


Your user should have insert update create rights on the schema where you are trying to do merge the data.

Keep Reading ! 


Friday, September 22, 2017

Hide a field in Maximo

Go to Conditional Expression and create a new condition some thing like :fieldA <>''  (field value in mbo not null)

Go to Application designer and create a sig option for that field from select actioni -- add modify sig options.

Assign this sig option to our Field which we want to hide.

Go to Security Group and allow access for this sig option in that application and add above condition.

Sign out and re login , you should be able to see that field only when fieldA is not null.


Thursday, September 21, 2017

Create a listener on a field from another field class in Maximo

To create a field validation class we usually extend the mbovalueadapter which implements the mbovaluelistener.

If you want to create a listener on another field B from the field validation class of Field A here is the process.

Field A can have both domain and a field validation class and in our case we have a list from a table so we can extend the MaxtableDomain

In the init method of the field validation class of Field A create another instance of MboValueListener 

class FieldA extends MaxtableDomain{

public init(){
MboValueListener mvl = new OurCustomListener(getmbovalue(FieldB);
getMboValue.addListener(mvl);
}
}



In the above case as the page loads the init of Field A will create a listener in memory for field B and will listen to all 
the methods of a normal field validation class( Validat/action etc)

Implement the custom listener class 

class OurCustomListener extends mbovalueadapter {

constructor -- with mbovalue 

public action(MboValue mbv){
// this will be called whenever the FieldB changes 
}

}



So this way we can create listeners for multiple fields from one field class, this is use full for utility classes in Maximo where you don't want to change field validation at different places for FieldB but you have a generic FieldA and you can do all the changes there.