Reading/Writing Read Structural Feature Actions

Moderator: Moderators

Reading/Writing Read Structural Feature Actions

Postby Jacob.alva@navy.mil » Thu Jul 18, 2019 2:20 pm

I have two seperate blocks, one holds a value property, the other holds an activity diagram. If I try to use the activity diagram to read structural feature (value property from other block) I will be given an error message that I can not read said value because I am out of its context. Is there a efficient workaround to read value properties, etc., out of context with an activity diagram?
Jacob.alva@navy.mil
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Thu Jul 18, 2019 2:14 pm

Re: Reading/Writing Read Structural Feature Actions

Postby rjhudson@mitre.org » Sat Aug 17, 2019 5:43 pm

Does the block with the activity diagram have any kind of reference to the other block? If it doesn't then that could indicator you are trying to perform some action that doesn't make sense for that block. If you block really should have access to that other block, then just add a reference of some kinda and use that in the activity diagram.
rjhudson@mitre.org
Forum Newbie
Forum Newbie
 
Posts: 13
Posts Rating:3
Joined: Thu Jun 29, 2017 3:40 pm

Re: Reading/Writing Read Structural Feature Actions

Postby Jacob.alva@navy.mil » Mon Aug 19, 2019 6:17 am

Thank you, is this done through a bound reference or?
Jacob.alva@navy.mil
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Thu Jul 18, 2019 2:14 pm

Re: Reading/Writing Read Structural Feature Actions

Postby danbrunski@gmail.com » Thu Apr 02, 2020 6:42 pm

I could use some help on this too. I have been struggling with this all day, in a way I would never have trouble with if it were C++. I have a block that is a directed composition of another block, and I'm trying to use the readStructureFeature in an activity diagram to read a value property of the sub block, but no matter how many lines and ports I draw, I just get "the specified structure feature is not owned by the given context."

To be more specific, let's say we have a satellite with a propulsion system. The satellite is a composition of the propulsion system. In the satellite I have a state machine diagram called calculate_burn. In the propulsion system I have a value property called thrust. In calculate_burn as the do activity I create the readStructureFeature action and tell it the structure is the thrust property.

I've tried creating an IBB in Satellite with all manner of ports and lines between satellite and propulsion. I've also tried creating another block called Satellite Context with an IBB that contains Satellite and Propulsion.

When I simulate my satellite, I just get the context error. Why? How is the propulsion system not part of the context?
danbrunski@gmail.com
Forum Newbie
Forum Newbie
 
Posts: 2
Posts Rating:0
Joined: Thu Apr 02, 2020 5:26 pm

Re: Reading/Writing Read Structural Feature Actions

Postby danbrunski@gmail.com » Mon Apr 06, 2020 11:53 am

Ok, I actually figured this out. As it turns out, SysML works just like an object oriented language! But man is it not intuitive, and the guides out there are not very clear.

I feel like this is a super obvious thing to everyone else here, so I won't go through a lengthy explanation unless someone asks. Basically I needed to create an internal block diagram on the lowest level block with the value of interest bound to an external port. Then on the upper level block, I created an ibd that has the lower level block's port bound to the upper level block. Then in my upper level block's activity diagram, I use a readSelf function, that sends the object to a readStructuralFeature, which sends the value to some calculation, and then at the end I have an addStructuralFeatureValue that receives both the object and calculated value.

This example is what made the read/addStructureFeature actions click for me: https://thaisysml.blogspot.com/2012/08/simple-clock-modeling-with-sysml.html

These two helped me understand ports better:

https://mbse4u.com/2013/09/23/sysml-full-ports-versus-proxy-ports/

https://mbse4u.com/2018/11/30/sysml-question-why-you-should-not-connect-ports-with-associations/
danbrunski@gmail.com
Forum Newbie
Forum Newbie
 
Posts: 2
Posts Rating:0
Joined: Thu Apr 02, 2020 5:26 pm


Return to Cameo Simulation Toolkits

Who is online

Users browsing this forum: No registered users and 2 guests

cron