Page 1 of 1

startObjectBehavior question

PostPosted: Sun Apr 14, 2013 7:49 pm
by tpen3219
I have tried unsuccessfully to apply the startObjectBehavior action to start an object with the property isActive==false as illustrated in the CST User Guide p 28 (see attached file).

The activity diagram that contains the action is provided (see attached file).
The block diagram describing the blocks involved is in the attached diagram (see attached file).

The simulation always stops when the it hits the activity diagram that contains the startObjectBehavior action.

Am I doing something wrong or is this a bug?

Re: startObjectBehavior question

PostPosted: Tue Apr 16, 2013 10:26 pm
by kritsana_u
Hi,

We would like the know the version of CST you have found the problem, because we cannot reproduce your problem with CST 17.0.3 and 17.0.4 beta.
The startObjectBehavior action works fine. You can see the following picture (figure 1).

001.png

Figure 1 -- Execution of startObjectBehavior

The startObjectBehavior has been activated correctly, the classifierBehavior of the WallClock, which is Clock state-machine, is started.

But, we found that the startObjectBehavior action has two outgoing control edges. Currently, CST does not support the concurrent flows. So, the control flow will be activated one-by-one. Here, the control flow which is connected to the acceptEventAction waiting for the Stop Simulation signal will be activated first. After it receives the signal, the control flow which is connected to the acceptEventAction waiting for Stop signal will be activated. So, the Facility object will start the behavior of the wallClock object and then it will wait for Stop Simulation signal. After it has received the signal, it will wait for Stop signal. We are not sure that this behavior is what you want. We guess that you want the Facility object to wait for both Stop Simulation, and Stop signal at the same time (but, CST does not support).

Note that, the startObjectBehavior in your model is synchronous (Is Synchronous = true). In Stereo system sample, all startObjectBehavior actions is asynchronous (Is Synchronous = false).

002.png

Figure 2 -- Script is incorrect

Another problem, we found the problem in your java script. As shown in figure 2.
The formatTimeDisplay opaque behavior owned by Facility, uses an undefined variable time.
If you want to refer to the value of the structural feature time, in the context object, you should use ALH.
You may add the following line of code on the top of your script

Code: Select all
time = ALH.getValue($context$, "time");


Best regards,

Kritsana U.

Re: startObjectBehavior question

PostPosted: Wed Apr 17, 2013 10:47 am
by tpen3219
Thank you very much,
The time parameter was just changed and I had not tested it since I was working on the clock. But thank s for pointing it out.

I am running CST 17.0.3 build 146241, MagicDraw 17.0.3 SP1 build 144375, and SysML 17.0.3 build 138684.

Thank you for identifying the synch v asynch issue and for explaining the issue with waiting for two events.

I'll make these changes and see what happens.

P.S. Is there a time yet when I can get CST 17.0.4 beta?

Thank you

**********************************************************
I changed the synchronous setting to false.
I fixed the time parameter and logic.
The simulation exits at the startWallClock action in EvacuateFacility.

My timeline to get this to work done is Friday

Re: startObjectBehavior question

PostPosted: Wed Apr 17, 2013 8:09 pm
by kritsana_u
Hi,

CST 17.0.4 beta, has been released since April 8, 2013. You can get it at https://www.magicdraw.com/download/came ... on_toolkit

Best regards,

Kritsana U.