Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions build/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ pub mod shared {
return_type_identifier: None,
r#type: "no".to_string(),
settings: vec![],
starting_node: None,
starting_node_id: 0,
node_functions: vec![],
};

let str_flow = serde_json::to_string(&flow).expect("Serialization failed");
Expand All @@ -33,7 +34,8 @@ pub mod shared {
"return_type_identifier": null,
"data_types": [],
"settings": [],
"starting_node": null
"starting_node_id": 0,
"node_functions": []
});

assert_eq!(json_flow, expected_json);
Expand All @@ -42,15 +44,16 @@ pub mod shared {
#[test]
fn test_deserialize() {
let json_data = r#"{
"flow_id": 0,
"project_id": 0,
"type": "no",
"input_type_identifier": null,
"return_type_identifier": null,
"data_types": [],
"settings": [],
"starting_node": null
}"#;
"flow_id": 0,
"project_id": 0,
"type": "no",
"input_type_identifier": null,
"return_type_identifier": null,
"data_types": [],
"settings": [],
"starting_node_id": 0,
"node_functions": []
}"#;

let deserialized: Result<ValidationFlow, _> = serde_json::from_str(json_data);
assert!(deserialized.is_ok());
Expand All @@ -63,7 +66,8 @@ pub mod shared {
data_types: vec![],
input_type_identifier: None,
return_type_identifier: None,
starting_node: None,
starting_node_id: 0,
node_functions: vec![],
};

assert_eq!(deserialized.unwrap(), expected_flow);
Expand Down
14 changes: 6 additions & 8 deletions proto/shared/shared.flow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ message ValidationFlow {
optional string input_type_identifier = 5;
optional string return_type_identifier = 6;
repeated FlowSetting settings = 7;
NodeFunction starting_node = 8;
int64 starting_node_id = 8;
repeated NodeFunction node_functions = 9;
}

message ExecutionFlow {
// Database ID -> req. for Aquila to identify in FlowStore
int64 flow_id = 1;
NodeFunction starting_node = 2;
int64 starting_node_id = 2;
repeated NodeFunction node_functions = 4;
optional shared.Value input_value = 3;
}

Expand All @@ -41,18 +43,14 @@ message NodeFunction {
int64 database_id = 1;
string runtime_function_id = 2;
repeated NodeParameter parameters = 3;
optional NodeFunction next_node = 4 ;
}

message NodeFunctions {
repeated NodeFunction functions = 1;
optional int64 next_node_id = 4;
}

message NodeValue {
oneof value {
shared.Value literal_value = 1;
ReferenceValue reference_value = 2;
NodeFunctions node_functions = 3;
int64 node_function_id = 3;
}
}

Expand Down