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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Usage of remoteMethodServer.invoke and RemoteMethodServer.ServerFlag

TG_10272716
10-Marble

Usage of remoteMethodServer.invoke and RemoteMethodServer.ServerFlag

Hello community!

 

I am looking through the PTC | Windchill code right now and I am encountering a lot of if(RemoteMethodServer.ServerFlag) { run code } else { remoteMethodServer.invoke(...)} constructs.

 

I am figuring this means something like "If the code is executed server-side then continue, otherwise invoke the method on the particular method server". But where would this code be executed, if not on the method server?

 

Can anyone please give me a better / more technical explanation. Why is it important to use this construct and when should you use it?

 

Thanks in advance and best regards

ACCEPTED SOLUTION

Accepted Solutions

Hi @TG_10272716 

The code can be run from Windchill shell, that moment you should care what MS you want to use or you can get the default one. 

If method server is not available then code fails

PetrH

View solution in original post

3 REPLIES 3

Hi @TG_10272716 

The code can be run from Windchill shell, that moment you should care what MS you want to use or you can get the default one. 

If method server is not available then code fails

PetrH

Hi @HelesicPetr, thank you for your reply. So, this basically means that I have to implement some kind of check (like mentioned above) whenever the code can or might be executed in the Windchill Shell.

 

Are there any other cases where this is required, what about Queues? Isn't there a difference between executed by Windchill (scheduled queue) and executed by the user (click)?

 

Best regards

Hi @TG_10272716 

I would say yes . 

queue is run on the method/background server directly so you do not need to cares about the check

PetrH

Announcements

Top Tags