flowable/flowable-engine · error · FlowableIllegalArgumentException
taskId is required
Error message
taskId is required
What it means
The GetHistoricEntityLinkParentsForTaskCmd constructor requires a taskId and throws FlowableIllegalArgumentException when it is null. The command returns the historic entity-link ancestors of a task, which requires the task id to look them up.
Solutions
- Confirm the task id exists (runtime or historic task query) before requesting its parent entity links.
- Null-check at the call site and return an empty list or skip the lookup.
- Pass the actual task id (Task.getId()), not related execution or process ids.
Example fix
// before
historyService.findHistoricEntityLinkParentsForTask(taskId);
// after
if (taskId == null) {
return Collections.emptyList();
}
historyService.findHistoricEntityLinkParentsForTask(taskId); Defensive patterns
Strategy: validation
Validate before calling
if (taskId == null) { return Collections.emptyList(); } Try / catch
try {
return historyService.findHistoricEntityLinkParentsForTask(taskId);
} catch (FlowableIllegalArgumentException e) {
return Collections.emptyList();
} Prevention
- Guard lookups chained off potentially-empty task queries
- Use Task.getId() as the only source of taskId for this API
- Log and skip missing tasks instead of forwarding null
When it happens
Trigger: new GetHistoricEntityLinkParentsForTaskCmd(null) — usually when a task query returned no result and the null was forwarded, or the variable holding the task id was never populated.
Common situations: Post-completion lookups where the task was deleted from history; passing an execution id or process instance id where a task id is expected; generic task-listener code invoked for non-process tasks.
Related errors
- taskId is required
- processInstanceId is required
- processInstanceId is required
- processInstanceId is required
- A delegated cannot be completed, but should be resolved…
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/c564e5bbac091526.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetHistoricEntityLinkParentsForTaskCmd.java:37
import org.flowable.common.engine.api.scope.ScopeTypes;
import org.flowable.common.engine.impl.interceptor.Command;
import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.impl.util.CommandContextUtil;
import org.flowable.entitylink.api.EntityLinkType;
import org.flowable.entitylink.api.history.HistoricEntityLink;
/**
* @author Javier Casal
*/
public class GetHistoricEntityLinkParentsForTaskCmd implements Command<List<HistoricEntityLink>>, Serializable {
private static final long serialVersionUID = 1L;
protected String taskId;
public GetHistoricEntityLinkParentsForTaskCmd(String taskId) {
if (taskId == null) {
throw new FlowableIllegalArgumentException("taskId is required");
}
this.taskId = taskId;
}
@Override
public List<HistoricEntityLink> execute(CommandContext commandContext) {
ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);
return processEngineConfiguration.getEntityLinkServiceConfiguration().getHistoricEntityLinkService()
.findHistoricEntityLinksByReferenceScopeIdAndType(taskId, ScopeTypes.TASK, EntityLinkType.CHILD);
}
}
View on GitHub (pinned to d6d39ce1c6)