Relationships
Topic relationships: archidocs guide relationships or get_authoring_guide("relationships").
A Relationship is declared under its consumer and points to the provider it depends on. Declare it at the level you know: Component to Component if the code shows which part calls which, else Service to Service. Edges between higher-level Elements are derived from these.
Write one
Section titled “Write one”upsert_relationship(project, from, to, fields?, id?):
fromis the consumer, in this Project.tois a bare id in this Project orproject:idin another; resolve it withsearch_elements.fields:description(what the consumer uses the provider for, as a verb phrase: “Reads prices from”),technology(“HTTPS/JSON”, “gRPC”, “SQL”),interaction(syncby default, orasync),tags,via,channel.idis needed only to tell apart several Relationships on the same pair; with noidand several on the pair, the tool returnsambiguouswith each candidate’s file:line.
Constraints
Section titled “Constraints”- A Person is only ever a consumer.
- An Element can’t depend on itself, its ancestor or its descendant.
viaandchannelare forasynconly.
Async through a broker
Section titled “Async through a broker”An event Relationship runs through a broker Service (type: broker). The Subscriber declares it, pointing to the Publisher, with interaction: async, via the broker, and channel the topic or queue:
services: emails: name: Emails relationships: - to: orders description: Sends a receipt for each placed order interaction: async via: platform:kafka channel: orders.placedImpact and path queries count the broker as a hop and as a dependency of both sides. An async Relationship with no broker (a webhook, a callback) leaves out via.
Cross-Project
Section titled “Cross-Project”Declare only this Project’s outbound Relationships. When the provider isn’t in the Model, leave the Relationship out and tell the user it is a gap for the provider’s Team; create Elements only in this Project. A provider outside the organisation may be added here as an External Service.