flowable/flowable-engine · error · FlowableException
The deployment contains decisions with the same key…
Error message
The deployment contains decisions with the same key (decision id attribute), this is not allowed
What it means
DmnDeploymentHelper.verifyDecisionTablesDoNotShareKeys enforces that all decisions in one deployment have distinct keys (the DMN <decision id> attribute). A duplicate key makes per-key version resolution ambiguous, so deployment fails with FlowableException.
Solutions
- Rename the duplicate <decision id="..."> to a unique key within the deployment.
- Split colliding decisions into separate deployments if they must keep identical keys (versions are per-key across deployments).
- Lint DMN resources with an XML check for duplicate ids before deploying.
- If versions differ, ensure each decision's id attribute is unique and reference decisions via DRD accordingly.
Example fix
// before (in .dmn XML) <decision id="myDecision" name="A">...</decision> <decision id="myDecision" name="B">...</decision> // after <decision id="myDecisionA" name="A">...</decision> <decision id="myDecisionB" name="B">...</decision>
Defensive patterns
Strategy: validation
Validate before calling
Set<String> seen = new HashSet<>();
for (String id : allDecisionIdsInResources) {
if (!seen.add(id)) throw new IllegalStateException("Duplicate decision id: " + id);
} Try / catch
try {
repositoryService.createDeployment().addClasspathResource("decision.dmn").deploy();
} catch (FlowableException e) {
if (e.getMessage().contains("same key")) { /* fix duplicate ids */ }
} Prevention
- Enforce unique <decision id> attributes across all resources in a deployment
- Add a pre-deploy DMN lint step
- Avoid copy-pasting decisions without renaming ids
- Prefer separate deployments when reusing the same key intentionally
When it happens
Trigger: Deploying a .dmn file (or set of resources) containing two <decision> elements with the same id attribute; merging DMN files that each define a decision with the same id; case-insensitive collisions across included resources in one deployment.
Common situations: Copy-pasting a decision table inside one DMN file to tweak it without renaming the id; concatenating DRD files from different sources that reuse ids like "decision1"; auto-generated DMN from tooling that emits fixed ids.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- byte array for resource
- bytes is null
- channel definition bytes is null
- Could not find deployment with id
- Could not find deployment with id
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/289be803308da2a5.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/deployer/DmnDeploymentHelper.java:48
import org.flowable.dmn.engine.impl.util.CommandContextUtil;
/**
* Methods for working with deployments. Much of the actual work of {@link DmnDeployer} is done by orchestrating the different pieces of work this class does; by having them here, we allow other
* deployers to make use of them.
*/
public class DmnDeploymentHelper {
/**
* Verifies that no two decisions share the same key, to prevent database unique index violation.
*
* @throws FlowableException
* if any two decisions have the same key
*/
public void verifyDecisionTablesDoNotShareKeys(Collection<DecisionEntity> decisionTables) {
Set<String> keySet = new LinkedHashSet<>();
for (DecisionEntity decisionTable : decisionTables) {
if (keySet.contains(decisionTable.getKey())) {
throw new FlowableException(
"The deployment contains decisions with the same key (decision id attribute), this is not allowed");
}
keySet.add(decisionTable.getKey());
}
}
/**
* Updates all the decision entities to match the deployment's values for tenant, engine version, and deployment id.
*/
public void copyDeploymentValuesToDecisions(DmnDeploymentEntity deployment, List<DecisionEntity> decisions) {
String tenantId = deployment.getTenantId();
String deploymentId = deployment.getId();
for (DecisionEntity decision : decisions) {
// decision inherits the tenant id
if (tenantId != null) {
decision.setTenantId(tenantId);
}View on GitHub (pinned to d6d39ce1c6)