How can a PlantUML document indicate a chart type?

As far as I can tell, PlantUML automatically determines the type of chart for a given document (sequence chart, Usecase chart, class chart, activity chart, etc.). This seems to work quite well, but sometimes I find that by editing the diagram, I will make some minor changes, and suddenly my activity diagram will become a class diagram (for example).

I would like to tell PlantUML what a chart type is and compile if the syntax is not valid for the selected chart type, but I could not find anything similar in the PlantUML documentation. Does such a chart type identifier exist?

+4
source share
1 answer

The easiest way is to start the description of the chart with what is characteristic of only one type of chart.

eg. if I had the following line

A --> B
  • For class diagram, I could add class Abefore this
  • For an activity chart, I could change it to A -->[ ] B
  • For a sequence diagram, I could add participant Abefore this

and etc.

In any case, the visualization has not changed - I add only what will be added automatically in any case.

+1
source

Source: https://habr.com/ru/post/1611352/


All Articles