Home » Modeling » Papyrus » extending requirement diagram in SysML
extending requirement diagram in SysML [message #997795] |
Tue, 08 January 2013 13:56  |
Eclipse User |
|
|
|
Hi,
I just started working with Papyrus and I went through tutorial for making UML profiles (with the example of requirement Model). Now I want to extend the Requirement element in SysML. So I want to choose Requirement as my base metaclass. How can I do that?
Thank you so much in advance for your help.
|
|
|
Re: extending requirement diagram in SysML [message #997852 is a reply to message #997795] |
Tue, 08 January 2013 16:47   |
Eclipse User |
|
|
|
Hi, Jeni,
You should be able to import the SysML profile as an imported package
in your profile. In the Model Explorer, select the root package of
your profile and select "Import Registered Package" (not sure of the
exact label) in the context menu. Can you choose the SysML profile in
this dialog? If so, then you'll end up with that profile imported and
its types available to use in generalization relationships,
associations, etc.
However, I'm not sure that the UML2 implementation of "dynamic
profiles" support these kinds of dependencies between profiles very
well. I think it may copy all of the definitions from the referenced
profiles (SysML in your case) into your profile's Ecore definition, so
that at the EMF level you end up with a distinct copy of SysML that
isn't interoperable with the original SysML profile. Perhaps somebody
in this newsgroup knows better than I how this works with dynamic
profiles. I know that dependencies between profiles work well when the
profiles are statically generated.
HTH,
Christian
On 2013-01-08 18:56:19 +0000, Jeni Martin said:
> Hi,
> I just started working with Papyrus and I went through tutorial for
> making UML profiles (with the example of requirement Model). Now I want
> to extend the Requirement element in SysML. So I want to choose
> Requirement as my base metaclass. How can I do that?
>
> Thank you so much in advance for your help.
|
|
| |
Re: extending requirement diagram in SysML [message #998732 is a reply to message #998727] |
Thu, 10 January 2013 10:19   |
Eclipse User |
|
|
|
Hi, Camille,
Thanks for the correction of the menu action.
Indeed, stereotypes are not metaclasses and thus cannot be extended by
stereotypes. But the Eclipse UML implementation supports
generalization of stereotypes well (though, as I said, I'm not sure
about how practical it is to have generalization relationships to
stereotypes in another profile when the profiles are dynamically
defined).
cW
On 2013-01-10 15:11:59 +0000, Camille Letavernier said:
> Hello,
>
>
> I think the "Import registered package" menu won't work in this case.
> It is intended for UML Libraries.
>
> However, the "Import registered profile" menu will work fine.
>
> You cannot choose the SysML Requirement as the "Base Metaclass" of your
> new Stereotype. Instead, you should create a Generalization between
> your Stereotype and the SysML Requirement.
>
>
> Regards,
> Camille
|
|
| | | |
Re: extending requirement diagram in SysML [message #1103504 is a reply to message #1001498] |
Fri, 06 September 2013 18:11   |
Eclipse User |
|
|
|
I am also interested in this subject. I would like to create a profile to create the <<System>> stereotype that you see in the first "System Context" diagram of every textbook. Using the original tutorial and the updated hints above, I was able to get this working almost perfectly but with one small remaining problem. Basically, I created my profile, imported the SysML profile, dragged a copy of the <<Block>> element onto my diagram, and then dragged a new stereotype onto the diagram. After naming the new stereotype <<System>> I added a generalization relationship to <<Block>>

(See uploaded file: Asatte_SysML_Profile_System_Generalizes_Block.png)
So far, so good. However, when I then create a test model, add a block and apply the new profile (all of which works as described) it shows up nicely in the model explorer, but not in the actual diagram. Like thisL

(See uploaded file: Not_OK_Diagram_Still_Shows_Block.png)
Looks like a (small) bug to me. Actually, I have a done step-by-step screen captures all the way from zero for this which I could drop into a Word document if that would be helpful... However, I am hoping that it is just something I missed...(?)
[Updated on: Fri, 06 September 2013 18:11] by Moderator
|
|
| | | | | |
Re: extending requirement diagram in SysML [message #1108447 is a reply to message #1106894] |
Fri, 13 September 2013 17:51  |
Eclipse User |
|
|
|
Hmmm... So today I downloaded the Papyrus source code tree (which is huge) and spent the day looking at it carefully. This behavior is not so easy to change, at least not for a beginner, and it is deeply embedded in both the UML and SysML side of Papyrus. From what I can see, the <<class>> element is the only element that does NOT hard-code the label to the shape. This behavior is true for both the base UML and also for the SysML. When I found the part that adds or subtracts the stereotype according to the buttons discussed above, it carefully prepends the stereotype list to whatever was there before inserting a comma in the string and then uses the same comma to strip it when you click the button again.
While I still feel that the original intent of UML is that you should be able to elide (hide) anything - including the stereotype - making the change to Papyrus to make this possible would be rather involved. Probably the best way would be to add a new appearance property "Display stereotype = true/false" that handled the basic stereotype. We would then have to rework the logic in AddAppliedQNStereotypeToDisplayCommand.java and RemoveAppliedStereotypePropertiesToDisplayCommand.java to accommodate the more complicated logic. Unfortunately, while I can allocate part of a Friday to reading some source code, I don't have quite enough time to do the work to get fully setup to be able to build and debug Papyrus (it looks pretty complicate) and learn all the ins and outs of the ui and datastructures to make this sort of change. I will submit it as a feature request instead and hope that someone who is already setup and educated on Papyrus building will find the request interesting enough to implement.
Thanks!
David Hetherington
|
|
|
Goto Forum:
Current Time: Wed Jul 23 17:05:21 EDT 2025
Powered by FUDForum. Page generated in 0.06893 seconds
|