flowable/flowable-engine · error · FlowableException

Unrecognized calledElementType [${calledElementType}] in ${e

Error message

Unrecognized calledElementType [${calledElementType}] in ${execution}

What it means

CallActivityBehavior.getProcessDefinition dispatches on the call activity's flowable:calledElementType attribute, which must be either 'key' or 'id'. Any other value falls through the switch's default branch and throws this FlowableException. It is a static configuration error in the BPMN XML of the call activity.

Source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/CallActivityBehavior.java:246

        processEngineConfiguration.getActivityInstanceEntityManager().recordSubProcessInstanceStart(executionEntity, subProcessInstance);

        CommandContextUtil.getAgenda().planContinueProcessOperation(subProcessInitialExecution);

        if (eventDispatcher != null && eventDispatcher.isEnabled()) {
            Map<String, Object> allVariables = new HashMap<>();
            allVariables.putAll(instanceBeforeContext.getVariables());
            allVariables.putAll(instanceBeforeContext.getTransientVariables());
            eventDispatcher.dispatchEvent(FlowableEventBuilder.createProcessStartedEvent(subProcessInitialExecution, allVariables, false),
                    processEngineConfiguration.getEngineCfgKey());
        }
        
    }

    protected ProcessDefinition getProcessDefinition(DelegateExecution execution, CallActivity callActivity, ProcessEngineConfigurationImpl processEngineConfiguration) {
        ProcessDefinition processDefinition = switch (StringUtils.isNotEmpty(calledElementType) ? calledElementType : CALLED_ELEMENT_TYPE_KEY) {
            case CALLED_ELEMENT_TYPE_ID -> getProcessDefinitionById(execution, processEngineConfiguration);
            case CALLED_ELEMENT_TYPE_KEY -> getProcessDefinitionByKey(execution, callActivity.isSameDeployment(), processEngineConfiguration);
            default -> throw new FlowableException("Unrecognized calledElementType [" + calledElementType + "] in " + execution);
        };
        return processDefinition;
    }

    @Override
    public void completing(DelegateExecution execution, DelegateExecution subProcessInstance) throws Exception {
        // only data. no control flow available on this execution.

        ExpressionManager expressionManager = CommandContextUtil.getProcessEngineConfiguration().getExpressionManager();

        // copy process variables
        ExecutionEntity executionEntity = (ExecutionEntity) execution;
        CallActivity callActivity = (CallActivity) executionEntity.getCurrentFlowElement();

        List<IOParameter> outParameters = callActivity.getOutParameters();
        if (!outParameters.isEmpty()) {
            BiConsumer<String, Object> variableConsumer = (variableName, value) -> {
                if (callActivity.isUseLocalScopeForOutParameters()) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Correct the calledElementType attribute in the call activity BPMN XML to exactly "key" or "id" and redeploy.
  2. Search the model XML for calledElementType and fix any value not matching CALLED_ELEMENT_TYPE_KEY/CALLED_ELEMENT_TYPE_ID constants.
  3. If the attribute is set programmatically, validate against allowed values before deployment.
  4. Remove the attribute entirely to fall back to the default (key) behavior if a key lookup is intended.

Example fix

// before
<callActivity id="callSub" calledElement="subProcess" flowable:calledElementType="definitionKey"/>
// after
<callActivity id="callSub" calledElement="subProcess" flowable:calledElementType="key"/>
Defensive patterns

Strategy: validation

Validate before calling

String t = callActivity.getAttributeValue("http://flowable.org/bpmn", "calledElementType");
if (t != null && !t.equals("key") && !t.equals("id")) throw new IllegalArgumentException("Bad calledElementType: " + t);

Try / catch

try { process.advance(); }
catch (FlowableException e) { if (e.getMessage().startsWith("Unrecognized calledElementType")) { fixBpmnAttributeAndRedeploy(); } else { throw e; } }

Prevention

When it happens

Trigger: A call activity element declares flowable:calledElementType with a value other than "key" or "id" (e.g. a typo like 'keys', 'Id', or 'definitionKey'), and the process reaches that call activity during execution.

Common situations: Hand-edited BPMN XML; bulk XML transformation or template generation producing an invalid attribute value; copy-paste from documentation of a different Flowable version with different accepted values.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/489e390a5fddda7d. Report an issue: GitHub.