{"record":{"id":"f1d1e1dde7a6f88e","repo":"flowable/flowable-engine","slug":"call-activity-executionactivityid-does-n","errorCode":null,"errorMessage":"Call activity '\" + executionActivityId + \"' does not exist in the new model. It must be mapped explicitly for migration (or all its child activities)","messagePattern":"Call activity '\" \\+ executionActivityId \\+ \"' does not exist in the 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":694,"sourceCode":"                if (subProcessActivityMappingsByCallActivityIdAndFromActivityId.containsKey(executionActivityId)) {\n                    Set<String> mappedSubProcessActivityIds = subProcessActivityMappingsByCallActivityIdAndFromActivityId.get(executionActivityId).keySet();\n                    List<ExecutionEntity> callActivityExecutions = filteredExecutionsByActivityId.get(executionActivityId).stream().filter(ExecutionEntity::isActive).collect(Collectors.toList());\n                    for (ExecutionEntity callActivityExecution : callActivityExecutions) { //parallel MultiInstance call activities\n                        List<ExecutionEntity> subProcessChildExecutions = executionEntityManager.findChildExecutionsByProcessInstanceId(callActivityExecution.getSubProcessInstance().getId());\n                        Set<String> childSubProcessExecutionActivityIds = subProcessChildExecutions.stream().map(Execution::getActivityId).collect(Collectors.toSet());\n                        childSubProcessExecutionActivityIds.removeAll(mappedSubProcessActivityIds);\n                        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)) {","sourceCodeStart":676,"sourceCodeEnd":712,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/migration/ProcessInstanceMigrationManagerImpl.java#L676-L712","documentation":"Thrown during auto-mapping when a call activity with running (unmapped) child instances has no explicit mapping and its activity id does not exist in the target process model. Migration of call activities with unmapped children requires the call activity itself to exist unchanged in the new model, otherwise instance state would be lost. The developer must map it explicitly.","triggerScenarios":"Migrating a process instance whose current execution tree contains a call activity with running child process instances, no activity mapping covers the call activity (or all its children), and the target model has no flow element with that id.","commonSituations":"The new model renamed or removed the call activity; a process refactor deleted the sub-process invocation; the migration document omitted mappings for the call activity's children.","solutions":["Add an explicit activity mapping for the call activity in the migration document: .addActivityMapping(oldId, newId)","Map all running child activities of the call activity explicitly so auto-mapping is not needed","Restore or keep the call activity id unchanged in the target model","Migrate the child process instances separately or terminate them before migrating"],"exampleFix":"// before\nruntimeService.createProcessInstanceMigrationBuilder()\n    .migrateToProcessDefinition(newDefId) // callActivity 'callTask1' removed in new model\n    .migrate(instanceId);\n// after\nruntimeService.createProcessInstanceMigrationBuilder()\n    .migrateToProcessDefinition(newDefId)\n    .addActivityMapping(\"callTask1\", \"callTask2\") // explicit mapping\n    .migrate(instanceId);","handlingStrategy":"validation","validationCode":"ProcessDefinition newDef = repositoryService.getProcessDefinition(targetDefId);\nBpmnModel newModel = repositoryService.getBpmnModel(newDef.getId());\nif (newModel.getFlowElement(\"callTask1\") == null && runningChildrenUnmapped) {\n    // add explicit mapping for callTask1 before migrating\n}","typeGuard":null,"tryCatchPattern":"try {\n    migrationBuilder.migrate(instanceId);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"Call activity\") && e.getMessage().contains(\"does not exist in the new model\")) {\n        // rebuild document with explicit call activity mapping\n    }\n}","preventionTips":["Always run validateMigrations before migrate()","Keep call activity ids stable across versions","Map call activities explicitly whenever their children are running","Diff old and new BpmnModels in tests before deploying breaking versions"],"tags":["flowable","migration","call-activity","missing-mapping"],"backgroundTag":"entity-not-found","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"}