Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Question about SysML parameters and EMF(Errors and visual notation)
Question about SysML parameters and EMF [message #1847234] Wed, 20 October 2021 12:27 Go to next message
Rod Naugler is currently offline Rod NauglerFriend
Messages: 65
Registered: September 2016
Member
Hi all,
I am relatively new to SysML and Papyrus. I am trying to use Papyrus to replicate a UAF model from Cameo so that I can work on the model.
I am currently rebuilding an activity tree. Within an activity, there are parameters (in and out) as well as activity parameters which refer to the parameter. I have two activities which have parameters and activity parameters which have the same names. In the second instance, 4 of 6 parameters have a green + sign in their icon. 1 parameter appears normal, and 1 parameter has a red x. In the model validation tab for the parameter with the red x, the description is "A Parameter with invalid text string is found" and the type is EMF problem. The Parameter name is 'mission plan'.
What I don't understand is why this particular Parameter has an error while the others do not. Are there protected words for the name?
If I delete the Parameter and recreate it as missionplan, it accepts it. Then, if I edit the Parameter to add the space, it remains without an error.

Are there some rules I am unaware of?

What do the green + signs mean?

Thanks!
Re: Question about SysML parameters and EMF [message #1847268 is a reply to message #1847234] Thu, 21 October 2021 14:12 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 479
Registered: May 2015
Location: Germany
Senior Member
Hi Rod,

yeah, Papyrus is more catholic than the pope, while Cameo is much more permissive.
Papyrus checks (almost) every rule defined in SysML and UML, the base of SysML.

For example according to the UML specification a activity parameter node shall have exactly one parameter. Papyrus checks this rule, Cameo does not.

I attached a tiny activity model that validates without issues.

I did it with Papyrus 5.2 with the SysML 1.6 add-on.

Maybe it fits as a reference / template.

/Carsten


EDIT:typo
  • Attachment: ActDemo.zip
    (Size: 5.22KB, Downloaded 88 times)

[Updated on: Thu, 21 October 2021 14:37]

Report message to a moderator

Re: Question about SysML parameters and EMF [message #1847271 is a reply to message #1847268] Thu, 21 October 2021 14:48 Go to previous messageGo to next message
Rod Naugler is currently offline Rod NauglerFriend
Messages: 65
Registered: September 2016
Member
Thanks for the feedback, but I still don't have an answer to the basic questions:
1. What does the green + mean?
2. Are there hidden naming rules?

I have a partial answer to #2. There are certain keywords that are not permitted, such as IN and OUT, which seem to cause the error. However, if you edit the name after it is created, the name isn't checked again so you can get away with it.

Rod
Re: Question about SysML parameters and EMF [message #1847276 is a reply to message #1847271] Thu, 21 October 2021 15:08 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 479
Registered: May 2015
Location: Germany
Senior Member
The green plus just signals that the element has visibility public.

And no there are no hidden naming rules. I often used IN and OUT to name ports or other elements. The issue is most probably elsewhere.

/Carsten
Re: Question about SysML parameters and EMF [message #1847280 is a reply to message #1847276] Thu, 21 October 2021 15:48 Go to previous messageGo to next message
Rod Naugler is currently offline Rod NauglerFriend
Messages: 65
Registered: September 2016
Member
Hi Carston,
Well, you are correct on what the green pluses mean, but it isn't reflected in the Properties tab for the element. I opened up the UML file and I have:
          <packagedElement xmi:type="uml:Activity" xmi:id="_17u6MDEDEeyMBvcXVe_RnA" name="Mission Preparation" node="_SOpeUDGVEey3cswIoKZz8w _9qxDMDGXEey3cswIoKZz8w _Cb1lgDGYEey3cswIoKZz8w _Gem3YDGYEey3cswIoKZz8w _KCiRIDGYEey3cswIoKZz8w _NPXZgDGYEey3cswIoKZz8w">
            <ownedParameter xmi:type="uml:Parameter" xmi:id="_LBYRQDGTEey3cswIoKZz8w" name="assets" visibility="public" effect="create"/>
            <ownedParameter xmi:type="uml:Parameter" xmi:id="_Pz3I0DGTEey3cswIoKZz8w" name="equipment" visibility="public" effect="create"/>
            <ownedParameter xmi:type="uml:Parameter" xmi:id="_XfG9QDGTEey3cswIoKZz8w" name="orders" visibility="public" effect="create"/>
            <ownedParameter xmi:type="uml:Parameter" xmi:id="_eM-jcDGTEey3cswIoKZz8w" name="personnel" visibility="public" effect="create"/>
            <ownedParameter xmi:type="uml:Parameter" xmi:id="_gZAWIDGTEey3cswIoKZz8w" name="supplies"/>
            <ownedParameter xmi:type="uml:Parameter" xmi:id="_u-V78DGgEey3cswIoKZz8w" name="mission plan" direction="out"/>
            <node xmi:type="uml:ActivityParameterNode" xmi:id="_SOpeUDGVEey3cswIoKZz8w" name="assets" ordering="unordered" parameter="_LBYRQDGTEey3cswIoKZz8w"/>
            <node xmi:type="uml:ActivityParameterNode" xmi:id="_9qxDMDGXEey3cswIoKZz8w" name="equipment" ordering="unordered" parameter="_Pz3I0DGTEey3cswIoKZz8w"/>
            <node xmi:type="uml:ActivityParameterNode" xmi:id="_Cb1lgDGYEey3cswIoKZz8w" name="orders" ordering="unordered" parameter="_XfG9QDGTEey3cswIoKZz8w"/>
            <node xmi:type="uml:ActivityParameterNode" xmi:id="_Gem3YDGYEey3cswIoKZz8w" name="personnel" ordering="unordered" parameter="_eM-jcDGTEey3cswIoKZz8w"/>
            <node xmi:type="uml:ActivityParameterNode" xmi:id="_KCiRIDGYEey3cswIoKZz8w" name="supplies" ordering="unordered" parameter="_gZAWIDGTEey3cswIoKZz8w"/>
            <node xmi:type="uml:ActivityParameterNode" xmi:id="_NPXZgDGYEey3cswIoKZz8w" name="mission plan" ordering="unordered" parameter="_u-V78DGgEey3cswIoKZz8w"/>
          </packagedElement>


For that package, and I can see that the supplies parameter does not have visibility="public" set. However, the properties tab shows it as having visibility set to public on the dropdown. I edited the UML file and reloaded it which removed the plus sign.

There should be an option in Papyrus to set both the visibility and actions to empty.

Weird.

Rod
Re: Question about SysML parameters and EMF [message #1847283 is a reply to message #1847280] Thu, 21 October 2021 17:02 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 479
Registered: May 2015
Location: Germany
Senior Member
The behavior of Papyrus IMHO complies completely with the UML 2.5.1 specification.

Just to cite the UML spec

7.8.12 PackageableElement [Abstract Class]

7.8.12.1 Description
A PackageableElement is a NamedElement that may be owned directly by a Package. A PackageableElement is also able to serve as the parameteredElement of a TemplateParameter.

7.8.12.2 Diagrams
Namespaces, Types, Constraints, Dependencies, Literals, Time, Components, Packages, Information Flows, Deployments, Artifacts, Events, Instances, Generalization Sets

7.8.12.3 Generalizations
ParameterableElement, NamedElement

7.8.12.4 Specializations
Constraint, Dependency, Type, Event, Observation, ValueSpecification, Package, InformationFlow,
GeneralizationSet, InstanceSpecification

7.8.12.5 Attributes
visibility : VisibilityKind [0..1] = public
A PackageableElement must have a visibility specified if it is owned by a Namespace. The default visibility is public.

7.8.12.6 Constraints
namespace_needs_visibility
A PackageableElement owned by a Namespace must have a visibility.
inv: visibility = null implies namespace = null


...


7.8.24 VisibilityKind [Enumeration]

7.8.24.1 Description
VisibilityKind is an enumeration type that defines literals to determine the visibility of Elements in a model.

7.8.24.2 Diagrams
Namespaces

7.8.24.3 Literals
* public
A Named Element with public visibility is visible to all elements that can access the contents of the Namespace that owns it.
* private
A NamedElement with private visibility is only visible inside the Namespace that owns it.
* protected
A NamedElement with protected visibility is visible to Elements that have a generalization relationship to the Namespace that owns it.
* package
A NamedElement with package visibility is visible to all Elements within the nearest enclosing Package (given
that other owning Elements have proper visibility). Outside the nearest enclosing Package, a NamedElement marked as having package visibility is not visible. Only NamedElements that are not owned by Packages can be marked as having package visibility.
Re: Question about SysML parameters and EMF [message #1847304 is a reply to message #1847283] Fri, 22 October 2021 09:46 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 461
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Hi,

the original issue is not related to UML validation rules, but to the use (by default) of an xtext editor for parameters. This editor allows the user to enter name and type with a single text. But the xtext grammar does not handle spaces in the parameter name (which could be considered as a bug). This editor stores the user input in an invalid text string, if it considers it erroneously., As a workaround, go to the Preferences, then type "Embedded editors" and change the editor type for Parameters from "Advanced" to "Simple Direct Editor".

Ansgar
Re: Question about SysML parameters and EMF [message #1847313 is a reply to message #1847304] Fri, 22 October 2021 11:57 Go to previous messageGo to next message
Rod Naugler is currently offline Rod NauglerFriend
Messages: 65
Registered: September 2016
Member
Another way I have found to avoid the issue is to click into the Name property in the UML Properties tab to enter the name, rather than entering the name in the tree, which is the default placement.
Re: Question about SysML parameters and EMF [message #1847315 is a reply to message #1847313] Fri, 22 October 2021 12:09 Go to previous messageGo to next message
Rod Naugler is currently offline Rod NauglerFriend
Messages: 65
Registered: September 2016
Member
@Carston,

While the behaviour may be in line with the spec WRT including the visibility=public property, I don't believe that Papyrus is performing according to the spec for two reasons:
1. It is inconsistent in applying the property to newly created parameters. I have created 5 parameters for the same activity and the first 3 had the green + (visibility=public) and the next two did not (no visibility property).
2. When an item does not have the visibility property set in the uml, it shows as visibility=public in the Papyrus software.
From an interface perspective, either Papyrus needs to ALWAYS set the property (so the lack of the set property is a bug) OR Papyrus needs to display the visibility property as blank (which is an interface design issue). Presently, whenever a parameter does not have the visibility property present in the UML, you must select something other than Public in the software, and then select Public to have the property set.

Cheers,
Rod
Re: Question about SysML parameters and EMF [message #1847324 is a reply to message #1847315] Fri, 22 October 2021 15:19 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 479
Registered: May 2015
Location: Germany
Senior Member
Hi Rod,

to point 1:
I am quite sure you clicked the visibility field in the three cases visibility is explicitly set and have not clicked it in the other two cases. Papyrus works deterministic in that regard.

to point 2:
Papyrus simply behaves like that because according to 7.8.12.5 "public" is the default.

/Carsten
Re: Question about SysML parameters and EMF [message #1847485 is a reply to message #1847324] Thu, 28 October 2021 16:52 Go to previous message
Rod Naugler is currently offline Rod NauglerFriend
Messages: 65
Registered: September 2016
Member
Thanks Carsten,

WRT Point 2, I think you missed my point. Since 7.8.12.5 defines visibility="public" as the default, and since there is no option to set NULL as the visibility in Papyrus, then the uml should also have visibility="public" present. This would have the software accurately reflect the content of the file. However, since the uml does not need to have the property present (as the software currently sits), AND the model explorer does show the property as unset, then the properties tab should also reflect the setting. From an interface design point of view, I would suggest that the software always include the property in the uml.

I really do appreciate your insights and experience with the software. I don't want to get bogged down in such a little point.

Cheers!

Rod
Previous Topic:Word wrap in long text blocks (Comment Element)?
Next Topic:Deletion of all model data
Goto Forum:
  


Current Time: Fri Apr 26 10:25:13 GMT 2024

Powered by FUDForum. Page generated in 0.04485 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top