Skip to content

Commit 73d91ce

Browse files
authored
Merge pull request #97 from code0-tech/add-comments
fix: add comments for clarity in data type and flow definitions
2 parents a0e663c + 3152369 commit 73d91ce

File tree

2 files changed

+88
-1
lines changed

2 files changed

+88
-1
lines changed

proto/shared/shared.data_type.proto

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,16 @@ message DataTypeIdentifier {
101101
}
102102

103103
message GenericType {
104+
// References a data type by its identifier
104105
string data_type_identifier = 1;
105106
repeated GenericMapper generic_mappers = 2;
106107
}
107108

109+
// target get mapped to source
108110
message GenericMapper {
109111
// can point to another generic or to a resolved data type
112+
// Assigns source to this source
110113
DataTypeIdentifier source = 1;
111-
// can only be a generic key
114+
// can only be a generic key for example: 'T', 'V'
112115
string target = 2;
113116
}

proto/shared/shared.flow.proto

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,34 @@ message Flow {
1111
// Database ID -> req. for Aquila to identify in FlowStore
1212
int64 flow_id = 1;
1313
int64 project_id = 2;
14+
// The FlowType´s identifier
1415
string type = 3;
16+
// All custom data types used in this flow
1517
repeated shared.DataType data_types = 4;
18+
// These reference data_types by its identifiers, which is are string
1619
optional string input_type_identifier = 5;
1720
optional string return_type_identifier = 6;
1821
repeated FlowSetting settings = 7;
1922
NodeFunction starting_node = 8;
2023
}
2124

2225
message FlowSetting {
26+
// The database id from sagittarius
2327
int64 database_id = 1;
2428
string flow_setting_id = 2;
2529
shared.Struct object = 3;
2630
}
2731

2832
message NodeFunction {
33+
// The database id from sagittarius
2934
int64 database_id = 1;
3035
string runtime_function_id = 2;
3136
repeated NodeParameter parameters = 3;
3237
optional NodeFunction next_node = 4 ;
3338
}
3439

3540
message NodeParameter {
41+
// The database id from sagittarius
3642
int64 database_id = 1;
3743
string runtime_parameter_id = 2;
3844
oneof value {
@@ -44,9 +50,85 @@ message NodeParameter {
4450

4551
message ReferenceValue {
4652
DataTypeIdentifier type_identifier = 1;
53+
54+
/*
55+
{primary}:{secondary}:{tertiary}
56+
57+
0:0 0:1 0:2 0:3
58+
Node1 -> Node2 -> Node3 -> Node4
59+
60+
all executed after each other (horizontal):
61+
- Secondary level
62+
63+
0:1 0:1:0
64+
Node2(NodeA):
65+
66+
1:0 1:0:0 1:0:1 1:1
67+
NodeA(NodeX, b) -> NodeB
68+
69+
2:0 2:0:0
70+
NodeX( x )
71+
72+
Vertical -> primary level
73+
74+
tertiary level is optional and references parameter in a node
75+
{vertical}:{horizontal}:{parameter}
76+
*/
4777
int32 primary_level = 2;
4878
int32 secondary_level = 3;
4979
optional int32 tertiary_level = 4;
80+
81+
/*
82+
User:
83+
name: string
84+
email: string
85+
housing_locations: Array[Location]
86+
87+
Location:
88+
street: string
89+
number: integer
90+
91+
0:1
92+
Node2:
93+
1:0 1:0:0
94+
NodeA(user)
95+
96+
user is the reference 1:0:0
97+
98+
To reference fields in the referenced object we use reference paths.
99+
100+
To reference the email:
101+
102+
{
103+
"primary_level": 1,
104+
"secondary_level": 0,
105+
"tertiary_level": 0,
106+
paths: [
107+
{
108+
"path": ".email",
109+
}
110+
]
111+
}
112+
113+
----
114+
115+
To reference the first street:
116+
117+
{
118+
"primary_level": 1,
119+
"secondary_level": 0,
120+
"tertiary_level": 0,
121+
paths: [
122+
{
123+
"path": ".housing_locations",
124+
"array_index": 0
125+
},
126+
{
127+
"path": ".street"
128+
}
129+
]
130+
}
131+
*/
50132
repeated ReferencePath paths = 5;
51133
}
52134

@@ -55,6 +137,8 @@ message ReferencePath {
55137
optional int64 array_index = 2;
56138
}
57139

140+
// Used in sagittarius´s FlowService because oneof can only
141+
// take in a single message type and not a repeated one
58142
message Flows {
59143
repeated Flow flows = 1;
60144
}

0 commit comments

Comments
 (0)