Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
To change the status of a promotional target, we configured the following code:
wt.maturity.PromotionNotice pn = (wt.maturity.PromotionNotice)primaryBusinessObject;
wt.fc.QueryResult qr= wt.maturity.MaturityHelper.service.getPromotionTargets(pn);
while (qr.hasMoreElements())
{
wt.doc.WTDocument doc=(wt.doc.WTDocument) qr.nextElement();
wt.lifecycle.LifeCycleServerHelper.service.setState((wt.lifecycle.LifeCycleManaged)doc,wt.lifecycle.State.toState("DESIGNCHANGE"));
}
try
{
wt.util.WTProperties props = wt.util.WTProperties.getLocalProperties();
VERBOSE = props.getProperty("wt.maturity.verbose",VERBOSE);
}
catch( Throwable t )
{
}
try{
wt.maturity.MaturityServerHelper.service.unlockTargets (pn);
} catch (wt.maturity.MaturityException me){
if ( VERBOSE )
me.printStackTrace();
}
I got the following error:
the primaryBusinessObject is a part object.
change
wt.doc.WTDocument doc=(wt.doc.WTDocument) qr.nextElement();
to
wt.part.WTPart part=(wt.part.WTPart) qr.nextElement();
Dear Jason27
If so, does not the same error occur for WTDocument?
I do not know how to handle the API properly, so I have to apply the if statement to specify the lifecycle state only for the WTDocument and the rest to apply the original process?
I copied the original Approval promotion Request Process and assigned it as the default process.
Thank you.
