Closed skeptic-monkey closed 3 years ago
Thanks for trying out the dynamic views @skeptic-monkey 🙂
You can definitely add a self-relationship but you need to first add it on the model, too. Basically, everything that you add to a dynamic view must first exist on the model.
from structurizr import Workspace
workspace = Workspace(
name="Getting Started",
description="This is a model of my software system.",
)
model = workspace.model
user = model.add_person(name="User", description="A user of my software system.")
software_system = model.add_software_system(
name="Software System", description="My software system."
)
software_system.uses(software_system)
dyn_view = workspace.views.create_dynamic_view(element=user, key="my_dynamic_view", description="something")
dyn_view.add(software_system, software_system, "calls Bar()")
Ok, I see. I thought it was "implied" that an element uses itself. But I guess I can live with that solution :)
@Midnighter thanks for the python port of structurizr ! loving it (I hated so much drawing diagrams ...)
Ok, I see. I thought it was "implied" that an element uses itself. But I guess I can live with that solution :)
I can understand that point of view. On the other hand, I think it's good to be explicit about those relationships that are shown in a diagram.
Checklist
Question
Currently if I try to run the following code, it fails per design:
It fails because
A relationship between element2 and element2 does not exist in the model.
In a way, there is an obvious relationship between an element and itself.Could we implement such behavior ? or is against some logic related to C4 model ?