{"record":{"id":"5d4041d05255d4cd","repo":"flowable/flowable-engine","slug":"no-move-execution-or-activity-ids-or-enable-activi","errorCode":null,"errorMessage":"No move execution or activity ids or enable activity ids provided","messagePattern":"No move execution or activity ids or enable activity ids provided","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/ChangeActivityStateCmd.java","lineNumber":39,"sourceCode":"import org.flowable.engine.impl.util.CommandContextUtil;\n\n/**\n * @author Tijs Rademakers\n */\npublic class ChangeActivityStateCmd implements Command<Void> {\n\n    protected ChangeActivityStateBuilderImpl changeActivityStateBuilder;\n\n    public ChangeActivityStateCmd(ChangeActivityStateBuilderImpl changeActivityStateBuilder) {\n        this.changeActivityStateBuilder = changeActivityStateBuilder;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        if (changeActivityStateBuilder.getMoveExecutionIdList().isEmpty() && changeActivityStateBuilder.getMoveActivityIdList().isEmpty()\n                && changeActivityStateBuilder.getEnableActivityIdList().isEmpty()) {\n            \n            throw new FlowableIllegalArgumentException(\"No move execution or activity ids or enable activity ids provided\");\n\n        } else if ((!changeActivityStateBuilder.getMoveActivityIdList().isEmpty() || !changeActivityStateBuilder.getEnableActivityIdList().isEmpty()) && changeActivityStateBuilder.getProcessInstanceId() == null) {\n            throw new FlowableIllegalArgumentException(\"Process instance id is required\");\n        }\n\n        DynamicStateManager dynamicStateManager = CommandContextUtil.getProcessEngineConfiguration(commandContext).getDynamicStateManager();\n        dynamicStateManager.moveExecutionState(changeActivityStateBuilder, commandContext);\n\n        return null;\n    }\n}\n","sourceCodeStart":21,"sourceCodeEnd":51,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/ChangeActivityStateCmd.java#L21-L51","documentation":"ChangeActivityStateCmd moves a running process instance to different activities at runtime. This command requires at least one of: move execution ids, move activity ids, or enable activity ids. Flowable throws FlowableIllegalArgumentException when all three lists are empty because there is nothing to do.","triggerScenarios":"Calling runtimeService.createChangeActivityStateBuilder() without calling any of moveExecutionIdsToSingleActivityId(), moveExecutionIdToActivityIds(), moveActivityIdTo(), moveActivityIdsToSingleActivityId() or enableActivity(), then calling changeState().","commonSituations":"Building the builder conditionally from user input where none of the conditions matched; refactoring code that removed the move/enable call; passing empty collections that resulted in no ids being set on the builder.","solutions":["Call at least one move method (e.g. moveActivityIdTo) or enableActivity on the ChangeActivityStateBuilder before changeState().","Set the process instance id via changeActivityStateBuilder.processInstanceId(...) plus move/enable activity ids if using activity-id based movement.","Validate before calling changeState() that at least one target activity/execution id is present."],"exampleFix":"// before\nruntimeService.createChangeActivityStateBuilder().changeState();\n// after\nruntimeService.createChangeActivityStateBuilder()\n    .processInstanceId(processInstanceId)\n    .moveActivityIdTo(\"currentActivity\", \"targetActivity\")\n    .changeState();","handlingStrategy":"validation","validationCode":"if (moveExecutionIds.isEmpty() && moveActivityIds.isEmpty() && enableActivityIds.isEmpty()) {\n    throw new IllegalArgumentException(\"Provide at least one move/enable activity or execution id\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always chain a move or enable call on createChangeActivityStateBuilder before changeState().","Centralize state-change logic in a helper that enforces at least one target.","Validate user-supplied inputs resolve to non-empty id lists before building the command."],"tags":["flowable","process-instance","missing-argument","runtime-state"],"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-18T11:17:12.947Z"}