{"record":{"id":"381a35c5aab1c9c1","repo":"flowable/flowable-engine","slug":"not-supported-for-version-5-deployments","errorCode":null,"errorMessage":"Not supported for version 5 deployments","messagePattern":"Not supported for version 5 deployments","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SetDeploymentKeyCmd.java","lineNumber":57,"sourceCode":"        this.key = key;\r\n    }\r\n\r\n    @Override\r\n    public Void execute(CommandContext commandContext) {\r\n\r\n        if (deploymentId == null) {\r\n            throw new FlowableIllegalArgumentException(\"Deployment id is null\");\r\n        }\r\n\r\n        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\r\n        DeploymentEntity deployment = processEngineConfiguration.getDeploymentEntityManager().findById(deploymentId);\r\n\r\n        if (deployment == null) {\r\n            throw new FlowableObjectNotFoundException(\"No deployment found for id = '\" + deploymentId + \"'\", Deployment.class);\r\n        }\r\n\r\n        if (Flowable5Util.isFlowable5Deployment(deployment, commandContext)) {\r\n            throw new FlowableException(\"Not supported for version 5 deployments\");\r\n        }\r\n\r\n        // Update category\r\n        deployment.setKey(key);\r\n\r\n        FlowableEventDispatcher eventDispatcher = processEngineConfiguration.getEventDispatcher();\r\n        if (eventDispatcher != null && eventDispatcher.isEnabled()) {\r\n            eventDispatcher.dispatchEvent(FlowableEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_UPDATED, deployment),\r\n                    processEngineConfiguration.getEngineCfgKey());\r\n        }\r\n\r\n        return null;\r\n    }\r\n\r\n    public String getDeploymentId() {\r\n        return deploymentId;\r\n    }\r\n\r","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SetDeploymentKeyCmd.java#L39-L75","documentation":"SetDeploymentKeyCmd.execute throws FlowableException \"Not supported for version 5 deployments\" when the deployment resolved to a Flowable 5 deployment but setDeploymentKey is invoked. Changing the key is only implemented for Flowable 6 deployments; the v5 compatibility handler has no such operation (unlike setDeploymentCategory).","triggerScenarios":"Calling repositoryService.setDeploymentKey(id, key) where the id refers to a deployment created by a Flowable 5 engine running in v5 compatibility mode.","commonSituations":"Migrated projects still running v5 process definitions/deployments; mixed-mode installations where operators attempt v6-only administration APIs on legacy deployments.","solutions":["Redeploy the process definitions with the Flowable 6 engine so a native v6 deployment exists, then set the key on that deployment.","Use setDeploymentCategory (which supports v5 deployments) if only a logical grouping is needed.","Check Flowable5Util.isFlowable5Deployment first and skip or route the operation accordingly."],"exampleFix":"// before\nrepositoryService.setDeploymentKey(deploymentId, key); // v5 deployment\n// after\nDeployment d = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();\nif (d != null && !isFlowable5Deployment(d)) {\n    repositoryService.setDeploymentKey(deploymentId, key);\n}","handlingStrategy":"fallback","validationCode":"Deployment d = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();\nboolean isV5 = d != null && \"5\".equals(d.getEngineVersion()); // skip key-set for v5 deployments","typeGuard":"boolean isV5Deployment = deployment != null && \"5\".equals(deployment.getEngineVersion());","tryCatchPattern":"try {\n    repositoryService.setDeploymentKey(deploymentId, key);\n} catch (FlowableException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"Not supported for version 5\")) {\n        // fall back: redeploy as v6 or use setDeploymentCategory instead\n    } else {\n        throw e;\n    }\n}","preventionTips":["Audit deployments for engineVersion 5 before invoking v6-only APIs.","Prefer setDeploymentCategory when v5 deployments must remain untouched.","During Flowable 5-to-6 migrations, isolate legacy deployments from new administration paths."],"tags":["flowable","deployment","compatibility","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}