Solved
Hi,
I want to get the view of the WTPart in workflow to compare if it is "Design" or "manufacturing".
I used below code in workflow execute expression robot.
====
if (primaryBusinessObject instanceof wt.part.WTPart) {
wt.part.WTPart part = (wt.part.WTPart) primaryBusinessObject;
wt.vc.views.View view = (wt.vc.views.View) part.getView().getObject();
if(view != null && view.equals("Design")){
result = "Go";
}else{
result = "NoGo";
}
====
On syntax check it work,
However, if i add workflow variable i got below error on syntax check.
===
Checking Syntax...
warning: Supported source version 'RELEASE_7' from annotation processor 'com.microsoft.azure.management.apigeneration.LangDefinitionProcessor' less than -source '1.8'
WfExpression_1315495121.java:129: error: variable view is already defined in method executemethod_1(Object[],Object[])
wt.vc.views.View view = (wt.vc.views.View) part.getView().getObject();
^
Note: WfExpression_1315495121.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
1 warning
Syntax check complete.
====
Can someone please guide me ?
Hi
What Windchill version do you use?
btw, where the variable partName is defined?
Do you define this variable in the workflow variable? if so, then you can not define it again in your code.
If I create global workflow variable, then I get same error as you.


if the variable is defined as a global then you can not define it again.
instead of wt.vc.views.View partName = ........
use just partName = (wt.vc.views.View) part.getView().getObject();

PetrH
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

