Wednesday, December 10, 2014

Quick build businessobjects.jar



Problem
------------
During development we often come across a situation where we need to quickly deploy the code (business objects code not bean) into maximo and test it.

We go for quickest way of deployment, start maximo.ear file building. Terminate the process when businessobject.jar build is done, copy businessobjects.jar from temp folder and paste in understand websphere installed application folder.

Problem is when we use buildmaximoear.cmd file it first copies set of image files and does other stuffs before it actually start building businessobjects.jar. It takes time .....


Solution
------------
Use command below, it directly starts building businessobjects.jar instead of going into other stuffs

buildmaximoear.cmd businessObjectsBuild

I would be glad if it helps you sometime ... :)

Thursday, August 14, 2014

Call oracle stored procedure from BIRT


Problem
------------
One lengthy report executes for long time and it times out. Mostly time out happens when exporting report in excel, works fine in browser view and export  to PDF.

Cause
-----------
When report is exported to excel, BIRT report executes once again and generates whole report and loads into memory. Probably below sequence would be followed

  • Execute report logic
  • Load all the rows in memory
  • Pass the result set to excel emitter
  • Emitter writes it to excel
  • OutputStream writer writes to file
Whole process takes a long time to complete the operation "export report to excel". Connects times out and browser terminated the connection and export aborts. One error message in the log "Connection aborted by software on your machine".

Solution
-------------
Follow the steps below in sequence
  1. Write stored procedure with the whole report logic into it (SQL of all the datasets). Make sure there is a return statement in the end procedure even though it doesn't return anything
  2. Generate the result set and write it in a temp_table in the database
  3. Write one more dataset in BIRT to fetch result from temp_table and publish it on the report
  4. Writing report logic in stored procedure will bring down the report execution time and export will be successfull
  5. Sample code of how to call stored procedure from BIRT
    Open method
    -------------------------
    maximoDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName());
    maximoDataSet.open();

    var sqlText = new String();

     
    // Add query to sqlText variable.

    sqlText = "call myproc('PARAM1', 'PARAM2')"
    // Include the Maximo where clause
    //+ " where " + params["where"]
    ;
     
    maximoDataSet.setQuery(sqlText);

    fetch method
    ----------------------
    if (!maximoDataSet.fetch())
    return (false);

     
    return (true);

    Hope this helps someone, difficulties implementing .. contact me :-)

Tuesday, August 5, 2014

Display user's "Default Insert Site" on maximo title bar


Hello,

Here I come with an interesting post on Maximo customization.

Problem
-----------
Display logged in user's "Default insert site" on the maximo header bar.


Solution
-----------
Follow the steps below, this solution is tested on Maximo 7.5. You need to modify the code according to the Maximo version you are working on.

  1. Navigate to path IBM\SMP\maximo\applications\maximo\maximouiweb\webmodule\webclient\components on you application server
  2. Search for file titlebar.jsp
  3. Open file and locate code below.
  4. <span id="txtappname" class="<%if(useHomeButton){%>homeButton<%}%>txtappname">&nbsp;  <%=apptitle%>
                                    </span>
  5. Below the above code and under the same <td> tag. Paste the code below
  6.     <%
               String site = "ERROR";
               String user = "TEMP";
                                       
               MboSetRemote sessionSet = control.getWebClientSession().getMXSession().getMboSet("MAXSESSION");
                sessionSet.setWhere(" MAXSESSIONUID = "+control.getWebClientSession().getMXSession().getUserInfo().getMaxSessionID()+" ");
                sessionSet.reset();
                                       
                if (sessionSet.getMbo(0) != null){
                         user = sessionSet.getMbo(0).getString("USERID");
                                           
                         // Get current insert site of user logged in
                         MboSetRemote userSet = control.getWebClientSession().getMXSession().getMboSet("MAXUSER");
                         userSet.setWhere(" userid ='"+user+"' ");
                         userSet.reset();
                                           
                         if (userSet.getMbo(0) != null){
                               site = userSet.getMbo(0).getString("DEFSITE");
                         }
                   userSet.close();
          }
                                       
          sessionSet.close();
      %>
       <font face="Arial" color="Yellow" size="4">
     &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <B>Site :</B>  <%=site%>
       </font>
  7. You are done.
  8. Difficulties to implement, write to me. I will be happy to help :-)

