In this section, we will show how to specify a group of services that share some common attributes and define a rule based on that grouping.
As a simple example let’s group oms and oms-trucking into a mail clients group since both services have flows that send mails through the mailsender service.
Hover the square dashed rectangle icon at the bottom the center pane (under the graph) and click on it until the tooltip shows Default Mode
Draw the square around oms and oms-trucking services, and in the Create Group dialog specify a group name: Mail Clients
In the dialog add a new tag for the group and call it mailclient, then click Save in the Create Group dialog.
Enable showing tags on the graph (like we enabled showing service labels and tech stacks). The graph should be similar to:
Now we can use the new tag applied on the group to create a new architectural rule. Create and dry-run the rule as shown here (apply the rules):
The rule enforces that every service tagged as mailclient must call the mailsender service.