flowable/flowable-engine · error · FlowableIllegalArgumentException
No move plan item instance or (activate) plan item definitio
Error message
No move plan item instance or (activate) plan item definition ids provided
What it means
ChangePlanItemStateCmd.execute() requires at least one of: plan item instances to move, plan item definitions to activate, terminate, change to available, wait for repetition, or stop waiting for repetition. If the ChangePlanItemStateBuilder is completely empty, Flowable throws FlowableIllegalArgumentException since there is no state change to perform.
Source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/ChangePlanItemStateCmd.java:45
protected CmmnEngineConfiguration cmmnEngineConfiguration;
protected ChangePlanItemStateBuilderImpl changePlanItemStateBuilder;
public ChangePlanItemStateCmd(ChangePlanItemStateBuilderImpl changePlanItemStateBuilder, CmmnEngineConfiguration cmmnEngineConfiguration) {
this.changePlanItemStateBuilder = changePlanItemStateBuilder;
this.cmmnEngineConfiguration = cmmnEngineConfiguration;
}
@Override
public Void execute(CommandContext commandContext) {
if (changePlanItemStateBuilder.getActivatePlanItemDefinitions().size() == 0 &&
changePlanItemStateBuilder.getTerminatePlanItemDefinitions().size() == 0 &&
changePlanItemStateBuilder.getChangeToAvailableStatePlanItemDefinitions().size() == 0 &&
changePlanItemStateBuilder.getWaitingForRepetitionPlanItemDefinitions().size() == 0 &&
changePlanItemStateBuilder.getRemoveWaitingForRepetitionPlanItemDefinitions().size() == 0) {
throw new FlowableIllegalArgumentException("No move plan item instance or (activate) plan item definition ids provided");
} else if (changePlanItemStateBuilder.getCaseInstanceId() == null) {
throw new FlowableIllegalArgumentException("Case instance id is required");
}
CmmnDynamicStateManager dynamicStateManager = cmmnEngineConfiguration.getDynamicStateManager();
dynamicStateManager.movePlanItemInstanceState(changePlanItemStateBuilder, commandContext);
return null;
}
}
View on GitHub (pinned to d6d39ce1c6)
Solutions
- Add at least one movePlanItemInstanceIdTo(...) or activatePlanItemDefinition(...) call before changeState().
- Check builder.getActivatePlanItemDefinitions() etc. size client-side and skip the changeState call when empty.
- Fix code paths that silently drop intended builder operations (e.g. swallowed exceptions during plan construction).
Example fix
// before
ChangePlanItemStateBuilder b = cmmnRuntimeService.createChangePlanItemStateBuilder(caseInstanceId);
if (applyMove) { b = b.movePlanItemInstanceIdTo(id, "stage2"); }
b.changeState(); // throws when applyMove == false
// after
if (applyMove) {
cmmnRuntimeService.createChangePlanItemStateBuilder(caseInstanceId)
.movePlanItemInstanceIdTo(id, "stage2").changeState();
} Defensive patterns
Strategy: validation
Validate before calling
if (moves.isEmpty() && activations.isEmpty() && terminations.isEmpty()) { skipChangeState(); return; } Try / catch
try { builder.changeState(); } catch (FlowableIllegalArgumentException e) { /* empty or invalid change plan */ } Prevention
- Only call changeState() after at least one builder operation succeeded.
- Guard dynamic plan generation with an emptiness check.
- Unit-test the code path where no operations are selected.
When it happens
Trigger: Calling cmmnRuntimeService.createChangePlanItemStateBuilder(caseInstanceId).changeState() without calling any of movePlanItemInstanceIdTo(...), activatePlanItemDefinition(...), terminatePlanItemDefinition(...), changeToAvailableState(...), waitingForRepetition(...), or removeWaitingForRepetition(...).
Common situations: Building the change list conditionally (e.g. from user input) and all conditions being false; a typo'd builder call returning a new builder instance; dynamic generation producing an empty plan.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- Case instance id is required
- Can only complete plan item instances of type stage. Type is
- Can only complete a stage plan item instance that is marked
- Cannot find plan item with definition id '<planItemDefinitio
- Setting transient variable is not supported for read only de
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/aa77d973aac9722a.
Report an issue: GitHub.