| 12345678910111213141516171819202122232425262728293031323334 |
- {
- "name": "verify-loop-explicit-loopback",
- "nodes": [
- {"id": "n1", "name": "Trigger", "type": "click-trigger", "position": {"x": 0, "y": 0}, "config": {}},
- {"id": "src", "name": "Src", "type": "code", "position": {"x": 0, "y": 100},
- "config": {"code": "return { items: ['a', 'b', 'c', 'd', 'e'] };"}},
- {"id": "lp", "name": "Loop", "type": "loop", "position": {"x": 0, "y": 200},
- "config": {"inputField": "data.result.items", "itemVariableName": "it", "outputField": "res", "continueOnError": true}},
- {"id": "mark", "name": "Mark", "type": "code", "position": {"x": -100, "y": 300},
- "config": {"code": "return { seen: input.it };"}},
- {"id": "gate", "name": "Gate", "type": "if-condition", "position": {"x": -100, "y": 400},
- "config": {"combineWith": "and", "conditions": [{"field": "data.result.seen", "operator": "equals", "value": "b"}]}},
- {"id": "stopHere", "name": "StopHere", "type": "code", "position": {"x": -250, "y": 500},
- "config": {"code": "return { hit: true };"}},
- {"id": "carryOn", "name": "CarryOn", "type": "code", "position": {"x": 50, "y": 500},
- "config": {"code": "return { next: true };"}},
- {"id": "after", "name": "After", "type": "code", "position": {"x": 200, "y": 300},
- "config": {"code": "const d=(input&&input.data)||{}; return { ran: true, processed: d.totalProcessed };"}}
- ],
- "connections": [
- {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "src", "targetInput": "data"},
- {"sourceNodeId": "src", "sourceOutput": "main", "targetNodeId": "lp", "targetInput": "data"},
- {"sourceNodeId": "lp", "sourceOutput": "loop", "targetNodeId": "mark", "targetInput": "data"},
- {"sourceNodeId": "mark", "sourceOutput": "main", "targetNodeId": "gate", "targetInput": "data"},
- {"sourceNodeId": "gate", "sourceOutput": "true", "targetNodeId": "stopHere", "targetInput": "data"},
- {"sourceNodeId": "gate", "sourceOutput": "false", "targetNodeId": "carryOn", "targetInput": "data"},
- {"sourceNodeId": "carryOn", "sourceOutput": "main", "targetNodeId": "lp", "targetInput": "data"},
- {"sourceNodeId": "lp", "sourceOutput": "done", "targetNodeId": "after", "targetInput": "data"}
- ],
- "expectStatus": "completed",
- "expect": {
- "after": {"status": "completed", "output": {"result": {"ran": true, "processed": 2}}}
- }
- }
|