Data Flow
The Data Flow defines how data flows through the different Schemas of an application.
Value Source
The Value Source is defines where the value for a single Schema Property comes from. All Value Sources together define the Data Flow.
There are 3 different types of Value Sources:
- Schema Value Source
- Static Value Source
- Metadata Value Source
Schema Value Source
The Schema Value Source connects two Properties of two different Schemas. The value of the target property is set with the value of the source property.
Example
The image shows the Data Flow between API Request and Command of a Command API use case with 3 Schema Value Sources:
- The value of
request.title
is the source for the value of command.title
- The value of
request.description
is the source for the value of command.description
- The value of
request.assignee id
is the source for the value of command.assignee id
Add
Plan the Schemas of two neighboring Use Case Elements, e.g. like in the image below for an API Request and a Command.
- Click the plus button on the right of a property, e.g. 'title'.
- Select the Value Source type 'Schema'.
Value Source Schema property
- Select a property from the source schema, e.g. 'add task.title'.
It is only possible to select properties with the same type.
- Click the checkmark icon to save the Schema Value Source.
- Click the cross cancel the Schema Value Source creation.
Command with Schema Value Sources of API Request
Copy Value Source
Copy a Schema offers a fast way to duplicate properties from a schema to an other neighboring schema.
All properties of the copied schema have a Schema Value Source of the original schema property.
See Copy a Schema for more details.
Static Value Source
The Static Value Source connects a Schema Property with a static value. The value of the target property is set with a defined static value.
Add
Plan the Schema a Use Case Element, e.g. like in the image below for an Aggregate State.
- Click the plus button on the right of a property, e.g. 'task id'.
- Select the Value Source type 'Static'.
Value Source Metadata property
- Type or select the static value, e.g. 'open'.
The data types string, uuid, int and decimal provide an input to type a static value.
The data types bool, Datetime and enum provide picker to select a static value.
- Click the checkmark icon to save the Static Value Source.
- Click the cross cancel the Static Value Source creation.
Aggregate State with Static Value Source for the 'task status' property
The Static Value Source connects the value of a Metadata of an Use Case Element value with a Schema Property of another Use Case Element. The value of the target property is set with a metadata property of the source Use Case Element.
Add
Plan the Schemas of two neighboring Use Case Elements, e.g. like in the image below for an Aggregate State and an API Response.
- Click the plus button on the right of a property, e.g. 'task id'.
- Select the Value Source type 'Metadata'.
Value Source Metadata property
- Select the Value Source Metadata property, e.g. 'task.aggregate id'.
- Click the checkmark icon to save the Schema Value Source.
- Click the cross cancel the Schema Value Source creation.
API Response with Metadata Value Source for the 'task id' property
Options
An overview of all possible Metadata Value Source Options
Command API
For Command Schema properties:
- API Request: Authorized user id:
Uuid
- The user ID from the authorization token.
For Aggregate State properties:
- Event: Occurred at:
Datetime
- The timestamp when the event occurred.
For API Response properties:
- Aggregate: Id:
Uuid
- The aggregate ID that produced the event.
- Aggregate: Version:
Int
- The new aggregate version the event created.
- Aggregate: Changed at:
Datetime
- The timestamp of the last recorded event.
Command Policy
For Command properties:
- Event: Aggregate id:
Uuid
- The aggregate ID that produced the event.
- Event: Aggregate version:
Int
- The new aggregate version the event created.
- Event: Occurred at:
Datetime
- The timestamp when the event occurred.
- Event: Sequence no:
Int
- The position of the event in the aggregate event stream.
For Aggregate State properties:
- Event: Occurred at:
Datetime
- The timestamp when the event occurred.
Projection
For Readmodel properties:
- Event: Aggregate id:
Uuid
- The aggregate ID that produced the event.
- Event: Aggregate version:
Int
- The new aggregate version the event created.
- Event: Occurred at:
Datetime
- The timestamp when the event occurred.
- Event: Sequence no:
Int
- The position of the event in the aggregate event stream.
For Readmodel conditions:
- Event: Aggregate id:
Uuid
- The aggregate ID that produced the event.
- Event: Aggregate version:
Int
- The new aggregate version the event created.
- Event: Occurred at:
Datetime
- The timestamp when the event occurred.
- Event: Sequence no:
Int
- The position of the event in the aggregate event stream.
For Source Readmodel conditions:
- Event: Aggregate id:
Uuid
- The aggregate ID that produced the event.
- Event: Aggregate version:
Int
- The new aggregate version the event created.
- Event: Occurred at:
Datetime
- The timestamp when the event occurred.
- Event: Sequence no:
Int
- The position of the event in the aggregate event stream.
Query API
For Source Readmodel conditions:
- API Request: Authorized user id:
Uuid
- The user ID from the authorization token.
Delete Value Source
- Click the cross button on the right of a property value source, e.g. 'add task.title'.
API Request and Command with deleted Schema Value Source of 'title' property