{"record":{"id":"79f3350cc0f96b31","repo":"flowable/flowable-engine","slug":"executionid-is-null-79f335","errorCode":null,"errorMessage":"executionId is null","messagePattern":"executionId is null","errorType":"validation","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/FindActiveActivityIdsCmd.java","lineNumber":41,"sourceCode":"import org.activiti.engine.impl.persistence.entity.ExecutionEntity;\nimport org.activiti.engine.runtime.Execution;\n\n/**\n * @author Tom Baeyens\n */\npublic class FindActiveActivityIdsCmd implements Command<List<String>>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n    protected String executionId;\n\n    public FindActiveActivityIdsCmd(String executionId) {\n        this.executionId = executionId;\n    }\n\n    @Override\n    public List<String> 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        return execution.findActiveActivityIds();\n    }\n}\n","sourceCodeStart":23,"sourceCodeEnd":55,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/FindActiveActivityIdsCmd.java#L23-L55","documentation":"FindActiveActivityIdsCmd returns the ids of currently active activities for an execution. It requires a non-null executionId; without it no execution can be located, so ActivitiIllegalArgumentException is thrown before the lookup.","triggerScenarios":"Calling RuntimeService.getActiveActivityIds(executionId) with a null execution id, e.g. when the execution variable was never set or a previous step returned null.","commonSituations":"Custom code tracking execution state after a process instance terminated (execution references gone); forgetting to store the execution id returned from startProcessInstanceByX; passing a variable that failed to initialize.","solutions":["Pass a non-null executionId obtained from ExecutionEntity.getId() or startProcessInstance results","Verify the process instance is still running and its executions not yet ended","Guard the call site with a null check on the executionId variable"],"exampleFix":"// before\nList<String> ids = runtimeService.getActiveActivityIds(executionId);\n// after\nif (executionId != null) {\n    List<String> ids = runtimeService.getActiveActivityIds(executionId);\n}","handlingStrategy":"validation","validationCode":"if (executionId == null) { throw new IllegalArgumentException(\"executionId required\"); }","typeGuard":"boolean hasExecutionId(String id) { return id != null && !id.isEmpty(); }","tryCatchPattern":"try { runtimeService.getActiveActivityIds(executionId); } catch (ActivitiIllegalArgumentException e) { LOGGER.error(\"Missing executionId\", e); }","preventionTips":["Store the execution id from startProcessInstance or ExecutionEntity.getId() immediately","Null-check ids captured from prior API calls before reuse","Avoid reusing execution ids after instance termination"],"tags":["null-check","execution","illegal-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"}