Data Flows
In Codebricks, after defining the schemas for adjacent Usecases, you need to connect properties between these schemas to ensure proper data flow and initialization. Connecting properties allows different parts of your application to interact and share data effectively.
Connecting Properties
To connect properties between schemas:
-
Open Usecase Details Menu:
- Click on a Usecase on the map to open its details.
-
Initiate Connection:
- Click the connection icon next to the property you want to connect.
-
Select Value Source:
- A dialog will open, allowing you to choose from three different value sources:
- Schema
- Static
- Metadata
- A dialog will open, allowing you to choose from three different value sources:
Value Source Types
Schema Value Sources
The Schema Value Source connects a property to a corresponding property in the adjacent schema to the left. This is used when you want to link data directly between schemas.
Value sources are type-sensitive, meaning you can only connect properties of the same data type.
Static Value Sources
The Static Value Source allows you to assign a fixed value to the property. Enter the desired static value directly into the input field provided.
Metadata Value Sources
The Metadata Value Source connects the property to metadata values, such as the aggregate ID or event timestamps. This is useful for incorporating system-generated or context-specific data.
Here is a list of possible Metadata Value Sources for each schema type:
Command
Name | Type | Description |
---|---|---|
Request Authorized user id (API) | Uuid | The user ID from the authorization token. |
Event aggregate id (Policy) | Uuid | The aggregate ID that produced the event. |
Event aggregate version (Policy) | Int | The version of the aggregate that produced the event. |
Event occurred at (Policy) | Datetime | The timestamp when the event occurred. |
Event sequence no (Policy) | Int | The position of the event in the aggregate event stream. |
Aggregate State
Name | Type | Description |
---|---|---|
Event occurred at | Datetime | The timestamp when the event occurred. |
Api Response
Name | Type | Description |
---|---|---|
Aggregate id | Uuid | The aggregate ID that produced the event. |
Aggregate version | Int | The version of the aggregate that produced the event. |
Aggregate changed at | Datetime | The timestamp of the last recorded event. |
Read Model
Name | Type | Description |
---|---|---|
Event Aggregate id (Projection) | Uuid | The aggregate ID that produced the event. |
Event Aggregate version (Projection) | Int | The version of the aggregate that produced the event. |
Event occurred at (Projection) | Datetime | The timestamp when the event occurred. |
Query
Name | Type | Description |
---|---|---|
Request Authorized user id (Query/Command API) | Uuid | The user ID from the authorization token. |
Event Aggregate id (Policy/Projection) | Uuid | The aggregate ID that produced the event. |
Event Aggregate version (Policy/Projection) | Int | The version of the aggregate that produced the event. |
Event occurred at (Policy/Projection) | Datetime | The timestamp when the event occurred. |
To make your setup more efficient, use the copy to button to duplicate properties from one schema to another. This feature copies all properties and automatically establishes connections between them.