Need help on example model that integrates act, stm, and sd.

Moderator: Moderators

Need help on example model that integrates act, stm, and sd.

Postby yonedal » Tue Apr 04, 2017 1:27 pm

Hello,

I am trying to put together an example model that demonstrates the integration of activities, state machines, and sequence diagrams. However, I am running into some issues getting the simulation to work (I'm probably missing a multitude of things in this...).

The model is attached. The desired result is as follows:

I run the simulation on Instance 4. This kicks off an activity diagram that calls the interaction System Behavior which is specified by a sequence diagram. Once the lifeline Subsystem A receives the message Change State it's state machine diagram should initialize. Once the state changes from State 1 to State 2, the activity Subsystem A should run and change the value of x from 0.0 to 10.0. Once this is done, the lifeline Subsystem A calls the operation ChangeValue on Subsystem B, which is implemented by the activity of the same name which changes the value of y from 0.0 to 13.0.

I'm sure something is going off the rails in terms of context here, I'm just not sure what.
You do not have the required permissions to view the files attached to this post.
yonedal
Forum Beginner
Forum Beginner
 
Posts: 35
Posts Rating:0
Joined: Sun Nov 23, 2014 5:09 pm

Re: Need help on example model that integrates act, stm, and sd.

Postby chanon_s » Fri Apr 07, 2017 4:02 am

Dear Customer

In SysML, full port is a part and doest not work as normal port. It takes signals by itself and does not relay signals to others. Normally, connectors should not be connected to that full port, but to nested ports on it. Usually, full port should have proxy ports with interfaces on it. Also, UML interfaces are not used on SysML ports, these provided/required interfaces are not part of SysML.

We have a sample project named CoffeeMachine, located in the <md.install>/samples/simulation folder, that uses full ports and proxy ports.

Sincerely

Chanon S.
No Magic Customer Support
chanon_s
Customer Support
Customer Support
 
Posts: 91
Posts Rating:7
Joined: Thu Dec 04, 2014 2:21 am

Re: Need help on example model that integrates act, stm, and sd.

Postby yonedal » Fri Apr 07, 2017 8:58 am

OK, I've updated this sample model and taken out all of the ports (I wasn't interested in ports in this case anyways; I'm primarily wanting this simulation to run by integrating the various behaviors).

When I run this simulation (on 4: External System), the classifier behavior for 4 (activity External System) runs and calls the Interaction System Behavior. In System Behavior, the lifeline subsystem 0 sends a signal to subsystem 1 and, what I want to happen, is this trigger a state transition from State 1 to State 2 in the state machine diagram for subsystem 1, and State 2 has a do behavior that is the activity Subsystem A which should update the value of x. In the interaction, subsystem A should call the operation ChangeValue of subsystem B whose method is specified by an activity of the same name which changes the value of the value property y.

What I'm trying to figure out is how to integrate these different behaviors across different instance specs, as opposed to just using primitive actions on activity diagrams to do everything. It's not working though, and I'm trying to figure out what it is that I'm missing.

Updated model attached.
You do not have the required permissions to view the files attached to this post.
yonedal
Forum Beginner
Forum Beginner
 
Posts: 35
Posts Rating:0
Joined: Sun Nov 23, 2014 5:09 pm

Re: Need help on example model that integrates act, stm, and sd.

Postby chanon_s » Mon Apr 10, 2017 3:15 am

Dear Customer

Please see the attachment for the modified project. We have moved the interaction diagram to be under block External System and used nested lifelines for easier understanding. You can display more lifelines by right-clicking the interaction diagram > Display > Display Lifelines.

Signals2_Modified.mdzip


Sincerely

Chanon S.
No Magic Customer Support
You do not have the required permissions to view the files attached to this post.
chanon_s
Customer Support
Customer Support
 
Posts: 91
Posts Rating:7
Joined: Thu Dec 04, 2014 2:21 am

Re: Need help on example model that integrates act, stm, and sd.

Postby yonedal » Mon Apr 10, 2017 9:41 am

Thank you, this was extremely helpful. I do have one more question though:

On the sequence diagram I send a signal to Subsystem A that is supposed to trigger a transition from State 1 to State 2; however, this doesn't happen. On a sequence diagram, how do I align a signal as a message with a SignalEvent that can be recognized as the trigger on a transition?

Thanks again for the help.
yonedal
Forum Beginner
Forum Beginner
 
Posts: 35
Posts Rating:0
Joined: Sun Nov 23, 2014 5:09 pm

Re: Need help on example model that integrates act, stm, and sd.

Postby chanon_s » Mon Apr 10, 2017 10:27 pm

Dear Customer

On the sequence diagram I send a signal to Subsystem A that is supposed to trigger a transition from State 1 to State 2; however, this doesn't happen. On a sequence diagram, how do I align a signal as a message with a SignalEvent that can be recognized as the trigger on a transition?


Do you mean the sequence diagram in your previous attached project? If so, that was because paths of lifelines were not correct. There needs to be a matching nested path in order to send a signal from a lifeline to another lifeline. Both lifelines need correct path. For example, in your sample project, the sequence diagram is called from block External System. So, there needs to be a referenced lifeline starting from the main System reference property and then connect to the next subSystem 0 part property, as displayed in the image below:

lifelines.png


Also, you did not set the main System slot of instance 4 : External System. You need to remove the ChangeValue activity from the classifier behavior of block Subsystem B, otherwise, this activity will be automatically started when simulation is run (according to the Auto Start Active Objects option in the Simulation Environment Options, see the image below).

options.png


In addition, in the ChangeValue activity diagram, the result output pin of the ReadStructuralFeature action is a real value (0.0). However, the object input pin of the AddStructuralFeatureValue action needs a runtime object in order to add a value to it. But, in your model, a real value (0.0) will be passed to that object input pin, which is not correct.

Sincerely

Chanon S.
No Magic Customer Support
You do not have the required permissions to view the files attached to this post.
chanon_s
Customer Support
Customer Support
 
Posts: 91
Posts Rating:7
Joined: Thu Dec 04, 2014 2:21 am


Return to Cameo Simulation Toolkits

Who is online

Users browsing this forum: No registered users and 0 guests

cron