{"record":{"id":"ae2424f32768bce1","repo":"flowable/flowable-engine","slug":"executionid-is-null-ae2424","errorCode":null,"errorMessage":"executionId is null","messagePattern":"executionId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/NeedsActiveExecutionCmd.java","lineNumber":42,"sourceCode":"import org.flowable.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 FlowableIllegalArgumentException(\"executionId is null\");\n        }\n\n        ExecutionEntity execution = CommandContextUtil.getExecutionEntityManager(commandContext).findById(executionId);\n\n        if (execution == null) {\n            throw new FlowableObjectNotFoundException(\"execution \" + executionId + \" doesn't exist\", Execution.class);\n        }\n\n        if (execution.isSuspended()) {\n            throw new FlowableException(getSuspendedExceptionMessagePrefix() + \" a suspended \" + execution);\n        }\n\n        return execute(commandContext, execution);\n    }\n\n    /**\n     * Subclasses should implement this method. The provided {@link ExecutionEntity} is guaranteed to be active (ie. not suspended).\n     */","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/NeedsActiveExecutionCmd.java#L24-L60","documentation":"NeedsActiveExecutionCmd is the base class for commands that operate on an execution which must be active (e.g. TriggerExecutionCmd). Its execute() first validates executionId is non-null and throws FlowableIllegalArgumentException 'executionId is null' otherwise.","triggerScenarios":"Calling runtimeService.trigger(null), signal/signalEventReceived with a null executionId, or any subclass command (trigger, message/event correlation) constructed with a null executionId.","commonSituations":"The execution id variable was never assigned (null return of an earlier query); argument order swapped in trigger-like APIs; null propagation from deserialized webhook payloads.","solutions":["Obtain a valid execution id via runtimeService.createExecutionQuery() before invoking trigger/signal APIs.","Null-check the execution id at the call site, especially for ids extracted from external payloads.","If you only have the process instance id, query for the waiting execution instead of passing null.","Catch FlowableIllegalArgumentException where null indicates 'nothing to trigger' and skip gracefully."],"exampleFix":"// before\nruntimeService.trigger(executionId); // executionId may be null\n// after\nif (executionId == null) {\n    return; // nothing waiting\n}\nruntimeService.trigger(executionId);","handlingStrategy":"validation","validationCode":"if (executionId == null || executionId.isBlank()) {\n    throw new IllegalArgumentException(\"executionId is required\");\n}","typeGuard":"boolean isValidExecutionId(String id) { return id != null && !id.isBlank(); }","tryCatchPattern":"try {\n    runtimeService.trigger(executionId);\n} catch (FlowableIllegalArgumentException e) {\n    log.warn(\"Cannot trigger execution: {}\", e.getMessage());\n}","preventionTips":["Obtain execution ids from ExecutionQuery results, never from untrusted input","Null-check ids deserialized from webhook/queue payloads","Don't swap argument order in trigger/signal-style APIs"],"tags":["flowable","null-check","execution","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T16:30:33.424Z"}