Skip to content

Commit

Permalink
publishign defintion on data index devservice and fix data type/schem…
Browse files Browse the repository at this point in the history
…a on events
  • Loading branch information
tiagodolphine committed Nov 1, 2023
1 parent 575d1b9 commit d7af0b0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public ProcessDefinitionDataEvent(ProcessDefinitionEventBody body) {
null,
null,
null,
null,
body.getType());
DATA_CONTENT_TYPE,
null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private Function<Process<?>, ProcessDefinitionDataEvent> mapProcessDefinition(Se
.setId(p.id())
.setName(p.name())
.setVersion(p.version())
.setType(ProcessDefinitionDataEvent.PROCESS_DEFINITION_EVENT)
.setType(p.type())
.setAddons(addons)
.setEndpoint(getEndpoint(endpoint, p))
.setNodes(getNodesDefinitions(p))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ public void publish(DataEvent<?> event) {

LOGGER.debug("Sending event to data index: {}", event);
switch (event.getType()) {
case "ProcessDefinitionDataEvent":
webClient.postAbs(dataIndexUrl.get() + "/definitions")
.putHeader(CONTENT_TYPE, CLOUD_EVENTS_CONTENT_TYPE)
.expect(ResponsePredicate.SC_ACCEPTED)
.sendJson(event, result -> {
if (result.failed()) {
LOGGER.error("Failed to send message to Data Index", result.cause());
} else {
LOGGER.debug("Event published to Data Index");
}
});
break;
case "ProcessInstanceErrorDataEvent":
case "ProcessInstanceNodeDataEvent":
case "ProcessInstanceSLADataEvent":
Expand Down

0 comments on commit d7af0b0

Please sign in to comment.