flowable/flowable-engine · error · FlowableEventJsonException

The channel xml key detection value was not found for the ch

Error message

The channel xml key detection value was not found for the channel model with key ${key}. One of fixedValue, xmlPathExpression, delegateExpression should be set.

What it means

Thrown when an 'xml' inbound channel has a ChannelEventKeyDetection object, but fixedValue, xmlXPathExpression, and delegateExpression are all empty. No mechanism to determine the event key from the XML payload is specified.

Source

Thrown at modules/flowable-event-registry-json-converter/src/main/java/org/flowable/eventregistry/json/converter/InboundChannelModelValidator.java:65

            if (StringUtils.isEmpty(channelEventKeyDetection.getFixedValue()) &&
                StringUtils.isEmpty(channelEventKeyDetection.getJsonField()) &&
                StringUtils.isEmpty(channelEventKeyDetection.getJsonPointerExpression()) &&
                StringUtils.isEmpty(channelEventKeyDetection.getDelegateExpression())) {
                throw new FlowableEventJsonException(
                    "The channel json key detection value was not found for the channel model with key " + inboundChannelModel.getKey()
                        + ". One of fixedValue, jsonField, jsonPointerExpression, delegateExpression should be set.");
            }

        } else if ("xml".equalsIgnoreCase(deserializerType)) {
            if (channelEventKeyDetection == null) {
                throw new FlowableEventJsonException("A channel key detection value is required for the channel model with key " + inboundChannelModel.getKey());
            }

            if (StringUtils.isEmpty(channelEventKeyDetection.getFixedValue()) &&
                StringUtils.isEmpty(channelEventKeyDetection.getXmlXPathExpression()) &&
                StringUtils.isEmpty(channelEventKeyDetection.getDelegateExpression())) {
                throw new FlowableEventJsonException(
                    "The channel xml key detection value was not found for the channel model with key " + inboundChannelModel.getKey()
                        + ". One of fixedValue, xmlPathExpression, delegateExpression should be set.");
            }

        } else if ("expression".equalsIgnoreCase(deserializerType)) {
            if (StringUtils.isEmpty(inboundChannelModel.getDeserializerDelegateExpression())) {
                throw new FlowableEventJsonException(
                    "The channel deserializer delegate expression was not set for the channel model with key " + inboundChannelModel);
            }
        } else if (deserializerType != null) {
            throw new FlowableEventJsonException(
                "The deserializer type is not supported " + deserializerType + " for the channel model with key " + inboundChannelModel.getKey());
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Populate xmlXPathExpression with a valid XPath expression for the key element
  2. Set fixedValue for a static key
  3. Provide delegateExpression referencing a ChannelEventKeyDetection bean
  4. Remove the channel or switch deserializerType if XML key detection is not needed

Example fix

// before
"channelEventKeyDetection": {
  "xmlXPathExpression": ""
}
// after
"channelEventKeyDetection": {
  "xmlXPathExpression": "/event/@type"
}
Defensive patterns

Strategy: validation

Validate before calling

ChannelEventKeyDetection d = channel.getChannelEventKeyDetection();
if ("xml".equalsIgnoreCase(channel.getDeserializerType()) && d != null
    && isEmpty(d.getFixedValue()) && isEmpty(d.getXmlXPathExpression()) && isEmpty(d.getDelegateExpression())) {
    throw new IllegalArgumentException("xml key detection for '" + channel.getKey() + "' has no value");
}

Type guard

boolean hasXmlDetectionValue = d -> d != null && (isSet(d.getFixedValue()) || isSet(d.getXmlXPathExpression()) || isSet(d.getDelegateExpression()));

Try / catch

try {
    channelValidator.validateChannel(model);
} catch (FlowableEventJsonException e) {
    logger.error("XML key detection empty: {}", e.getMessage());
}

Prevention

When it happens

Trigger: validateDeserializer encounters deserializerType 'xml' with a non-null channelEventKeyDetection whose getFixedValue(), getXmlXPathExpression(), and getDelegateExpression() are all empty.

Common situations: Templates or generated models emitting an empty detection object; users clearing an XPath expression during editing without providing an alternative.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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