Skip to content

Comments

ST6RI-867 Trigger is not shown properly (PlantUML)#689

Merged
seidewitz merged 3 commits intomasterfrom
ST6RI-867
Sep 22, 2025
Merged

ST6RI-867 Trigger is not shown properly (PlantUML)#689
seidewitz merged 3 commits intomasterfrom
ST6RI-867

Conversation

@himi
Copy link
Member

@himi himi commented Sep 7, 2025

The trigger name of Sig below is wrongly rendered as SigOccurrence. This PR fixes it by rendering the first parameter (Sig) only.

    attribute def Sig;
    
    state s1 {
    	state s11;
    	accept Sig then done;
    }

@himi
Copy link
Member Author

himi commented Sep 7, 2025

After the fix, the result above is correctly rendered as Sig.
image

@himi himi requested a review from seidewitz September 7, 2025 15:52
@himi himi added the bug Something isn't working label Sep 7, 2025
@seidewitz seidewitz changed the title [ST6RI-867] Trigger is not shown properly (PlantUML) ST6RI-867 Trigger is not shown properly (PlantUML) Sep 20, 2025
@seidewitz seidewitz self-assigned this Sep 20, 2025
@seidewitz seidewitz added this to the 2025-08 milestone Sep 20, 2025
- In convertToDescription(TransitionUsage), used TransitionUsage
operations, rather than navigating TransitionFeatureMemberships.

- In triggerToText(AcceptActionUsage), constructed text similarly to
in addAcceptActionUsage.
@seidewitz
Copy link
Member

I updated VBehavior::convertToDescription so it uses TransitionUsage operations to get the trigger action, guard expression and effect action. I also updated triggerToText so it is similar to the corresponding code in addAcceptActionUsage, accounting for trigger actions with declared names and receivers. The model

package ST6RI_867 {
    attribute def Sig;
    
    state s0 {
    	state s01;
    	then done;
    }
    state s1 {
    	state s11;
    	accept Sig then done;
    }
    state s2 {
    	state s21;
    	accept s : Sig then done;
    }
    state s3 {
    	state s31;
    	accept Sig via this then done;
    }
}

is now visualized as
image

Please review and let me know if this is acceptable.

@himi
Copy link
Member Author

himi commented Sep 22, 2025

@seidewitz, thank you! That is great, but I found two issues on AcctionActionUsage rendering. So far, we use : to show type name even if it does not have a default name (payload). So for example:

attribute def Sig;
action a0 {
    accept : Sig;
}

is rendered as
image

I want to make it consistent and should we eliminate : if it does not have a default name? (Note that the textual syntax allow both. Both accept :Sig and action Sig are valid syntax and I want to make the notations consistent.)

Also I found if there is no declared name, a proper effective name is not rendered properly:

	attribute def Sig;
	attribute ss : Sig;
    state s1 {
    	state s11;
    	accept :>> ss then done;
    }
Screenshot 2025-09-22 at 1 39 46 PM

I can fix these if we always omit or render : in the case we do not have a proper payload name. appendNameType() is designed to support such case and I want to apply it to trigger's AcceptActionUsage as well.

@seidewitz
Copy link
Member

I can fix these if we always omit or render : in the case we do not have a proper payload name. appendNameType() is designed to support such case and I want to apply it to trigger's AcceptActionUsage as well.

I think it is better to always omit the : if there is not a proper payload name.

  name only.
  (triggetText): Simply use appendNameAndType().
@himi
Copy link
Member Author

himi commented Sep 22, 2025

Thank you. I updated based on your comment:

package ST6RI867 {
	attribute def Sig;
	
	action a0 {
	    accept Sig;
	    accept s:Sig;
	}
	
	    
    state s0 {
    	state s01;
    	then done;
    }
    
    state s1 {
    	state s11;
    	accept Sig then done;
    }


    state s2 {
    	state s21;
    	accept s : Sig then done;
    }
    
    state s3 {
    	state s31;
    	accept Sig via this then done;
    }
    
    
    attribute ss : Sig;
	state s4 {
    	state s41;
    	accept :>> ss then done;
    }
    state s5 {
    	state s51;
    	accept :>> ss : Sig then done;
    }
   
}

is rendered as:
image

Note that we do not show Sig in state s4 example because we do not render inherited type name by default.

Copy link
Member

@seidewitz seidewitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@seidewitz seidewitz merged commit dbc031a into master Sep 22, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants