Creating a New Mbo Class

Hello;

One of the basic java functionality is to create new mbo’s and changing its default behaviour. For example we can create a new mbo as the child of Workorder. And assume there is a relationship between workorder and newMbo as wonum=:wonum. When we add a new record from the user interface, new record’s wonum is not populated automatically. So we have to extend psdi.mbo.Mbo to automate this. Here is how it is done….
File :custom.newMbo.newMbo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package custom.newMbo;
 
import psdi.util.*;
import java.util.*;
import psdi.mbo.*;
import java.rmi.*;
import psdi.server.MXServer;
 
 
public class newMbo extends Mbo
        implements newMboRemote {
 
    /**
     * Constructor
     */
    public newMbo(MboSet ms) throws MXException, RemoteException {
        super(ms);
    }
 
    public void add() throws MXException, RemoteException {
        super.add();        
        MboRemote mboremote = getOwner();
        setValue("WONUM", mboremote.getString("WONUM"), 2L);
 
 
    }
 
}

File :custom.newMbo.newMboSet

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package custom.newMbo;
import psdi.mbo.*;
import psdi.util.*;
import java.util.*;
import java.rmi.*;
 
public class newMboSet extends MboSet
implements newMboSetRemote
{
/**
* Constructor
*/
 
public newMboSet(MboServerInterface ms)
throws MXException, RemoteException
{
super(ms);
}
 
 
 
protected Mbo getMboInstance(MboSet ms)
throws MXException, RemoteException
{
return new newMbo(ms); // this is the key line ...
}
}

File :custom.newMbo.newMboRemote

1
2
3
4
5
6
7
8
9
package custom.newMbo;
import psdi.mbo.*;
import psdi.util.*;
import java.rmi.*;
 
public interface newMboRemote extends MboRemote
{
 
}

File :custom.newMbo.newMboSetRemote

1
2
3
4
5
6
7
8
9
package custom.newMbo;
import psdi.mbo.*;
import psdi.util.*;
import java.rmi.*;
 
public interface newMboSetRemote
extends MboSetRemote
{
}

Then you have to compile and rmic these files. Then Go to the database configuration find your object. Enter ‘custom.newMbo.newMboSet’ to the class…

Configure DB
Build Maximo.ear
Deploy Maximo.ear

Tip: It is better to make Wonum field readonly on user interface. Users must not change the field from the user interface

Then you’re good to go….

Have a good day…

14 Responses

  1. KH Says:

    Hi,

    I’m very new to maximo and trying to get familiar with Maximo 6.2.2 development environment. May i know what is the procedure to add a new application into maximo and make it function with my own class? This is because i had create my mbo (using Databse Configuration) and interface (using Application Designer). I also compiled a folder called myapp (consists of the basic classes) and deployed it (also assigned it to my mbo). But it didn’t function as I expected. One thing i noticed is the service of my mbo still remain as ‘CUSTAPP’.

    PS: what do u mean by ‘rmic’ the file?

    Have a nice day…

  2. admin Says:

    Hello;

    It is actually easy and enjoyable to develop new applications and make them use your own classes. You can do it via application designer and database configuration..(Write your classname to the classname field of your object in database configuration).. I suggest you to use Maximodeveloper addon for eclipse.. It really makes your job easy.. It directly creates classes and rmic them…

    You can have that addon: http://maximodeveloper.sourceforge.net/

    Have a good day…

  3. KH Says:

    Hello:

    Really appreciate for your suggestion… I’m trying out on it. Thanks a lot!

    Have a nice day.

  4. KH Says:

    Hi,

    Do I need to install Maximo 6 on my PC in order to use the maximodeveloper plugin? Or just the Maximo folder will do?

  5. PP Says:

    I made the necessary steps , but when i try to “refresh tree” command i get an error.

    Connection to database not present, could not initialize Maximo developer.

    Any suggest?

    thks

  6. thang Says:

    get following error while compiling:
    Error(26,12): constructor newMboSet(psdi.mbo.MboSet) not found in class psdi.custom.newMboSet

  7. thang Says:

    just ignore, actually my mistake while typing

  8. sherif Says:

    solve error “Connection to database not present, could not initialize Maximo developer.”
    this because password of database is encrypted in maximo.properties
    so use maximo.properties-oirg

  9. kamran Says:

    Hi Burak!

    First i would like thanks you for contribution that help many us of a lot.
    Second, with maximo developer plugin, i can extend mbos.
    1. is it possible to extend or create bean classes with this. if possible then how?
    2. is it possible to debug the code in debug mode. if possiible then can you please elaborate it.

    Regards, kamran

  10. Kayambu Says:

    I hava many doubts for how to create MBO class

  11. san_marino Says:

    Hi,

    Myself very new to maximo.I have been through the steps as described.Designed my user interface in the app designer, but am recieving invalid binding.I am not using maximo developer.I am working with ibm rad.I have downloaded the jar file for rmic and after copying it to the relevant folder and configuring the buildpath , I am getting one option called “Rmic marcar/desmarcar auto gear stub”.Upon selecting the option project is built.

    1. Is that option aiding in rmic and
    2. Is an AppBean mandatory for an application
    3. I would like to know the reason for invalid binding

    Regards.

  12. Yustas Says:

    Hi
    I have same error!. I created copy of maximo.properties_orig from /SMP/etc/ to /SMP/maximo/applications/maximo/properties folder. Deleted all rows with mxe.encripted. After it I wrote all passwords for all servers in this file. Then I try to create new project as described in MaximoDeveloper manual but receive next error – !Connection to database not present, could not initialize Maximo developer.
    In .log file of my workspace I found this row:
    !ENTRY org.eclipse.ui 4 0 2010-12-20 14:25:03.099
    !MESSAGE Unhandled event loop exception
    !STACK 0
    org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.RuntimeException: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver)……
    In maximo.properties file this driver are presented:
    mxe.system.reguser=MAXREG
    mxe.system.regpassword=XXXXXX
    mxe.db.driver=com.ibm.db2.jcc.DB2Driver
    mxe.db.url=jdbc:db2://192.168.1.17:50005/maxdb71
    mxe.rmi.port=0
    mxe.db.schemaowner=maximo
    Now I can’t correctly configure the MaximoDeveloper properties to find this driver.
    Could you help me in this case?

  13. fitness instructor Says:

    What I wouldnt give to have a debate with you about this. You just say so many things that come from nowhere that Im pretty sure Id have a fair shot. Your blog is great visually, I mean people wont be bored. But others who can see past the videos and the layout wont be so impressed with your generic understanding of this topic.:)

  14. kulveer singh Says:

    Hi

    I have one requirement where i need to attach the documents to assets but i want to send them to some FTP through JAVA code.

    My idea is to override the save() method of MBO and redirect this to the FTP using java code.

    I have not much knowledge about the MAXIMO but if it is possible , can you provide which classes need to be extended and methods to be overridden.

    Thank you
    Singh

Leave a Reply


Switch to our mobile site