Tuesday 18 October 2011

How to make object readonly or editable by using maximo API coding?

To make Object Readonly: setFlag(7L,true);
To make Object Editable: setFlag(7L,false);

Note:
1.If object is readonly, can't make fields editable in that object.
2. If object is readonly, then make object editable using setFlag(7L,false);. Now all the fields will be editable, and make other fields readonly by using setFieldFlag("<attributename>",7L,true);

Tuesday 4 October 2011

How to Initiate Work Flow in maximo 7 through coding?

Step 1: import psdi.server.MXServer;
            import psdi.workflow.WorkFlowServiceRemote;
Step 2: Now write the below code in your method:

            try
             {
                  MXServer mx = MXServer.getMXServer();
                  WorkFlowServiceRemote wfsr = (WorkFlowServiceRemote)mx.lookup("WORKFLOW");

                   RFQRemote  rfq = (RFQRemote)getMbo();
                   wfsr.initiateWorkFlow("<work flow name>",rfq);
              }
              catch(Exception e)
             {
                  e.printStactTrace();
              }

Note: i) In the above sample code, I was initiated work flow of RFQ. So I used RFQRemote. Like that you can use your required application remote class. For example: If you want to initiate PO work flow, then you have to PORemote instead of RFQRemote.
          ii) initiateWorkFlow("<here you have to give WF name which you want to initiate>", <here you have to give MBO name, in the above example "rfq" is the instance of RFQRemote which is storing mbo of RFQ>);

How to add parameters in crontask (maximo 7)?

Step 1. import psdi.app.system.CrontaskParamInfo;
Step 2. import java.rmi.RemoteException;
Step 3:
public class CustomCronTask  extends SimpleCronTask{
 public CrontaskParamInfo[] getParameters() throws MXException,RemoteException
{
   CrontaskParamInfo parameters[] = new CrontaskParamInfo[2];
   parameters[0] = new CrontaskParamInfo();
   parameters[0].setName("Parameter 1");
   parameters[1] = new CrontaskParamInfo();
   parameters[1].setName("Parameter 2");
   return parameters;

}
}
Step 4: ***** This is very important *****
        i) If it is a new crontask, after creating an instance, parameters will display on the screen.
        ii) If you are adding parameters to the existing crontask, then you have to create a new crontaskinstance and save the record. Then parameters will display on the screen.

Wednesday 14 September 2011

How to add warnings in Maximo 7.x ?


Below is the syntax to add warnings in maximo 7.x :
getThisMboSet()).addWarning(new MXApplicationException(msggroup, msgkey, params));

Tuesday 13 September 2011

Where to find the JMS Queues in web sphere?

Path to find JMS Queues in websphere is : Buses > intjmsbus > Messaging engines > ctgNode01.MXServer-intjmsbus > Queue points > SQOUTBD@ctgNode01.MXServer-intjmsbus > Messages > File

Wednesday 17 August 2011

How to make field readonly, required and set value null

By using maximo api we can make fields read-only, required and set values null to the attributes:

To make field Readonly: setFieldFlag("<attributename>",7L,true);
To make field Editable: setFieldFlag("<attributename>",7L,false);
To set value as null: setValueNull("<attributename>",2L);
To make field Required: setFieldFlag("<attributename>",8L,true);

Thursday 21 July 2011

Default value in XML file

Syntax to give default value in xml file is:

<defaultvalue dataattribute="<Attribute name>" id="1234567" value="<enter the value>"/>

For example: Setting default value for PRIORITY as 2 while inserting new PM in Preventive Maintenance application.

<defaultvalue dataattribute="priority" id="1234567" value="2"/>

Duplicate Existing application in Maximo 7

Step 1: Go to "Application Designer" and select the existing application which needs to duplicate.
Step 2: Click on "Select Action" menu, then click on "Duplicate Application Definition".
Step 3: Dialog box will appear.
            Enter "Application" name (Valid characters are A through Z, 0 through 9, underscore(_), and $. First            character must be A through Z. Allowed only 10 characters.).
            Enter "Description" (Description will appear as application name in Maximo).
            "Main Object" is a read only and having object name same as existing application. It means, the data entered in new application will also store in the same object.
Step 4: Click on Save button on the Application designer.
Step 5: Go to "Security Group" application and select your group.
Step 6: Click on Applications tab and Select the newly created application.
Step 7: Grant access to the application.

Tuesday 12 July 2011

Introduction

I would like to post all the Maximo related information here, which is very usefull to technical and functional consultants.

Please feel free to raise a questions and also correct me if anything wrong in my blog.

Thanks!!
Maximo Techie

Maximo SOAPUI error javax.xml.ws.WebServiceException

SOAPUI error while sending payload to below url (in cluster environment) http://localhost:9080/meaweb/services/MXASSET Error : <f...