Maximo Wire - The IBM Maximo Help & Discussion Forum
May 22, 2012, 10:56:53 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to Maximo Wire, the IBM Maximo help forum. Feel free to register and ask any Maximo related questions you like.
 
  Home Help Search Login Register  
*
Pages: [1]   Go Down
  Print  
Author Topic: JobPlan changeStatus doesn't check related rules - missed something?  (Read 317 times)
0 Members and 1 Guest are viewing this topic.
robbinma
Newbie
*

Karma: 1
Posts: 13


View Profile
« on: October 29, 2009, 09:30:02 am »

Hello,

I am writing a java utility to update the status of some job plans.
It changes the status but it doesn't apply all the relevant status rules e.g.
duration must be > 0.
Setting a plan status to active when no labor is set.

The validate method doesn't appear to fail.
The save method also works without raising any errors.

I'm guessing that the duration rule must be set at the front-end rather than on
the MBO.
Alternatively I may have missed something. This feels more likely as I would
expect the labor rule to be set at the MBO level.

Someone else has suggested using Escalations for this but it seems to need a time interval attribute which isn't available.

Could someone have a look and point me in the right direction?

Cheers,

Mark

// retrieved unique job plan into mbosetremote
boolean valiWarningFlg;
mbosetremote.getWarnings(); // clear any old warnings out
mbosetremote.validate(); // TODO: checking the object

valiWarningFlg = mbosetremote.hasWarnings();
if (valiWarningFlg)
{
System.out.println("Validation generated warnings");
MXException[] mboWarn = mbosetremote.getWarnings();

MXException tempMboWarn;
for(int excepCnt = 0; excepCnt < mboWarn.length; excepCnt ++){
tempMboWarn = mboWarn[excepCnt];
System.out.println(tempMboWarn.getDisplayMessage());
}
} else
{
System.out.println("Validation didn't generate warnings");
}
if(mbosetremote.count() == 1)
{
MboRemote tempMBO;
tempMBO = mbosetremote.moveFirst();
JobPlanRemote jp = (JobPlanRemote)tempMBO;
jp.changeStatus("Active", new Date(),"Auto approved", MboConstants.NONE);
try
{
jp.getThisMboSet().save();
} catch (Exception saveExcep)
{
System.out.println("Problem saving MBO Excep"+saveExcep.getMessage());
}
}

Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Recent

TinyPortal v1.0 beta 4 © Bloc
Powered by MySQL Powered by PHP Powered by SMF 1.1.15 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!