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…
June 24th, 2009 at 5:28 am
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…
June 24th, 2009 at 5:12 pm
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…
June 27th, 2009 at 9:27 am
Hello:
Really appreciate for your suggestion… I’m trying out on it. Thanks a lot!
Have a nice day.
June 27th, 2009 at 9:33 am
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?
November 4th, 2009 at 1:00 pm
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
November 25th, 2009 at 1:14 pm
get following error while compiling:
Error(26,12): constructor newMboSet(psdi.mbo.MboSet) not found in class psdi.custom.newMboSet
November 25th, 2009 at 1:16 pm
just ignore, actually my mistake while typing
December 31st, 2009 at 11:56 am
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