Skip to content

Commit

Permalink
[Fix #3721] Reducing group event size
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtirado committed Oct 22, 2024
1 parent b733219 commit bf180f1
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 366 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@
package org.kie.kogito.app.audit.json;

import org.kie.kogito.event.job.JobInstanceDataEvent;
import org.kie.kogito.event.process.ProcessInstanceDataEvent;
import org.kie.kogito.event.usertask.UserTaskInstanceDataEvent;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;

import io.cloudevents.jackson.JsonFormat;

Expand All @@ -41,15 +38,7 @@ public static ObjectMapper getObjectMapper() {
}

public static ObjectMapper configure(ObjectMapper objectMapper) {
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
objectMapper.registerModule(JsonFormat.getCloudEventJacksonModule());
objectMapper.registerModule(new JavaTimeModule());

SimpleModule module = new SimpleModule("Kogito Cloud Events");
module.addDeserializer(ProcessInstanceDataEvent.class, new JsonProcessInstanceDataEventDeserializer());
module.addDeserializer(UserTaskInstanceDataEvent.class, new JsonUserTaskInstanceDataEventDeserializer());
module.addDeserializer(JobInstanceDataEvent.class, new JsonJobDataEventDeserializer());
objectMapper.registerModule(module);
return objectMapper;
return objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false).registerModule(JsonFormat.getCloudEventJacksonModule())
.registerModule(new SimpleModule("Data Audit").addDeserializer(JobInstanceDataEvent.class, new JsonJobDataEventDeserializer())).findAndRegisterModules();
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,13 @@
*/
package org.kie.kogito.index.json;

import org.kie.kogito.event.process.ProcessInstanceDataEvent;
import org.kie.kogito.event.usertask.UserTaskInstanceDataEvent;
import org.kie.kogito.jackson.utils.JsonObjectUtils;
import org.kie.kogito.jackson.utils.MergeUtils;
import org.kie.kogito.jackson.utils.ObjectMapperFactory;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;

import io.cloudevents.jackson.JsonFormat;

Expand All @@ -44,15 +40,7 @@ public static ObjectMapper getObjectMapper() {
}

public static ObjectMapper configure(ObjectMapper objectMapper) {
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
objectMapper.registerModule(JsonFormat.getCloudEventJacksonModule());
objectMapper.registerModule(new JavaTimeModule());

SimpleModule module = new SimpleModule("Kogito Cloud Events");
module.addDeserializer(ProcessInstanceDataEvent.class, new JsonProcessInstanceDataEventDeserializer());
module.addDeserializer(UserTaskInstanceDataEvent.class, new JsonUserTaskInstanceDataEventDeserializer());
objectMapper.registerModule(module);
return objectMapper;
return objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false).registerModule(JsonFormat.getCloudEventJacksonModule()).findAndRegisterModules();
}

public static ObjectNode mergeVariable(String variableName, Object variableValue, ObjectNode variables) {
Expand Down
Loading

0 comments on commit bf180f1

Please sign in to comment.