{"record":{"id":"04891b8222abc6a3","repo":"flowable/flowable-engine","slug":"aonfe-getmessage","errorCode":null,"errorMessage":"${aonfe.getMessage()}","messagePattern":"\\$\\{aonfe\\.getMessage\\(\\)\\}","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceCollectionResource.java","lineNumber":442,"sourceCode":"            CaseInstanceResponse caseInstanceResponse = null;\n            if (request.getReturnVariables()) {\n                Map<String, Object> runtimeVariableMap = runtimeService.getVariables(instance.getId());\n                caseInstanceResponse = restResponseFactory.createCaseInstanceResponse(instance, true, runtimeVariableMap);\n\n            } else {\n                caseInstanceResponse = restResponseFactory.createCaseInstanceResponse(instance);\n            }\n            \n            CaseDefinition caseDefinition = repositoryService.createCaseDefinitionQuery().caseDefinitionId(caseInstanceResponse.getCaseDefinitionId()).singleResult();\n            if (caseDefinition != null) {\n                caseInstanceResponse.setCaseDefinitionName(caseDefinition.getName());\n                caseInstanceResponse.setCaseDefinitionDescription(caseDefinition.getDescription());\n            }\n\n            return caseInstanceResponse;\n\n        } catch (FlowableObjectNotFoundException aonfe) {\n            throw new FlowableIllegalArgumentException(aonfe.getMessage(), aonfe);\n        }\n    }\n\n    @ApiOperation(value = \"Post action request to delete/terminate a bulk of case instances\", tags = { \"Case Instances\" }, nickname = \"bulkDeleteCaseInstances\", code = 204)\n    @ApiResponses(value = {\n            @ApiResponse(code = 204, message = \"Indicates the bulk of case instances was found and deleted. Response body is left empty intentionally.\"),\n            @ApiResponse(code = 404, message = \"Indicates at least one requested case instance was not found.\")\n    })\n    @PostMapping(value = \"/cmmn-runtime/case-instances/delete\")\n    @ResponseStatus(value = HttpStatus.NO_CONTENT)\n    public void bulkDeleteCaseInstances(@RequestBody BulkDeleteInstancesRestActionRequest request) {\n        if (BulkDeleteInstancesRestActionRequest.DELETE_ACTION.equals(request.getAction())) {\n            if (restApiInterceptor != null) {\n                restApiInterceptor.bulkDeleteCaseInstances(request.getInstanceIds());\n            }\n            runtimeService.bulkDeleteCaseInstances(request.getInstanceIds());\n        } else if (BulkDeleteInstancesRestActionRequest.TERMINATE_ACTION.equals(request.getAction())) {\n            if (restApiInterceptor != null) {","sourceCodeStart":424,"sourceCodeEnd":460,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceCollectionResource.java#L424-L460","documentation":"In CaseInstanceCollectionResource.createCaseInstance, a FlowableObjectNotFoundException raised while starting a case instance (e.g. unknown case definition key or missing definition) is re-wrapped as a FlowableIllegalArgumentException carrying the original message. It signals that the REST request referenced an object that does not exist in the CMMN engine.","triggerScenarios":"POST to the case instances collection URL with a caseDefinitionId/caseDefinitionKey that does not exist, or referencing a definition not deployed to the runtime repository, causing FlowableObjectNotFoundException which is converted to FlowableIllegalArgumentException.","commonSituations":"Typo in case definition key; case definition deployed to a different tenant; definition deleted or undeployed before the call; environment mismatch (test vs prod repository).","solutions":["Verify the case definition key/id exists via GET /cmmn-repository/case-definitions before starting the instance.","Ensure the CMMN deployment containing the definition is present in the target database/tenant.","Catch FlowableIllegalArgumentException and surface a 404-style message pointing at the definition reference.","Fix typos or stale configuration referencing the old definition key."],"exampleFix":"// before\nPOST /cmmn-runtime/case-instances {\"caseDefinitionKey\": \"orderProces\"}\n// after\nPOST /cmmn-runtime/case-instances {\"caseDefinitionKey\": \"orderProcess\"} // key verified against case-definitions endpoint","handlingStrategy":"validation","validationCode":"// Java: check definition exists before starting\nCaseDefinition def = repositoryService.createCaseDefinitionQuery()\n    .caseDefinitionKey(key).latestVersion().singleResult();\nif (def == null) throw new IllegalArgumentException(\"Unknown case definition key: \" + key);","typeGuard":null,"tryCatchPattern":"try { caseInstance = runtimeService.startCaseInstance(request); }\ncatch (FlowableIllegalArgumentException e) { /* 404-style response, e.getCause() is FlowableObjectNotFoundException */ }","preventionTips":["Query case-definitions endpoint to confirm key/id before starting","Keep definition keys in constants or config, not string literals","Verify deployments exist in the target environment/tenant"],"tags":["rest-api","case-instance","not-found","flowable-cmmn"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}