{"record":{"id":"7834193a13297b4b","repo":"flowable/flowable-engine","slug":"flowable-5-process-definitions-are-not-supported-f","errorCode":null,"errorMessage":"Flowable 5 process definitions are not supported for ${execution}","messagePattern":"Flowable 5 process definitions are not supported for (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/DeleteMultiInstanceExecutionCmd.java","lineNumber":69,"sourceCode":"    @Override\n    public Void execute(CommandContext commandContext) {\n        ExecutionEntityManager executionEntityManager = CommandContextUtil.getExecutionEntityManager();\n        ExecutionEntity execution = executionEntityManager.findById(executionId);\n        \n        BpmnModel bpmnModel = ProcessDefinitionUtil.getBpmnModel(execution.getProcessDefinitionId());\n        Activity miActivityElement = (Activity) bpmnModel.getFlowElement(execution.getActivityId());\n        MultiInstanceLoopCharacteristics multiInstanceLoopCharacteristics = miActivityElement.getLoopCharacteristics();\n        \n        if (miActivityElement.getLoopCharacteristics() == null) {\n            throw new FlowableException(\"No multi instance execution found for \" + execution);\n        }\n        \n        if (!(miActivityElement.getBehavior() instanceof MultiInstanceActivityBehavior)) {\n            throw new FlowableException(\"No multi instance behavior found for \" + execution);\n        }\n        \n        if (Flowable5Util.isFlowable5ProcessDefinitionId(commandContext, execution.getProcessDefinitionId())) {\n            throw new FlowableException(\"Flowable 5 process definitions are not supported for \" + execution);\n        }\n        \n        ExecutionEntity miExecution = getMultiInstanceRootExecution(execution);\n        executionEntityManager.deleteChildExecutions(execution, \"Delete MI execution\", false);\n        executionEntityManager.deleteExecutionAndRelatedData(execution, \"Delete MI execution\", false);\n        \n        int loopCounter = 0;\n        if (multiInstanceLoopCharacteristics.isSequential()) {\n            SequentialMultiInstanceBehavior miBehavior = (SequentialMultiInstanceBehavior) miActivityElement.getBehavior();\n            loopCounter = miBehavior.getLoopVariable(execution, miBehavior.getCollectionElementIndexVariable());\n        }\n        \n        if (executionIsCompleted) {\n            VariableInstance nrOfCompletedInstancesVariable = miExecution.getVariableInstance(NUMBER_OF_COMPLETED_INSTANCES);\n            if (!ParallelMultiInstanceLoopVariableType.TYPE_NAME.equals(nrOfCompletedInstancesVariable.getTypeName())) {\n                Integer numberOfCompletedInstances = (Integer) nrOfCompletedInstancesVariable.getValue();\n                miExecution.setVariableLocal(NUMBER_OF_COMPLETED_INSTANCES, numberOfCompletedInstances + 1);\n            }","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/DeleteMultiInstanceExecutionCmd.java#L51-L87","documentation":"DeleteMultiInstanceExecutionCmd.execute() rejects process definitions created by the Flowable 5 engine; multi-instance execution deletion is only supported for Flowable 6+ definitions. The check uses Flowable5Util.isFlowable5ProcessDefinitionId on the execution's process definition.","triggerScenarios":"Passing an execution that belongs to a process definition deployed and executed via the Flowable 5 compatibility layer into the multi-instance delete command.","commonSituations":"Migrated projects still running legacy v5 process definitions side-by-side with v6; admin tooling or REST calls that apply v6-only MI operations to old process instances.","solutions":["Upgrade the process definition to a Flowable 6 (BPMN-native) deployment and start new instances from it.","For v5 instances, terminate the multi-instance via the v5 compatibility handler API instead of this command.","Check the process definition id/version with RepositoryService to confirm whether it is a v5 definition before calling the command.","Complete or delete the v5 process instance and redeploy as v6 if MI execution manipulation is required."],"exampleFix":"// before\nruntimeService.deleteMultiInstanceExecutionForExecution(executionId); // v5 definition\n// after\nProcessDefinition pd = repositoryService.createProcessDefinitionQuery()\n    .processInstanceId(executionId) // or resolve via execution\n    .singleResult();\nif (!Flowable5Util.isFlowable5ProcessDefinitionId(pd.getId())) {\n    runtimeService.deleteMultiInstanceExecutionForExecution(executionId);\n}","handlingStrategy":"validation","validationCode":"boolean isFlowable5(String processDefinitionId) {\n    return processDefinitionId != null && processDefinitionId.contains(\":\") && versionCheckIsV5(processDefinitionId);\n}\n// guard: skip v5 definitions before calling deleteMultiInstanceExecutionForExecution","typeGuard":null,"tryCatchPattern":"try { rs.deleteMultiInstanceExecutionForExecution(id); } catch (FlowableException e) { /* migrate to v6 or use v5 API */ }","preventionTips":["Migrate legacy v5 definitions to native Flowable 6 BPMN","Detect v5 definitions at deploy time and route operations accordingly","Document that MI manipulation commands are v6-only"],"tags":["workflow","compatibility","flowable5","multi-instance"],"backgroundTag":"unsupported-operation","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}