-
Notifications
You must be signed in to change notification settings - Fork 29
ST6RI-842: Support shorthand notations (PlantUML) #647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
* VDefault (casePerformActionUsage, caseExhibitStateUsage, caseExhibitStateUsage, caseIncludeUseCaseUsage): Use shorthand notation if possible * VStructure (caseSatisfyRequirementUsage): if hasRefSubsettingWithoutDeclaredName(), render a node for the SatisfyRequirementUsage. * SysML2PlantUMLStyle (StyleRelDefaultSwitch): Added arrow styles for shorthand notations.
(isEmptyObjective, isEmpty): Added (addShorthandRelation): Use isEmpty(). * VCompartment (caseObjectiveMembership): Do not render empty objectives. * VTree (caseObjectiveMembership): Likewise
We can use shorthand notations with the simple cases:
|
If such features owns any meaningful (excluding empty subjects or objectives) members, shorthand notations are not used:
|
I also fixed an issue on SatisfyRequirementUsage. Previously, the visualizer did not render
|
BTW, I found a weird behaviour on
|
relationship * VDefault (isEmptySubject, isEmptyObjective): Check if the name is null.
Yes, this is the intended behavior. It is because one intended style of event occurrence usages is to have them refer to the source and target events of messages (e.g., |
In your That is, none of the event occurrence usages, perform action usages or exhibit usages appear. I think this is misleading. I would expect some form of "cumbersome" notation to be used to show them. For example, if I change However, if I remove the name |
@seidewitz thank you for the feedback. I agree. I will fix it tonight. Update: I could fix it but I need to add explanations because it's complicated than what I had expected. I will write them tomorrow. |
If a perform action usage (or similar) has additional specializations (e.g., Also, there actually is a specific graphical notation for reference subsetting. From 8.2.3.6 Definition and Usage Graphical Notation: Can this be used in the "cumbersome" notation to make it clear what the referenced feature is? This is particularly relevant when the perform action usage has other kinds of subsettings, too. |
Agreed. I want to fix it as well.
Unfortunately, this requires the update to PlantUML itself. So I plan to support such new symbols in a different schedule. |
not exist in the rendering result, we render a distinct node (cumbersome notation).
* VDefault (isEmpty): Check Specialization except for ReferenceSubsetting (addShorthandRelation): Use toBeRendered() to check if the target is rendered.
…ceUsage, caseIncludeUseCaseUsage): Show <<event>> or <<include>> when hasRefSubsettingWithoutDeclaredName() is true like perform and exhibit.
@seidewitz, thank you for your review. I'd missed it and have just fixed it. |
The event symbols still show |
It is just printing the result of I just come up with an idea. When |
I guess the graphical notation for this is really not clear in the specification. My understanding was that for symbols using the keywords On the other hand, I agree that it also makes sense to interpret the name compartment of a usage symbol as always showing the (effective) name of that usage. So, I understand your idea of showing So, I would suggest either using Obviously we should clear this up in the specification in the future, probably when we formalize the mapping from the GBNF to the abstract syntax. |
I'm getting to understand your point. These nodes representing |
I am not quite sure what you are proposing. As I noted previously, if you include |
My point is that I want to use a special graphical notation for these nodes to specify it is not usual. Anyway, it's much better to use a simple notation and I will use a usual round rentable notation in this PR without further agreement. Do you agree that we use a referencing feature name or feature chain names with |
Yes, I agree. |
hasRefSubsettingWithoutDeclaredName() (addNameWithId): If it's a special reference, use the reference name. (getNameWithNamespace): Allow enclosingNs to be null. * VStructure (hasRefSubsettingWithoutDeclaredName): Removed. (extractTitleName): Use getSpecialReference() instead of hasRefSubsettingWithoutDeclaredName(). (caseSatisfyRequirementUsage): Ditto. * SysML2PlantUMLStyle.StyleStereotypeDefaultSwitch: Ditto.
This PR renders shorthand notations for
PerformActionUsage
,ExhibitStateUsage
,EventOccurrenceUsage
, andIncludeUsecase
. In the example below, we can use just an arrow with<<perform>>
label from p1 to a0 to renderPerformActionUsage
without rendering a distinct node for it.However, we cannot use this notation if
PerformActionUsage
is referred to by others or if it has its own members, because we cannot properly render this information without a distinct node. We render a cumbersome notation with a distinct node in such cases.