Friday, August 1, 2014

BIRT report export in excel fails


Problem Summary

Lengthy BIRT report with approx 15 datasets runs fine in browser view with 32 pages but when it is exported to excel. It fails with below error message

Caused by: java.io.IOException: Async IO operation failed (1), reason: RC: 10053  An established connection was aborted by the software in your host machine.

Cause

When a BIRT report runs in browser view it doesn't fetch all the records before publishing it on screen because of this report is published properly in browser view.

When report is exported to excel it fetches all the records of report output and writes it to excel before prompting user to save the file. Report export in excel causes below events

- execute whole report logic again
- fetch all the records from memory
- write them to excel using excel emmitter
- prompt user to save file

Whole operation takes a lot of time to complete because of report complexity, this causes report export to time out.

Solution

Below are the list of solutions that can be applied to this

- Increase webserver read/write time out property in websphere
- If first solution doesn't help then try to optimize SQLs in the report design
- If above two doesn't work then try to develop report in some third party tool like excel, connect directly to the database, execute logic, fetch records and publish in report.

Sunday, July 27, 2014

Maximo EAR building and deployment takes too much time to complete


Hi,

There could be many reason for this but one of the reason I found is "Antivirus scanning every new file getting created on the server". During EAR building several files will be created, every file will be scanned by the antivirus software on the server. This can make whole process of EAR building slow. You can prevent this by following steps below.

Antivirus software considered in the explanation below is symantec endpoint protection. You can follow similar steps for the antivirus on your server.

1. Open Symantec endpoint protection console
2. Click on the options button
3. Select change settings
4. Goto "File-Systems auto protect" tab
5. Click on centralized exceptions button
6. Click on "Add->Security Risk Exception->Folder"
7. Select "D:\IBM\" or the maximo installation folder
8. Click Close
9. Click OK
10. Done, for next time when you build and deploy EAR. It will be very fast.
 

Add an attribute to maximo table from backend.


Hi,

You can use simple script below to add attribute to maximo table from backend. Follow the steps below.

1. Make sure you have write permission to the maximo database.
2. Connect to maximo database using utility like SQL Developer or TOAD
3. Execute two SQL statements below

insert into maxattributecfg (OBJECTNAME,ATTRIBUTENAME,ALIAS,AUTOKEYNAME,ATTRIBUTENO,CANAUTONUM,CLASSNAME,COLUMNNAME,DEFAULTVALUE,DOMAINID,EAUDITENABLED,ENTITYNAME,ESIGENABLED,ISLDOWNER,ISPOSITIVE,LENGTH,MAXTYPE,MUSTBE,REQUIRED,PERSISTENT,PRIMARYKEYCOLSEQ,REMARKS,SAMEASATTRIBUTE,SAMEASOBJECT,SCALE,TITLE,USERDEFINED,CHANGED,SEARCHTYPE,MLSUPPORTED,MLINUSE,HANDLECOLUMNNAME,MAXATTRIBUTEID,RESTRICTED,LOCALIZABLE,TEXTDIRECTION,COMPLEXEXPRESSION)
values ('MAXSESSION', 'XUNIT', 'XUNIT', null, 19, 0, null,'XUNIT', null, null, 0, 'MAXSESSION',0,0,0,20,'UPPER',0,0,1,null,'Unit of the current session',null,null,0,'Session Unit',1,'I','NONE',0,0,null,MAXATTRIBUTECFGSEQ.NEXTVAL,0,0,null,null);

update maxobjectcfg set changed = 'A' where objectname = 'MAXSESSION';

4. Commit changes.
5. Run configDB from database configuration application or stop application server and run it from command prompt. (configdb.bat)
6. Done