{"record":{"id":"b18aa23511299cdd","repo":"flowable/flowable-engine","slug":"the-channel-xml-key-detection-value-was-not-found-b18aa2","errorCode":null,"errorMessage":"The channel xml key detection value was not found for the channel model with key ${channelModel.key}. One of fixedValue, xmlPathExpression, delegateExpression should be set.","messagePattern":"The channel xml key detection value was not found for the channel model with key (.+?)\\. One of fixedValue, xmlPathExpression, delegateExpression should be set\\.","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/pipeline/InboundChannelModelProcessor.java","lineNumber":232,"sourceCode":"            eventTransformer = resolveExpression(channelModel.getEventTransformerDelegateExpression(), InboundEventTransformer.class);\n        }\n\n        InboundEventKeyDetector<Document> eventKeyDetector;\n\n        ChannelEventKeyDetection keyDetection = channelModel.getChannelEventKeyDetection();\n        if (keyDetection == null) {\n            throw new FlowableException(\"A channel key detection value is required for inbound channel \" + channelModel.getKey());\n        }\n\n        if (StringUtils.isNotEmpty(keyDetection.getFixedValue())) {\n            eventKeyDetector = new InboundEventStaticKeyDetector<>(keyDetection.getFixedValue());\n        } else if (StringUtils.isNotEmpty(keyDetection.getXmlXPathExpression())) {\n            eventKeyDetector = new XpathBasedInboundEventKeyDetector(keyDetection.getXmlXPathExpression());\n        } else if (StringUtils.isNotEmpty(keyDetection.getDelegateExpression())) {\n            //noinspection unchecked\n            eventKeyDetector = resolveExpression(keyDetection.getDelegateExpression(), InboundEventKeyDetector.class);\n        } else {\n            throw new FlowableException(\n                \"The channel xml key detection value was not found for the channel model with key \" + channelModel.getKey()\n                    + \". One of fixedValue, xmlPathExpression, delegateExpression should be set.\");\n        }\n\n        ChannelEventTenantIdDetection channelEventTenantIdDetection = channelModel.getChannelEventTenantIdDetection();\n        if (channelEventTenantIdDetection != null) {\n            if (StringUtils.isNotEmpty(channelEventTenantIdDetection.getFixedValue())) {\n                eventTenantDetector = new InboundEventStaticTenantDetector<>(channelEventTenantIdDetection.getFixedValue());\n            } else if (StringUtils.isNotEmpty(channelEventTenantIdDetection.getXmlXPathExpression())) {\n                eventTenantDetector = new XpathBasedInboundEventTenantDetector(channelEventTenantIdDetection.getXmlXPathExpression());\n            } else if (StringUtils.isNotEmpty(channelEventTenantIdDetection.getxPathExpression())) {\n                eventTenantDetector = new XpathBasedInboundEventTenantDetector(channelEventTenantIdDetection.getxPathExpression());\n            } else if (StringUtils.isNotEmpty(channelEventTenantIdDetection.getDelegateExpression())) {\n                //noinspection unchecked\n                eventTenantDetector = resolveExpression(channelEventTenantIdDetection.getDelegateExpression(), InboundEventTenantDetector.class);\n            } else {\n                throw new FlowableException(\n                    \"The channel xml tenant detection value was not found for the channel model with key \" + channelModel.getKey()","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/pipeline/InboundChannelModelProcessor.java#L214-L250","documentation":"Thrown when an XML inbound channel has a ChannelEventKeyDetection but none of fixedValue, xmlXPathExpression, or delegateExpression is populated. The block exists yet defines no key detection mechanism, so no InboundEventKeyDetector<Document> can be created.","triggerScenarios":"Registering an XML inbound channel with a non-null keyDetection where getFixedValue, getXmlXPathExpression and getDelegateExpression are all empty.","commonSituations":"Empty <keyDetection/> element in the channel model XML; using jsonField/jsonPointer (JSON-only options) on an XML channel — they are ignored here; attribute name typos during hand-editing.","solutions":["Populate one of keyDetection.fixedValue, keyDetection.xmlXPathExpression, or keyDetection.delegateExpression.","Use setXmlXPathExpression with an XPath that selects the event key from the document.","Use setDelegateExpression for a custom InboundEventKeyDetector<Document> bean.","If the detection was meant for JSON, move the channel to the JSON pipeline or convert the detection to an XPath expression."],"exampleFix":"// before\nChannelEventKeyDetection keyDetection = new ChannelEventKeyDetection();\nkeyDetection.setJsonField(\"type\"); // ignored on XML channels\n\n// after\nChannelEventKeyDetection keyDetection = new ChannelEventKeyDetection();\nkeyDetection.setXmlXPathExpression(\"/event/@type\");","handlingStrategy":"validation","validationCode":"ChannelEventKeyDetection kd = channelModel.getChannelEventKeyDetection();\nif (kd != null && isBlank(kd.getFixedValue()) && isBlank(kd.getXmlXPathExpression())\n        && isBlank(kd.getDelegateExpression())) {\n    throw new IllegalArgumentException(\"Empty keyDetection on XML channel \" + channelModel.getKey());\n}","typeGuard":"null","tryCatchPattern":"try {\n    eventRegistry.registerChannelModel(channelModel);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"xml key detection value was not found\")) {\n        logger.error(\"Set fixedValue/xmlXPathExpression/delegateExpression on channel {}\", channelModel.getKey());\n    }\n    throw e;\n}","preventionTips":["Use XML-specific options (xmlXPathExpression), not JSON ones (jsonField/jsonPointer)","Test XPath expressions against sample XML documents before registering","Keep one key detection option set per channel and delete leftover empty blocks"],"tags":["flowable","event-registry","missing-config","xml-channel"],"backgroundTag":"empty-required-field","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"}