flowable/flowable-engine · error · FlowableIllegalStateException
Cannot trigger case task plan item instance : reference type
Error message
Cannot trigger case task plan item instance : reference type '${referenceType}' not supported What it means
After checking referenceId, CaseTaskActivityBehavior.trigger validates that referenceType equals ReferenceTypes.PLAN_ITEM_CHILD_CASE. Any other reference type means this plan item is not backed by a child case, so triggering it as a case task is unsupported and this error is thrown.
Source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/CaseTaskActivityBehavior.java:172
.handleFormFieldsOnSubmit(variableInfo.formInfo, null, null, caseInstanceEntity.getId(), ScopeTypes.CMMN,
variablesFromFormSubmission, caseInstanceEntity.getTenantId());
}
if (!blocking) {
CommandContextUtil.getAgenda(commandContext).planCompletePlanItemInstanceOperation(planItemInstanceEntity);
}
}
@Override
public void trigger(CommandContext commandContext, PlanItemInstanceEntity planItemInstance) {
if (!PlanItemInstanceState.ACTIVE.equals(planItemInstance.getState())) {
throw new FlowableIllegalStateException("Can only trigger a plan item that is in the ACTIVE state");
}
if (planItemInstance.getReferenceId() == null) {
throw new FlowableIllegalStateException("Cannot trigger case task plan item instance : no reference id set");
}
if (!ReferenceTypes.PLAN_ITEM_CHILD_CASE.equals(planItemInstance.getReferenceType())) {
throw new FlowableIllegalStateException("Cannot trigger case task plan item instance : reference type '"
+ planItemInstance.getReferenceType() + "' not supported");
}
// load the case instance referenced by this case task plan item to check its current state
CaseInstanceEntity caseInstance = CommandContextUtil.getCaseInstanceEntityManager(commandContext).findById(planItemInstance.getReferenceId());
if (caseInstance != null) {
// Out parameters are handled here only when the case is still active (manual trigger scenario).
// When the child case completed normally, out parameters are already handled
// in ChildCaseInstanceStateChangeCallback before the child case gets deleted.
handleOutParameters(commandContext, planItemInstance);
if (caseInstance.getState().equals(CaseInstanceState.ACTIVE)) {
// Triggering the plan item (as opposed to a regular complete of the referenced case) manually terminates the case instance
CommandContextUtil.getAgenda(commandContext).planManualTerminateCaseInstanceOperation(planItemInstance.getReferenceId());
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Ensure the planItemInstanceId passed to triggerPlanItemInstance belongs to a case task plan item.
- Check planItemInstance.getReferenceType() equals PLAN_ITEM_CHILD_CASE before triggering.
- Use the behavior-appropriate completion path for other task types (e.g. process task handled via the child process).
- Audit runtime tables for corrupted reference_type values if this occurs without user error.
Example fix
// before
runtimeService.triggerPlanItemInstance(id); // plan item is a child-process task
// after
PlanItemInstance pii = runtimeService.createPlanItemInstanceQuery()
.planItemInstanceId(id).singleResult();
if (ReferenceTypes.PLAN_ITEM_CHILD_CASE.equals(pii.getReferenceType())) {
runtimeService.triggerPlanItemInstance(id);
} Defensive patterns
Strategy: validation
Validate before calling
PlanItemInstance pii = cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceId(id).singleResult(); boolean isChildCase = pii != null && ReferenceTypes.PLAN_ITEM_CHILD_CASE.equals(pii.getReferenceType());
Try / catch
try {
cmmnRuntimeService.triggerPlanItemInstance(id);
} catch (FlowableIllegalStateException e) {
if (e.getMessage().contains("reference type")) {
// wrong plan item type passed — route to the correct completion API
}
} Prevention
- Match plan item ids to their task type before triggering
- Check referenceType before programmatic completion
- Avoid sharing trigger code across case task and process task plan items
- Audit reference_type values after data migrations
When it happens
Trigger: Triggering a plan item instance whose referenceType is something other than PLAN_ITEM_CHILD_CASE — e.g. data from a different behavior type was reused, or instance data was migrated/corrupted across task types.
Common situations: Mixing up ids of case task and process task (child process) plan items when calling triggerPlanItemInstance; runtime data migrated from another engine version or another task type; custom behaviors setting their own reference types.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- Can only delete a child entity for a plan item with referenc
- Could not start case instance: no case reference defined in
- Can only trigger a plan item that is in the ACTIVE state
- Cannot trigger case task plan item instance : no reference i
- Cannot trigger process task plan item instance : reference t
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/193ae2cf99e9557b.
Report an issue: GitHub.