diff --git a/event-processing/README.md b/event-processing/README.md index bdf0c3a2..34bd2897 100644 --- a/event-processing/README.md +++ b/event-processing/README.md @@ -64,7 +64,7 @@ A message event that should be able to work with the event processor should: * define a message name that matches the events' name * if not a start event, define a correlation key that matches the events' id -* have an end listener with the job type `correlated` +* have an end listener or a following service task with the job type `correlated` Now, an event can be published and its state can be tracked with the rest api: @@ -100,3 +100,9 @@ mvn spring-boot:run ``` To connect against another cluster (saas for example), you can adjust the application.yaml according to [this guide](https://docs.camunda.io/docs/apis-tools/spring-zeebe-sdk/getting-started/). + +There is an example [process](./src/test/resources/eventHandler.bpmn) and [request](./src/test/resources/createEventRequest.json) available in the tests. + +Just deploy the process and send a request to publish an event as documented above. + +![img.png](docs/img4.png) diff --git a/event-processing/docs/img4.png b/event-processing/docs/img4.png new file mode 100644 index 00000000..ef69244f Binary files /dev/null and b/event-processing/docs/img4.png differ diff --git a/event-processing/src/main/java/com/camunda/consulting/eventprocessing/ExampleServiceCalls.java b/event-processing/src/main/java/com/camunda/consulting/eventprocessing/ExampleServiceCalls.java new file mode 100644 index 00000000..b442fa9b --- /dev/null +++ b/event-processing/src/main/java/com/camunda/consulting/eventprocessing/ExampleServiceCalls.java @@ -0,0 +1,26 @@ +package com.camunda.consulting.eventprocessing; + +import io.camunda.zeebe.spring.client.annotation.JobWorker; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +@Component +public class ExampleServiceCalls { + private static final Logger LOG = LoggerFactory.getLogger(ExampleServiceCalls.class); + + @JobWorker + public void service1() { + LOG.info("Service 1 called"); + } + + @JobWorker + public void service2() { + LOG.info("Service 2 called"); + } + + @JobWorker + public void service3() { + LOG.info("Service 3 called"); + } +} diff --git a/event-processing/src/main/java/com/camunda/consulting/eventprocessing/Mapper.java b/event-processing/src/main/java/com/camunda/consulting/eventprocessing/Mapper.java index cfd22280..53e1df7a 100644 --- a/event-processing/src/main/java/com/camunda/consulting/eventprocessing/Mapper.java +++ b/event-processing/src/main/java/com/camunda/consulting/eventprocessing/Mapper.java @@ -23,10 +23,15 @@ import java.util.Objects; import java.util.function.Function; +/** + * Please ignore this class for the example. + * + *
This is just a generic mapper to map dto - pojo - entity as they are separated
+ */
public class Mapper {
private static final Map