Cancel
Showing results for 
Search instead for 
Did you mean: 

Continuing with the execution of a method , when a another independent method is called

Valued Contributor
Valued Contributor

Hello Community, 

 

my goal is to continue with the execution of method (x), when another independent method (y) is called. At the moment I am using a user defined attribut (type bollean) which is changed to true, when method (y) is called. With this procedure I am able to continue at a certain point with method (x).

 

My question: I am curious if there is a better way to see with method (x) if method (y) is called? My current procedure is more like a workaround...

 

Thanks in advance! 

3 REPLIES

Re: Continuing with the execution of a method , when a another independent method is called

Phenom
Phenom

What is the specific background for suspending the method(x) ,whilst execution, to wait for another method(y)to start execution ?

Re: Continuing with the execution of a method , when a another independent method is called

Valued Contributor
Valued Contributor
I am using this to observe if a certain process started, which I am not able to observe otherwise.

In general, I am just curious if there is a way to observe the start of one method with another method.

Something like the following code, which obviously does not exist in this syntax in Plant Sim :

waituntil Method(x).active = true prio1;

Re: Continuing with the execution of a method , when a another independent method is called

Gears Phenom Gears Phenom
Gears Phenom

I agree with @simulator, I don't yet see a need to do what you want to do. Why not split your "waiting" method into 2 methods and the 2nd method is called from the other method?

However, you can waituntil a user-defined attribute turns TRUE, but unfortunately that attribute cannot belong to a method, because then you would have to use the &/ref operator in the waituntil statement. A workaround could be like in the attached example model (specific user-attribute of type boolean for the "other" method, e.g. on a network or on the "waiting" method itself --> then you could use self.~.mFinish_wasCalled).

Alex

____________________________________________________________
Alex Dilg, Consultant at SimPlan AG (www.SimPlan.de)
This post was good and/or helpful to you? Please provide some Kudos, thank you!