Skip to main content
1-Visitor
May 14, 2010
Question

Custom promotion with Design Check Loop before Approval - Code Error

  • May 14, 2010
  • 14 replies
  • 2934 views
Hello everyone, I am putting together a custom workflow that is very basic. It's the same as the standard Promotion Workflow except that it has design check loop in it where it send the objects back and forth from design check and to the engineer...finally once approval is done it sends it away from Approval.


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

}

14 replies

1-Visitor
June 8, 2010
Hi Joy,

I think you are missing method in your syntax.

com.ptc.windchill.enterprise.maturity.PromotionNoticeWorkflowHelper.
doSomething((wt.maturity.PromotionNotice)primaryBusinessObject, false);


*Thank you*
*Sudeep Bhattarai*
*Principal Solutions Architect*
*NajaNaja Ltd*
*847-220-7008*
*
1-Visitor
June 8, 2010

Hi Sudeep,

I ran a windchill shell and it says resource not found for this class.

Is the class not available in 9.1. M040?


1-Visitor
June 9, 2010
This class does NOT appear to be in 9.1 M040 and I have never heard of it or
had a need to use it.



I did not load Rational Rose, but did load every jar and class file under
codebase into Eclipse from 9.1 M040. Only closest named class in that java
package is PromotionPreferenceHelper



It almost sounds like a custom class someone wrote and added as a solution
in this earlier email thread w/o actually providing the source code.



HTH,

Dave






10-Marble
June 9, 2010
This is ootb in 9.1 m050



On Jun 8, 2010, at 10:15 PM, David DeMay <-