Skip to content

Commit

Permalink
Blueprint samples
Browse files Browse the repository at this point in the history
  • Loading branch information
brunolnetto committed Jan 15, 2022
1 parent 4935636 commit b3d89ef
Show file tree
Hide file tree
Showing 13 changed files with 1,490 additions and 0 deletions.
135 changes: 135 additions & 0 deletions src/samples/POC_userTask.json
Original file line number Diff line number Diff line change
@@ -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":{

}
}
}
117 changes: 117 additions & 0 deletions src/samples/blueprints/POC_userTask.json
Original file line number Diff line number Diff line change
@@ -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": {}
}
}
75 changes: 75 additions & 0 deletions src/samples/blueprints/activitySchemaValidation.json
Original file line number Diff line number Diff line change
@@ -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":{

}
}
}
50 changes: 50 additions & 0 deletions src/samples/blueprints/basic.json
Original file line number Diff line number Diff line change
@@ -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":{

}
}
}
Loading

0 comments on commit b3d89ef

Please sign in to comment.