0

I'm trying to implement a small project on Kogito. I use kogito-addons-quarkus-messaging + kafka + cloud events.

The question is: How to get data written in cloud-events extensions in the context of a process instance?

I send a message to the service's incoming channel:

headers:

ce_id: 6dfde9b9-886e-4674-9936-1c6e2bfcd5dd, ce_kogitobusinesskey: asdasd, ce_source: https://github.com/cloudevents/sdk-java/tree/main/examples/kafka, ce_specversion: 1.0, ce_test: rest, ce_type: GetAccountList

payload:

{
   "a": "b"
}

the process instance starts, the payload is written to a variable, the business key is pulled up. Everything is fine.

enter image description here

Next, a service task is called, in which I log various data by context, but I can’t find the extension from the ce_test header anywhere

    public void showAll (KogitoProcessContext context) {
        System.out.println("headers: " + context.getHeaders());
        System.out.println("contextData: " + context.getContextData());
        if (!context.getContextData().isEmpty()) {
            context.getContextData().forEach((s, o) -> {
                System.out.println("CD name: " + s + " val: " + o);
            });
        }
        System.out.println("vars: " + context.getProcessInstance().getVariables());
        System.out.println("process meta: " + context.getProcessInstance().getProcess().getMetaData());
        System.out.println("node meta: " + context.getNodeInstance().getNode().getMetaData());
        System.out.println("PI_headers: " + context.getProcessInstance().getHeaders());
        System.out.println("events: " + Arrays.toString(context.getProcessInstance().getEventTypes()));
    }

Is it possible to interact with the ce_test: rest extension from event in bpmn or is it ignored and not written anywhere?

0 Answers0