Tuesday, 5 May 2015

Maximo automation script mboset iteration

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()

No comments:

Maximo SOAPUI error javax.xml.ws.WebServiceException

SOAPUI error while sending payload to below url (in cluster environment) http://localhost:9080/meaweb/services/MXASSET Error : <f...