{"record":{"id":"6958ab45790bdaa9","repo":"flowable/flowable-engine","slug":"merge-mode-not-found","errorCode":null,"errorMessage":"Merge mode '' not found.","messagePattern":"Merge mode '' not found\\.","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/ChangeDeploymentTenantIdCmd.java","lineNumber":70,"sourceCode":"\n    public ChangeDeploymentTenantIdCmd(String deploymentId, String newTenantId, MergeMode mergeMode) {\n        this.deploymentId = deploymentId;\n        this.newTenantId = newTenantId;\n        switch (mergeMode) {\n            case VERIFY:\n                deploymentMergeStrategy = new VerifyDeploymentMergeStrategy();\n                break;\n            case AS_NEW:\n                deploymentMergeStrategy = new AddAsNewDeploymentMergeStrategy();\n                break;\n            case AS_OLD:\n                deploymentMergeStrategy = new AddAsOldDeploymentMergeStrategy();\n                break;\n            case BY_DATE:\n                deploymentMergeStrategy = new MergeByDateDeploymentMergeStrategy();\n                break;\n            default:\n                throw new FlowableException(\"Merge mode '\" + mergeMode + \"' not found.\");\n        }\n    }\n\n    public ChangeDeploymentTenantIdCmd(String deploymentId, String newTenantId, DeploymentMergeStrategy deploymentMergeStrategy) {\n        this.deploymentId = deploymentId;\n        this.newTenantId = newTenantId;\n        this.deploymentMergeStrategy = deploymentMergeStrategy;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        if (deploymentId == null) {\n            throw new FlowableIllegalArgumentException(\"deploymentId is null\");\n        }\n\n        // Update all entities\n        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\n        DeploymentEntity deployment = processEngineConfiguration.getDeploymentEntityManager().findById(deploymentId);","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/ChangeDeploymentTenantIdCmd.java#L52-L88","documentation":"ChangeDeploymentTenantIdCmd switches a deployment's tenant id and applies a merge mode (DEFAULT, BY_TIME, BY_DATE) selecting a DeploymentMergeStrategy. An unrecognized merge mode string reaches the switch's default branch and Flowable throws a generic FlowableException.","triggerScenarios":"Passing an invalid mergeMode string when constructing ChangeDeploymentTenantIdCmd (e.g. typo or wrong casing) via the repositoryService deployment tenant API.","commonSituations":"Hardcoded mode constants changed or misspelled; configuration value mapped from an external config file with an unexpected value; upgrading Flowable and using a mode name that no longer exists.","solutions":["Use one of the valid merge modes: DEFAULT, BY_TIME, or BY_DATE (constants on the cmd/related class).","Fix the casing/spelling of the merge mode string.","Inject a custom DeploymentMergeStrategy via the constructor overload instead of relying on a mode name."],"exampleFix":"// before\nnew ChangeDeploymentTenantIdCmd(deploymentId, tenantId, \"BYDATE\");\n// after\nnew ChangeDeploymentTenantIdCmd(deploymentId, tenantId, \"BY_DATE\");","handlingStrategy":"validation","validationCode":"if (!\"DEFAULT\".equals(mergeMode) && !\"BY_TIME\".equals(mergeMode) && !\"BY_DATE\".equals(mergeMode)) {\n    throw new IllegalArgumentException(\"Unsupported merge mode: \" + mergeMode);\n}","typeGuard":null,"tryCatchPattern":"try {\n    repositoryService.changeDeploymentTenantId(deploymentId, tenantId);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"Merge mode\")) {\n        // fall back to DEFAULT mode\n    }\n}","preventionTips":["Use the mode constants, not hand-typed strings.","Externalize merge mode from config with a whitelist validation at startup."],"tags":["flowable","deployment","tenant","enum"],"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-14T11:17:12.474Z"}