{"record":{"id":"e7587314ecea4bf3","repo":"flowable/flowable-engine","slug":"cannot-resolve-calledelement-expression-calledp","errorCode":null,"errorMessage":"Cannot resolve calledElement expression '${calledProcessDefKey}' of callActivity '${callActivityId}'","messagePattern":"Cannot resolve calledElement expression '(.+?)' of callActivity '(.+?)'","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/dynamic/AbstractDynamicStateManager.java","lineNumber":414,"sourceCode":"                }\n                \n                CallActivity callActivity = null;\n                if (bpmnModelToMigrateTo != null) {\n                \tcallActivity = (CallActivity) resolveFlowElementFromBpmnModel(bpmnModelToMigrateTo, moveExecutionContainer.getCallActivityId());\n                } else {\n                \tcallActivity = (CallActivity) resolveFlowElementFromBpmnModel(bpmnModel, moveExecutionContainer.getCallActivityId());\n                }\n\n                moveExecutionContainer.setCallActivity(callActivity);\n                ProcessDefinition callActivityProcessDefinition = ProcessDefinitionUtil.getProcessDefinition(processDefinitionIdOfCallActivity);\n                String tenantId = callActivityProcessDefinition.getTenantId();\n                Integer calledProcessVersion = moveExecutionContainer.getCallActivitySubProcessVersion();\n                String calledProcessDefKey = callActivity.getCalledElement();\n                if (isExpression(calledProcessDefKey)) {\n                    try {\n                        calledProcessDefKey = expressionManager.createExpression(calledProcessDefKey).getValue(firstExecution.getProcessInstance()).toString();\n                    } catch (FlowableException e) {\n                        throw new FlowableException(\"Cannot resolve calledElement expression '\" + calledProcessDefKey + \"' of callActivity '\" + callActivity.getId() + \"'\", e);\n                    }\n                }\n                moveExecutionContainer.setSubProcessDefKey(calledProcessDefKey);\n                ProcessDefinition subProcessDefinition = resolveProcessDefinition(calledProcessDefKey, calledProcessVersion, tenantId, commandContext);\n                BpmnModel subProcessModel = ProcessDefinitionUtil.getBpmnModel(subProcessDefinition.getId());\n                moveExecutionContainer.setSubProcessDefinition(subProcessDefinition);\n                moveExecutionContainer.setSubProcessModel(subProcessModel);\n\n                newFlowElement = resolveFlowElementFromBpmnModel(subProcessModel, activityId);\n                canContainerDirectMigrate = false;\n                \n            } else {\n                // Get first execution to get process definition id\n                ExecutionEntity firstExecution = moveExecutionContainer.getExecutions().get(0);\n                BpmnModel bpmnModel = ProcessDefinitionUtil.getBpmnModel(firstExecution.getProcessDefinitionId());\n                currentActivityId = firstExecution.getCurrentActivityId();\n                currentFlowElement = resolveFlowElementFromBpmnModel(bpmnModel, currentActivityId);\n                if (bpmnModelToMigrateTo != null) {","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/dynamic/AbstractDynamicStateManager.java#L396-L432","documentation":"When moving execution state into/out of a callActivity, the callActivity's calledElement may be an expression. If evaluating that expression against the current process instance throws a FlowableException, it is wrapped and rethrown with the callActivity id. The expression (often referencing a variable) failed to evaluate.","triggerScenarios":"callActivity with flowable:calledElement=\"${someVar}\" where the variable is missing/null on the process instance, or the expression itself throws during evaluation while a move/change-state operation crosses the callActivity.","commonSituations":"Variable not set before the move operation; expression references a bean not present in the context; moving executions that pass a callActivity boundary without the variables the calledElement expression depends on.","solutions":["Ensure the variable used in the calledElement expression is set on the process instance before invoking change-state","Simplify or fix the expression syntax in the BPMN callActivity definition","Catch/inspect the wrapped cause (FlowableException e) for the root evaluation failure"],"exampleFix":"// before\ncalledElement=\"${targetProcess}\" with targetProcess never set\n// after\nruntimeService.setVariable(piId, \"targetProcess\", \"orderProcess\");\nbuilder.moveActivityIdTo(...).changeState();","handlingStrategy":"validation","validationCode":"Object target = runtimeService.getVariable(piId, \"targetProcess\");\nif (target == null) throw new IllegalStateException(\"calledElement variable missing for callActivity\");","typeGuard":null,"tryCatchPattern":"try { builder.changeState(); } catch (FlowableException e) { if (e.getMessage().contains(\"Cannot resolve calledElement expression\")) { logger.warn(\"cause\", e.getCause()); } else throw e; }","preventionTips":["Set all variables referenced by calledElement expressions before change-state","Prefer static calledElement values where possible","Log e.getCause() — the original expression failure is wrapped"],"tags":["flowable","expression","callactivity"],"backgroundTag":"invalid-config-value","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"}