{"record":{"id":"4e1cb9b4c6401e09","repo":"flowable/flowable-engine","slug":"flowable-5-process-definitions-are-not-supported","errorCode":null,"errorMessage":"Flowable 5 process definitions are not supported","messagePattern":"Flowable 5 process definitions are not supported","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/AddMultiInstanceExecutionCmd.java","lineNumber":62,"sourceCode":"\n    public AddMultiInstanceExecutionCmd(String activityId, String parentExecutionId, Map<String, Object> executionVariables) {\n        this.activityId = activityId;\n        this.parentExecutionId = parentExecutionId;\n        this.executionVariables = executionVariables;\n    }\n\n    @Override\n    public Execution execute(CommandContext commandContext) {\n        ExecutionEntityManager executionEntityManager = CommandContextUtil.getExecutionEntityManager();\n        \n        ExecutionEntity miExecution = searchForMultiInstanceActivity(activityId, parentExecutionId, executionEntityManager);\n        \n        if (miExecution == null) {\n            throw new FlowableException(\"No multi instance execution found for activity id \" + activityId);\n        }\n        \n        if (Flowable5Util.isFlowable5ProcessDefinitionId(commandContext, miExecution.getProcessDefinitionId())) {\n            throw new FlowableException(\"Flowable 5 process definitions are not supported\");\n        }\n        \n        ExecutionEntity childExecution = executionEntityManager.createChildExecution(miExecution);\n        childExecution.setCurrentFlowElement(miExecution.getCurrentFlowElement());\n        \n        BpmnModel bpmnModel = ProcessDefinitionUtil.getBpmnModel(miExecution.getProcessDefinitionId());\n        Activity miActivityElement = (Activity) bpmnModel.getFlowElement(miExecution.getActivityId());\n        MultiInstanceLoopCharacteristics multiInstanceLoopCharacteristics = miActivityElement.getLoopCharacteristics();\n        \n        Integer currentNumberOfInstances = (Integer) miExecution.getVariable(NUMBER_OF_INSTANCES);\n        miExecution.setVariableLocal(NUMBER_OF_INSTANCES, currentNumberOfInstances + 1);\n        \n        if (executionVariables != null) {\n            childExecution.setVariablesLocal(executionVariables);\n        }\n        \n        if (!multiInstanceLoopCharacteristics.isSequential()) {\n            miExecution.setActive(true);","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/AddMultiInstanceExecutionCmd.java#L44-L80","documentation":"FlowableException thrown in AddMultiInstanceExecutionCmd.execute when the process definition the MI execution belongs to is a Flowable 5 process definition. The dynamic add-multi-instance-execution feature is implemented only for the Flowable 6 engine internals; V5 compatibility processes are routed to the Flowable5CompatibilityHandler for identity links but not supported for this command, so it fails fast.","triggerScenarios":"Calling runtimeService.addMultiInstanceExecution(activityId, processInstanceId, variables) where the running instance was started from a Flowable 5 (Activiti 5-compatible) process definition, detected via Flowable5Util.isFlowable5ProcessDefinitionId.","commonSituations":"Migrated projects running mixed V5/V6 process definitions (V5 definitions loaded from the old ACT_ tables); dynamically adding executions in a shared engine where some deployments predate Flowable 6; assumption that all runtime features work on legacy definitions.","solutions":["Redeploy the process definition with the Flowable 6 BPMN converter (flowable.process-definition-location / v5 conversion) so new instances run on V6 internals.","Do not use dynamic MI execution manipulation on V5 definitions — instead redesign the process or implement the dynamic behavior inside the V5 model itself.","Guard the call: check Flowable5Util.isFlowable5ProcessDefinitionId (or the definition's deployment metadata) before invoking addMultiInstanceExecution."],"exampleFix":"// before\nruntimeService.addMultiInstanceExecution(activityId, processInstanceId, vars); // may hit V5 definition\n// after\nProcessDefinition def = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionId(runtimeService.createProcessInstanceQuery()\n        .processInstanceId(processInstanceId).singleResult().getProcessDefinitionId()).singleResult();\nif (def.getEngineVersion() == null || \"v6\".equals(def.getEngineVersion())) {\n    runtimeService.addMultiInstanceExecution(activityId, processInstanceId, vars);\n}","handlingStrategy":"try-catch","validationCode":"ProcessDefinition def = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionId(definitionId).singleResult();\nboolean isV5 = def != null && \"activiti\".equalsIgnoreCase(def.getEngineVersion());\nif (isV5) {\n    // skip dynamic MI manipulation for V5 definitions\n}","typeGuard":null,"tryCatchPattern":"try {\n    runtimeService.addMultiInstanceExecution(activityId, piId, vars);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"Flowable 5 process definitions are not supported\")) {\n        // migrate/redeploy the definition on V6 or use an alternative mechanism\n    }\n    throw e;\n}","preventionTips":["Convert all legacy V5/Activiti definitions to Flowable 6 format at deployment time.","Document that dynamic process manipulation APIs are V6-only and gate their use in shared engines.","Track engineVersion on deployed definitions and expose it to feature-toggle logic."],"tags":["flowable","compatibility","flowable5","unsupported-feature"],"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"}