diff --git a/serverless-workflow-examples/serverless-workflow-compensation-quarkus/README.md b/serverless-workflow-examples/serverless-workflow-compensation-quarkus/README.md index 0688f1e701..9560bb21e2 100644 --- a/serverless-workflow-examples/serverless-workflow-compensation-quarkus/README.md +++ b/serverless-workflow-examples/serverless-workflow-compensation-quarkus/README.md @@ -79,7 +79,7 @@ Should return something like this ("id" will change) "id": "b1e8ce8d-2fc5-4d39-b3b3-6f7dddbb1515", "workflowdata": { "shouldCompensate": true, - "compensated": "true" + "compensated": true, "compensating_more": "Real Betis Balompie" } } diff --git a/serverless-workflow-examples/serverless-workflow-compensation-quarkus/src/main/resources/compensation.sw.json b/serverless-workflow-examples/serverless-workflow-compensation-quarkus/src/main/resources/compensation.sw.json index 29331b47a2..8e504cc000 100644 --- a/serverless-workflow-examples/serverless-workflow-compensation-quarkus/src/main/resources/compensation.sw.json +++ b/serverless-workflow-examples/serverless-workflow-compensation-quarkus/src/main/resources/compensation.sw.json @@ -4,64 +4,95 @@ "name": "Workflow Error example", "description": "An example of how compensation works", "start": "printStatus", + "functions": [ + { + "name": "PrintOutput", + "type": "custom", + "operation": "sysout" + } + ], "states": [ - { + { "name": "printStatus", "type": "inject", "data": { - "compensated": false + "compensated": false }, - "compensatedBy" : "compensating", - "transition": "branch" - }, + "compensatedBy": "compensating", + "transition": "branch" + }, { "name": "branch", "type": "switch", "dataConditions": [ { "condition": ".shouldCompensate==true", - "transition": { - "nextState" : "finish_compensate", - "compensate" : true - } - }, + "transition": { + "nextState": "finish_compensate", + "compensate": true + } + }, { "condition": ".shouldCompensate==false", - "transition": { - "nextState" : "finish_not_compensate", - "compensate" : false - } + "transition": { + "nextState": "finish_not_compensate", + "compensate": false + } } - ] + ], + "defaultCondition": { + "end": true + } }, { "name": "compensating", - "usedForCompensation" : true, + "usedForCompensation": true, "type": "inject", "data": { "compensated": true - }, - "transition" : "compensating_more" + }, + "transition": "compensating_more" }, { "name": "compensating_more", - "usedForCompensation" : true, + "usedForCompensation": true, "type": "inject", "data": { "compensating_more": "Real Betis Balompie" - } + }, + "end": true }, { "name": "finish_compensate", "type": "operation", - "actions": [], + "actions": [ + { + "name": "finish_compensate_sysout", + "functionRef": { + "refName": "PrintOutput", + "arguments": { + "message": "completed" + } + } + } + ], "end": true }, { "name": "finish_not_compensate", "type": "operation", - "actions": [], + "actions": [ + { + "name": "finish_not_compensate_sysout", + "functionRef": { + "refName": "PrintOutput", + "arguments": { + "message": "completed" + } + } + } + ], "end": true } ] -} +} \ No newline at end of file