| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- {
- "version": "3.6",
- "name": "Simple Approval Workflow",
- "registry": {
- "services": [
- "SubmitRequest(description(STRING), amount(INT)) RETURN requestId(STRING)",
- "CheckApprovalPolicy(amount(INT)) RETURN needsApproval(BOOL), approver(STRING)",
- "NotifyApprover(requestId(STRING), approver(STRING)) RETURN notified(BOOL)"
- ],
- "components": [
- "FileOps"
- ],
- "vars": [
- "$description(STRING)",
- "$amount(INT)",
- "$requestId(STRING)",
- "$needsApproval(BOOL)",
- "$approver(STRING)",
- "$status(STRING)"
- ],
- "files": {
- "inputs": [
- "Process/Input/*"
- ],
- "artifacts": [
- "Process/Artifacts/*"
- ]
- }
- },
- "steps": [
- {
- "id": "Service_SubmitRequest",
- "in": {
- "description": "$description",
- "amount": "$amount"
- },
- "out": {
- "$requestId": "_result.requestId"
- },
- "next": "Service_CheckApprovalPolicy"
- },
- {
- "id": "Service_CheckApprovalPolicy",
- "in": {
- "amount": "$amount"
- },
- "out": {
- "$needsApproval": "_result.needsApproval",
- "$approver": "_result.approver"
- },
- "next": "Branch_CheckIfNeedsApproval"
- },
- {
- "id": "Branch_CheckIfNeedsApproval",
- "cases": [
- ["$needsApproval == true", "Service_NotifyApprover"],
- ["ELSE", "Set_AutoApproved"]
- ],
- "next": "Write_Result"
- },
- {
- "id": "Service_NotifyApprover",
- "in": {
- "requestId": "$requestId",
- "approver": "$approver"
- },
- "next": "Set_PendingApproval"
- },
- {
- "id": "Set_PendingApproval",
- "target": "$status",
- "value": "\"pending_approval\""
- },
- {
- "id": "Set_AutoApproved",
- "target": "$status",
- "value": "\"auto_approved\"",
- "next": "Write_Result"
- },
- {
- "id": "Write_Result",
- "target": "\"Process/Artifacts/request_\" + $requestId + \".json\"",
- "value": "$status",
- "mode": "overwrite",
- "next": "Stop_End"
- },
- {
- "id": "Stop_End"
- }
- ]
- }
|