diff --git a/src/samples/POC_userTask.json b/src/samples/POC_userTask.json new file mode 100644 index 00000000..6049c321 --- /dev/null +++ b/src/samples/POC_userTask.json @@ -0,0 +1,135 @@ +{ + "name":"testUserTask", + "description":"Start a flow, commit activity and verify timeout", + "blueprint_spec":{ + "requirements":[ + "core" + ], + "prepare":[ + + ], + "nodes":[ + { + "id":"1", + "type":"Start", + "name":"Start flow action", + "next":"2", + "parameters":{ + "input_schema":{ + "type":"object", + "properties":{ + "flow":{ + "type":"object", + "properties":{ + "action":{ + "type":"string" + } + } + } + } + } + }, + "required":[ + "flow" + ], + "lane_id":"everyone" + }, + { + "id":"2", + "name":"VERIFY-ACTION", + "next":{ + "START":"3", + "CONTINUE":"3", + "default":"5" + }, + "type":"Flow", + "lane_id":"everyone", + "parameters":{ + "input":{ + "action":{ + "$ref":"bag.flow.action" + } + } + } + }, + { + "id":"3", + "type":"UserTask", + "name":"CHOOSE-ACTION", + "next":"4", + "lane_id":"everyone", + "parameters":{ + "action":"PROVIDE_NEXT_ACTION", + "input":{ + "current_action":{ + "$ref":"bag.flow.action" + } + }, + "activity_manager":"commit", + "activity_schema":{ + "type":"object", + "properties":{ + + }, + "required":[ + "current_action" + ] + } + } + }, + { + "id":"4", + "name":"SAVE-ACTION", + "next":"5", + "type":"SystemTask", + "category":"setToBag", + "lane_id":"everyone", + "parameters":{ + "input":{ + "flow":{ + "action":{ + "$ref":"result.activities[0].data.qty" + } + } + } + } + }, + { + "id":"5", + "type":"Flow", + "name":"VERIFY-TIMEOUT", + "next":{ + "true":"6", + "default":"3" + }, + "lane_id":"everyone", + "parameters":{ + "input":{ + "is_timeout":{ + "$ref":"result.activities[0].is_continue" + } + } + } + }, + { + "id":"6", + "type":"Finish", + "name":"Finish Praise", + "next":null, + "lane_id":"everyone" + } + ], + "lanes":[ + { + "id":"everyone", + "name":"free lane", + "rule":{ + "$js":"({actor_data, bag}) => true" + } + } + ], + "environment":{ + + } + } +} diff --git a/src/samples/blueprints/POC_userTask.json b/src/samples/blueprints/POC_userTask.json new file mode 100644 index 00000000..fa6ef085 --- /dev/null +++ b/src/samples/blueprints/POC_userTask.json @@ -0,0 +1,117 @@ +{ + "name": "testUserTask", + "description": "Start a flow, commit activity and verify timeout", + "blueprint_spec": { + "requirements": ["core"], + "prepare": [], + "nodes": [ + { + "id": "1", + "type": "Start", + "name": "Start flow action", + "next": "2", + "parameters": { + "input_schema": { + "type": "object", + "properties": { + "flow": { + "type": "object", + "properties": { + "action": { "type": "string" } + } + } + } + } + }, + "required": ["flow"], + "lane_id": "everyone" + }, + { + "id": "2", + "name": "VERIFY-ACTION", + "next": { + "START": "3", + "CONTINUE": "3", + "default": "5" + }, + "type": "Flow", + "lane_id": "everyone", + "parameters": { + "input": { + "action": { + "$ref": "bag.flow.action" + } + } + } + }, + { + "id": "3", + "type": "UserTask", + "name": "CHOOSE-ACTION", + "next": "4", + "lane_id": "everyone", + "parameters": { + "action": "PROVIDE_NEXT_ACTION", + "input": { + "current_action": { "$ref": "bag.flow.action" } + }, + "activity_manager": "commit", + "activity_schema": { + "type": "object", + "properties": {}, + "required": ["current_action"] + } + } + }, + { + "id":"4", + "name":"SAVE-ACTION", + "next":"5", + "type":"SystemTask", + "category":"setToBag", + "lane_id":"everyone", + "parameters":{ + "input":{ + "flow":{ + "action": { + "$ref": "result.activities[0].data.qty" + } + } + } + } + }, + { + "id": "5", + "type": "Flow", + "name": "VERIFY-TIMEOUT", + "next": { + "true": "6", + "default": "3" + }, + "lane_id": "everyone", + "parameters": { + "input": { + "is_timeout": { + "$ref": "result.activities[0].is_continue" + } + } + } + }, + { + "id": "6", + "type": "Finish", + "name": "Finish Praise", + "next": null, + "lane_id": "everyone" + } + ], + "lanes": [ + { + "id": "everyone", + "name": "free lane", + "rule": {"$js": "({actor_data, bag}) => true"} + } + ], + "environment": {} + } +} diff --git a/src/samples/blueprints/activitySchemaValidation.json b/src/samples/blueprints/activitySchemaValidation.json new file mode 100644 index 00000000..f4602581 --- /dev/null +++ b/src/samples/blueprints/activitySchemaValidation.json @@ -0,0 +1,75 @@ +{ + "name":"schemaValidation", + "description":"workflow to test activity schema validation", + "blueprint_spec":{ + "requirements":[ + "core" + ], + "prepare":[ + + ], + "nodes":[ + { + "id":"1", + "type":"Start", + "name":"Start node", + "next":"2", + "parameters":{ + "input_schema":{ + + } + }, + "lane_id":"1" + }, + { + "id":"2", + "type":"UserTask", + "name":"User Task node", + "next":"3", + "lane_id":"1", + "parameters":{ + "action":"do something", + "input":{ + + }, + "activity_schema":{ + "type":"object", + "properties":{ + "date":{ + "type":"string", + "format":"date" + } + }, + "required":[ + "date" + ] + } + } + }, + { + "id":"3", + "type":"Finish", + "name":"Finish node", + "next":null, + "lane_id":"1" + } + ], + "lanes":[ + { + "id":"1", + "name":"the_only_lane", + "rule":[ + "fn", + [ + "&", + "args" + ], + true + ] + } + ], + "environment":{ + + } + } +} diff --git a/src/samples/blueprints/basic.json b/src/samples/blueprints/basic.json new file mode 100644 index 00000000..bce856c2 --- /dev/null +++ b/src/samples/blueprints/basic.json @@ -0,0 +1,50 @@ +{ + "name":"basic", + "description":"system workflow", + "blueprint_spec":{ + "requirements":[ + "core" + ], + "prepare":[ + + ], + "nodes":[ + { + "id":"1", + "type":"Start", + "name":"Start node", + "parameters":{ + "input_schema":{ + + } + }, + "next":"2", + "lane_id":"1" + }, + { + "id":"2", + "type":"Finish", + "name":"Finish node", + "next":null, + "lane_id":"1" + } + ], + "lanes":[ + { + "id":"1", + "name":"the_only_lane", + "rule":[ + "fn", + [ + "&", + "args" + ], + true + ] + } + ], + "environment":{ + + } + } +} diff --git a/src/samples/blueprints/customNode.json b/src/samples/blueprints/customNode.json new file mode 100644 index 00000000..69358e65 --- /dev/null +++ b/src/samples/blueprints/customNode.json @@ -0,0 +1,78 @@ +{ + "name":"custom node workflow", + "description":"custom workflow", + "blueprint_spec":{ + "requirements":[ + "core" + ], + "prepare":[ + + ], + "nodes":[ + { + "id":"1", + "type":"Start", + "name":"Start node", + "next":"2", + "parameters":{ + "input_schema":{ + + } + }, + "lane_id":"1" + }, + { + "id":"2", + "type":"SystemTask", + "category":"CustomTask", + "name":"Custom task", + "next":"3", + "lane_id":"1", + "parameters":{ + "input":{ + + } + } + }, + { + "id":"3", + "type":"UserTask", + "name":"User Task node", + "next":"4", + "lane_id":"1", + "parameters":{ + "action":"do something", + "input":{ + "internal_key":"result.custom_data", + "outr":"valor", + "qualqer":"coisa" + } + } + }, + { + "id":"4", + "type":"Finish", + "name":"Finish node", + "next":null, + "lane_id":"1" + } + ], + "lanes":[ + { + "id":"1", + "name":"the_only_lane", + "rule":[ + "fn", + [ + "&", + "args" + ], + true + ] + } + ], + "environment":{ + + } + } +} diff --git a/src/samples/blueprints/environmentVariables.json b/src/samples/blueprints/environmentVariables.json new file mode 100644 index 00000000..3592526b --- /dev/null +++ b/src/samples/blueprints/environmentVariables.json @@ -0,0 +1,50 @@ +{ + "name":"environment_variables", + "description":"system workflow with environment variables", + "blueprint_spec":{ + "requirements":[ + "core" + ], + "prepare":[ + + ], + "nodes":[ + { + "id":"1", + "type":"Start", + "name":"Start node", + "parameters":{ + "input_schema":{ + + } + }, + "next":"2", + "lane_id":"1" + }, + { + "id":"2", + "type":"Finish", + "name":"Finish node", + "next":null, + "lane_id":"1" + } + ], + "lanes":[ + { + "id":"1", + "name":"the_only_lane", + "rule":[ + "fn", + [ + "&", + "args" + ], + true + ] + } + ], + "environment":{ + "TEST_VARIABLE":"KOA_LOG_LEVEL" + } + } +} diff --git a/src/samples/blueprints/findProcess.json b/src/samples/blueprints/findProcess.json new file mode 100644 index 00000000..59659afa --- /dev/null +++ b/src/samples/blueprints/findProcess.json @@ -0,0 +1,76 @@ +{ + "name":"find_process", + "description":"workflow for testing find process", + "blueprint_spec":{ + "requirements":[ + "core" + ], + "prepare":[ + + ], + "nodes":[ + { + "id":"1", + "type":"Start", + "name":"Start node", + "next":"2", + "parameters":{ + "input_schema":{ + "type":"object", + "properties":{ + "entity_id":{ + "type":"string" + } + }, + "required":[ + "entity_id" + ] + } + }, + "lane_id":"1" + }, + { + "id":"2", + "type":"systemTask", + "category":"findProcess", + "name":"Find Process", + "next":"3", + "lane_id":"1", + "parameters":{ + "input":{ + "entity_id":{ + "$ref":"bag.entity_id" + } + } + } + }, + { + "id":"3", + "type":"Finish", + "name":"Finish node", + "next":null, + "lane_id":"1" + } + ], + "lanes":[ + { + "id":"1", + "name":"the_only_lane", + "rule":[ + "fn", + [ + "&", + "args" + ], + true + ] + } + ], + "environment":{ + + } + } +} + + + diff --git a/src/samples/blueprints/indexProcess.json b/src/samples/blueprints/indexProcess.json new file mode 100644 index 00000000..a5adca48 --- /dev/null +++ b/src/samples/blueprints/indexProcess.json @@ -0,0 +1,83 @@ +{ + "name":"index_process", + "description":"workflow for testing indexNode", + "blueprint_spec":{ + "requirements":[ + "core" + ], + "prepare":[ + + ], + "nodes":[ + { + "id":"1", + "type":"Start", + "name":"Start node", + "next":"2", + "parameters":{ + "input_schema":{ + "type":"object", + "properties":{ + "entity_type":{ + "type":"string" + }, + "entity_id":{ + "type":"string" + } + }, + "required":[ + "entity_type", + "entity_id" + ] + } + }, + "lane_id":"1" + }, + { + "id":"2", + "type":"systemTask", + "category":"createIndex", + "name":"Index Process", + "next":"3", + "lane_id":"1", + "parameters":{ + "input":{ + "entity_type":{ + "$ref":"bag.entity_type" + }, + "entity_id":{ + "$ref":"bag.entity_id" + } + } + } + }, + { + "id":"3", + "type":"Finish", + "name":"Finish node", + "next":null, + "lane_id":"1" + } + ], + "lanes":[ + { + "id":"1", + "name":"the_only_lane", + "rule":[ + "fn", + [ + "&", + "args" + ], + true + ] + } + ], + "environment":{ + + } + } +} + + + diff --git a/src/samples/blueprints/notifyUserTask.json b/src/samples/blueprints/notifyUserTask.json new file mode 100644 index 00000000..9b422a42 --- /dev/null +++ b/src/samples/blueprints/notifyUserTask.json @@ -0,0 +1,79 @@ +{ + "name":"notify_task", + "description":"user notify task workflow", + "blueprint_spec":{ + "requirements":[ + + ], + "prepare":[ + + ], + "nodes":[ + { + "id":"1", + "type":"Start", + "name":"Start node", + "next":"2N", + "parameters":{ + "input_schema":{ + + } + }, + "lane_id":"1" + }, + { + "id":"2N", + "type":"UserTask", + "name":"User Task node", + "next":"3X", + "lane_id":"1", + "parameters":{ + "activity_manager":"notify", + "action":"notify something", + "input":{ + + } + } + }, + { + "id":"3X", + "type":"UserTask", + "name":"User Task node", + "next":"4E", + "lane_id":"1", + "parameters":{ + "action":"do something", + "input":{ + + } + } + }, + { + "id":"4E", + "type":"Finish", + "name":"Finish node", + "next":null, + "lane_id":"1" + } + ], + "lanes":[ + { + "id":"1", + "name":"the_only_lane", + "rule":[ + "fn", + [ + "&", + "args" + ], + true + ] + } + ], + "environment":{ + + } + } +} + + diff --git a/src/samples/blueprints/precious.json b/src/samples/blueprints/precious.json new file mode 100644 index 00000000..0fbe14d9 --- /dev/null +++ b/src/samples/blueprints/precious.json @@ -0,0 +1,502 @@ +{ + "name": "PRECIOUS", + "description": "BP para testar outras BPs", + "blueprint_spec": { + "lanes": [ + { + "id": "1", + "name": "theOnlyLane", + "rule": [ + "fn", + [ + "&", + "args" + ], + true + ] + } + ], + "nodes": [ + { + "id": "1", + "name": "start PRECIOUS", + "next": "CONFIG", + "type": "Start", + "lane_id": "1", + "parameters": { + "input_schema": {} + } + }, + { + "id": "CONFIG", + "name": "bag creatorId", + "next": "TOKEN", + "type": "SystemTask", + "lane_id": "1", + "category": "setToBag", + "parameters": { + "input": { + "bpName": "PRECIOUS-TEST-SAMPLE", + "expectedNode": "", + "expectedEnd": "finished", + "submittedInfo": "", + "expectedHistory": [ + "1", + "1", + "GENERATE-NUMBER", + "CHECK-NUMBER", + "ALERT-USER-BIG-NUMBER", + "WAIT-10", + "TEST-COINGECKO-API", + "CHECK-COINGECKO-API-RESPONSE", + "COINGECKO-OK", + "END-SUCCESS-COINGECKO" + ] + } + } + }, + { + "id": "TOKEN", + "name": "get token", + "next": "TOKEN-RESPONSE", + "type": "SystemTask", + "lane_id": "1", + "category": "HTTP", + "parameters": { + "input": {}, + "request": { + "url": "http://localhost:3000/token", + "verb": "POST", + "headers": {} + } + } + }, + { + "id": "TOKEN-RESPONSE", + "name": "check token response", + "next": { + "200": "TOKEN-BAG", + "default": "TOKEN-RESPONSE-END-ERROR" + }, + "type": "Flow", + "lane_id": "1", + "parameters": { + "input": { + "status": { + "$ref": "result.status" + } + } + } + }, + { + "id": "TOKEN-BAG", + "name": "bag token", + "next": "PROCESS", + "type": "SystemTask", + "lane_id": "1", + "category": "SetToBag", + "parameters": { + "input": { + "token": { + "$ref": "result.data.jwtToken" + } + } + } + }, + { + "id": "PROCESS", + "name": "start process by workflow name\"", + "next": "PROCESS-RESPONSE", + "type": "SystemTask", + "lane_id": "1", + "category": "HTTP", + "parameters": { + "input": {}, + "request": { + "url": { + "$mustache": "http://localhost:3000/workflows/name/{{bag.bpName}}/start" + }, + "verb": "POST", + "headers": { + "Authorization": { + "$mustache": "Bearer {{bag.token}}" + } + } + } + } + }, + { + "id": "PROCESS-RESPONSE", + "name": "check process response", + "next": { + "201": "PROCESS-ID-BAG", + "default": "PROCESS-RESPONSE-END-ERROR" + }, + "type": "Flow", + "lane_id": "1", + "parameters": { + "input": { + "status": { + "$ref": "result.status" + } + } + } + }, + { + "id": "PROCESS-ID-BAG", + "name": "bag process id", + "next": "CURRENT-STATE", + "type": "SystemTask", + "lane_id": "1", + "category": "SetToBag", + "parameters": { + "input": { + "processId": { + "$ref": "result.data.process_id" + } + } + } + }, + { + "id": "CURRENT-STATE", + "name": "get current state of workflow process", + "next": "CURRENT-STATE-RESPONSE", + "type": "SystemTask", + "lane_id": "1", + "category": "HTTP", + "parameters": { + "input": {}, + "request": { + "url": { + "$mustache": "http://localhost:3000/processes/{{bag.processId}}/state" + }, + "verb": "GET", + "headers": { + "Authorization": { + "$mustache": "Bearer {{bag.token}}" + } + } + } + } + }, + { + "id": "CURRENT-STATE-RESPONSE", + "name": "check current state response", + "next": { + "200": "CURRENT-STATE-CHECK", + "default": "CURRENT-STATE-RESPONSE-END-ERROR" + }, + "type": "Flow", + "lane_id": "1", + "parameters": { + "input": { + "status": { + "$ref": "result.status" + } + } + } + }, + { + "id": "CURRENT-STATE-CHECK", + "name": "check current state", + "next": { + "finished": "CURRENT-STATE-EXPECTED", + "expired": "CURRENT-STATE-EXPECTED", + "error": "CURRENT-STATE-CHECK-END-ERROR", + "waiting": "NODE-EXPECTED", + "running": "CURRENT-STATE-WAIT", + "pending": "CURRENT-STATE-WAIT", + "default": "CURRENT-STATE-CHECK-END-ERROR" + }, + "type": "Flow", + "lane_id": "1", + "parameters": { + "input": { + "status": { + "$ref": "result.data.state.status" + } + } + } + }, + { + "id": "CURRENT-STATE-EXPECTED", + "name": "check if current state is expected", + "next": { + "true": "HISTORY", + "default": "CURRENT-STATE-EXPECTED-END-ERROR" + }, + "type": "Flow", + "lane_id": "1", + "parameters": { + "input": { + "status": { + "$js": "({bag, result}) => {if (bag.expectedEnd == result.data.state.status) {return true;} else { return false;}}" + } + } + } + }, + { + "id": "HISTORY", + "name": "get history of workflow process", + "next": "HISTORY-RESPONSE", + "type": "SystemTask", + "lane_id": "1", + "category": "HTTP", + "parameters": { + "input": {}, + "request": { + "url": { + "$mustache": "http://localhost:3000/processes/{{bag.processId}}/history" + }, + "verb": "GET", + "headers": { + "Authorization": { + "$mustache": "Bearer {{bag.token}}" + } + }, + "max_content_length": 50000 + } + } + }, + { + "id": "HISTORY-RESPONSE", + "name": "check history response", + "next": { + "200": "HISTORY-BAG", + "default": "HISTORY-RESPONSE-END-ERROR" + }, + "type": "Flow", + "lane_id": "1", + "parameters": { + "input": { + "status": { + "$ref": "result.status" + } + } + } + }, + { + "id": "HISTORY-BAG", + "name": "bag history", + "next": "HISTORY-EXPECTED", + "type": "SystemTask", + "lane_id": "1", + "category": "setToBag", + "parameters": { + "input": { + "processHistory": { + "$js": "({ result }) => {\n let history = result.data.map(item => {\n return item.node_id;\n });\n return history.reverse();\n }" + } + } + } + }, + { + "id": "HISTORY-EXPECTED", + "name": "check expected history", + "next": { + "true": "HISTORY-EXPECTED-END-SUCCESS", + "default": "HISTORY-EXPECTED-END-ERROR" + }, + "type": "Flow", + "lane_id": "1", + "parameters": { + "input": { + "status": { + "$js": "({bag}) => { if (bag.expectedHistory.length != bag.processHistory.length) {return false;}; for(i = 0; i < bag.expectedHistory.length; i++) {if (bag.expectedHistory[i] != bag.processHistory[i]) { return false;}} return true;}" + } + } + } + }, + { + "id": "CURRENT-STATE-WAIT", + "type": "SystemTask", + "category": "timer", + "name": "wait 5 seconds to proceed", + "parameters": { + "input": {}, + "timeout": 5 + }, + "next": "CURRENT-STATE", + "lane_id": "1" + }, + { + "id": "NODE-EXPECTED", + "name": "check expected history", + "next": { + "true": "ACTIVITY-MANAGER", + "default": "NODE-EXPECTED-END-ERROR" + }, + "type": "Flow", + "lane_id": "1", + "parameters": { + "input": { + "status": { + "$js": "({bag, result}) => {if (bag.expectedNode == result.data.state.node_id) {return true;} else { return false;}}" + } + } + } + }, + { + "id": "ACTIVITY-MANAGER", + "name": "get activity manager of current node", + "next": "ACTIVITY-MANAGER-RESPONSE", + "type": "SystemTask", + "lane_id": "1", + "category": "HTTP", + "parameters": { + "input": {}, + "request": { + "url": { + "$mustache": "http://localhost:3000/processes/{{bag.processId}}/activity" + }, + "verb": "GET", + "headers": { + "Authorization": { + "$mustache": "Bearer {{bag.token}}" + } + } + } + } + }, + { + "id": "ACTIVITY-MANAGER-RESPONSE", + "name": "check activity manager response", + "next": { + "200": "SUBMIT", + "204": "CURRENT-STATE-WAIT", + "default": "ACTIVITY-MANAGER-RESPONSE-END-ERROR" + }, + "type": "Flow", + "lane_id": "1", + "parameters": { + "input": { + "status": { + "$ref": "result.status" + } + } + } + }, + { + "id": "SUBMIT", + "name": "submit info to current node", + "next": "SUBMIT-RESPONSE", + "type": "SystemTask", + "lane_id": "1", + "category": "HTTP", + "parameters": { + "input": {}, + "request": { + "url": { + "$mustache": "http://localhost:3000/activity_manager/{{result.data.id}}/submit" + }, + "verb": "GET", + "headers": { + "Authorization": { + "$mustache": "Bearer {{bag.token}}" + } + } + } + } + }, + { + "id": "SUBMIT-RESPONSE", + "name": "check submit response", + "next": { + "200": "CURRENT-STATE", + "default": "SUBMIT-RESPONSE-END-ERROR" + }, + "type": "Flow", + "lane_id": "1", + "parameters": { + "input": { + "status": { + "$ref": "result.status" + } + } + } + }, + { + "id": "TOKEN-RESPONSE-END-ERROR", + "name": "end from token response", + "next": null, + "type": "Finish", + "lane_id": "1" + }, + { + "id": "PROCESS-RESPONSE-END-ERROR", + "name": "end from process response", + "next": null, + "type": "Finish", + "lane_id": "1" + }, + { + "id": "CURRENT-STATE-RESPONSE-END-ERROR", + "name": "end from current state response", + "next": null, + "type": "Finish", + "lane_id": "1" + }, + { + "id": "HISTORY-RESPONSE-END-ERROR", + "name": "end from history response", + "next": null, + "type": "Finish", + "lane_id": "1" + }, + { + "id": "CURRENT-STATE-CHECK-END-ERROR", + "name": "end from current state check", + "next": null, + "type": "Finish", + "lane_id": "1" + }, + { + "id": "NODE-EXPECTED-END-ERROR", + "name": "end from expected node", + "next": null, + "type": "Finish", + "lane_id": "1" + }, + { + "id": "HISTORY-EXPECTED-END-ERROR", + "name": "end from history expected", + "next": null, + "type": "Finish", + "lane_id": "1" + }, + { + "id": "SUBMIT-RESPONSE-END-ERROR", + "name": "end from submit response", + "next": null, + "type": "Finish", + "lane_id": "1" + }, + { + "id": "CURRENT-STATE-EXPECTED-END-ERROR", + "name": "end from current state expected", + "next": null, + "type": "Finish", + "lane_id": "1" + }, + { + "id": "ACTIVITY-MANAGER-RESPONSE-END-ERROR", + "name": "end from token response", + "next": null, + "type": "Finish", + "lane_id": "1" + }, + { + "id": "HISTORY-EXPECTED-END-SUCCESS", + "name": "end from history expected", + "next": null, + "type": "Finish", + "lane_id": "1" + } + ], + "prepare": [], + "environment": {}, + "requirements": [ + "core" + ] + } +} \ No newline at end of file diff --git a/src/samples/blueprints/scriptNode.json b/src/samples/blueprints/scriptNode.json new file mode 100644 index 00000000..dcaef734 --- /dev/null +++ b/src/samples/blueprints/scriptNode.json @@ -0,0 +1,118 @@ +{ + "name":"user_script_task workflow", + "description":"function lisp workflow", + "blueprint_spec":{ + "requirements":[ + "core", + "test_package" + ], + "prepare":[ + "do", + [ + "def", + "test_function", + [ + "fn", + [ + "&", + "args" + ], + { + "new_bag":"New Bag" + } + ] + ], + null + ], + "nodes":[ + { + "id":"1", + "type":"Start", + "name":"Start node", + "next":"2", + "parameters":{ + "input_schema":{ + + } + }, + "lane_id":"1" + }, + { + "id":"2", + "type":"ScriptTask", + "name":"Service node", + "next":"3", + "lane_id":"1", + "parameters":{ + "input":{ + + }, + "script":{ + "function":[ + "fn", + [ + "&", + "args" + ], + [ + "test_function" + ] + ] + } + } + }, + { + "id":"3", + "type":"UserTask", + "name":"User Task node", + "next":"4", + "lane_id":"1", + "parameters":{ + "action":"do something", + "input":{ + + } + } + }, + { + "id":"4", + "type":"SystemTask", + "category":"SetToBag", + "name":"Set to bag node", + "next":"5", + "lane_id":"1", + "parameters":{ + "input":{ + "any":{ + "$ref":"result.any" + } + } + } + }, + { + "id":"5", + "type":"Finish", + "name":"Finish node", + "next":null, + "lane_id":"1" + } + ], + "lanes":[ + { + "id":"1", + "name":"simpleton", + "rule":[ + "fn", + [ + "&", + "args" + ], + true + ] + } + ], + "environment":{ + + } + } +} diff --git a/src/samples/blueprints/singleUserTask.json b/src/samples/blueprints/singleUserTask.json new file mode 100644 index 00000000..e3e13014 --- /dev/null +++ b/src/samples/blueprints/singleUserTask.json @@ -0,0 +1,63 @@ +{ + "name":"user_task", + "description":"user task workflow", + "blueprint_spec":{ + "requirements":[ + "core" + ], + "prepare":[ + + ], + "nodes":[ + { + "id":"1", + "type":"Start", + "name":"Start node", + "next":"2", + "parameters":{ + "input_schema":{ + + } + }, + "lane_id":"1" + }, + { + "id":"2", + "type":"UserTask", + "name":"User Task node", + "next":"3", + "lane_id":"1", + "parameters":{ + "action":"do something", + "input":{ + + } + } + }, + { + "id":"3", + "type":"Finish", + "name":"Finish node", + "next":null, + "lane_id":"1" + } + ], + "lanes":[ + { + "id":"1", + "name":"the_only_lane", + "rule":[ + "fn", + [ + "&", + "args" + ], + true + ] + } + ], + "environment":{ + + } + } +} diff --git a/src/samples/blueprints/timer.json b/src/samples/blueprints/timer.json new file mode 100644 index 00000000..df92692a --- /dev/null +++ b/src/samples/blueprints/timer.json @@ -0,0 +1,64 @@ +{ + "name":"timer_process", + "description":"timer task workflow", + "blueprint_spec":{ + "requirements":[ + "core" + ], + "prepare":[ + + ], + "nodes":[ + { + "id":"1", + "type":"Start", + "name":"Start node", + "next":"2", + "parameters":{ + "input_schema":{ + + } + }, + "lane_id":"1" + }, + { + "id":"2", + "type":"SystemTask", + "category":"timer", + "name":"Timer node", + "next":"3", + "lane_id":"1", + "parameters":{ + "input":{ + + }, + "timeout":30 + } + }, + { + "id":"3", + "type":"Finish", + "name":"Finish node", + "next":null, + "lane_id":"1" + } + ], + "lanes":[ + { + "id":"1", + "name":"the_only_lane", + "rule":[ + "fn", + [ + "&", + "args" + ], + true + ] + } + ], + "environment":{ + + } + } +}