{"record":{"id":"116ed75664a82421","repo":"flowable/flowable-engine","slug":"executionid-is-null-116ed7","errorCode":null,"errorMessage":"executionId is null","messagePattern":"executionId is null","errorType":"exception","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/NeedsActiveExecutionCmd.java","lineNumber":41,"sourceCode":"import org.activiti.engine.runtime.Execution;\n\n/**\n * @author Joram Barrez\n */\npublic abstract class NeedsActiveExecutionCmd<T> implements Command<T>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n\n    protected String executionId;\n\n    public NeedsActiveExecutionCmd(String executionId) {\n        this.executionId = executionId;\n    }\n\n    @Override\n    public T execute(CommandContext commandContext) {\n        if (executionId == null) {\n            throw new ActivitiIllegalArgumentException(\"executionId is null\");\n        }\n\n        ExecutionEntity execution = commandContext\n                .getExecutionEntityManager()\n                .findExecutionById(executionId);\n\n        if (execution == null) {\n            throw new ActivitiObjectNotFoundException(\"execution \" + executionId + \" doesn't exist\", Execution.class);\n        }\n\n        if (execution.isSuspended()) {\n            throw new ActivitiException(getSuspendedExceptionMessage());\n        }\n\n        return execute(commandContext, execution);\n    }\n\n    /**","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/NeedsActiveExecutionCmd.java#L23-L59","documentation":"Base-class validation in NeedsActiveExecutionCmd.execute(): executionId must be non-null before the command can load the execution. Subclasses (e.g. trigger, signal-related commands) rely on an execution id, and a null id fails fast with ActivitiIllegalArgumentException.","triggerScenarios":"runtimeService.trigger(null), or any subclass command (e.g. TriggerExecutionCmd) constructed with a null executionId; call sites passing variables/ids from maps or headers that are null.","commonSituations":"Correlation data missing the execution id; variable lookup returned null and was passed straight through; refactored API call omitted the id.","solutions":["Pass a valid executionId obtained from an execution query","Validate the id before calling trigger/signal-style APIs","Fix the upstream lookup that produced the null id"],"exampleFix":"// before\nruntimeService.trigger(executionId, variables);\n// after\nif (executionId == null) throw new IllegalArgumentException(\"executionId required\");\nruntimeService.trigger(executionId, variables);","handlingStrategy":"validation","validationCode":"if (executionId == null) throw new IllegalArgumentException(\"executionId required\");","typeGuard":null,"tryCatchPattern":"try { runtimeService.trigger(executionId); } catch (ActivitiIllegalArgumentException e) { log.error(\"trigger called with null executionId\"); throw e; }","preventionTips":["Obtain executionId from an execution query immediately before triggering","Null-check correlation results before invoking engine commands","Keep correlation keys and execution ids in validated DTOs"],"tags":["java","activiti","validation","null-argument"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}