{"record":{"id":"c3a0cc4deaa6d43d","repo":"flowable/flowable-engine","slug":"invalid-action-action-c3a0cc","errorCode":null,"errorMessage":"Invalid action: '${action}'.","messagePattern":"Invalid action: '(.+?)'\\.","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":409,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/planitem/PlanItemInstanceResource.java","lineNumber":82,"sourceCode":"        \n        if (restApiInterceptor != null) {\n            restApiInterceptor.doPlanItemInstanceAction(planItemInstance, actionRequest);\n        }\n\n        if (RestActionRequest.TRIGGER.equals(actionRequest.getAction())) {\n            runtimeService.triggerPlanItemInstance(planItemInstance.getId());\n            \n        } else if (RestActionRequest.ENABLE.equals(actionRequest.getAction())) {\n            runtimeService.startPlanItemInstance(planItemInstanceId);\n            \n        } else if (RestActionRequest.DISABLE.equals(actionRequest.getAction())) {\n            runtimeService.disablePlanItemInstance(planItemInstanceId);\n            \n        } else if (RestActionRequest.START.equals(actionRequest.getAction())) {\n            runtimeService.startPlanItemInstance(planItemInstanceId);\n            \n        } else {\n            throw new FlowableIllegalArgumentException(\"Invalid action: '\" + actionRequest.getAction() + \"'.\");\n        }\n\n        // Re-fetch the execution, could have changed due to action or even completed\n        planItemInstance = runtimeService.createPlanItemInstanceQuery().planItemInstanceId(planItemInstance.getId()).singleResult();\n        if (planItemInstance == null) {\n            // Execution is finished, return empty body to inform user\n            response.setStatus(HttpStatus.NO_CONTENT.value());\n            return null;\n        } else {\n            return restResponseFactory.createPlanItemInstanceResponse(planItemInstance);\n        }\n    }\n}\n","sourceCodeStart":64,"sourceCodeEnd":96,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/planitem/PlanItemInstanceResource.java#L64-L96","documentation":"performPlanItemInstanceAction dispatches on the action string of a RestActionRequest (e.g. complete, enable, disable, start). Any action string outside the recognized set falls into the else branch and throws FlowableIllegalArgumentException, since no corresponding engine operation exists.","triggerScenarios":"POST .../cmmn-runtime/plan-item-instances/{id}/action with body {\"action\":\"...\"} where the action is misspelled, in the wrong case, or not supported for this resource (e.g. 'complete' where not handled, 'trigger', 'resolve').","commonSituations":"Typos or casing mismatches in the action string; reusing action names valid on other Flowable REST resources (tasks/jobs); older client SDK sending actions removed in this version.","solutions":["Use exactly one of the supported action strings handled by the method: complete, enable, disable, start (as matched via RestActionRequest constants).","Compare against RestActionRequest constants or the REST documentation rather than free-form strings.","Validate the action string client-side before POSTing.","Catch FlowableIllegalArgumentException (HTTP 400) and show the allowed actions to the user."],"exampleFix":"// before\n{\"action\":\"Complete\"}\n// after\n{\"action\":\"complete\"}","handlingStrategy":"validation","validationCode":"const ALLOWED = ['complete','enable','disable','start'];\nif (!ALLOWED.includes(action)) throw new Error(`Invalid action: ${action}`);","typeGuard":"const isValidAction = (a) => ['complete','enable','disable','start'].includes(a);","tryCatchPattern":"try { await performAction(id, action); } catch (e) { if (e.status === 400 && /Invalid action/.test(e.message)) { /* show allowed actions */ } else { throw e; } }","preventionTips":["Use RestActionRequest constants, never raw literals","Normalize action input (trim/lowercase) before sending","Check per-resource action support in the REST docs"],"tags":["rest-api","invalid-argument","action"],"backgroundTag":"invalid-enum-value","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T16:17:23.245Z"}