You need to extend statefull bean class for this
Sample class would be
package custom.webclient.beans.workorder;
import java.rmi.RemoteException;
import psdi.mbo.MboSetRemote;
import psdi.mbo.StatefulMboRemote;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.webclient.system.beans.DataBean;
public class CustStatefulAppBean extends StatefulAppBean {
public int WSCH() throws RemoteException, MXException {
DataBean db = app.getAppBean();
StatefulMboRemote mbo = (StatefulMboRemote) db.getMbo();
targetStatusOption = "WPCOND";
statusChangeButtonSigoption = "WPCOND";
mbo.setTargetStatusOption("WPCOND");
mbo.setStatusChangeButtonSigoption("WPCOND");
STATUSSUB();
clientSession.loadDialog("status");
return 1;
}
public int STATUSSUB() throws MXException, RemoteException {
DataBean appBean = app.getAppBean();
StatefulMboRemote statefullRemote = (StatefulMboRemote)appBean.getMbo();
if (app.onListTab())
{
statefullRemote.setOnListTab(true);
}
else
{
statefullRemote.setOnListTab(false);
MboSetRemote statuslist = statefullRemote.getValidStatusList();
if (statuslist.getMbo(0) == null)
{
statefullRemote.setTargetStatusOption(null);
targetStatusOption = null;
throw new MXApplicationException("system", "StatusChangeNotAllowed");
}
}
return 2;
}
}
Sample class would be
package custom.webclient.beans.workorder;
import java.rmi.RemoteException;
import psdi.mbo.MboSetRemote;
import psdi.mbo.StatefulMboRemote;
import psdi.util.MXApplicationException;
import psdi.util.MXException;
import psdi.webclient.system.beans.DataBean;
public class CustStatefulAppBean extends StatefulAppBean {
public int WSCH() throws RemoteException, MXException {
DataBean db = app.getAppBean();
StatefulMboRemote mbo = (StatefulMboRemote) db.getMbo();
targetStatusOption = "WPCOND";
statusChangeButtonSigoption = "WPCOND";
mbo.setTargetStatusOption("WPCOND");
mbo.setStatusChangeButtonSigoption("WPCOND");
STATUSSUB();
clientSession.loadDialog("status");
return 1;
}
public int STATUSSUB() throws MXException, RemoteException {
DataBean appBean = app.getAppBean();
StatefulMboRemote statefullRemote = (StatefulMboRemote)appBean.getMbo();
if (app.onListTab())
{
statefullRemote.setOnListTab(true);
}
else
{
statefullRemote.setOnListTab(false);
MboSetRemote statuslist = statefullRemote.getValidStatusList();
if (statuslist.getMbo(0) == null)
{
statefullRemote.setTargetStatusOption(null);
targetStatusOption = null;
throw new MXApplicationException("system", "StatusChangeNotAllowed");
}
}
return 2;
}
}
Comments
Post a Comment