Giuseppe
Giuseppe

Reputation: 1

Kogito Intermediate catch Event Correlation

I hope someone can help me. I have two process

enter image description here

enter image description here

Log shows me the following message when the first process consumes event throws by the second process.

No matches found for trigger raccolta_dati in process cra_edit. Skipping consumed message CloudEventWrapDataEvent [cloudEvent=CloudEvent{id='c91d80dc-aaa9-43b4-83ae-dc6ce55f5424', source=/process/raccolta_dati, type='raccolta_dati', time=2024-01-30T17:56:57.096033500+01:00, data=JsonCloudEventData{node="string"}, extensions={kogitoproctype=BPMN, kogitoprocinstanceid=d48b1e4e-bc15-4ee7-8456-7b5a3adcc577, kogitoprocist=Active, kogitoprocversion=1.0, kogitoprocid=raccolta_dati}}]

For kafka i would use the same topic for all node events and my configuration is:

mp.messaging.incoming.kogito_incoming_stream.connector=${KOGITO.KAFKA.CONNECTOR} mp.messaging.incoming.kogito_incoming_stream.topic=${KAFKA.KOGITO.INCOMING-STREAM.TOPIC} mp.messaging.incoming.kogito_incoming_stream.value.deserializer=org.apache.kafka.common.serialization.StringDeserializer mp.messaging.incoming.kogito_incoming_stream.auto.offset.reset=earliest mp.messaging.incoming.kogito_incoming_stream.group.id=node-events-consumer

mp.messaging.outgoing.kogito_outgoing_stream.connector=${KOGITO.KAFKA.CONNECTOR} mp.messaging.outgoing.kogito_outgoing_stream.topic=${KAFKA.KOGITO.OUTGOING-STREAM.TOPIC} mp.messaging.outgoing.kogito_outgoing_stream.value.serializer=org.apache.kafka.common.serialization.StringSerializer

Kogito_incoming_stream and kogito_outgoing_stream have same topic.

Maybe i need to set the correlations but I do not understand where insert this configuration.

Thanks

Upvotes: 0

Views: 257

Answers (1)

Udara S.S Liyanage
Udara S.S Liyanage

Reputation: 6453

You need to set kogitoprocrefid in the message. It should match the id of the process instance. Check the comment section of https://blog.kie.org/2021/09/kogito-process-eventing-add-ons.html

{
  "specversion": "1.0",
  "id": "21627e26-31eb-43e7-8343-92a696fd96b1",
  "source": "",
  "type": "inbound.events",
  "time": "2024-11-11T13:25:16Z",
  "kogitoprocrefid": "6a582155-a524-4974-a9b2-9ceb7858026e",
  "correlationKey": "c1", 
  "data": {
    "status":"GOOD",
    "taskName":"MyTask"
  }
}

Upvotes: 0

Related Questions