Change representation of subgraph connections
CreateData() -> (A, B)
MyPrint(A=None, B=None)
# graph.json
{
"graph": {"name": "graph"}
"nodes": [{"id": "create_data", "task_type": "class", "task_identifier": "CreateData"}
{"id": "node1", "task_type": "graph", "task_identifier": "/tmp/subgraph.json"}]
"links": [{"source": "create_data",
"target": "node1",
"arguments": {"A": "A", "B": "B"},
"conditions": {"A": 10}
}]
}
# subgraph.json
{
"graph": {"name": "subgraph", "inputs": , "inputs":{
"A": {"id":"node1", "argument":"A"}
"B": {"id":"node1", "argument":"B"}}}
"nodes": [{"id": "node1", "task_type": "graph", "task_identifier": "/tmp/subsubgraph.json"}]
}
# subsubgraph.json
{
"graph": {"name": "subsubgraph", "inputs": {"A": {"id":"print1", "argument":"A"}
"B": {"id":"print2", "argument":"B"}}}
"nodes": [{"id": "print1", "task_type": "class", "task_identifier": "MyPrint"},
{"id": "print2", "task_type": "class", "task_identifier": "MyPrint"}]
}
After parsing:
# graph.json
{
"graph": {"name": "graph"}
"nodes": [{"id": "create_data", "task_type": "class", "task_identifier": "CreateData"}
{"id": ["subgraph", ["subsubgraph", "print1"]], "task_type": "class", "task_identifier": "MyPrint"},
{"id": ["subgraph", ["subsubgraph", "print2"]], "task_type": "class", "task_identifier": "MyPrint"}]
"links": [{"source": "create_data",
"target": ["subgraph", ["subsubgraph", "print1"]],
"arguments": {"A": "A"},
"conditions": {"A": 10}
},
{"source": "create_data",
"target": ["subgraph", ["subsubgraph", "print2"]],
"arguments": {"B": "B"},
"conditions": {"A": 10}
}]
}
Edited by Wout De Nolf