Custom promotion with Design Check Loop before Approval - Code Error
- May 14, 2010
- 14 replies
- 2934 views
Now this is impossible with the standard workflow (plus a loop) as the Workflow does not pick up the new changes that were made to the CAD files during the Design Check loop. It only promotes and includes the EXACT objects (down to the iteration ie. A.1).
I've got some java expressions to have the promotion workflow check if the objects its promoting are the latest iteration of that model. If not then it goes and grabs them and puts them on the Promotion Request and they will be promoted.
I'm very close but I get a java error in my code and need some assistance. I've also attached the Workflow. Note that all custom expressions are contained in the first "conditional" node underneath the "Accepted" portion. Here is the error and the code below. I know it's just a "missing semi-colon" but I can't figure it out as it seems like everything is OK.
THANKS!
ERROR:
D:\ptc\Windchill\temp\WfExpression24296.java:54: ';' expected
WTPart latestPart = (wt.part.WTPart) VersionControlHelper.service.getLatestIteration(wt.part.WTPart, false) wt.lifecycle.LifeCycleHelper.service.setLifeCycleState(wt.part.WTPart, wt.lifecycle.State.toState(INWORK));
CODE:
wt.fc.QueryResult qr = wt.fc.PersistenceServerHelper.expand(primaryBusinessObject, wt.maturity.PromotionTarget.PROMOTABLE_ROLE, wt.maturity.PromotionTarget.class, false);
wt.fc.collections.WTSet promotionTargets = new wt.fc.collections.WTHashSet(qr.size());
promotionTargets.addAll(qr);
java.util.Iterator i = promotionTargets.persistableIterator();
while (i.hasNext()) {
wt.maturity.PromotionTarget theTarget = (wt.maturity.PromotionTarget)i.next();
WTPart latestPart = (WTPart) VersionControlHelper.service.getLatestIteration(WTPart, false) wt.lifecycle.LifeCycleHelper.service.setLifeCycleState(WTPart, wt.lifecycle.State.toState(INWORK));
}

