Skip to main content

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:

  1. Open Usecase Details Menu:

    • Click on a Usecase on the map to open its details.
  2. Initiate Connection:

    • Click the connection icon next to the property you want to connect.

    Codebricks planner with opened details menu and with a highlight on the connection of two properties.

  3. Select Value Source:

    • A dialog will open, allowing you to choose from three different value sources:
      • Schema
      • Static
      • Metadata

    Codebricks planner with the Value Source Menu open, showing Schema, Static and Metadata options.

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.

note

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

NameTypeDescription
Request Authorized user id (API)UuidThe user ID from the authorization token.
Event aggregate id (Policy)UuidThe aggregate ID that produced the event.
Event aggregate version (Policy)IntThe version of the aggregate that produced the event.
Event occurred at (Policy)DatetimeThe timestamp when the event occurred.
Event sequence no (Policy)IntThe position of the event in the aggregate event stream.

Aggregate State

NameTypeDescription
Event occurred atDatetimeThe timestamp when the event occurred.

Api Response

NameTypeDescription
Aggregate idUuidThe aggregate ID that produced the event.
Aggregate versionIntThe version of the aggregate that produced the event.
Aggregate changed atDatetimeThe timestamp of the last recorded event.

Read Model

NameTypeDescription
Event Aggregate id (Projection)UuidThe aggregate ID that produced the event.
Event Aggregate version (Projection)IntThe version of the aggregate that produced the event.
Event occurred at (Projection)DatetimeThe timestamp when the event occurred.

Query

NameTypeDescription
Request Authorized user id (Query/Command API)UuidThe user ID from the authorization token.
Event Aggregate id (Policy/Projection)UuidThe aggregate ID that produced the event.
Event Aggregate version (Policy/Projection)IntThe version of the aggregate that produced the event.
Event occurred at (Policy/Projection)DatetimeThe timestamp when the event occurred.
tip

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.

Codebricks planner with opened details menu and a highlight the copy to command button.