{"record":{"id":"31c99c45637f19b8","repo":"flowable/flowable-engine","slug":"no-key-set-for-channel-model","errorCode":null,"errorMessage":"No key set for channel model","messagePattern":"No key set for channel model","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/deployer/CachingAndArtifactsManager.java","lineNumber":82,"sourceCode":"        \n        DeploymentCache<ChannelDefinitionCacheEntry> channelDefinitionCache = eventRegistryEngineConfiguration.getDeploymentManager().getChannelDefinitionCache();\n\n        for (ChannelDefinitionEntity channelDefinition : parsedDeployment.getAllChannelDefinitions()) {\n            ChannelModel channelModel = parsedDeployment.getChannelModelForChannelDefinition(channelDefinition);\n            ChannelDefinitionCacheEntry cacheEntry = new ChannelDefinitionCacheEntry(channelDefinition, channelModel);\n            channelDefinitionCache.add(channelDefinition.getId(), cacheEntry);\n            \n            registerChannelModel(channelModel, channelDefinition, eventRegistryEngineConfiguration);\n\n            // Add to deployment for further usage\n            deployment.addDeployedArtifact(channelDefinition);\n        }\n    }\n    \n    public void registerChannelModel(ChannelModel channelModel, ChannelDefinition channelDefinition, EventRegistryEngineConfiguration eventRegistryEngineConfiguration) {\n        String channelDefinitionKey = channelModel.getKey();\n        if (StringUtils.isEmpty(channelDefinitionKey)) {\n            throw new FlowableIllegalArgumentException(\"No key set for channel model\");\n        }\n\n        if (channelModel instanceof InboundChannelModel inboundChannelModel) {\n\n            if (inboundChannelModel.getInboundEventChannelAdapter() != null) {\n                InboundEventChannelAdapter inboundEventChannelAdapter = (InboundEventChannelAdapter) inboundChannelModel.getInboundEventChannelAdapter();\n                inboundEventChannelAdapter.setEventRegistry(eventRegistryEngineConfiguration.getEventRegistry());\n                inboundEventChannelAdapter.setInboundChannelModel(inboundChannelModel);\n            }\n\n        } else if (!(channelModel instanceof OutboundChannelModel)) {\n            throw new FlowableIllegalArgumentException(\"Unrecognized ChannelModel class : \" + channelModel.getClass());\n        }\n\n        InboundChannelModelCacheManager.ChannelRegistration channelRegistration = null;\n        if (channelModel instanceof InboundChannelModel) {\n            channelRegistration = eventRegistryEngineConfiguration.getInboundChannelModelCacheManager()\n                    .registerChannelModel((InboundChannelModel) channelModel, channelDefinition);","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/deployer/CachingAndArtifactsManager.java#L64-L100","documentation":"CachingAndArtifactsManager.registerChannelModel throws FlowableIllegalArgumentException when the ChannelModel's key is null or empty. The key identifies the channel definition in the registry cache and database, so registration cannot proceed without it.","triggerScenarios":"Deploying an event registry model whose channel model is missing the id/key attribute, or constructing a ChannelModel programmatically without setting its key before deployment registration.","commonSituations":"Hand-edited event registry JSON where the channel's 'key' field was removed or renamed, programmatically built ChannelModel objects for tests, or model conversion tools dropping the key.","solutions":["Set the channel model's key/id in the event registry resource JSON and redeploy.","When building ChannelModel programmatically, call setKey(...) before registering/deploying.","Validate the deployed model with the event-registry JSON schema or a modeler before deployment."],"exampleFix":"// before\nInboundChannelModel model = new InboundChannelModel(); // key never set\n// after\nInboundChannelModel model = new InboundChannelModel();\nmodel.setKey(\"my-inbound-channel\");","handlingStrategy":"validation","validationCode":"if (channelModel == null || channelModel.getKey() == null || channelModel.getKey().isBlank()) throw new IllegalArgumentException(\"Channel model key required\");","typeGuard":null,"tryCatchPattern":"try { deployer.deploy(...); } catch (FlowableIllegalArgumentException e) { log.error(\"Channel model misconfigured: {}\", e.getMessage()); }","preventionTips":["Validate event registry JSON keys before deployment","Never hand-edit key attributes out of models","Add schema validation to the deployment pipeline"],"tags":["flowable","event-registry","deployment","validation"],"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-14T05:17:10.506Z"}