{"record":{"id":"654639bbdc4664cf","repo":"flowable/flowable-engine","slug":"taskid-is-required","errorCode":null,"errorMessage":"taskId is required","messagePattern":"taskId is required","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetHistoricEntityLinkChildrenForTaskCmd.java","lineNumber":34,"sourceCode":"import java.util.List;\n\nimport org.flowable.cmmn.engine.CmmnEngineConfiguration;\nimport org.flowable.cmmn.engine.impl.util.CommandContextUtil;\nimport org.flowable.common.engine.api.FlowableIllegalArgumentException;\nimport org.flowable.common.engine.api.scope.ScopeTypes;\nimport org.flowable.common.engine.impl.interceptor.Command;\nimport org.flowable.common.engine.impl.interceptor.CommandContext;\nimport org.flowable.entitylink.api.EntityLinkType;\nimport org.flowable.entitylink.api.history.HistoricEntityLink;\n\npublic class GetHistoricEntityLinkChildrenForTaskCmd implements Command<List<HistoricEntityLink>>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n    protected String taskId;\n\n    public GetHistoricEntityLinkChildrenForTaskCmd(String taskId) {\n        if (taskId == null) {\n            throw new FlowableIllegalArgumentException(\"taskId is required\");\n        }\n        this.taskId = taskId;\n    }\n\n    @Override\n    public List<HistoricEntityLink> execute(CommandContext commandContext) {\n        CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);\n        return cmmnEngineConfiguration.getEntityLinkServiceConfiguration().getHistoricEntityLinkService()\n                .findHistoricEntityLinksByScopeIdAndScopeType(taskId, ScopeTypes.TASK, EntityLinkType.CHILD);\n    }\n\n}\n","sourceCodeStart":16,"sourceCodeEnd":47,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetHistoricEntityLinkChildrenForTaskCmd.java#L16-L47","documentation":"GetHistoricEntityLinkChildrenForTaskCmd returns historic entity links that are children of a given task. Its constructor throws FlowableIllegalArgumentException when taskId is null, mirroring the fail-fast argument validation used across Flowable command implementations.","triggerScenarios":"Calling new GetHistoricEntityLinkChildrenForTaskCmd(null), or an upstream service method that resolves the taskId from a nullable source (request parameter, map, entity field) and forwards null.","commonSituations":"Task id lost between layers (e.g. a delegate or listener with no task context), wrong parameter order in a call, or a REST layer not mapping the task id path variable.","solutions":["Supply a valid non-null taskId before constructing the command.","Verify the caller actually has a task context (e.g. DelegateTask.getId()) instead of a null field.","Validate the id at the API/HTTP layer and reject requests missing the task id."],"exampleFix":"// before\nhistoryService.getHistoricEntityLinkChildrenForTask(taskId);\n// after\nif (taskId == null || taskId.isEmpty()) {\n    throw new IllegalArgumentException(\"taskId must be provided\");\n}\nhistoryService.getHistoricEntityLinkChildrenForTask(taskId);","handlingStrategy":"validation","validationCode":"if (taskId == null || taskId.isEmpty()) { throw new IllegalArgumentException(\"taskId must be provided\"); }","typeGuard":"boolean hasTaskId = s != null && !s.trim().isEmpty();","tryCatchPattern":"try { ... } catch (FlowableIllegalArgumentException e) { throw new BadRequestException(\"taskId is required\"); }","preventionTips":["Capture DelegateTask.getId() inside task-scoped listeners","Validate request path/body parameters before engine calls","Check parameter order when passing ids to service APIs"],"tags":["flowable","cmmn","null-argument","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-14T05:17:10.506Z"}