How to access instances of classifiers in Activity Diagram [message #1820828] |
Wed, 29 January 2020 20:09 |
Gerhard Jensen Messages: 7 Registered: January 2020 |
Junior Member |
|
|
Hi folks,
I'm new to Papyrus and have been using SysML 1.4 to model a software system. I have a single Block called Domain with various child Blocks. For the sake of discussion I'll call one of the child blocks Foo. The Domain block has an attribute foo that refers to a single instance of Foo.
In an Activity diagram, I want to call an operation Foo::bar() on the instance child. In Java it would be expressed foo.bar(). The Call Operation block has a target input pin that needs to be connected to an instance of Foo.
How do I get the foo attribute from my Domain block to connect to the target pin?
I've tried passing in an instance of Domain as a parameter to the Activity, then adding a ReadStructuralFeatureAction to extract foo. That passes validation but is clunky and I'm not sure it's correct.
It would seem an Object node would be useful for this, but this apparently does not exist in Papyrus, as discussed here.
Alternatively, I can add an Activity Parameter to the diagram, but then the Operation signature of the Activity now requires an instance of Foo as one of the input parameters. That seems clunky, especially for my case where I have only one Foo in the system.
I tried a DataStore block, which looks good in the diagram, but it appears I cannot share the same DataStore across multiple activity diagrams.
What's the canonical SysML way to do this?
I sure appreciate any nudge in the right direction. Please let me know if I should post a minimum example to make it more clear.
Thanks!
G.
|
|
|
Powered by
FUDForum. Page generated in 0.03180 seconds