使用MAXIMO平台做开发,对很多东西都迷迷糊糊的,在这里一点一点总结,理清思路。
一、虚拟表
顾名思义就是不存在的表,它实际上只是被配置在MAXIMO的表信息中,但在物理中是不存在的,是虚拟的。
虚拟表,主要用来存储临时数据,因为maximo用的都是对象或者说是对象集,如果你想临时存储一些数据,那么你就要构造这个虚表。一般是在页面代码中调用。
1、最常见的虚拟表就是修改状态的表,例如WOChangeStatus、WOChangeStatusSet。
1)这种类的代码基本大同小异,
public class WOChangeStatusSet extends ChangeStatusSet
implements NonPersistentMboSetRemote

...{

public WOChangeStatusSet(MboServerInterface mboserverinterface)
throws MXException, RemoteException

...{
super(mboserverinterface);
}

protected Mbo getMboInstance(MboSet mboset)
throws MXException, RemoteException

...{
return new WOChangeStatus(mboset);
}

public String getName()

...{
return "WOChangeStatus";
}

protected MboSetRemote getMboIntoSet(MboRemote mboremote)
throws MXException, RemoteException

...{
MboSetRemote mbosetremote = getMboServer().getMboSet("WORKORDER", getUserInfo());
SqlFormat sqlformat = new SqlFormat(mboremote, "wonum = :wonum");
mbosetremote.setWhere(sqlformat.format());
mbosetremote.setApp(getApp());
return mbosetremote;
}
}
public class WOChangeStatus extends NonPersistentMbo
implements NonPersistentMboRemote

...{

public WOChangeStatus(MboSet mboset)
throws MXException, RemoteException

...{
super(mboset);
}

public void add()
throws MXException, RemoteException

...{
super.add();
java.util.Date date = MXServer.getMXServer().getDate();
setValue("AsOfDate", date, 11L);
setValue("ChildStatus", getOwner().getBoolean("ChangeChildStatus"), 11L);
setValue("SINGLEWO", 0, 11L);
}
}

2)需要在WOService 中建立联系
public class WOService extends AppService implements WOServiceRemote

...{
。。。

public void createRelationList(RelationList relationlist) ...{
。。。
relationlist.addRelation(new RelationInfo("WOChangeStatus", "WORKORDER", "WOChangeStatus", ""));
}
。。。
}
二、还有另外一种,如AssignLabor、AssignLaborSet。