cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to solve invocation error in expression robot ?

BernardWielfaer
12-Amethyst

How to solve invocation error in expression robot ?

Hi

I have a problem that is pending for 2 weeks now, and I can't find the cause of it. I have a call to a method inside a java expression that looks like this;

Snap2.png

 The method executes and I see results in the bg method server but when the method terminates it gives next error;

Snap3.pngI am sure I am returning a String. obsResult is defined as a Java string in the properties of the Approval process.

Snap4.pngWhat can be the cause of this error, please help ?

 

ACCEPTED SOLUTION

Accepted Solutions

Aha, now completely solved. There where also wrong calls to the method included in the Phase Process (execution of workflow) when reaching the Obsolete status in an older iteration of the lifecycle. The objects I am using where still set to this (old) lifecycle. Now all is okay, pff difficult to track but thanks to running this from command line I did see this.

View solution in original post

8 REPLIES 8

The problem is that Windchill can't find your class and method. Please check first, if the java class is copied correctly to the server or if you have any typo in the call.

It says clear: No such method error

 

Strange that the method server first executes the code, so it must find it, then outputs the error,...

This is more then a typo going on here....

What happens when you press "Check Syntax"?

Everything is okay, it says. Strange if I give with "null" to the method the error is not comming and it returned properly. I recompiled the class file and it commes out ok.

No such method error shows "Ljava." it is looking for a method with Array, not sure why.

Are you able to call this method from class outside of workflow, passing appropriate object. Is it possbile for you to add more Debug Statements to the method and forward the information or if feasible share the java file.

 

Regards,

Bhushan

Hi Bushan

The culprit is found, it was a call to set the lifeCycleState. When only 2 parameters are given (LifeCycleManaged and wantedState) then this method is terminating the workflow processes associated with this state that are open. In other words it was killing it's own, returning an invocation exception. Optionally there is a call to a method with 3 parameters, where the 3th indicates if processes needs to be terminated. When I use next all is ok.   

Thank you anyway for your willingness to look into this problem. Best regards Bernard

 

Snap4.png

Hum hum not completly solved. When the status is already ok it performs ok, but when the status has to change it is giving me again this Invocation Exception. What about the locking of the promotion targets, why is this needed and is this the case here ?

Still in trouble here, please help....

Aha, now completely solved. There where also wrong calls to the method included in the Phase Process (execution of workflow) when reaching the Obsolete status in an older iteration of the lifecycle. The objects I am using where still set to this (old) lifecycle. Now all is okay, pff difficult to track but thanks to running this from command line I did see this.

Announcements

Top Tags