To iterate mboset records using automation script:
Usually we do below coding in java using Maximo API:
In the below example, taking PR as MboSet:
MboSetRemote prSet = MXServer.getMXServer().getMboSet("PR",MXServer.getMXServer().getSystemUserInfo());
prSet.setWhere("prnum = '"+<PRNUM>+"' and siteid = '"+<SITEID>+"'");
prSet.reset();
MboRemote pr = null;
int i = 0;
if(!prSet.isEmpty()){
while((pr=prSet.getMbo(i)) != null){
pr.setValue("description","TEST PR");
i++;
}
prSet.save();
}
Now we will do above logic in Automation Script:
from psdi.server import MXServer
mxServer = MXServer.getMXServer()
prSet = mxServer.getMboSet("PR",mxServer.getUserInfo())
prSet.setWhere("prnum = '"+<PRNUM>+"' and siteid = '"+<SITEID>+"'")
prSet.reset()
prRemote= prSet.moveFirst()
while prRemote:
prRemote= prSet.moveNext()
prSet.save()
Usually we do below coding in java using Maximo API:
In the below example, taking PR as MboSet:
MboSetRemote prSet = MXServer.getMXServer().getMboSet("PR",MXServer.getMXServer().getSystemUserInfo());
prSet.setWhere("prnum = '"+<PRNUM>+"' and siteid = '"+<SITEID>+"'");
prSet.reset();
MboRemote pr = null;
int i = 0;
if(!prSet.isEmpty()){
while((pr=prSet.getMbo(i)) != null){
pr.setValue("description","TEST PR");
i++;
}
prSet.save();
}
Now we will do above logic in Automation Script:
from psdi.server import MXServer
mxServer = MXServer.getMXServer()
prSet = mxServer.getMboSet("PR",mxServer.getUserInfo())
prSet.setWhere("prnum = '"+<PRNUM>+"' and siteid = '"+<SITEID>+"'")
prSet.reset()
prRemote= prSet.moveFirst()
while prRemote:
prRemote= prSet.moveNext()
prSet.save()
No comments:
Post a Comment