{"record":{"id":"4b56ec94d46846ac","repo":"flowable/flowable-engine","slug":"invalid-event-definition-id-null","errorCode":null,"errorMessage":"Invalid event definition id : null","messagePattern":"Invalid event definition id : null","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/persistence/deploy/EventDeploymentManager.java","lineNumber":71,"sourceCode":"    protected EventDeploymentEntityManager deploymentEntityManager;\n\n    public EventDeploymentManager(DeploymentCache<EventDefinitionCacheEntry> eventDefinitionCache, \n                    DeploymentCache<ChannelDefinitionCacheEntry> channelDefinitionCache, EventRegistryEngineConfiguration engineConfig) {\n        \n        this.eventDefinitionCache = eventDefinitionCache;\n        this.channelDefinitionCache = channelDefinitionCache;\n        this.engineConfig = engineConfig;\n    }\n\n    public void deploy(EventDeploymentEntity deployment) {\n        for (Deployer deployer : deployers) {\n            deployer.deploy(deployment);\n        }\n    }\n\n    public EventDefinitionEntity findDeployedEventDefinitionById(String eventDefinitionId) {\n        if (eventDefinitionId == null) {\n            throw new FlowableException(\"Invalid event definition id : null\");\n        }\n\n        // first try the cache\n        EventDefinitionCacheEntry cacheEntry = eventDefinitionCache.get(eventDefinitionId);\n        EventDefinitionEntity eventDefinition = cacheEntry != null ? cacheEntry.getEventDefinitionEntity() : null;\n\n        if (eventDefinition == null) {\n            eventDefinition = engineConfig.getEventDefinitionEntityManager().findById(eventDefinitionId);\n            if (eventDefinition == null) {\n                throw new FlowableObjectNotFoundException(\"no deployed event definition found with id '\" + eventDefinitionId + \"'\");\n            }\n            eventDefinition = resolveEventDefinition(eventDefinition).getEventDefinitionEntity();\n        }\n        return eventDefinition;\n    }\n    \n    public ChannelDefinitionEntity findDeployedChannelDefinitionById(String channelDefinitionId) {\n        if (channelDefinitionId == null) {","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/persistence/deploy/EventDeploymentManager.java#L53-L89","documentation":"findDeployedEventDefinitionById requires a non-null eventDefinitionId. When null is passed, it throws a plain FlowableException before any cache or database lookup. It is a fail-fast guard for a programming error on the caller side.","triggerScenarios":"Calling findDeployedEventDefinitionById(null), typically because the caller obtained the id from an unset field, a null map entry, or an upstream API response that lacked the id.","commonSituations":"Command classes (e.g. event-registry commands using it in execute) propagating null ids from request parameters; deserialization of incomplete deployment payloads; variable/property missing in a process context.","solutions":["Ensure the caller supplies a real event definition id before invoking the lookup","Null-check the id at the call site and return a meaningful error or skip the lookup","Trace where the null originates (request body, DB column, process variable) and fix the producer"],"exampleFix":"// before\nEventDefinitionEntity def = deploymentManager.findDeployedEventDefinitionById(request.getDefinitionId());\n// after\nif (request.getDefinitionId() != null) {\n    EventDefinitionEntity def = deploymentManager.findDeployedEventDefinitionById(request.getDefinitionId());\n}","handlingStrategy":"type-guard","validationCode":"if (eventDefinitionId == null || eventDefinitionId.isEmpty()) {\n    throw new IllegalArgumentException(\"eventDefinitionId is required\");\n}","typeGuard":"boolean hasDefinitionId(String id) { return id != null && !id.trim().isEmpty(); }","tryCatchPattern":"try {\n    def = deploymentManager.findDeployedEventDefinitionById(id);\n} catch (org.flowable.common.engine.api.FlowableException e) {\n    throw new IllegalArgumentException(\"event definition id must not be null\", e);\n}","preventionTips":["Null-check ids from requests/variables before lookup calls","Make id fields required at the API boundary","Log the origin of ids so nulls are caught early in tests"],"tags":["java","event-registry","null-check"],"backgroundTag":"null-argument","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"}