flowable/flowable-engine · error · FlowableIllegalArgumentException

The decision id is mandatory, but '<decisionId>' has been pr

Error message

The decision id is mandatory, but '<decisionId>' has been provided.

What it means

The GetDeploymentDecisionRequirementsDiagramCmd constructor validates that the DRD (decision requirements) id is present, throwing FlowableIllegalArgumentException when it is null or empty. The message intentionally includes the blank value that was supplied. This check happens at command construction time, before any command is executed against the repository.

Source

Thrown at modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/cmd/GetDeploymentDecisionRequirementsDiagramCmd.java:39

import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.dmn.engine.impl.persistence.entity.DecisionEntity;
import org.flowable.dmn.engine.impl.util.CommandContextUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Yvo Swillens
 */
public class GetDeploymentDecisionRequirementsDiagramCmd implements Command<InputStream>, Serializable {

    private static final long serialVersionUID = 1L;
    private static final Logger LOGGER = LoggerFactory.getLogger(GetDeploymentDecisionRequirementsDiagramCmd.class);

    protected String decisionId;

    public GetDeploymentDecisionRequirementsDiagramCmd(String decisionId) {
        if (decisionId == null || decisionId.length() == 0) {
            throw new FlowableIllegalArgumentException("The decision id is mandatory, but '" + decisionId + "' has been provided.");
        }
        this.decisionId = decisionId;
    }

    @Override
    public InputStream execute(CommandContext commandContext) {
        DecisionEntity decisionEntity = CommandContextUtil.getDmnEngineConfiguration(commandContext).getDeploymentManager().findDeployedDecisionById(decisionId);
        String deploymentId = decisionEntity.getDeploymentId();
        String resourceName = decisionEntity.getDiagramResourceName();
        if (resourceName == null) {
            LOGGER.info("Resource name is null! No decision requirements diagram stream exists.");
            return null;
        } else {
            return new GetDeploymentResourceCmd(deploymentId, resourceName).execute(commandContext);
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Pass a valid, non-empty decision requirements definition id obtained from the repository query (e.g. DecisionRequirementsDefinition.getId())
  2. Validate the id on the caller side before constructing the command / calling the service
  3. Check upstream data: if the id came from a search result, confirm the DRD was actually deployed and the query matched

Example fix

// before
InputStream diagram = repoService.getDecisionRequirementsDiagram(req.getParameter("drdId"));
// after
String drdId = req.getParameter("drdId");
if (drdId == null || drdId.isEmpty()) {
    throw new BadRequestException("drdId is required");
}
InputStream diagram = repoService.getDecisionRequirementsDiagram(drdId);
Defensive patterns

Strategy: validation

Validate before calling

if (drdId == null || drdId.isEmpty()) throw new IllegalArgumentException("decision requirements id is required");

Try / catch

try { repoService.getDecisionRequirementsDiagram(id); } catch (FlowableIllegalArgumentException e) { if (e.getMessage().startsWith("The decision id is mandatory")) { return ResponseEntity.badRequest().body("drdId required"); } throw e; }

Prevention

When it happens

Trigger: new GetDeploymentDecisionRequirementsDiagramCmd(null) or new GetDeploymentDecisionRequirementsDiagramCmd("") — typically via dmnRepositoryService.getDecisionRequirementsDiagram(id) with a null/empty id.

Common situations: Result of a DB/entity lookup that returned null and was passed straight through; an empty request path/id parameter in a REST controller; calling the wrong *Diagram method with a decision-table id left blank.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/e045dc01b442fcd7. Report an issue: GitHub.