Developing code in Workflow Template Administrator
I . . I'm a windchill starter user and i have skills in JAVA , now i'm trying to construct a Expression in Workflow Template Administrator and i need to get the PDF (Representation File) from a EPM Document received in a Promotion Request and copy that to a specific folder ...
I get this piece of code from internet but i get errors showed in bottom...
try{
QueryResult theQueryResult = MaturityHelper.service.getPromotionTargets(thePromotionNotice);
Versioned theVersioned = null ;
if (theQueryResult != null){
while(theQueryResult.hasMoreElements()){
theVersioned = (Versioned)theQueryResult.nextElement();
if (theVersioned instanceof EPMDocument) { ... }
}
}
catch(...){}
//primaryBusinessObject
QueryResult theQueryResult;
wt.maturity.PromotionNotice pn = (wt.maturity.PromotionNotice)primaryBusinessObject;
try{
theQueryResult = MaturityHelper.service.getPromotionTargets(pn);
Versioned theVersioned = null ;
if (theQueryResult != null){
while(theQueryResult.hasMoreElements()){
theVersioned = (Versioned)theQueryResult.nextElement();
if (theVersioned instanceof EPMDocument) {
System.out.println("IS A EPM DOCUMENT");
//É Preciso procurar o PDF AGORA.....
System.out.println("NOW GET THE PDF DOCUMENT");
// . . .
}else{
System.out.println("THIS IS NOT AN EPM");
}
}
}
}catch(Exception e){
System.out.println("ERROR EXPORTING PDF: " + e.getMessage());
errorMsg = "ERROR EXPORTING PDF Promotion Request: " + e.getMessage();
}
Five errors reported in check Syntax..
1) WfExpression45853891.java:36: cannot find symbol
symbol : class QueryResult
location: class wt.workflow.expr.WfExpression45853891
QueryResult theQueryResult;
^
2) WfExpression45853891.java:39: package MaturityHelper does not exist
theQueryResult = MaturityHelper.service.getPromotionTargets(pn);
^
3) WfExpression45853891.java:40: cannot find symbol
symbol : class Versioned
location: class wt.workflow.expr.WfExpression45853891
Versioned theVersioned = null ;
^
4) WfExpression45853891.java:43: cannot find symbol
symbol : class Versioned
location: class wt.workflow.expr.WfExpression45853891
theVersioned = (Versioned)theQueryResult.nextElement();
^
5) WfExpression45853891.java:44: cannot find symbol
symbol : class EPMDocument
location: class wt.workflow.expr.WfExpression45853891
if (theVersioned instanceof EPMDocument) {
I need help here because and dont know all structure of Windchill API classes
