flowable/flowable-engine · error · FlowableIllegalArgumentException

No key set for channel model

Error message

No key set for channel model

What it means

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.

Source

Thrown at modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/deployer/CachingAndArtifactsManager.java:82

        
        DeploymentCache<ChannelDefinitionCacheEntry> channelDefinitionCache = eventRegistryEngineConfiguration.getDeploymentManager().getChannelDefinitionCache();

        for (ChannelDefinitionEntity channelDefinition : parsedDeployment.getAllChannelDefinitions()) {
            ChannelModel channelModel = parsedDeployment.getChannelModelForChannelDefinition(channelDefinition);
            ChannelDefinitionCacheEntry cacheEntry = new ChannelDefinitionCacheEntry(channelDefinition, channelModel);
            channelDefinitionCache.add(channelDefinition.getId(), cacheEntry);
            
            registerChannelModel(channelModel, channelDefinition, eventRegistryEngineConfiguration);

            // Add to deployment for further usage
            deployment.addDeployedArtifact(channelDefinition);
        }
    }
    
    public void registerChannelModel(ChannelModel channelModel, ChannelDefinition channelDefinition, EventRegistryEngineConfiguration eventRegistryEngineConfiguration) {
        String channelDefinitionKey = channelModel.getKey();
        if (StringUtils.isEmpty(channelDefinitionKey)) {
            throw new FlowableIllegalArgumentException("No key set for channel model");
        }

        if (channelModel instanceof InboundChannelModel inboundChannelModel) {

            if (inboundChannelModel.getInboundEventChannelAdapter() != null) {
                InboundEventChannelAdapter inboundEventChannelAdapter = (InboundEventChannelAdapter) inboundChannelModel.getInboundEventChannelAdapter();
                inboundEventChannelAdapter.setEventRegistry(eventRegistryEngineConfiguration.getEventRegistry());
                inboundEventChannelAdapter.setInboundChannelModel(inboundChannelModel);
            }

        } else if (!(channelModel instanceof OutboundChannelModel)) {
            throw new FlowableIllegalArgumentException("Unrecognized ChannelModel class : " + channelModel.getClass());
        }

        InboundChannelModelCacheManager.ChannelRegistration channelRegistration = null;
        if (channelModel instanceof InboundChannelModel) {
            channelRegistration = eventRegistryEngineConfiguration.getInboundChannelModelCacheManager()
                    .registerChannelModel((InboundChannelModel) channelModel, channelDefinition);

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Set the channel model's key/id in the event registry resource JSON and redeploy.
  2. When building ChannelModel programmatically, call setKey(...) before registering/deploying.
  3. Validate the deployed model with the event-registry JSON schema or a modeler before deployment.

Example fix

// before
InboundChannelModel model = new InboundChannelModel(); // key never set
// after
InboundChannelModel model = new InboundChannelModel();
model.setKey("my-inbound-channel");
Defensive patterns

Strategy: validation

Validate before calling

if (channelModel == null || channelModel.getKey() == null || channelModel.getKey().isBlank()) throw new IllegalArgumentException("Channel model key required");

Try / catch

try { deployer.deploy(...); } catch (FlowableIllegalArgumentException e) { log.error("Channel model misconfigured: {}", e.getMessage()); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

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/31c99c45637f19b8. Report an issue: GitHub.