Hi Guys,
I am completely new at customization and inquisitive for knowledge Thank you for your help in Advance !
i wanted to send the number/name of the Part in the Header of the Review PR Task Mail during the Promotion Notice (Workflow).
For that i created the Variables PR_Description, Part_Number, Part_Name in the Workflow Properties/Variables and added the following code to the first conditional.
wt.maturity.PromotionNotice pn = (wt.maturity.PromotionNotice)primaryBusinessObject;
wt.part.WTPart prt = (wt.part.WTPart)primaryBusinessObject;
PR_Description = ext.testpackage.Promotionhelper.get_pn_desc(pn);
Part_Number = ext.testpackage.Promotionhelper.get_part_number(prt);
Part_Name = ext.testpackage.Promotionhelper.get_part_name(prt);
The created class includes the following:
package ext.testpackage;
import wt.maturity.PromotionNotice;
import wt.part.WTPart;
public class Promotionhelper {
public static void main(String args[]) {
System.out.println("test");
}
public static String get_pn_desc (PromotionNotice pn) {
return pn.getDescription();
}
public static String get_part_number (WTPart prt) {
return prt.getNumber();
}
public static String get_part_name (WTPart prt) {
return prt.getName();
}
The PR_Description works perfectly. It got the mail with the Description, but for PartName and PartNumber i got the following:
Mo 6/3/13 14:02:05: WfPropagationQueue.PollingThread: Caused by: java.lang.ClassCastException: wt.maturity.PromotionNotice cannot be cast to wt.part.WTPart
Mo 6/3/13 14:02:05: WfPropagationQueue.PollingThread: at wt.workflow.expr.WfExpression39493.execute_ROUTER_EXPRESSION_(WfExpression39493.java:40)
Mo 6/3/13 14:02:05: WfPropagationQueue.PollingThread: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Mo 6/3/13 14:02:05: WfPropagationQueue.PollingThread: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Mo 6/3/13 14:02:05: WfPropagationQueue.PollingThread: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Mo 6/3/13 14:02:05: WfPropagationQueue.PollingThread: at java.lang.reflect.Method.invoke(Method.java:597)
Mo 6/3/13 14:02:05: WfPropagationQueue.PollingThread: at wt.workflow.definer.WfExpression.executeRouter(WfExpression.java:2715)
Mo 6/3/13 14:02:05: WfPropagationQueue.PollingThread: ... 15 more
Do you have any clue how i can get the PartName and PartNumber for the Object in Promotion Notice?