Dynamic View
Topic dynamic-view: archidocs guide dynamic-view or get_authoring_guide("dynamic-view").
A Dynamic View shows one scenario as an ordered list of Steps. Each Step resolves to a Relationship that already exists in the Model.
- Scenario. The user describes a scenario (“a shopper checks out”) or names an entry point.
- Trace. Follow the path through the Model with
get_element,find_pathsandget_view, and through code where the Model is silent. Draft the Steps. - Gaps. When a Step has no Relationship to take, propose adding it with
upsert_relationship(seerelationships) and write it once the user agrees. Keep the Step. - Write.
upsert_view(project, id, definition, file?); adefinitionwithstepsis a Dynamic View. - Finish the edit loop;
get_view(id)shows the resolved Steps.
Definition
Section titled “Definition”title, optionaldescription,tags.participants: optional; fixes the order of the lifelines. Otherwise they appear in order of first use. An Element and its own ancestor can’t both take part.steps:[{from, to, relationship?, description?, note?, return?}].- Call:
fromthe consumertothe provider, over a Relationship or a derived edge between them. - Event:
fromthe Publishertoa Subscriber; resolves to the Subscriber’sviasubscription. - Return:
return: trueis the reply to a sync Relationship declaredto→from. An async Relationship has no reply. relationshipnames the Relationship’s id when several match the pair.
- Call:
views: dynamic: checkout: title: Checkout steps: - from: shopper to: web description: Places the order - from: web to: payments:payments-api description: Charges the card - from: web to: payments:payments-api return: true description: Payment confirmed