{"record":{"id":"5169e94f8841f88a","repo":"flowable/flowable-engine","slug":"no-event-object-was-passed-to-the-consumer","errorCode":null,"errorMessage":"No event object was passed to the consumer","messagePattern":"No event object was passed to the consumer","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/consumer/BaseEventRegistryEventConsumer.java","lineNumber":63,"sourceCode":" * @author Filip Hrisafov\n */\npublic abstract class BaseEventRegistryEventConsumer implements EventRegistryEventConsumer {\n\n    protected AbstractEngineConfiguration engineConfiguration;\n    protected CommandExecutor commandExecutor;\n\n    public BaseEventRegistryEventConsumer(AbstractEngineConfiguration engineConfiguration) {\n        this.engineConfiguration = engineConfiguration;\n        this.commandExecutor = engineConfiguration.getCommandExecutor();\n    }\n\n    @Override\n    public EventRegistryProcessingInfo eventReceived(EventRegistryEvent event) {\n        if (event.getEventObject() != null && event.getEventObject() instanceof EventInstance) {\n            return eventReceived((EventInstance) event.getEventObject());\n        } else {\n            if (event.getEventObject() == null) {\n                throw new FlowableIllegalArgumentException(\"No event object was passed to the consumer\");\n            } else {\n                throw new FlowableIllegalArgumentException(\"Unsupported event object type: \" + event.getEventObject().getClass());\n            }\n        }\n    }\n\n    protected abstract EventRegistryProcessingInfo eventReceived(EventInstance eventInstance);\n\n    /**\n     * Generates all possible correlation keys for the given correlation parameters.\n     * The first element in the list will only have used one parameter. The last element in the list has included all parameters.\n     */\n    protected Collection<CorrelationKey> generateCorrelationKeys(Collection<EventPayloadInstance> correlationParameterInstances) {\n\n        if (correlationParameterInstances.isEmpty()) {\n            return Collections.emptySet();\n        }\n","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/consumer/BaseEventRegistryEventConsumer.java#L45-L81","documentation":"BaseEventRegistryEventConsumer.eventReceived(EventRegistryEvent) throws FlowableIllegalArgumentException when the incoming event's getEventObject() is null. The consumer only knows how to process EventInstance payloads, so a null payload cannot be dispatched to eventReceived(EventInstance).","triggerScenarios":"A channel adapter or custom producer enqueues an EventRegistryEvent whose event object was never set, or the payload was lost/cleared between reception and consumption.","commonSituations":"Custom InboundEventChannelAdapter implementations that forget to wrap raw payloads into an EventInstance via EventRegistry.getEventPayloadConverter()/eventInstance building, deserialization returning null, or filtering pipelines dropping the payload.","solutions":["Ensure the inbound channel adapter builds an EventInstance (e.g. via InboundEventHandlingStateManager / event payload conversion) and sets it on the event before dispatch.","Inspect the custom adapter/transformer that created the EventRegistryEvent and verify setEventObject/getEventObject is populated.","Add logging at channel reception to confirm the raw payload is non-null and converts correctly."],"exampleFix":"// before\nEventRegistryEvent event = new EventRegistryEvent(null);\nconsumer.eventReceived(event);\n// after\nEventInstance eventInstance = eventRegistry.createEventInstance(\"myEventKey\", payload);\nEventRegistryEvent event = new EventRegistryEvent(eventInstance);\nconsumer.eventReceived(event);","handlingStrategy":"type-guard","validationCode":"if (event == null || event.getEventObject() == null) { log.warn(\"Skipping event with null payload\"); return; }","typeGuard":"boolean isConsumable(EventRegistryEvent e) { return e != null && e.getEventObject() instanceof EventInstance; }","tryCatchPattern":"try { consumer.eventReceived(event); } catch (FlowableIllegalArgumentException e) { log.error(\"Event payload missing: {}\", e.getMessage()); }","preventionTips":["Always wrap payloads into EventInstance in the inbound channel adapter","Log event objects at reception to catch nulls early","Write adapter unit tests asserting non-null EventInstance payloads"],"tags":["flowable","event-registry","null-argument","consumer"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}