API Diagrams - Component Subsets

It is possible to define subsets of components when you produce api diagrams if you would like to focus in on part of the output.

As an example lets say you have the following components defined within your uda file:

componentAAA componentBBB componentCCC componentDDD componentEEE

When you run the produce_api_diagrams job, the resulting diagram will show all 5 components. What are your options if you only want to see 3 of the 5?

First, you can run job run produce_api_diagrams --component-subset componentAAA componentBBB componentCCC --name subset

This will produce a new api diagram within the same directory the normal diagram is located (if the system in question has 3 languages there will be 3 diagrams within 3 respective language directories) with the name subset.png

Note that the --name flag is always required when using subset arguments, this is to prevent the default diagram from getting overwritten.

However in the case you want to use the name “subset” again, you can pass the --overwrite flag at the cli to overwrite it. Note that this only works with user defined names, and not the default Component API Viewname.


To make things simpler you can also pass in a file with the components you want to subset on already defined, to save you time from having to type them in at the command line.

For example the file

componentEEE componentDDD

 

when passed in to the cli, will produce a diagram with only those two components.

You can do this like this job run produce_api_diagrams --component-subset-file /your/path/to/the/file --name subset

Notice the component-subset-file flag. You pass it the path to the subset file.

The subset file should be formatted with a single component on a new line, for all components desired. It can have any extension and any name. If you wish to comment out components, they will not be used in the subset. For example

componentEEE #componentDDD

will only subset on componentEEE.