{"record":{"id":"75f4a0d3d5c058bc","repo":"flowable/flowable-engine","slug":"call-activity-executionactivityid-loop-c","errorCode":null,"errorMessage":"Call activity '\" + executionActivityId + \"' loop characteristics differs in new model. It must be mapped explicitly for migration (or all its child activities)","messagePattern":"Call activity '\" \\+ executionActivityId \\+ \"' loop characteristics differs in new model\\. It must be mapped explicitly for migration \\(or all its child activities\\)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/migration/ProcessInstanceMigrationManagerImpl.java","lineNumber":701,"sourceCode":"                        if (!childSubProcessExecutionActivityIds.isEmpty()) {\n                            runningChildrenNotFullyMapped = true;\n                            break;\n                        }\n                    }\n                }\n\n                if (!subProcessActivityMappingsByCallActivityIdAndFromActivityId.containsKey(executionActivityId) || runningChildrenNotFullyMapped) {\n                    //If there are running child activities not mapped, the call activity must be equally valid in the new model, the activityId in the new model must refer also to a callActivity with matching callElement\n                    FlowElement newModelFlowElement = newModel.getFlowElement(executionActivityId);\n                    if (newModelFlowElement == null) {\n                        throw new FlowableException(\"Call activity '\" + executionActivityId + \"' does not exist in the new model. It must be mapped explicitly for migration (or all its child activities)\");\n                    }\n                    if (newModelFlowElement instanceof CallActivity) {\n                        if (!referToSameCalledElement((CallActivity) currentModelFlowElement, (CallActivity) newModelFlowElement)) {\n                            throw new FlowableException(\"Call activity '\" + executionActivityId + \"' has a different called element in the new model. It must be mapped explicitly for migration (or all its child activities)\");\n                        }\n                        if (((CallActivity) currentModelFlowElement).hasMultiInstanceLoopCharacteristics() ^ ((CallActivity) newModelFlowElement).hasMultiInstanceLoopCharacteristics()) {\n                            throw new FlowableException(\"Call activity '\" + executionActivityId + \"' loop characteristics differs in new model. It must be mapped explicitly for migration (or all its child activities)\");\n                        }\n                    } else {\n                        throw new FlowableException(\"Call activity '\" + executionActivityId + \"' is not a Call Activity in the new model. It must be mapped explicitly for migration (or all its child activities)\");\n                    }\n                }\n            }\n\n            String flowElementMultiInstanceParentId = getFlowElementMultiInstanceParentId(currentModelFlowElement);\n            if (flowElementMultiInstanceParentId != null && mappedFromActivities.contains(flowElementMultiInstanceParentId)) {\n                // Add the parent MI execution activity Id to be explicitly mapped...\n                if (!executionActivityIdsToMapExplicitly.contains(flowElementMultiInstanceParentId)) {\n                    executionActivityIdsToMapExplicitly.add(flowElementMultiInstanceParentId);\n                }\n                // The root executions are the ones to migrate and are explicitly mapped\n                List<ExecutionEntity> miRootExecutions = (List<ExecutionEntity>) executionEntityManager.findInactiveExecutionsByActivityIdAndProcessInstanceId(flowElementMultiInstanceParentId, processInstanceExecution.getId());\n                filteredExecutionsByActivityId.put(flowElementMultiInstanceParentId, miRootExecutions);\n                \n            } else {","sourceCodeStart":683,"sourceCodeEnd":719,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/migration/ProcessInstanceMigrationManagerImpl.java#L683-L719","documentation":"Thrown when a call activity with running unmapped children exists in both models but exactly one of the models declares multi-instance loop characteristics for it. A change in loop cardinality/structure of an actively running multi-instance call activity cannot be auto-migrated, so an explicit mapping is required.","triggerScenarios":"Migrating instances where the call activity had multi-instance characteristics added or removed in the new model (XOR of hasMultiInstanceLoopCharacteristics is true) and no explicit mapping exists.","commonSituations":"Adding a multi-instance (parallel/sequential) wrapper to a previously simple call activity, or removing it, in a new definition version while instances are mid-flight inside that call activity.","solutions":["Add an explicit activity mapping for the call activity in the migration document","Keep loop characteristics identical in the target model version","Terminate or complete the running multi-instance children before migrating","Redesign the migration in steps: complete the MI branch, then migrate to the new model"],"exampleFix":"// before\n// callActivity had no MI in v1, got multiInstanceLoopCharacteristics in v2, unmapped\n// after\nmigrationBuilder.addActivityMapping(\"miCallActivity\", \"miCallActivity\");","handlingStrategy":"validation","validationCode":"boolean oldMI = ((CallActivity) oldModel.getFlowElement(id)).hasMultiInstanceLoopCharacteristics();\nboolean newMI = ((CallActivity) newModel.getFlowElement(id)).hasMultiInstanceLoopCharacteristics();\nif (oldMI ^ newMI) { /* explicit mapping required */ }","typeGuard":null,"tryCatchPattern":"try {\n    migrationBuilder.migrate(instanceId);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"loop characteristics differs\")) {\n        // add explicit mapping or keep MI configuration identical\n    }\n}","preventionTips":["Avoid adding/removing multi-instance on activities that can be running during migration","Stage such refactors behind a new activity id","Validate migrations in CI against realistic running instances","Map MI call activities explicitly by default"],"tags":["flowable","migration","multi-instance","call-activity"],"backgroundTag":"incompatible-source-type","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"}