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
3 changes: 3 additions & 0 deletions app/services/namespaces/projects/flows/create_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ def create_node_function(node_function_id, input_nodes, t)
next
end

# This will be broken, because we cant reference nodes that arent created yet
# And we will need to put all parameter nodes inside the flowinput.nodes
# So we can reference them here because we will not recursively search for them
referenced_node = NodeFunction.joins(:runtime_function).find_by(
id: parameter.value.reference_value.node_function_id.model_id,
runtime_function_definitions: { runtime_id: namespace_project.primary_runtime.id }
Expand Down
3 changes: 3 additions & 0 deletions app/services/namespaces/projects/flows/update_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ def update_node_parameters(t, current_node, current_node_input, all_nodes)
t
)

# This will be broken, because we cant reference nodes that arent created yet
# And we will need to put all parameter nodes inside the flowinput.nodes
# So we can reference them here because we will not recursively search for them
referenced_node = NodeFunction.joins(:runtime_function).find_by(
id: parameter.value.reference_value.node_function_id.model_id,
runtime_function_definitions: { runtime_id: flow.project.primary_runtime.id }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
flow: {
name: generate(:flow_name),
type: flow_type.to_global_id.to_s,
startingNodeId: 'gid://sagittarius/NodeFunction/999',
startingNodeId: 'gid://sagittarius/NodeFunction/1000',
settings: {
flowSettingIdentifier: 'key',
value: {
Expand All @@ -68,23 +68,46 @@
},
nodes: [
{
id: 'gid://sagittarius/NodeFunction/999',
id: 'gid://sagittarius/NodeFunction/1000',
runtimeFunctionId: runtime_function.to_global_id.to_s,
parameters: [
runtimeParameterDefinitionId: runtime_function.parameters.first.to_global_id.to_s,
value: {
literalValue: 'test_value',
functionValue: {
id: 'gid://sagittarius/NodeFunction/2000',
runtimeFunctionId: runtime_function.to_global_id.to_s,
nextNodeId: nil,
parameters: [
{
runtimeParameterDefinitionId: runtime_function.parameters.first.to_global_id.to_s,
value: {
literalValue: 100,
},
}
],
},
}
],
nextNodeId: 'gid://sagittarius/NodeFunction/991',
nextNodeId: 'gid://sagittarius/NodeFunction/1001',
},
{
id: 'gid://sagittarius/NodeFunction/991',
id: 'gid://sagittarius/NodeFunction/1001',
runtimeFunctionId: runtime_function.to_global_id.to_s,
parameters: [
runtimeParameterDefinitionId: runtime_function.parameters.first.to_global_id.to_s,
value: {
literalValue: 'test_value2',
# https://github.com/code0-tech/sagittarius/issues/756
literalValue: 42,
# referenceValue: {
# depth: 1,
# node: 1,
# scope: [],
# referencePath: [],
# nodeFunctionId: 'gid://sagittarius/NodeFunction/2000',
# dataTypeIdentifier: {
# genericKey: 'K',
# },
# },
}
],
}
Expand Down