{"record":{"id":"c3f282bbf2ce3d71","repo":"flowable/flowable-engine","slug":"event-definition-s-does-not-contain-correlation-p","errorCode":null,"errorMessage":"Event definition %s does not contain correlation parameters. Cannot verify if instance already exists.","messagePattern":"Event definition (.+?) does not contain correlation parameters\\. Cannot verify if instance already exists\\.","errorType":"exception","errorClass":"FlowableIllegalStateException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/consumer/BaseEventRegistryEventConsumer.java","lineNumber":151,"sourceCode":"    protected String generateCorrelationKey(Collection<EventPayloadInstance> correlationParameterInstances) {\n        Map<String, Object> data = new HashMap<>();\n        EventRegistryEngineConfiguration eventRegistryConfiguration = getEventRegistryEngineConfiguration();\n        for (EventPayloadInstance correlationParameterInstance : correlationParameterInstances) {\n            data.put(correlationParameterInstance.getDefinitionName(), eventRegistryConfiguration.getCorrelationValueTransformer().transformValue(correlationParameterInstance));\n        }\n\n        return getEventRegistry().generateKey(data);\n    }\n\n    protected CorrelationKey getCorrelationKeyWithAllParameters(Collection<CorrelationKey> correlationKeys, EventInstance eventInstance) {\n        CorrelationKey result = null;\n        for (CorrelationKey correlationKey : correlationKeys) {\n            if (result == null || (correlationKey.getParameterInstances().size() >= result.getParameterInstances().size()) ) {\n                result = correlationKey;\n            }\n        }\n        if (result == null) {\n            throw new FlowableIllegalStateException(String.format(\"Event definition %s does not contain correlation parameters. Cannot verify if instance already exists.\", eventInstance.getEventKey()));\n        }\n        return result;\n    }\n\n    protected List<EventSubscription> findEventSubscriptions(String scopeType, EventInstance eventInstance,  Collection<CorrelationKey> correlationKeys) {\n        return commandExecutor.execute(commandContext -> {\n\n            EventSubscriptionQuery eventSubscriptionQuery = createEventSubscriptionQuery()\n                .eventType(eventInstance.getEventKey())\n                .scopeType(scopeType);\n\n            if (!correlationKeys.isEmpty()) {\n\n                Set<String> allCorrelationKeyValues = correlationKeys.stream().map(CorrelationKey::getValue).collect(Collectors.toSet());\n\n                eventSubscriptionQuery.or()\n                    .withoutConfiguration()\n                    .configurations(allCorrelationKeyValues)","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/consumer/BaseEventRegistryEventConsumer.java#L133-L169","documentation":"getCorrelationKeyWithAllParameters throws FlowableIllegalStateException when the computed correlation keys list is empty, i.e. the event definition has no correlation parameters defined. Without correlation parameters it is impossible to build a correlation key, so deduplication/instance-existence checks cannot run.","triggerScenarios":"Consuming an event (start-form or event-registry triggered flow) whose event definition model lacks <correlation> parameter definitions, while the consumer path requires correlation (e.g. checking if a case/process instance already exists for the event).","commonSituations":"Event definition JSON/XML deployed without correlationParameter sections, a changed/renamed event key after model edits, or reusing a definition designed for fire-and-forget events in a correlation-required scenario.","solutions":["Add correlation parameter definitions to the event definition model (at least one parameter marked as correlation) and redeploy.","If the event should not correlate, adjust the consuming flow so it does not require correlation keys.","Verify eventInstance.getEventKey() matches the deployed definition that actually contains correlation parameters."],"exampleFix":"// before (event definition model)\n// no correlation parameters defined\n// after\n// in the event definition model add:\n// <correlationParameter name=\"orderId\" />\n// then redeploy the event definition","handlingStrategy":"validation","validationCode":"EventDefinitionModel model = eventRepositoryService.getEventDefinitionModelByKey(eventKey);\nif (model.getCorrelationParameters() == null || model.getCorrelationParameters().isEmpty()) throw new IllegalStateException(\"Event \" + eventKey + \" needs correlation parameters\");","typeGuard":null,"tryCatchPattern":"try { processEvent(eventInstance); } catch (FlowableIllegalStateException e) { log.error(\"Correlation not configured: {}\", e.getMessage()); }","preventionTips":["Define at least one correlationParameter in every event definition model","Review event registry resources in code review for correlation sections","Deploy models only via the Flowable modeler/schema validation"],"tags":["flowable","event-registry","correlation","misconfiguration"],"backgroundTag":"missing-required-config-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"}