Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.
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.