diff --git a/digiwf-connector/digiwf-camunda-connector-service/pom.xml b/digiwf-connector/digiwf-camunda-connector-service/pom.xml index 02bec96135..598b50ed3f 100644 --- a/digiwf-connector/digiwf-camunda-connector-service/pom.xml +++ b/digiwf-connector/digiwf-camunda-connector-service/pom.xml @@ -6,8 +6,6 @@ digiwf-camunda-connector-service digiwf-camunda-connector-service - - de.muenchen.oss.digiwf @@ -51,13 +49,6 @@ jackson-module-kotlin - - - de.muenchen.oss.digiwf - digiwf-spring-security-starter - ${project.version} - - com.h2database diff --git a/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application-local.properties b/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application-local.properties deleted file mode 100644 index f8831a7548..0000000000 --- a/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application-local.properties +++ /dev/null @@ -1,15 +0,0 @@ -server.port=8090 -logging.level.io.muenchendigital=info -logging.level.org.springframework=info -camunda.bpm.client.base-url=http://localhost:39146/engine-rest -#spring.cloud.stream -digiwf.streaming.connector.topics.message=dwf-connector-local-01 -digiwf.streaming.connector.topics.incident=dwf-connector-incident-local-01 -digiwf.streaming.connector.topics.bpmnerror=dwf-connector-bpmnerror-local-01 -digiwf.streaming.connector.topics.dlq=dwf-connector-local-01-dlq -digiwf.streaming.connector.group=dwf-connector-local-01 -spring.cloud.stream.kafka.binder.brokers=${KAFKA_BOOTSTRAP_SERVER:localhost}:${KAFKA_BOOTSTRAP_SERVER_PORT:29092} -spring.cloud.stream.kafka.binder.consumerProperties.auto.offset.reset=latest - -digiwf.security.client-id=${SSO_TASK_CLIENT_ID} -digiwf.security.client-secret=${SSO_TASK_CLIENT_SECRET} diff --git a/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application-local.yml b/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application-local.yml new file mode 100644 index 0000000000..0ab9e84a55 --- /dev/null +++ b/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application-local.yml @@ -0,0 +1,38 @@ +digiwf: + streaming: + connector: + topics: + bpmnerror: dwf-connector-bpmnerror-local-01 + incident: dwf-connector-incident-local-01 + message: dwf-connector-local-01 + dlq: dwf-connector-local-01-dlq + group: dwf-connector-local-01 + security: + client-id: ${SSO_TASK_CLIENT_ID} + client-secret: ${SSO_TASK_CLIENT_SECRET} +spring: + cloud: + stream: + kafka: + binder: + consumerProperties: + auto: + offset: + reset: latest + brokers: ${KAFKA_BOOTSTRAP_SERVER:localhost}:${KAFKA_BOOTSTRAP_SERVER_PORT:29092} +logging: + level: + org: + springframework: info + io: + muenchendigital: info +server: + port: '8090' +de: + muenchen: + oss: + digiwf: + connector: + core: + integrations: + exampleIntegration: "dwf-example-integration-${DIGIWF_ENV}" diff --git a/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application-streaming.properties b/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application-streaming.properties deleted file mode 100644 index c854ec0ec6..0000000000 --- a/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application-streaming.properties +++ /dev/null @@ -1,21 +0,0 @@ -spring.cloud.stream.default-binder=kafka -#Spring Cloud Functions -spring.cloud.function.definition=createIncident;createBpmnError;correlateMessage;dynamicProducer; -spring.cloud.stream.bindings.correlateMessage-in-0.destination=${digiwf.streaming.connector.topics.message} -spring.cloud.stream.bindings.correlateMessage-in-0.group=${digiwf.streaming.connector.group} -spring.cloud.stream.bindings.createIncident-in-0.destination=${digiwf.streaming.connector.topics.incident} -spring.cloud.stream.bindings.createIncident-in-0.group=${digiwf.streaming.connector.group} -spring.cloud.stream.bindings.createBpmnError-in-0.destination=${digiwf.streaming.connector.topics.bpmnerror} -spring.cloud.stream.bindings.createBpmnError-in-0.group=${digiwf.streaming.connector.group} -spring.cloud.stream.bindings.dynamicProducer-out-0.destination=${digiwf.streaming.connector.topics.message} -spring.cloud.stream.bindings.dynamicProducer-out-0.producer.auto-startup=true -#Kafka Config -spring.cloud.stream.kafka.binder.consumerProperties.key.deserializer=org.springframework.kafka.support.serializer.JsonDeserializer -spring.cloud.stream.kafka.binder.consumerProperties.value.deserializer=org.springframework.kafka.support.serializer.JsonDeserializer -spring.cloud.stream.kafka.binder.producerProperties.key.serializer=org.springframework.kafka.support.serializer.JsonSerializer -spring.cloud.stream.kafka.binder.producerProperties.value.serializer=org.springframework.kafka.support.serializer.JsonSerializer -spring.kafka.consumer.properties.spring.json.trusted.packages=* -#DLQ Config -> only possible if group for functionRouter is set -spring.cloud.stream.default.consumer.maxAttempts=1 -spring.cloud.stream.kafka.default.consumer.dlqName=${digiwf.streaming.connector.topics.dlq} -spring.cloud.stream.kafka.default.consumer.enableDlq=true diff --git a/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application-streaming.yml b/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application-streaming.yml new file mode 100644 index 0000000000..2d4d50b47a --- /dev/null +++ b/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application-streaming.yml @@ -0,0 +1,46 @@ +spring: + cloud: + stream: + kafka: + binder: + producerProperties: + value: + serializer: org.springframework.kafka.support.serializer.JsonSerializer + key: + serializer: org.springframework.kafka.support.serializer.JsonSerializer + consumerProperties: + key: + deserializer: org.springframework.kafka.support.serializer.JsonDeserializer + value: + deserializer: org.springframework.kafka.support.serializer.JsonDeserializer + default: + consumer: + dlqName: ${digiwf.streaming.connector.topics.dlq} + enableDlq: 'true' + bindings: + dynamicProducer-out-0: + destination: ${digiwf.streaming.connector.topics.message} + producer: + auto-startup: 'true' + createBpmnError-in-0: + group: ${digiwf.streaming.connector.group} + destination: ${digiwf.streaming.connector.topics.bpmnerror} + createIncident-in-0: + destination: ${digiwf.streaming.connector.topics.incident} + group: ${digiwf.streaming.connector.group} + correlateMessage-in-0: + group: ${digiwf.streaming.connector.group} + destination: ${digiwf.streaming.connector.topics.message} + default-binder: kafka + default: + consumer: + maxAttempts: '1' + function: + definition: createIncident;createBpmnError;correlateMessage;dynamicProducer; + kafka: + consumer: + properties: + spring: + json: + trusted: + packages: '*' diff --git a/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application.properties b/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application.properties deleted file mode 100644 index fe7b37f85d..0000000000 --- a/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application.properties +++ /dev/null @@ -1,5 +0,0 @@ -server.port=8080 -spring.application.name=@project.artifactId@ -camunda.bpm.client.date-format=yyyy-MM-dd'T'HH:mm:ss.SSSX - -feign.client.config.default.url=${ENGINE_CAMUNDA_REST_ENDPOINT_URL} diff --git a/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application.yml b/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application.yml new file mode 100644 index 0000000000..baf116b7cb --- /dev/null +++ b/digiwf-connector/digiwf-camunda-connector-service/src/main/resources/application.yml @@ -0,0 +1,33 @@ +spring: + application: + name: '@project.artifactId@' +server: + port: '8080' +feign: + client: + config: + default: + url: ${ENGINE_CAMUNDA_REST_ENDPOINT_URL} + digiwf-process-instance: + name: digiwf-process-instance + url: ${ENGINE_REST_ENDPOINT_URL} +camunda: + bpm: + client: + base-url: ${ENGINE_CAMUNDA_REST_ENDPOINT_URL} + date-format: yyyy-MM-dd'T'HH:mm:ss.SSSX +de: + muenchen: + oss: + digiwf: + connector: + core: + integrations: + addressIntegration: "dwf-address-${DIGIWF_ENV}" + alwIntegration: "dwf-alw-${DIGIWF_ENV}" + cosysIntegration: "dwf-cosys-${DIGIWF_ENV}" + dmsIntegration: "dwf-dms-${DIGIWF_ENV}" + emailIntegration: "dwf-email-${DIGIWF_ENV}" + s3Integration: "dwf-s3-${DIGIWF_ENV}" + # TODO: Remove this fallback after all processes are migrated to the new version. It's a legacy feature to avoid breaking changes. + deprecatedLegacyFeature: ${digiwf.streaming.connector.topics.dlq} diff --git a/digiwf-connector/digiwf-camunda-rest-connector-starter/pom.xml b/digiwf-connector/digiwf-camunda-rest-connector-starter/pom.xml index df25ce682d..66240e1634 100644 --- a/digiwf-connector/digiwf-camunda-rest-connector-starter/pom.xml +++ b/digiwf-connector/digiwf-camunda-rest-connector-starter/pom.xml @@ -67,6 +67,13 @@ digiwf-connector-starter ${project.version} + + + de.muenchen.oss.digiwf + digiwf-spring-security-starter + ${project.version} + + diff --git a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/DigiWFCamundaConnectorAutoConfiguration.java b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/DigiWFCamundaConnectorAutoConfiguration.java index 68e56d05de..6ac7f05864 100644 --- a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/DigiWFCamundaConnectorAutoConfiguration.java +++ b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/DigiWFCamundaConnectorAutoConfiguration.java @@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.messaging.Message; @@ -23,6 +24,7 @@ @RequiredArgsConstructor @ComponentScan(basePackages = "de.muenchen.oss.digiwf.connector.adapter.camunda.rest") @EnableConfigurationProperties(DigiWFCamundaConnectorProperties.class) +@EnableFeignClients(basePackages = "de.muenchen.oss.digiwf.connector.adapter.camunda.rest.out") public class DigiWFCamundaConnectorAutoConfiguration { diff --git a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClient.java b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClient.java index 5c78212a1f..1d597f5f5f 100644 --- a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClient.java +++ b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClient.java @@ -3,6 +3,8 @@ import de.muenchen.oss.digiwf.connector.adapter.camunda.rest.mapper.EngineDataSerializer; import de.muenchen.oss.digiwf.connector.core.application.port.in.ExecuteTaskInPort; import de.muenchen.oss.digiwf.connector.core.application.port.in.ExecuteTaskInPort.ExecuteTaskCommand; +import de.muenchen.oss.digiwf.connector.core.domain.IntegrationNameConfigException; +import de.muenchen.oss.digiwf.connector.core.domain.ProcessDefinitionLoadingException; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.camunda.bpm.client.task.ExternalTask; @@ -10,7 +12,6 @@ import org.camunda.bpm.client.task.ExternalTaskService; import java.util.Map; -import java.util.Optional; import java.util.stream.Collectors; @@ -25,21 +26,33 @@ public class CamundaClient implements ExternalTaskHandler { @Override public void execute(final ExternalTask externalTask, final ExternalTaskService externalTaskService) { final Map data = this.getData(externalTask); - final String topic = (String) data.get(CamundaClientConfiguration.TOPIC_NAME); + String integrationName = (String) data.get(CamundaClientConfiguration.INTEGRATION_NAME); + final String customTopic = (String) data.get(CamundaClientConfiguration.TOPIC_NAME); final String type = (String) data.get(CamundaClientConfiguration.TYPE_NAME); - log.info("External task received (topic {}, type {})", topic, type); - final Optional message = Optional.ofNullable(data.get(CamundaClientConfiguration.MESSAGE_NAME)).map(Object::toString); + log.info("External task received (integration {}, type {})", integrationName, type); final Map filteredData = this.filterVariables(data); - executeTaskInPort.executeTask(ExecuteTaskCommand.builder() - .messageName(message.orElse(null)) - .destination(topic) - .type(type) - .instanceId(externalTask.getProcessInstanceId()) - .data(filteredData) - .build()); + // TODO: Remove this fallback after all processes are migrated to the new version. It's a legacy feature to avoid breaking changes. + if (integrationName == null) { + log.warn("Integration name is null. Falling back to deprecated legacy feature. Please update your process definition."); + integrationName = "deprecatedLegacyFeature"; + } - externalTaskService.complete(externalTask); + try { + executeTaskInPort.executeTask(ExecuteTaskCommand.builder() + .customDestination(customTopic) + .integrationName(integrationName) + .type(type) + .instanceId(externalTask.getProcessInstanceId()) + .data(filteredData) + .build()); + + externalTaskService.complete(externalTask); + } catch (final IntegrationNameConfigException e) { + externalTaskService.handleFailure(externalTask, e.getMessage(), e.getDetailedMessage(), 0, 0); + } catch (final ProcessDefinitionLoadingException e) { + externalTaskService.handleFailure(externalTask, e.getMessage(), e.getDetailedMessage(), 0, 0); + } } diff --git a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClientConfiguration.java b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClientConfiguration.java index f6829653f8..c0fe01f0e4 100644 --- a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClientConfiguration.java +++ b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClientConfiguration.java @@ -7,17 +7,16 @@ @RequiredArgsConstructor public class CamundaClientConfiguration { - - public final static String MESSAGE_NAME = "app_message_name"; public final static String TYPE_NAME = "app_type_name"; public final static String TOPIC_NAME = "app_topic_name"; - + public final static String INTEGRATION_NAME = "app_integration_name"; + private final List filteredVariables; public List getFilters() { final List allFilters = new ArrayList<>(); allFilters.addAll(this.filteredVariables); - allFilters.addAll(List.of(MESSAGE_NAME, TOPIC_NAME, TYPE_NAME)); + allFilters.addAll(List.of(TOPIC_NAME, TYPE_NAME, INTEGRATION_NAME)); return allFilters; } } diff --git a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/IncidentAdapter.java b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/IncidentAdapter.java index 2cbfca4253..f77d33fd43 100644 --- a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/IncidentAdapter.java +++ b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/IncidentAdapter.java @@ -26,17 +26,17 @@ public class IncidentAdapter implements CreateIncidentOutPort { private final EventSubscriptionApi eventSubscriptionApi; @Override - public void createIncident(final String processInstanceId, final String messageName, final String messageContent) { + public void createIncident(final String processInstanceId, final String integrationName, final String messageContent) { try { //check parameters Assert.notNull(processInstanceId, "process instance id cannot be empty"); - Assert.notNull(messageName, "message name cannot be empty"); + Assert.notNull(integrationName, "integrationName name cannot be empty"); //load corresponding event subscription final List eventSubscriptions = this.eventSubscriptionApi.getEventSubscriptions( null, - messageName, + integrationName, EVENT_TYPE, null, processInstanceId, @@ -69,7 +69,7 @@ public void createIncident(final String processInstanceId, final String messageN // send create incident call this.executionApi.createIncident(executionId, createIncidentDto); } catch (final NoSuchElementException | IllegalArgumentException e) { - log.error("Cannot create incident for processinstance id {} and message name {}", processInstanceId, messageName); + log.error("Cannot create incident for processinstance id {} and integration name {}", processInstanceId, integrationName); throw new RuntimeException(e); } diff --git a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/processdefinition/ProcessDefinitionAdapter.java b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/processdefinition/ProcessDefinitionAdapter.java new file mode 100644 index 0000000000..299c8dcd77 --- /dev/null +++ b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/processdefinition/ProcessDefinitionAdapter.java @@ -0,0 +1,23 @@ +package de.muenchen.oss.digiwf.connector.adapter.camunda.rest.out.processdefinition; + +import de.muenchen.oss.digiwf.connector.core.application.port.out.ProcessOutPort; +import de.muenchen.oss.digiwf.connector.core.domain.ProcessDefinitionLoadingException; +import feign.FeignException; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class ProcessDefinitionAdapter implements ProcessOutPort { + + private final ProcessInstanceClient processInstanceClient; + + @Override + public String loadProcessDefinition(final String processInstanceId) throws ProcessDefinitionLoadingException { + try { + return processInstanceClient.getRootProcessInstanceDetail(processInstanceId).getDefinitionName(); + } catch (final FeignException e) { + throw new ProcessDefinitionLoadingException("Could not load process definition for process instance with id " + processInstanceId, e.getMessage()); + } + } +} diff --git a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/processdefinition/ProcessInstanceClient.java b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/processdefinition/ProcessInstanceClient.java new file mode 100644 index 0000000000..133bfb0383 --- /dev/null +++ b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/processdefinition/ProcessInstanceClient.java @@ -0,0 +1,19 @@ +package de.muenchen.oss.digiwf.connector.adapter.camunda.rest.out.processdefinition; + +import de.muenchen.oss.digiwf.spring.security.client.DigiwfFeignOauthClientConfig; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +@FeignClient( + name = "${feign.client.config.digiwf-process-instance.name:digiwf-process-instance}", + url = "${feign.client.config.digiwf-process-instance.url}rest/service/instance", + configuration = DigiwfFeignOauthClientConfig.class +) +public interface ProcessInstanceClient { + + @RequestMapping(method = RequestMethod.GET, value = "/root/{id}") + ServiceInstanceTO getRootProcessInstanceDetail(@PathVariable("id") final String id); + +} diff --git a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/processdefinition/ServiceInstanceTO.java b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/processdefinition/ServiceInstanceTO.java new file mode 100644 index 0000000000..eebfd691fa --- /dev/null +++ b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/processdefinition/ServiceInstanceTO.java @@ -0,0 +1,22 @@ +package de.muenchen.oss.digiwf.connector.adapter.camunda.rest.out.processdefinition; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ServiceInstanceTO { + private String id; + private String definitionName; + private Date startTime; + private Date endTime; + private String status; + private String description; + +} diff --git a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/resources/bpmn/StreamingTemplateV02.bpmn b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/resources/bpmn/StreamingTemplateV02.bpmn index 13d8245be8..c30ac4cd9d 100644 --- a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/resources/bpmn/StreamingTemplateV02.bpmn +++ b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/main/resources/bpmn/StreamingTemplateV02.bpmn @@ -1,5 +1,11 @@ - + Flow_0riqkf6 @@ -59,7 +65,7 @@ - + diff --git a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClientConfigurationTest.java b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClientConfigurationTest.java index be18086f27..4dff844557 100644 --- a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClientConfigurationTest.java +++ b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClientConfigurationTest.java @@ -9,7 +9,7 @@ import static org.assertj.core.api.Assertions.assertThat; -public class CamundaClientConfigurationTest { +class CamundaClientConfigurationTest { private CamundaClientConfiguration config; private List initialFilteredVariables; @@ -23,11 +23,11 @@ void setUp() { @Test void testGetFilters() { List expectedFilters = Arrays.asList("var1", "var2", "var3", - CamundaClientConfiguration.MESSAGE_NAME, CamundaClientConfiguration.TOPIC_NAME, - CamundaClientConfiguration.TYPE_NAME); + CamundaClientConfiguration.TYPE_NAME, + CamundaClientConfiguration.INTEGRATION_NAME); List actualFilters = config.getFilters(); - assertThat(actualFilters).containsAll(expectedFilters); + assertThat(actualFilters).isEqualTo(expectedFilters); } } diff --git a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClientTest.java b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClientTest.java index 496279d960..a7c0cda9b8 100644 --- a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClientTest.java +++ b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/in/CamundaClientTest.java @@ -18,7 +18,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -public class CamundaClientTest { +class CamundaClientTest { @Mock private ExecuteTaskInPort executeTaskInPort; @@ -44,12 +44,47 @@ public void setUp() { } @Test - public void testExecute() { + void testExecute() { // Prepare test data VariableMap testData = new VariableMapImpl(); + testData.put(CamundaClientConfiguration.INTEGRATION_NAME, "testIntegrationName"); + testData.put(CamundaClientConfiguration.TYPE_NAME, "testType"); + testData.put("someOtherKey", "someOtherValue"); + + HashMap filteredData = new HashMap<>(); + filteredData.put("someOtherKey", "someOtherValue"); + + // Configure mocks + ExecuteTaskInPort.ExecuteTaskCommand expectedCommand = ExecuteTaskInPort.ExecuteTaskCommand.builder() + .integrationName("testIntegrationName") + .type("testType") + .instanceId("testProcessInstanceId") + .data(filteredData) + .build(); + + when(externalTask.getProcessInstanceId()).thenReturn("testProcessInstanceId"); + when(externalTask.getAllVariablesTyped()).thenReturn(testData); + when(serializer.fromEngineData(testData)).thenReturn(testData); + when(clientConfiguration.getFilters()).thenReturn(List.of( + CamundaClientConfiguration.TOPIC_NAME, + CamundaClientConfiguration.TYPE_NAME, + CamundaClientConfiguration.INTEGRATION_NAME)); + + // Execute the method under test + camundaClient.execute(externalTask, externalTaskService); + + // Verify interactions and assert conditions + verify(executeTaskInPort).executeTask(expectedCommand); + verify(externalTaskService).complete(externalTask); + } + + @Test + void testExecute_forCustomIntegration() { + // Prepare test data + VariableMap testData = new VariableMapImpl(); + testData.put(CamundaClientConfiguration.INTEGRATION_NAME, "testIntegrationName"); testData.put(CamundaClientConfiguration.TOPIC_NAME, "testTopic"); testData.put(CamundaClientConfiguration.TYPE_NAME, "testType"); - testData.put(CamundaClientConfiguration.MESSAGE_NAME, "testMessage"); testData.put("someOtherKey", "someOtherValue"); HashMap filteredData = new HashMap<>(); @@ -57,9 +92,9 @@ public void testExecute() { // Configure mocks ExecuteTaskInPort.ExecuteTaskCommand expectedCommand = ExecuteTaskInPort.ExecuteTaskCommand.builder() - .destination("testTopic") + .integrationName("testIntegrationName") + .customDestination("testTopic") .type("testType") - .messageName("testMessage") .instanceId("testProcessInstanceId") .data(filteredData) .build(); @@ -70,7 +105,7 @@ public void testExecute() { when(clientConfiguration.getFilters()).thenReturn(List.of( CamundaClientConfiguration.TOPIC_NAME, CamundaClientConfiguration.TYPE_NAME, - CamundaClientConfiguration.MESSAGE_NAME)); + CamundaClientConfiguration.INTEGRATION_NAME)); // Execute the method under test camundaClient.execute(externalTask, externalTaskService); diff --git a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/processdefinition/ProcessDefinitionAdapterTest.java b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/processdefinition/ProcessDefinitionAdapterTest.java new file mode 100644 index 0000000000..93a2def188 --- /dev/null +++ b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/adapter/camunda/rest/out/processdefinition/ProcessDefinitionAdapterTest.java @@ -0,0 +1,63 @@ +package de.muenchen.oss.digiwf.connector.adapter.camunda.rest.out.processdefinition; + +import de.muenchen.oss.digiwf.connector.core.application.port.out.ProcessOutPort; +import de.muenchen.oss.digiwf.connector.core.domain.ProcessDefinitionLoadingException; +import feign.FeignException; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +class ProcessDefinitionAdapterTest { + + private final ProcessInstanceClient processInstanceClient = mock(ProcessInstanceClient.class); + private ProcessOutPort processOutPort; + + @BeforeEach + void setup() { + processOutPort = new ProcessDefinitionAdapter(processInstanceClient); + } + + + @Test + void test_processDefinitionAdapterReturnsRootProcessDefinitionForInstanceId() { + // Arrange + final String processInstanceId = "validProcessInstanceId"; + final String expectedDefinitionName = "rootProcessDefinition"; + + final ServiceInstanceTO serviceInstanceTO = ServiceInstanceTO.builder() + .id(processInstanceId) + .definitionName(expectedDefinitionName) + .build(); + + when(processInstanceClient.getRootProcessInstanceDetail(processInstanceId)).thenReturn(serviceInstanceTO); + + // Act + final String actualDefinitionName = processOutPort.loadProcessDefinition(processInstanceId); + + // Assert + assertThat(actualDefinitionName).isEqualTo(expectedDefinitionName); + } + + @Test + void test_processDefinitionAdapterThrowsProcessDefinitionExceptionIfClientRequestFails() { + // Arrange + String processInstanceId = "validProcessInstanceId"; + String feignExceptionMessage = "Feign exception message"; + + final FeignException feignException = mock(FeignException.class); + when(feignException.getMessage()).thenReturn(feignExceptionMessage); + + when(processInstanceClient.getRootProcessInstanceDetail(processInstanceId)).thenThrow(feignException); + + // Act and Assert + assertThatThrownBy(() -> processOutPort.loadProcessDefinition(processInstanceId)) + .isInstanceOf(ProcessDefinitionLoadingException.class) + .hasMessage("Could not load process definition for process instance with id " + processInstanceId) + .hasFieldOrPropertyWithValue("detailedMessage", feignExceptionMessage); + } + +} diff --git a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/resources/Feature_GenericErrors.bpmn b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/resources/Feature_GenericErrors.bpmn index 0e5fb30b9a..1938519864 100644 --- a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/resources/Feature_GenericErrors.bpmn +++ b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/resources/Feature_GenericErrors.bpmn @@ -16,7 +16,6 @@ false - bpmnError Flow_1umpo2a @@ -31,7 +30,6 @@ ${errorCode} ${topic} bpmnerror - bpmnError ${execution.processInstanceId} @@ -130,13 +128,13 @@ - + - + diff --git a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/resources/bpmn/ExampleProcess.bpmn b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/resources/bpmn/ExampleProcess.bpmn index 8cf6bace2b..43c462c4f8 100644 --- a/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/resources/bpmn/ExampleProcess.bpmn +++ b/digiwf-connector/digiwf-camunda-rest-connector-starter/src/test/resources/bpmn/ExampleProcess.bpmn @@ -12,10 +12,10 @@ Flow_1xd5oxg Flow_0nyulbz - var meinjson = { + var meinjson = { "testString": "Hallo das ist mein Gruß" , "testNumber": 100 , -"testBoolean": true +"testBoolean": true } execution.setVariable('objectData', S(JSON.stringify(meinjson))); @@ -25,7 +25,6 @@ execution.setVariable('objectData', S(JSON.stringify(meinjson))); - diff --git a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/DigiWFConnectorAutoConfiguration.java b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/DigiWFConnectorAutoConfiguration.java index db9d63630f..e0e49f2c9e 100644 --- a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/DigiWFConnectorAutoConfiguration.java +++ b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/DigiWFConnectorAutoConfiguration.java @@ -1,10 +1,12 @@ package de.muenchen.oss.digiwf.connector.core; import lombok.RequiredArgsConstructor; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.ComponentScan; @RequiredArgsConstructor @ComponentScan(basePackages = "de.muenchen.oss.digiwf.connector.core") +@EnableConfigurationProperties(DigiWFConnectorProperties.class) public class DigiWFConnectorAutoConfiguration { } diff --git a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/DigiWFConnectorProperties.java b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/DigiWFConnectorProperties.java new file mode 100644 index 0000000000..87bc6eb20f --- /dev/null +++ b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/DigiWFConnectorProperties.java @@ -0,0 +1,16 @@ +package de.muenchen.oss.digiwf.connector.core; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.validation.annotation.Validated; + +import java.util.Map; + +@Getter +@Setter +@Validated +@ConfigurationProperties(prefix = "de.muenchen.oss.digiwf.connector.core") +public class DigiWFConnectorProperties { + private Map integrations; +} diff --git a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/BpmnErrorEventConsumer.java b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/BpmnErrorEventConsumer.java index 69db2436e6..a94e57b835 100644 --- a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/BpmnErrorEventConsumer.java +++ b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/BpmnErrorEventConsumer.java @@ -22,9 +22,9 @@ public class BpmnErrorEventConsumer { @Bean public Consumer> createBpmnError() { - return correlation -> { - log.info("Received bpmn error correlation {}", correlation.getPayload()); - this.inPort.createBpmnError(map(correlation.getPayload())); + return bpmnError -> { + log.info("Received bpmn error correlation {}", bpmnError.getPayload()); + this.inPort.createBpmnError(map(bpmnError.getPayload())); }; } diff --git a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/IncidentConsumer.java b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/IncidentConsumer.java index 3252060f7e..6c4f0f0d3d 100644 --- a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/IncidentConsumer.java +++ b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/IncidentConsumer.java @@ -21,7 +21,8 @@ public class IncidentConsumer { private static final String HEADER_PROCESS_INSTANCE_ID = "digiwf.processinstanceid"; - private static final String HEADER_MESSAGE_NAME = "digiwf.messagename"; + public static final String HEADER_INTEGRATION_NAME = "digiwf.integrationname"; + private final CreateIncidentInPort inPort; @@ -29,20 +30,20 @@ public class IncidentConsumer { public Consumer> createIncident() { return correlation -> { final Optional processInstanceId = Optional.ofNullable(correlation.getHeaders().get(HEADER_PROCESS_INSTANCE_ID)).map(Object::toString); - final Optional messageName = Optional.ofNullable(correlation.getHeaders().get(HEADER_MESSAGE_NAME)).map(Object::toString); + final Optional integrationName = Optional.ofNullable(correlation.getHeaders().get(HEADER_INTEGRATION_NAME)).map(Object::toString); if (processInstanceId.isEmpty()) { log.error("No process instance id present. Cannot create an incident"); return; } - if (messageName.isEmpty()) { - log.error("No messageName is present. Cannot create an incident"); + if (integrationName.isEmpty()) { + log.error("No integrationName is present. Cannot create an incident"); return; } log.info("Received create incident for process instance with id: {}", processInstanceId.get()); - this.inPort.createIncident(processInstanceId.get(), messageName.get(), correlation.getPayload()); + this.inPort.createIncident(processInstanceId.get(), integrationName.get(), correlation.getPayload()); }; } } diff --git a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/StreamingHeaders.java b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/StreamingHeaders.java index 4af93bd405..b6973cbe03 100644 --- a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/StreamingHeaders.java +++ b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/StreamingHeaders.java @@ -3,8 +3,9 @@ public class StreamingHeaders { public static final String DIGIWF_PROCESS_INSTANCE_ID = "digiwf.processinstanceid"; + public static final String DIGIWF_PROCESS_DEFINITION = "digiwf.processdefinition"; + public static final String DIGIWF_INTEGRATION_NAME = "digiwf.integrationname"; public static final String STREAM_SEND_TO_DESTINATION = "spring.cloud.stream.sendto.destination"; public static final String TYPE = "type"; - public static final String DIGIWF_MESSAGE_NAME = "digiwf.messagename"; } diff --git a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/out/EventEmitterAdapter.java b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/out/EventEmitterAdapter.java index 797cd97e61..5ab10b560b 100644 --- a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/out/EventEmitterAdapter.java +++ b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/adapter/out/EventEmitterAdapter.java @@ -22,23 +22,11 @@ public class EventEmitterAdapter implements EmitEventOutPort { public void emitEvent( final String destination, final String type, + final String integrationName, final String instanceId, + final String processDefinition, final Map data) { - final Message> message = this.createMessage(destination, type, instanceId, data).build(); - log.debug("Emit message {}", message); - this.dynamicSink.tryEmitNext(message).orThrow(); - } - - @Override - public void emitEvent( - final String messageName, - final String destination, - final String type, - final String instanceId, - final Map data) { - final Message> message = this.createMessage(destination, type, instanceId, data) - .setHeader(StreamingHeaders.DIGIWF_MESSAGE_NAME, messageName) - .build(); + final Message> message = this.createMessage(destination, type, integrationName, instanceId, processDefinition, data).build(); log.debug("Emit message {}", message); this.dynamicSink.tryEmitNext(message).orThrow(); } @@ -46,14 +34,18 @@ public void emitEvent( private MessageBuilder> createMessage( final String destination, final String type, + final String integrationName, final String instanceId, + final String processDefinition, final Map data) { return MessageBuilder .withPayload(data) .setHeader(StreamingHeaders.STREAM_SEND_TO_DESTINATION, destination) .setHeader(StreamingHeaders.TYPE, type) - .setHeader(StreamingHeaders.DIGIWF_PROCESS_INSTANCE_ID, instanceId); + .setHeader(StreamingHeaders.DIGIWF_INTEGRATION_NAME, integrationName) + .setHeader(StreamingHeaders.DIGIWF_PROCESS_INSTANCE_ID, instanceId) + .setHeader(StreamingHeaders.DIGIWF_PROCESS_DEFINITION, processDefinition); } } diff --git a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/in/CreateIncidentInPort.java b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/in/CreateIncidentInPort.java index 0b45bcafec..2efd332fcc 100644 --- a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/in/CreateIncidentInPort.java +++ b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/in/CreateIncidentInPort.java @@ -1,16 +1,14 @@ package de.muenchen.oss.digiwf.connector.core.application.port.in; -import jakarta.validation.constraints.NotBlank; - public interface CreateIncidentInPort { /** - * Create a incident + * Create an incident * * @param processInstanceId id of the process instance - * @param messageName name of the message that should be answered + * @param integrationName name of the integration that should be answered * @param messageContent optional content of message for provide detailed information */ - void createIncident(@NotBlank String processInstanceId, @NotBlank String messageName, String messageContent); + void createIncident(String processInstanceId, String integrationName, String messageContent); } diff --git a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/in/ExecuteTaskInPort.java b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/in/ExecuteTaskInPort.java index 5d5077123d..542dacca74 100644 --- a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/in/ExecuteTaskInPort.java +++ b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/in/ExecuteTaskInPort.java @@ -1,5 +1,7 @@ package de.muenchen.oss.digiwf.connector.core.application.port.in; +import de.muenchen.oss.digiwf.connector.core.domain.IntegrationNameConfigException; +import de.muenchen.oss.digiwf.connector.core.domain.ProcessDefinitionLoadingException; import jakarta.validation.Valid; import jakarta.validation.constraints.NotBlank; import lombok.*; @@ -8,7 +10,7 @@ public interface ExecuteTaskInPort { - void executeTask(@Valid ExecuteTaskCommand command); + void executeTask(@Valid ExecuteTaskCommand command) throws IntegrationNameConfigException, ProcessDefinitionLoadingException; @Data @ToString @@ -16,10 +18,11 @@ public interface ExecuteTaskInPort { @AllArgsConstructor @NoArgsConstructor class ExecuteTaskCommand { - private String messageName; + + private String customDestination; @NotBlank - private String destination; + private String integrationName; @NotBlank private String type; diff --git a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/out/CreateIncidentOutPort.java b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/out/CreateIncidentOutPort.java index 5c33b96796..ab7f6b8bcb 100644 --- a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/out/CreateIncidentOutPort.java +++ b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/out/CreateIncidentOutPort.java @@ -8,9 +8,9 @@ public interface CreateIncidentOutPort { * Create a incident * * @param processInstanceId id of the process instance - * @param messageName name of the message that should be answered + * @param integrationName name of the integration that should be answered * @param messageContent optional content of message for provide detailed information */ - void createIncident(String processInstanceId, String messageName, @Nullable String messageContent); + void createIncident(String processInstanceId, String integrationName, @Nullable String messageContent); } diff --git a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/out/EmitEventOutPort.java b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/out/EmitEventOutPort.java index 57c7854077..120dcda754 100644 --- a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/out/EmitEventOutPort.java +++ b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/out/EmitEventOutPort.java @@ -7,34 +7,21 @@ */ public interface EmitEventOutPort { - /** - * Emit a message to a specific topic - * - * @param messageName name of the message to respond to - * @param destination name of the topic to write the message to - * @param type type header of the message - * @param instanceId id of the process instance - * @param data payload data - */ - void emitEvent( - String messageName, - String destination, - String type, - String instanceId, - Map data); - /** * Emit a message to a specific topic * * @param destination name of the topic to write the message to * @param type type header of the message + * @param integrationName name of the integration * @param instanceId id of the process instance * @param data payload data */ void emitEvent( String destination, String type, + String integrationName, String instanceId, + String processDefinition, Map data); } diff --git a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/out/ProcessOutPort.java b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/out/ProcessOutPort.java new file mode 100644 index 0000000000..c86d241131 --- /dev/null +++ b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/port/out/ProcessOutPort.java @@ -0,0 +1,9 @@ +package de.muenchen.oss.digiwf.connector.core.application.port.out; + +import de.muenchen.oss.digiwf.connector.core.domain.ProcessDefinitionLoadingException; + +public interface ProcessOutPort { + + String loadProcessDefinition(final String processInstanceId) throws ProcessDefinitionLoadingException; + +} diff --git a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/usecase/CreateIncidentUseCase.java b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/usecase/CreateIncidentUseCase.java index 91e1d41013..59363efd1e 100644 --- a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/usecase/CreateIncidentUseCase.java +++ b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/usecase/CreateIncidentUseCase.java @@ -17,8 +17,8 @@ class CreateIncidentUseCase implements CreateIncidentInPort { private final CreateIncidentOutPort outPort; @Override - public void createIncident(@NotBlank String processInstanceId, @NotBlank String messageName, String messageContent) { + public void createIncident(@NotBlank String processInstanceId, @NotBlank String integrationName, String messageContent) { log.info("Received create incident for process instance with id: {}", processInstanceId); - outPort.createIncident(processInstanceId, messageName, messageContent); + outPort.createIncident(processInstanceId, integrationName, messageContent); } } diff --git a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/usecase/ExecuteTaskUseCase.java b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/usecase/ExecuteTaskUseCase.java index 587490f4a8..912bb94b8a 100644 --- a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/usecase/ExecuteTaskUseCase.java +++ b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/application/usecase/ExecuteTaskUseCase.java @@ -1,7 +1,11 @@ package de.muenchen.oss.digiwf.connector.core.application.usecase; +import de.muenchen.oss.digiwf.connector.core.DigiWFConnectorProperties; import de.muenchen.oss.digiwf.connector.core.application.port.in.ExecuteTaskInPort; import de.muenchen.oss.digiwf.connector.core.application.port.out.EmitEventOutPort; +import de.muenchen.oss.digiwf.connector.core.application.port.out.ProcessOutPort; +import de.muenchen.oss.digiwf.connector.core.domain.IntegrationNameConfigException; +import de.muenchen.oss.digiwf.connector.core.domain.ProcessDefinitionLoadingException; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -15,16 +19,27 @@ @RequiredArgsConstructor class ExecuteTaskUseCase implements ExecuteTaskInPort { + private final DigiWFConnectorProperties digiWFConnectorProperties; private final EmitEventOutPort emitEventOutPort; + private final ProcessOutPort processOutPort; @Override - public void executeTask(@Valid ExecuteTaskCommand command) { + public void executeTask(@Valid ExecuteTaskCommand command) throws IntegrationNameConfigException, ProcessDefinitionLoadingException { log.info("Execute task with command {}", command); - if (StringUtils.isNotBlank(command.getMessageName())) { - emitEventOutPort.emitEvent(command.getMessageName(), command.getDestination(), command.getType(), command.getInstanceId(), command.getData()); - } else { - emitEventOutPort.emitEvent(command.getDestination(), command.getType(), command.getInstanceId(), command.getData()); + final String processDefinition = this.processOutPort.loadProcessDefinition(command.getInstanceId()); + + final String destination = StringUtils.isNotBlank(command.getCustomDestination()) ? + command.getCustomDestination() : + this.getDefaultDestination(command.getIntegrationName()); + + emitEventOutPort.emitEvent(destination, command.getType(), command.getIntegrationName(), command.getInstanceId(), processDefinition, command.getData()); + } + + private String getDefaultDestination(String integrationName) { + if (!digiWFConnectorProperties.getIntegrations().containsKey(integrationName)) { + throw new IntegrationNameConfigException("Integration " + integrationName + " is not registered in configuration.", integrationName); } + return digiWFConnectorProperties.getIntegrations().get(integrationName); } } diff --git a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/domain/IntegrationNameConfigException.java b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/domain/IntegrationNameConfigException.java new file mode 100644 index 0000000000..d1c5e8744d --- /dev/null +++ b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/domain/IntegrationNameConfigException.java @@ -0,0 +1,15 @@ +package de.muenchen.oss.digiwf.connector.core.domain; + +import lombok.Getter; + +@Getter +public class IntegrationNameConfigException extends RuntimeException { + + private final String detailedMessage; + + public IntegrationNameConfigException(final String message, final String integrationName) { + super(message); + this.detailedMessage = "Integration " + integrationName + " is not registered in configuration. Make sure to register it in configuration or provide a custom topic."; + } + +} diff --git a/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/domain/ProcessDefinitionLoadingException.java b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/domain/ProcessDefinitionLoadingException.java new file mode 100644 index 0000000000..a903880a69 --- /dev/null +++ b/digiwf-connector/digiwf-connector-starter/src/main/java/de/muenchen/oss/digiwf/connector/core/domain/ProcessDefinitionLoadingException.java @@ -0,0 +1,15 @@ +package de.muenchen.oss.digiwf.connector.core.domain; + +import lombok.Getter; + +@Getter +public class ProcessDefinitionLoadingException extends RuntimeException { + + private final String detailedMessage; + + public ProcessDefinitionLoadingException(final String message, final String detailedMessage) { + super(message); + this.detailedMessage = detailedMessage; + } + +} diff --git a/digiwf-connector/digiwf-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/IncidentConsumerTest.java b/digiwf-connector/digiwf-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/IncidentConsumerTest.java index 4f80c80306..f591ee76a6 100644 --- a/digiwf-connector/digiwf-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/IncidentConsumerTest.java +++ b/digiwf-connector/digiwf-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/core/adapter/in/streaming/IncidentConsumerTest.java @@ -15,14 +15,15 @@ @DisplayName("Incident Consumer Test") class IncidentConsumerTest { private static final String HEADER_PROCESS_INSTANCE_ID = "digiwf.processinstanceid"; - private static final String HEADER_MESSAGE_NAME = "digiwf.messagename"; + public static final String HEADER_INTEGRATION_NAME = "digiwf.integrationname"; + private final CreateIncidentInPort inPort = mock(CreateIncidentInPort.class); private final IncidentConsumer incidentConsumer = new IncidentConsumer(inPort); @Test @DisplayName("should do noting if headers are empty") - public void shouldDoNothingIfHeadersAreEmpty() { + void shouldDoNothingIfHeadersAreEmpty() { Consumer> consumer = incidentConsumer.createIncident(); consumer.accept(new Message() { @@ -42,7 +43,7 @@ public void shouldDoNothingIfHeadersAreEmpty() { @Test @DisplayName("should create incident if headers are given") - public void shouldCreateIncidentIfHeadersAreGiven() { + void shouldCreateIncidentIfHeadersAreGiven() { Consumer> consumer = incidentConsumer.createIncident(); consumer.accept(new Message() { @@ -55,18 +56,18 @@ public void shouldCreateIncidentIfHeadersAreGiven() { public @NotNull MessageHeaders getHeaders() { final HashMap map = new HashMap<>(); map.put(HEADER_PROCESS_INSTANCE_ID, "process-instance-id"); - map.put(HEADER_MESSAGE_NAME, "message-name"); + map.put(HEADER_INTEGRATION_NAME, "integration-name"); return new MessageHeaders(map); } }); - verify(inPort).createIncident("process-instance-id", "message-name", "payload"); + verify(inPort).createIncident("process-instance-id", "integration-name", "payload"); } @Test @DisplayName("should create incident if payload is missing") - public void shouldCreateIncidentIfPayloadIsMissing() { + void shouldCreateIncidentIfPayloadIsMissing() { Consumer> consumer = incidentConsumer.createIncident(); consumer.accept(new Message() { @@ -79,12 +80,12 @@ public String getPayload() { public @NotNull MessageHeaders getHeaders() { final HashMap map = new HashMap<>(); map.put(HEADER_PROCESS_INSTANCE_ID, "process-instance-id"); - map.put(HEADER_MESSAGE_NAME, "message-name"); + map.put(HEADER_INTEGRATION_NAME, "integration-name"); return new MessageHeaders(map); } }); - verify(inPort).createIncident("process-instance-id", "message-name", null); + verify(inPort).createIncident("process-instance-id", "integration-name", null); } } diff --git a/digiwf-connector/digiwf-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/core/adapter/out/EventEmitterAdapterTest.java b/digiwf-connector/digiwf-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/core/adapter/out/EventEmitterAdapterTest.java index 2915ce8fba..a31d487343 100644 --- a/digiwf-connector/digiwf-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/core/adapter/out/EventEmitterAdapterTest.java +++ b/digiwf-connector/digiwf-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/core/adapter/out/EventEmitterAdapterTest.java @@ -15,7 +15,7 @@ @DisplayName("Streaming Service Test") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public class EventEmitterAdapterTest extends BaseSpringTest { +class EventEmitterAdapterTest extends BaseSpringTest { @Mock @@ -31,11 +31,11 @@ private void initTests() { @Order(1) @Test @DisplayName("shouldEmitMessage") - public void shouldEmitMessage() { + void shouldEmitMessage() { when(this.dynamicSink.tryEmitNext(any())).thenReturn(Sinks.EmitResult.OK); - this.outputService.emitEvent("myTopic", "myType", "myInstance", Map.of("key", "value")); + this.outputService.emitEvent("myTopic", "myType", "exampleIntegration", "myInstance", "processDefinition", Map.of("key", "value")); verify(this.dynamicSink, times(1)).tryEmitNext(any()); } diff --git a/digiwf-connector/digiwf-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/core/application/usecase/ExecuteTaskUseCaseTest.java b/digiwf-connector/digiwf-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/core/application/usecase/ExecuteTaskUseCaseTest.java index a2b4d8aa6f..0637881048 100644 --- a/digiwf-connector/digiwf-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/core/application/usecase/ExecuteTaskUseCaseTest.java +++ b/digiwf-connector/digiwf-connector-starter/src/test/java/de/muenchen/oss/digiwf/connector/core/application/usecase/ExecuteTaskUseCaseTest.java @@ -1,58 +1,123 @@ package de.muenchen.oss.digiwf.connector.core.application.usecase; +import de.muenchen.oss.digiwf.connector.core.DigiWFConnectorProperties; import de.muenchen.oss.digiwf.connector.core.application.port.in.ExecuteTaskInPort.ExecuteTaskCommand; import de.muenchen.oss.digiwf.connector.core.application.port.out.EmitEventOutPort; -import org.apache.commons.lang3.StringUtils; +import de.muenchen.oss.digiwf.connector.core.application.port.out.ProcessOutPort; +import de.muenchen.oss.digiwf.connector.core.domain.IntegrationNameConfigException; +import de.muenchen.oss.digiwf.connector.core.domain.ProcessDefinitionLoadingException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import java.util.Map; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.mockito.Mockito.*; class ExecuteTaskUseCaseTest { private ExecuteTaskUseCase useCase; private EmitEventOutPort emitEventOutPort; + private ProcessOutPort processOutPort; + private DigiWFConnectorProperties digiWFConnectorProperties; @BeforeEach void setUp() { emitEventOutPort = mock(EmitEventOutPort.class); - useCase = new ExecuteTaskUseCase(emitEventOutPort); + digiWFConnectorProperties = mock(DigiWFConnectorProperties.class); + processOutPort = mock(ProcessOutPort.class); + useCase = new ExecuteTaskUseCase(digiWFConnectorProperties, emitEventOutPort, processOutPort); } @Test - void executeTask_shouldCallEmitEventWithCorrectParametersWhenMessageNameIsNotBlank() { + void executeTask_shouldCallEmitEventWithCorrectParametersAndDefaultDestination() { // Arrange ExecuteTaskCommand command = new ExecuteTaskCommand(); - command.setMessageName("testMessageName"); - command.setDestination("testDestination"); + command.setIntegrationName("testIntegrationName"); command.setType("testType"); command.setInstanceId("123"); command.setData(Map.of()); + when(digiWFConnectorProperties.getIntegrations()).thenReturn(Map.of("testIntegrationName", "defaultDestination")); + when(processOutPort.loadProcessDefinition(command.getInstanceId())).thenReturn("processDefinition"); // Act useCase.executeTask(command); // Assert - verify(emitEventOutPort).emitEvent(command.getMessageName(), command.getDestination(), command.getType(), command.getInstanceId(), command.getData()); + verify(emitEventOutPort).emitEvent("defaultDestination", command.getType(), command.getIntegrationName(), command.getInstanceId(), "processDefinition", command.getData()); } @Test - void executeTask_shouldCallEmitEventWithDifferentParametersWhenMessageNameIsBlank() { + void executeTask_shouldCallEmitEventWithCorrectParametersAndCustomDestination() { // Arrange ExecuteTaskCommand command = new ExecuteTaskCommand(); - command.setMessageName(StringUtils.EMPTY); // Explicitly set message name to blank - command.setDestination("testDestination"); + command.setCustomDestination("customDestination"); + command.setIntegrationName("testIntegrationName"); command.setType("testType"); command.setInstanceId("123"); command.setData(Map.of()); + when(digiWFConnectorProperties.getIntegrations()).thenReturn(Map.of("testIntegrationName", "defaultDestination")); + when(processOutPort.loadProcessDefinition(command.getInstanceId())).thenReturn("processDefinition"); // Act useCase.executeTask(command); // Assert - verify(emitEventOutPort).emitEvent(command.getDestination(), command.getType(), command.getInstanceId(), command.getData()); + verify(emitEventOutPort).emitEvent(command.getCustomDestination(), command.getType(), command.getIntegrationName(), command.getInstanceId(), "processDefinition", command.getData()); + } + + @Test + void executeTask_shouldCallEmitEventWithCorrectParametersAndCustomDestinationForCustomIntegration() { + // Arrange + ExecuteTaskCommand command = new ExecuteTaskCommand(); + command.setCustomDestination("customDestination"); + command.setIntegrationName("testIntegrationName"); + command.setType("testType"); + command.setInstanceId("123"); + command.setData(Map.of()); + when(digiWFConnectorProperties.getIntegrations()).thenReturn(Map.of()); + when(processOutPort.loadProcessDefinition(command.getInstanceId())).thenReturn("processDefinition"); + + // Act + useCase.executeTask(command); + + // Assert + verify(emitEventOutPort).emitEvent(command.getCustomDestination(), command.getType(), command.getIntegrationName(), command.getInstanceId(), "processDefinition", command.getData()); + } + + @Test + void executeTask_shouldThrowIntegrationNameConfigExceptionIfIntegrationNameIsNotConfigured() { + // Arrange + ExecuteTaskCommand command = new ExecuteTaskCommand(); + command.setIntegrationName("testIntegrationName"); + command.setType("testType"); + command.setInstanceId("123"); + command.setData(Map.of()); + when(digiWFConnectorProperties.getIntegrations()).thenReturn(Map.of()); + when(processOutPort.loadProcessDefinition(command.getInstanceId())).thenReturn("processDefinition"); + + // Assert + assertThatThrownBy(() -> useCase.executeTask(command)) + .isInstanceOf(IntegrationNameConfigException.class) + .hasMessage("Integration testIntegrationName is not registered in configuration.") + .hasFieldOrPropertyWithValue("detailedMessage", "Integration testIntegrationName is not registered in configuration. Make sure to register it in configuration or provide a custom topic."); + } + + @Test + void executeTask_shouldThrowProcessDefinitionLoadingExceptionIfProcessDefinitionCouldNotBeLoaded() { + // Arrange + ExecuteTaskCommand command = new ExecuteTaskCommand(); + command.setIntegrationName("testIntegrationName"); + command.setType("testType"); + command.setInstanceId("123"); + command.setData(Map.of()); + when(digiWFConnectorProperties.getIntegrations()).thenReturn(Map.of("testIntegrationName", "defaultDestination")); + when(processOutPort.loadProcessDefinition(command.getInstanceId())).thenThrow(new ProcessDefinitionLoadingException("testException", "testDetailedMessage")); + + // Assert + assertThatThrownBy(() -> useCase.executeTask(command)) + .isInstanceOf(ProcessDefinitionLoadingException.class) + .hasMessage("testException") + .hasFieldOrPropertyWithValue("detailedMessage", "testDetailedMessage"); } } diff --git a/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/output/process/AbstractStreamingIntegrationDelegate.java b/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/output/process/AbstractStreamingIntegrationDelegate.java index 3764e6f4b9..eb9957a59f 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/output/process/AbstractStreamingIntegrationDelegate.java +++ b/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/output/process/AbstractStreamingIntegrationDelegate.java @@ -2,6 +2,7 @@ import de.muenchen.oss.digiwf.engine.mapper.EngineDataMapper; import io.holunda.camunda.bpm.data.factory.VariableFactory; +import lombok.extern.slf4j.Slf4j; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.springframework.messaging.Message; import org.springframework.messaging.support.MessageBuilder; @@ -18,15 +19,16 @@ * * @author externer.dl.horn */ +@Slf4j public class AbstractStreamingIntegrationDelegate { private final EngineDataMapper engineDataMapper; - private final static VariableFactory MESSAGE_NAME = stringVariable("app_message_name"); private final static VariableFactory TYPE_NAME = stringVariable("app_type_name"); + private final static VariableFactory INTEGRATION_NAME = stringVariable("app_integration_name"); private final static VariableFactory TOPIC_NAME = stringVariable("app_topic_name"); private final static VariableFactory RESPONSELESS = stringVariable("app_responseless"); private final static List filterVariables = List.of( - MESSAGE_NAME.getName(), + INTEGRATION_NAME.getName(), TYPE_NAME.getName(), TOPIC_NAME.getName(), RESPONSELESS.getName() @@ -39,12 +41,21 @@ public AbstractStreamingIntegrationDelegate(final EngineDataMapper engineDataMap protected Message> mapMessage(final DelegateExecution delegateExecution, final Map variables) { final Map data = this.filterVariables(variables); + // StreamingTemplateV01 sends an integration name to the integrations too, but it does not support any further features. + final String integrationName = INTEGRATION_NAME.from(delegateExecution).getOrDefault(TYPE_NAME.from(delegateExecution).get()); + if (integrationName.equals("deprecatedLegacyFeature")) { + log.warn("Integration name is null. Falling back to deprecated legacy feature. Please update your process definition."); + } + final MessageBuilder> builder = MessageBuilder .withPayload(this.engineDataMapper.mapToData(data)) .setHeader(STREAM_SEND_TO_DESTINATION, TOPIC_NAME.from(delegateExecution).get()) .setHeader(TYPE, TYPE_NAME.from(delegateExecution).get()) + .setHeader(DIGIWF_INTEGRATION_NAME, integrationName) + // Note: It is not the root process definition. It is the StreamingTemplateV01. + // We will soon remove the feature + .setHeader(DIGIWF_PROCESS_DEFINITION, delegateExecution.getProcessDefinitionId()) .setHeader(DIGIWF_PROCESS_INSTANCE_ID, delegateExecution.getProcessInstanceId()); - MESSAGE_NAME.from(delegateExecution).getOptional().ifPresent(name -> builder.setHeader(DIGIWF_MESSAGE_NAME, name)); return builder.build(); } diff --git a/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/output/process/StreamingTemplateIntegrationDelegate.java b/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/output/process/StreamingTemplateIntegrationDelegate.java index 484b655f78..8d2518b704 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/output/process/StreamingTemplateIntegrationDelegate.java +++ b/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/output/process/StreamingTemplateIntegrationDelegate.java @@ -16,6 +16,7 @@ * * @author externer.dl.horn */ +@Deprecated @Slf4j @Component public class StreamingTemplateIntegrationDelegate extends AbstractStreamingIntegrationDelegate implements JavaDelegate { @@ -27,6 +28,13 @@ public StreamingTemplateIntegrationDelegate(final EngineDataMapper engineDataMap this.dynamicSink = dynamicSink; } + /** + * StreamingTemplateV01 sends an integration name to the integrations too, but it does not support any further features. + * Migrate to StreamingTemplateV02 as soon as possible. + * + * @param delegateExecution + * @throws Exception + */ @Override public void execute(final DelegateExecution delegateExecution) throws Exception { final Map localVariables = delegateExecution.getVariables(); diff --git a/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/process/instance/api/resource/ServiceInstanceController.java b/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/process/instance/api/resource/ServiceInstanceController.java index 54cfa4d7a1..c403efb50c 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/process/instance/api/resource/ServiceInstanceController.java +++ b/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/process/instance/api/resource/ServiceInstanceController.java @@ -67,4 +67,10 @@ public ResponseEntity getProcessInstanceDetail(@PathVar return ResponseEntity.ok(this.serviceInstanceApiMapper.map2TO(startedInstances)); } + @GetMapping("/root/{id}") + public ResponseEntity getRootProcessInstanceDetail(@PathVariable("id") final String id) { + val instance = this.processInstanceService.getRootProcessInstance(id); + return ResponseEntity.ok(this.serviceInstanceApiMapper.map2TO(instance)); + } + } diff --git a/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/process/instance/domain/service/ServiceInstanceService.java b/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/process/instance/domain/service/ServiceInstanceService.java index b913ac1d6d..7917256293 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/process/instance/domain/service/ServiceInstanceService.java +++ b/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/process/instance/domain/service/ServiceInstanceService.java @@ -13,18 +13,20 @@ import de.muenchen.oss.digiwf.process.instance.domain.model.ServiceInstanceDetail; import de.muenchen.oss.digiwf.process.instance.infrastructure.entity.ServiceInstanceEntity; import de.muenchen.oss.digiwf.process.instance.infrastructure.repository.ProcessInstanceInfoRepository; +import jakarta.annotation.Nullable; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import lombok.val; import org.apache.commons.lang3.StringUtils; import org.camunda.bpm.engine.HistoryService; +import org.camunda.bpm.engine.RuntimeService; +import org.camunda.bpm.engine.runtime.ProcessInstance; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; -import jakarta.annotation.Nullable; import java.util.Date; import java.util.List; import java.util.Map; @@ -44,6 +46,7 @@ public class ServiceInstanceService { private final ProcessConfigService processConfigService; private final ServiceInstanceAuthService serviceInstanceAuthService; + private final RuntimeService runtimeService; private final ProcessInstanceInfoRepository processInstanceInfoRepository; @@ -104,6 +107,19 @@ public ServiceInstanceDetail getServiceInstanceDetail(final String infoId) { return detail; } + public ServiceInstance getRootProcessInstance(final String instanceId) { + final ProcessInstance instance = this.runtimeService.createProcessInstanceQuery() + .processInstanceId(instanceId) + .singleResult(); + if (instance == null) { + throw new IllegalArgumentException("No process instance found for id: " + instanceId); + } + + return this.processInstanceInfoRepository.findByInstanceId(instance.getRootProcessInstanceId()) + .map(this.serviceInstanceMapper::map2Model) + .orElseThrow(); + } + /** * Get service instance by id. * diff --git a/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/shared/streaming/StreamingHeaders.java b/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/shared/streaming/StreamingHeaders.java index 933d0ea9e2..43dcc9c3e3 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/shared/streaming/StreamingHeaders.java +++ b/digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/shared/streaming/StreamingHeaders.java @@ -3,8 +3,9 @@ public class StreamingHeaders { public static final String DIGIWF_PROCESS_INSTANCE_ID = "digiwf.processinstanceid"; + public static final String DIGIWF_PROCESS_DEFINITION = "digiwf.processdefinition"; + public static final String DIGIWF_INTEGRATION_NAME = "digiwf.integrationname"; public static final String STREAM_SEND_TO_DESTINATION = "spring.cloud.stream.sendto.destination"; public static final String TYPE = "type"; - public static final String DIGIWF_MESSAGE_NAME = "digiwf.messagename"; } diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/alw_personeninfo/alw_personeninfo_create_call_activity_template.json b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/alw_personeninfo/alw_personeninfo_create_call_activity_template.json index ee3c6c155b..8acbbc13c2 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/alw_personeninfo/alw_personeninfo_create_call_activity_template.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/alw_personeninfo/alw_personeninfo_create_call_activity_template.json @@ -28,19 +28,6 @@ "notEmpty": true } }, - { - "label": "Event Message", - "type": "String", - "value": "correlateAlwPersoneninfo", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, { "label": "Event Type", "type": "String", @@ -80,8 +67,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } -} \ No newline at end of file + ] +} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/alw_personeninfo/feature/Feature_AlwPersoneninfo.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/alw_personeninfo/feature/Feature_AlwPersoneninfo.bpmn index ff9e99223a..6a4581a942 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/alw_personeninfo/feature/Feature_AlwPersoneninfo.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/alw_personeninfo/feature/Feature_AlwPersoneninfo.bpmn @@ -16,7 +16,6 @@ - diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/parkausweis/feature/Feature_ParkausweisAnlegen.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/parkausweis/feature/Feature_ParkausweisAnlegen.bpmn index 5a9986db23..b1c6294e5c 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/parkausweis/feature/Feature_ParkausweisAnlegen.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/parkausweis/feature/Feature_ParkausweisAnlegen.bpmn @@ -17,7 +17,6 @@ - diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/parkausweis/parkausweis_create_call_activity_template.json b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/parkausweis/parkausweis_create_call_activity_template.json index 15daddb99d..0a88c5ed2e 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/parkausweis/parkausweis_create_call_activity_template.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/parkausweis/parkausweis_create_call_activity_template.json @@ -28,19 +28,6 @@ "notEmpty": true } }, - { - "label": "Event Message", - "type": "String", - "value": "correlateParkausweisCreated", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, { "label": "Event Type", "type": "String", @@ -210,8 +197,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } -} \ No newline at end of file + ] +} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/parkausweis/parkausweis_create_call_activityv2_template.json b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/parkausweis/parkausweis_create_call_activityv2_template.json index 003c49b55d..f3db1aaf69 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/parkausweis/parkausweis_create_call_activityv2_template.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/kvr/parkausweis/parkausweis_create_call_activityv2_template.json @@ -28,19 +28,6 @@ "notEmpty": true } }, - { - "label": "Event Message", - "type": "String", - "value": "correlateParkausweisCreated", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, { "label": "Event Type", "type": "String", @@ -573,8 +560,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } -} \ No newline at end of file + ] +} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/mail/template/mail_task_template.json b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/mail/template/mail_task_template.json index ec49694b09..1e9bd299a4 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/mail/template/mail_task_template.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/mail/template/mail_task_template.json @@ -139,8 +139,5 @@ "name": "camunda:asyncBefore" } } - ], - "entriesVisible": { - "_all": false - } -} \ No newline at end of file + ] +} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/process/startinstance/feature/TestStartInstance1.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/process/startinstance/feature/TestStartInstance1.bpmn index fdc9911784..f88fca1686 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/process/startinstance/feature/TestStartInstance1.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/process/startinstance/feature/TestStartInstance1.bpmn @@ -31,7 +31,6 @@ execution.setVariable('blank', ""); - diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/process/startinstance/start_instance_call_activity_template.json b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/process/startinstance/start_instance_call_activity_template.json index 9622266b45..18f9c627dd 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/process/startinstance/start_instance_call_activity_template.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/process/startinstance/start_instance_call_activity_template.json @@ -28,20 +28,6 @@ "notEmpty": true } }, - { - "label": "Event Message", - "type": "Hidden", - "value": "startProcessV01", - "editable": false, - "binding": { - "type": "camunda:in", - "expression": true, - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, { "label": "Responseless", "type": "Hidden", @@ -126,8 +112,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } -} \ No newline at end of file + ] +} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/s3/s3_create_presigned_url_template.json b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/s3/s3_create_presigned_url_template.json index 8c89a64c88..6268fcc278 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/s3/s3_create_presigned_url_template.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/s3/s3_create_presigned_url_template.json @@ -30,21 +30,6 @@ "notEmpty": true } }, - { - "label": "Event Message", - "type": "String", - "editable": false, - "value": "createPresignedUrl", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, { "label": "Event Type", "type": "String", @@ -99,8 +84,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/s3/sendMail.json b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/s3/sendMail.json index 79b283bb5f..b94259d7d0 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/s3/sendMail.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/s3/sendMail.json @@ -29,21 +29,6 @@ "notEmpty": true } }, - { - "label": "Event Message", - "type": "String", - "editable": false, - "value": "genericEvent", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, { "label": "Type Header", "type": "String", diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/streaming/StreamingTemplateIntegrationV01.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/streaming/StreamingTemplateIntegrationV01.bpmn index 5cd060f400..27769c0176 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/streaming/StreamingTemplateIntegrationV01.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/streaming/StreamingTemplateIntegrationV01.bpmn @@ -36,7 +36,7 @@ - + diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/streaming/StreamingTemplateV02.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/streaming/StreamingTemplateV02.bpmn index 13d8245be8..c30ac4cd9d 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/streaming/StreamingTemplateV02.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/streaming/StreamingTemplateV02.bpmn @@ -1,5 +1,11 @@ - + Flow_0riqkf6 @@ -59,7 +65,7 @@ - + diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/verification/feature/Feature_Verifcation.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/verification/feature/Feature_Verifcation.bpmn index 22936c4eb0..3bde4e228d 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/verification/feature/Feature_Verifcation.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/verification/feature/Feature_Verifcation.bpmn @@ -33,7 +33,6 @@ - Flow_1en2301 diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/verification/verification_template.json b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/verification/verification_template.json index 03cbc992c3..e0f663def9 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/verification/verification_template.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/bausteine/verification/verification_template.json @@ -27,19 +27,6 @@ "notEmpty": true } }, - { - "label": "Event Message (Link)", - "description": "Name der Nachricht für den Bestätigungslink", - "type": "String", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, { "label": "Event Type", "type": "Hidden", @@ -117,8 +104,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } -} \ No newline at end of file + ] +} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/Start-Form.schema.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/Start-Form.schema.json index fb6e80e1f1..422dce0fb5 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/Start-Form.schema.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/Start-Form.schema.json @@ -44,26 +44,6 @@ "dense": true }, "x-rules": [] - }, - "address_integration_topic": { - "fieldType": "text", - "title": "Address Integration Topic", - "type": "string", - "key": "address_integration_topic", - "description": "", - "default": "dwf-address-local-01", - "x-options": { - "fieldColProps": { - "cols": 12, - "sm": 12, - "messages": {} - } - }, - "x-props": { - "outlined": true, - "dense": true - }, - "x-rules": [] } } } diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/address-integration-example.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/address-integration-example.bpmn index 199dac085c..2bbcd4b0a1 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/address-integration-example.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/address-integration-example.bpmn @@ -7,11 +7,10 @@ - - + @@ -57,9 +56,8 @@ - - + @@ -68,11 +66,10 @@ - - + @@ -82,9 +79,8 @@ - - + @@ -95,12 +91,11 @@ - - + @@ -109,9 +104,8 @@ - - + diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/checkAddress.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/CheckAddress.json similarity index 84% rename from digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/checkAddress.json rename to digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/CheckAddress.json index a1c13af79a..ac52425753 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/checkAddress.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/CheckAddress.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "addressIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -149,8 +135,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/findStreetById.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/findStreetById.json index 800bdc242d..9923e6d407 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/findStreetById.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/findStreetById.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "addressIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -82,8 +68,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/listAenderungenMuenchen.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/listAenderungenMuenchen.json index a22856d70d..18ba294185 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/listAenderungenMuenchen.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/listAenderungenMuenchen.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "addressIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -162,8 +148,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/listStreet.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/listStreet.json index 316fe6b582..4d9db70365 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/listStreet.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/listStreet.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "addressIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -115,8 +101,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/searchAdressenGeoMuenchen.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/searchAddressesGeo.json similarity index 85% rename from digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/searchAdressenGeoMuenchen.json rename to digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/searchAddressesGeo.json index 3a559e231c..378a942a85 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/searchAdressenGeoMuenchen.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/searchAddressesGeo.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "addressIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -160,8 +146,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/searchAddressesGermany.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/searchAddressesGermany.json index ae993ab7d3..fd55a77a7e 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/searchAddressesGermany.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/searchAddressesGermany.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "addressIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -142,8 +128,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/searchAdressenMuenchen.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/searchAdressenMuenchen.json index a222569b67..7d0b7b194e 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/searchAdressenMuenchen.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/address-integration/element-templates/searchAdressenMuenchen.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "addressIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -112,8 +98,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/cosys-integration/CosysGenerateDocumentTest.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/cosys-integration/CosysGenerateDocumentTest.bpmn index 6d98a348b4..387a9a30ba 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/cosys-integration/CosysGenerateDocumentTest.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/cosys-integration/CosysGenerateDocumentTest.bpmn @@ -27,24 +27,23 @@ } execution.setVariable('cosysData', S(JSON.stringify(meinjson))); - + - - + Flow_0815z5m Flow_0ubqgpj - + + - diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/cosys-integration/CosysGenerateDocumentTestV02.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/cosys-integration/CosysGenerateDocumentTestV02.bpmn index 55acf6364a..79b41ab6ea 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/cosys-integration/CosysGenerateDocumentTestV02.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/cosys-integration/CosysGenerateDocumentTestV02.bpmn @@ -36,10 +36,10 @@ execution.setVariable('cosysData', S(JSON.stringify(myjson))); - + + - @@ -69,10 +69,9 @@ execution.setVariable('cosysData', S(JSON.stringify(myjson))); - - + diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/cancel-object/dms-integration-cancel-object.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/cancel-object/dms-integration-cancel-object.bpmn index 3d616d5b7b..5616a4538a 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/cancel-object/dms-integration-cancel-object.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/cancel-object/dms-integration-cancel-object.bpmn @@ -10,12 +10,11 @@ - - + @@ -43,9 +42,8 @@ - - + @@ -112,4 +110,4 @@ - \ No newline at end of file + diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/cancel-object/forms/dms-integration-cancel-object_start.schema.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/cancel-object/forms/dms-integration-cancel-object_start.schema.json index b190c54448..de7413ea5a 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/cancel-object/forms/dms-integration-cancel-object_start.schema.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/cancel-object/forms/dms-integration-cancel-object_start.schema.json @@ -43,25 +43,6 @@ }, "x-rules": [] }, - "topic": { - "fieldType": "text", - "title": "Create Procedure Topic", - "type": "string", - "key": "topic", - "default": "dwf-dms-local-01", - "x-options": { - "fieldColProps": { - "cols": 12, - "sm": 12, - "messages": {} - } - }, - "x-props": { - "outlined": true, - "dense": true - }, - "x-rules": [] - }, "title": { "fieldType": "text", "title": "Title", @@ -124,4 +105,4 @@ } ] } -} \ No newline at end of file +} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-document/dms-integration-upload-s3/dms-integration-create-document.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-document/dms-integration-upload-s3/dms-integration-create-document.bpmn index 6ebfc9f831..f41535455a 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-document/dms-integration-upload-s3/dms-integration-create-document.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-document/dms-integration-upload-s3/dms-integration-create-document.bpmn @@ -28,11 +28,10 @@ - - + diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-document/dms-integration-upload-s3/element-templates/createDocument.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-document/dms-integration-upload-s3/element-templates/createDocument.json index 0d776f4b95..e452894d93 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-document/dms-integration-upload-s3/element-templates/createDocument.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-document/dms-integration-upload-s3/element-templates/createDocument.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "dmsIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-document/dms-integration-upload-s3/forms/dms-integration-create-document_start.schema.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-document/dms-integration-upload-s3/forms/dms-integration-create-document_start.schema.json index d2382e38ba..6f21682890 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-document/dms-integration-upload-s3/forms/dms-integration-create-document_start.schema.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-document/dms-integration-upload-s3/forms/dms-integration-create-document_start.schema.json @@ -43,25 +43,6 @@ }, "x-rules": [] }, - "topic": { - "fieldType": "text", - "title": "Create Document Topic", - "type": "string", - "key": "topic", - "default": "dwf-dms-local-01", - "x-options": { - "fieldColProps": { - "cols": 12, - "sm": 12, - "messages": {} - } - }, - "x-props": { - "outlined": true, - "dense": true - }, - "x-rules": [] - }, "title": { "fieldType": "text", "title": "Title", @@ -188,4 +169,4 @@ } ] } -} \ No newline at end of file +} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-file/dms-integration-create-file.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-file/dms-integration-create-file.bpmn index 1d26dcb43b..a9ffa94f36 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-file/dms-integration-create-file.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-file/dms-integration-create-file.bpmn @@ -28,12 +28,11 @@ - - + Flow_16a04uf diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-file/forms/dms-integration-create-file_start.schema.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-file/forms/dms-integration-create-file_start.schema.json index 6723ba0be1..e8fedc19fb 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-file/forms/dms-integration-create-file_start.schema.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-file/forms/dms-integration-create-file_start.schema.json @@ -43,25 +43,6 @@ }, "x-rules": [] }, - "topic": { - "fieldType": "text", - "title": "Create File Topic", - "type": "string", - "key": "topic", - "default": "dwf-dms-local-01", - "x-options": { - "fieldColProps": { - "cols": 12, - "sm": 12, - "messages": {} - } - }, - "x-props": { - "outlined": true, - "dense": true - }, - "x-rules": [] - }, "title": { "fieldType": "text", "title": "Title", @@ -124,4 +105,4 @@ } ] } -} \ No newline at end of file +} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-vorgang/dms-integration-create-vorgang.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-vorgang/dms-integration-create-vorgang.bpmn index 328e16f975..680e0164b2 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-vorgang/dms-integration-create-vorgang.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-vorgang/dms-integration-create-vorgang.bpmn @@ -28,12 +28,11 @@ - - + Flow_16a04uf diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-vorgang/element-templates/createProcedure.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-vorgang/element-templates/createProcedure.json index 9228b033ec..b1a1a016e1 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-vorgang/element-templates/createProcedure.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-vorgang/element-templates/createProcedure.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "dmsIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-vorgang/forms/dms-integration-create-vorgang_start.schema.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-vorgang/forms/dms-integration-create-vorgang_start.schema.json index cd8572f95c..02872e7dab 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-vorgang/forms/dms-integration-create-vorgang_start.schema.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/create-vorgang/forms/dms-integration-create-vorgang_start.schema.json @@ -43,25 +43,6 @@ }, "x-rules": [] }, - "topic": { - "fieldType": "text", - "title": "Create Procedure Topic", - "type": "string", - "key": "topic", - "default": "dwf-dms-local-01", - "x-options": { - "fieldColProps": { - "cols": 12, - "sm": 12, - "messages": {} - } - }, - "x-props": { - "outlined": true, - "dense": true - }, - "x-rules": [] - }, "title": { "fieldType": "text", "title": "Title", @@ -124,4 +105,4 @@ } ] } -} \ No newline at end of file +} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/deposit-object/dms-integration-deposit-object.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/deposit-object/dms-integration-deposit-object.bpmn index df4c4fd76e..36ab588927 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/deposit-object/dms-integration-deposit-object.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/deposit-object/dms-integration-deposit-object.bpmn @@ -10,12 +10,11 @@ - - + @@ -43,9 +42,8 @@ - - + diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/deposit-object/forms/dms-integration-deposit-object_start.schema.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/deposit-object/forms/dms-integration-deposit-object_start.schema.json index 0268887991..8fd8168b7d 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/deposit-object/forms/dms-integration-deposit-object_start.schema.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/deposit-object/forms/dms-integration-deposit-object_start.schema.json @@ -43,25 +43,6 @@ }, "x-rules": [] }, - "topic": { - "fieldType": "text", - "title": "Deposit Object Topic", - "type": "string", - "key": "topic", - "default": "dwf-dms-local-01", - "x-options": { - "fieldColProps": { - "cols": 12, - "sm": 12, - "messages": {} - } - }, - "x-props": { - "outlined": true, - "dense": true - }, - "x-rules": [] - }, "title": { "fieldType": "text", "title": "Title", @@ -124,4 +105,4 @@ } ] } -} \ No newline at end of file +} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/read-content/dms-integration-read-content.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/read-content/dms-integration-read-content.bpmn index cf6da3f2bf..0f04790ee5 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/read-content/dms-integration-read-content.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/read-content/dms-integration-read-content.bpmn @@ -28,10 +28,9 @@ - - + diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/read-content/forms/dms-integration-read-content_start.schema.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/read-content/forms/dms-integration-read-content_start.schema.json index 42cbabd9ff..3f97c116d2 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/read-content/forms/dms-integration-read-content_start.schema.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/read-content/forms/dms-integration-read-content_start.schema.json @@ -66,25 +66,6 @@ "x-rules": [], "minItems": 1 }, - "topic": { - "fieldType": "text", - "title": "Read Files Topic", - "type": "string", - "key": "topic", - "default": "dwf-dms-local-01", - "x-options": { - "fieldColProps": { - "cols": 12, - "sm": 12, - "messages": {} - } - }, - "x-props": { - "outlined": true, - "dense": true - }, - "x-rules": [] - }, "user": { "fieldType": "text", "title": "Dms User", @@ -111,4 +92,4 @@ } ] } -} \ No newline at end of file +} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/search-file/dms-integration-search-file.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/search-file/dms-integration-search-file.bpmn index 534826bbc1..a3001ee3ae 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/search-file/dms-integration-search-file.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/search-file/dms-integration-search-file.bpmn @@ -49,9 +49,8 @@ - - + diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/search-file/forms/dms-integration-search-file_start.schema.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/search-file/forms/dms-integration-search-file_start.schema.json index 185f625ac3..fb1041d270 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/search-file/forms/dms-integration-search-file_start.schema.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/search-file/forms/dms-integration-search-file_start.schema.json @@ -43,25 +43,6 @@ }, "x-rules": [] }, - "topic": { - "fieldType": "text", - "title": "Search File Topic", - "type": "string", - "key": "topic", - "default": "dwf-dms-local-01", - "x-options": { - "fieldColProps": { - "cols": 12, - "sm": 12, - "messages": {} - } - }, - "x-props": { - "outlined": true, - "dense": true - }, - "x-rules": [] - }, "search": { "fieldType": "text", "title": "Search", @@ -144,4 +125,4 @@ } ] } -} \ No newline at end of file +} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/update-document/dms-integration-update-document.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/update-document/dms-integration-update-document.bpmn index ad9cd2cf07..fa45d73d0f 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/update-document/dms-integration-update-document.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/update-document/dms-integration-update-document.bpmn @@ -28,11 +28,10 @@ - - + diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/update-document/element-templates/updateDocument.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/update-document/element-templates/updateDocument.json index 5739d14c33..353612b24d 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/update-document/element-templates/updateDocument.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/update-document/element-templates/updateDocument.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "dmsIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/update-document/forms/dms-integration-update-document_start.schema.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/update-document/forms/dms-integration-update-document_start.schema.json index be53ed19d5..4132ada836 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/update-document/forms/dms-integration-update-document_start.schema.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/dms-integration/update-document/forms/dms-integration-update-document_start.schema.json @@ -43,25 +43,6 @@ }, "x-rules": [] }, - "topic": { - "fieldType": "text", - "title": "Update Document Topic", - "type": "string", - "key": "topic", - "default": "dwf-dms-local-01", - "x-options": { - "fieldColProps": { - "cols": 12, - "sm": 12, - "messages": {} - } - }, - "x-props": { - "outlined": true, - "dense": true - }, - "x-rules": [] - }, "documentCoo": { "fieldType": "text", "title": "Dokuement (COO)", @@ -170,4 +151,4 @@ } ] } -} \ No newline at end of file +} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-example-V02/element-templates/sendMail.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-example-V02/element-templates/EmailIntegration.json similarity index 69% rename from digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-example-V02/element-templates/sendMail.json rename to digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-example-V02/element-templates/EmailIntegration.json index 44fb6a69a4..9b6bf2f70e 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-example-V02/element-templates/sendMail.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-example-V02/element-templates/EmailIntegration.json @@ -1,6 +1,6 @@ { - "name": "Send E-Mail", - "id": "de.muenchen.digitalwf.templates.send-email", + "name": "Send E-Mail V02", + "id": "de.muenchen.digitalwf.templates.send-mail-V02", "appliesTo": [ "bpmn:CallActivity" ], @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "emailIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -78,7 +64,7 @@ "type": "String", "value": "", "binding": { - "type": "camunda:in", + "type": "camunda:inputParameter", "expression": true, "name": "receiversCc", "target": "receiversCc" @@ -87,12 +73,24 @@ "notEmpty": false } }, + { + "type": "Hidden", + "value": "${receiversCc}", + "binding": { + "type": "camunda:in", + "expression": true, + "target": "receiversCc" + }, + "constraints": { + "notEmpty": true + } + }, { "label": "Receiver (BCC)", "type": "String", "value": "", "binding": { - "type": "camunda:in", + "type": "camunda:inputParameter", "expression": true, "name": "receiversBcc", "target": "receiversBcc" @@ -101,6 +99,18 @@ "notEmpty": false } }, + { + "type": "Hidden", + "value": "${receiversBcc}", + "binding": { + "type": "camunda:in", + "expression": true, + "target": "receiversBcc" + }, + "constraints": { + "notEmpty": true + } + }, { "label": "Subject", "type": "String", @@ -117,12 +127,23 @@ }, { "label": "Body", - "type": "String", + "type": "Text", "value": "", + "binding": { + "type": "camunda:inputParameter", + "expression": true, + "name": "body" + }, + "constraints": { + "notEmpty": true + } + }, + { + "type": "Hidden", + "value": "${body}", "binding": { "type": "camunda:in", "expression": true, - "name": "body", "target": "body" }, "constraints": { @@ -134,19 +155,31 @@ "type": "String", "value": "", "binding": { - "type": "camunda:in", + "type": "camunda:inputParameter", "expression": true, "name": "replyTo", "target": "replyTo" } }, + { + "type": "Hidden", + "value": "${replyTo}", + "binding": { + "type": "camunda:in", + "expression": true, + "target": "replyTo" + }, + "constraints": { + "notEmpty": true + } + }, { "label": "Attachment Paths (S3)", "type": "String", "value": "", "description": "Array of presigned urls created with s3 integration", "binding": { - "type": "camunda:in", + "type": "camunda:inputParameter", "expression": true, "name": "attachments", "target": "attachments" @@ -155,6 +188,18 @@ "notEmpty": false } }, + { + "type": "Hidden", + "value": "${attachments}", + "binding": { + "type": "camunda:in", + "expression": true, + "target": "attachments" + }, + "constraints": { + "notEmpty": true + } + }, { "label": "Dispatch Status", "value": "mailSentStatus", diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-example-V02/email-example-V02.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-example-V02/email-example-V02.bpmn index 57960c043f..a464319384 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-example-V02/email-example-V02.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-example-V02/email-example-V02.bpmn @@ -15,22 +15,21 @@ - - + Flow_0n9f7m4 Flow_0rqxdmr + - @@ -42,7 +41,6 @@ - @@ -50,7 +48,7 @@ - + Flow_1lp426t Flow_06uw57q diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-example-V02/forms/email-example-V02_start.schema.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-example-V02/forms/email-example-V02_start.schema.json index 392954a158..fb573ec23b 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-example-V02/forms/email-example-V02_start.schema.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-example-V02/forms/email-example-V02_start.schema.json @@ -46,36 +46,6 @@ }, "key": "2c4a0df8-83c1-443c-b7c1-59aa68b8ef15" }, - { - "containerType": "group", - "title": "Group", - "description": "", - "x-options": { - "childrenClass": "pl-0" - }, - "properties": { - "FORMFIELD_EMAIL_TOPIC": { - "fieldType": "text", - "title": "Email Topic", - "type": "string", - "key": "FORMFIELD_EMAIL_TOPIC", - "default": "dwf-email-local-01", - "x-options": { - "fieldColProps": { - "cols": 12, - "sm": 12, - "messages": {} - } - }, - "x-props": { - "outlined": true, - "dense": true - }, - "x-rules": [] - } - }, - "key": "83da6f62-99d1-43a8-8139-93082db58310" - }, { "containerType": "group", "title": "Email", @@ -210,4 +180,4 @@ } ] } -} \ No newline at end of file +} diff --git a/docs/src/.vuepress/public/element-template/sendMailV01.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-integration/element-templates/EmailIntegration.json similarity index 69% rename from docs/src/.vuepress/public/element-template/sendMailV01.json rename to digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-integration/element-templates/EmailIntegration.json index 6734de8de2..010ae3fcfe 100644 --- a/docs/src/.vuepress/public/element-template/sendMailV01.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-integration/element-templates/EmailIntegration.json @@ -1,6 +1,6 @@ { - "name": "Send E-Mail", - "id": "de.muenchen.digitalwf.templates.send-email", + "name": "Send E-Mail V02", + "id": "de.muenchen.digitalwf.templates.send-mail-V02", "appliesTo": [ "bpmn:CallActivity" ], @@ -9,36 +9,22 @@ "label": "Template", "type": "String", "editable": false, - "value": "StreamingTemplateV01", + "value": "StreamingTemplateV02", "binding": { "type": "property", "name": "calledElement" } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "s3Integration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -78,7 +64,7 @@ "type": "String", "value": "", "binding": { - "type": "camunda:in", + "type": "camunda:inputParameter", "expression": true, "name": "receiversCc", "target": "receiversCc" @@ -87,12 +73,24 @@ "notEmpty": false } }, + { + "type": "Hidden", + "value": "${receiversCc}", + "binding": { + "type": "camunda:in", + "expression": true, + "target": "receiversCc" + }, + "constraints": { + "notEmpty": true + } + }, { "label": "Receiver (BCC)", "type": "String", "value": "", "binding": { - "type": "camunda:in", + "type": "camunda:inputParameter", "expression": true, "name": "receiversBcc", "target": "receiversBcc" @@ -101,6 +99,18 @@ "notEmpty": false } }, + { + "type": "Hidden", + "value": "${receiversBcc}", + "binding": { + "type": "camunda:in", + "expression": true, + "target": "receiversBcc" + }, + "constraints": { + "notEmpty": true + } + }, { "label": "Subject", "type": "String", @@ -119,10 +129,21 @@ "label": "Body", "type": "Text", "value": "", + "binding": { + "type": "camunda:inputParameter", + "expression": true, + "name": "body" + }, + "constraints": { + "notEmpty": true + } + }, + { + "type": "Hidden", + "value": "${body}", "binding": { "type": "camunda:in", "expression": true, - "name": "body", "target": "body" }, "constraints": { @@ -134,13 +155,22 @@ "type": "String", "value": "", "binding": { - "type": "camunda:in", + "type": "camunda:inputParameter", "expression": true, "name": "replyTo", "target": "replyTo" + } + }, + { + "type": "Hidden", + "value": "${replyTo}", + "binding": { + "type": "camunda:in", + "expression": true, + "target": "replyTo" }, "constraints": { - "notEmpty": false + "notEmpty": true } }, { @@ -149,7 +179,7 @@ "value": "", "description": "Array of presigned urls created with s3 integration", "binding": { - "type": "camunda:in", + "type": "camunda:inputParameter", "expression": true, "name": "attachments", "target": "attachments" @@ -158,6 +188,18 @@ "notEmpty": false } }, + { + "type": "Hidden", + "value": "${attachments}", + "binding": { + "type": "camunda:in", + "expression": true, + "target": "attachments" + }, + "constraints": { + "notEmpty": true + } + }, { "label": "Dispatch Status", "value": "mailSentStatus", @@ -170,8 +212,5 @@ "notEmpty": false } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-integration/element-templates/sendSimpleMail.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-integration/element-templates/sendSimpleMail.json deleted file mode 100644 index a856a79d23..0000000000 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-integration/element-templates/sendSimpleMail.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "name": "Send simple E-Mail", - "id": "de.muenchen.digitalwf.templates.send-simple-email", - "appliesTo": [ - "bpmn:CallActivity" - ], - "properties": [ - { - "label": "Template", - "type": "String", - "editable": false, - "value": "StreamingTemplateV01", - "binding": { - "type": "property", - "name": "calledElement" - } - }, - { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", - "type": "String", - "editable": false, - "value": "genericEvent", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Type Header", - "type": "String", - "editable": false, - "value": "sendMailFromEventBus", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_type_name", - "target": "app_type_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Receiver", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "receivers", - "target": "receivers" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Subject", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "subject", - "target": "subject" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Body", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "body", - "target": "body" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Reply-To Address", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "replyTo", - "target": "replyTo" - } - }, - { - "label": "Dispatch Status", - "value": "mailSentStatus", - "type": "String", - "binding": { - "type": "camunda:out", - "source": "mailSentStatus" - }, - "constraints": { - "notEmpty": false - } - } - ], - "entriesVisible": { - "_all": false - } -} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-integration/email-integration.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-integration/email-integration.bpmn index e2548517b5..f9c78a5222 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-integration/email-integration.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-integration/email-integration.bpmn @@ -11,10 +11,9 @@ - - + diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-integration/forms/email-integration_start.schema.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-integration/forms/email-integration_start.schema.json index 4644a8e6dc..579be44bc7 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-integration/forms/email-integration_start.schema.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/email-integration/forms/email-integration_start.schema.json @@ -43,25 +43,6 @@ }, "x-rules": [] }, - "FormField_EmailTopic": { - "fieldType": "text", - "title": "Email Topic", - "type": "string", - "key": "FormField_EmailTopic", - "default": "dwf-email-local-01", - "x-options": { - "fieldColProps": { - "cols": 12, - "sm": 12, - "messages": {} - } - }, - "x-props": { - "outlined": true, - "dense": true - }, - "x-rules": [] - }, "FormField_Email": { "fieldType": "text", "title": "Email", @@ -125,4 +106,4 @@ } ] } -} \ No newline at end of file +} diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/example-integration/ExampleIntegration.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/example-integration/ExampleIntegration.json index 3d07c6e529..a0cd18cf7a 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/example-integration/ExampleIntegration.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/example-integration/ExampleIntegration.json @@ -29,20 +29,6 @@ "notEmpty": true } }, - { - "label": "Event Message", - "type": "String", - "editable": false, - "value": "genericEvent", - "binding": { - "type": "camunda:in", - "name": "app_message_name", - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, { "label": "Type Header", "type": "String", diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/example-integration/example-integration.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/example-integration/example-integration.bpmn index 9fef5566fa..fba7c2cf72 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/example-integration/example-integration.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/example-integration/example-integration.bpmn @@ -6,8 +6,7 @@ - - + diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/s3-integration/S3TestProzess.bpmn b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/s3-integration/S3TestProzess.bpmn index 9ae3d5e1c8..10d79a6edd 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/s3-integration/S3TestProzess.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/s3-integration/S3TestProzess.bpmn @@ -54,8 +54,8 @@ execution.setVariable('cosysData', S(JSON.stringify(meinjson))); + - @@ -66,13 +66,12 @@ execution.setVariable('cosysData', S(JSON.stringify(meinjson))); - - + Flow_0815z5m @@ -80,8 +79,8 @@ execution.setVariable('cosysData', S(JSON.stringify(meinjson))); + - @@ -97,13 +96,12 @@ execution.setVariable('cosysData', S(JSON.stringify(meinjson))); - - + Flow_1nf1mk3 diff --git a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/s3-integration/StartFormular.schema.json b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/s3-integration/StartFormular.schema.json index f0a8c1bb3f..c56100e9b0 100644 --- a/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/s3-integration/StartFormular.schema.json +++ b/digiwf-engine/digiwf-engine-service/src/main/resources/prozesse/example/s3-integration/StartFormular.schema.json @@ -59,44 +59,6 @@ "dense": true }, "x-rules": [] - }, - "FormField_EmailTopic": { - "fieldType": "text", - "title": "Email Topic", - "type": "string", - "key": "FormField_EmailTopic", - "default": "dwf-email-local-01", - "x-options": { - "fieldColProps": { - "cols": 12, - "sm": 12, - "messages": {} - } - }, - "x-props": { - "outlined": true, - "dense": true - }, - "x-rules": [] - }, - "FormField_CosysTopic": { - "fieldType": "text", - "title": "Cosys Topic", - "type": "string", - "key": "FormField_CosysTopic", - "default": "dwf-cosys-local-01", - "x-options": { - "fieldColProps": { - "cols": 12, - "sm": 12, - "messages": {} - } - }, - "x-props": { - "outlined": true, - "dense": true - }, - "x-rules": [] } }, "key": "f393458d-db10-41ec-96e6-40e6a905093f" diff --git a/digiwf-engine/digiwf-engine-service/src/test/java/de/muenchen/oss/digiwf/process/instance/domain/service/ServiceInstanceServiceTest.java b/digiwf-engine/digiwf-engine-service/src/test/java/de/muenchen/oss/digiwf/process/instance/domain/service/ServiceInstanceServiceTest.java new file mode 100644 index 0000000000..c1793f995d --- /dev/null +++ b/digiwf-engine/digiwf-engine-service/src/test/java/de/muenchen/oss/digiwf/process/instance/domain/service/ServiceInstanceServiceTest.java @@ -0,0 +1,121 @@ +package de.muenchen.oss.digiwf.process.instance.domain.service; + +import de.muenchen.oss.digiwf.jsonschema.domain.service.JsonSchemaService; +import de.muenchen.oss.digiwf.process.config.domain.service.ProcessConfigService; +import de.muenchen.oss.digiwf.process.instance.domain.mapper.HistoryTaskMapper; +import de.muenchen.oss.digiwf.process.instance.domain.mapper.ServiceInstanceMapper; +import de.muenchen.oss.digiwf.process.instance.domain.model.ServiceInstance; +import de.muenchen.oss.digiwf.process.instance.infrastructure.entity.ServiceInstanceEntity; +import de.muenchen.oss.digiwf.process.instance.infrastructure.repository.ProcessInstanceInfoRepository; +import org.camunda.bpm.engine.HistoryService; +import org.camunda.bpm.engine.RuntimeService; +import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.camunda.bpm.engine.runtime.ProcessInstanceQuery; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mapstruct.factory.Mappers; + +import java.util.Optional; +import java.util.UUID; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +class ServiceInstanceServiceTest { + + private final HistoryService historyService = mock(HistoryService.class); + private final ProcessConfigService processConfigService = mock(ProcessConfigService.class); + private final ServiceInstanceAuthService serviceInstanceAuthService = mock(ServiceInstanceAuthService.class); + private final RuntimeService runtimeService = mock(RuntimeService.class); + private final ProcessInstanceInfoRepository processInstanceInfoRepository = mock(ProcessInstanceInfoRepository.class); + private final HistoryTaskMapper historyTaskMapper = mock(HistoryTaskMapper.class); + private final JsonSchemaService jsonSchemaService = mock(JsonSchemaService.class); + private final ServiceInstanceDataService serviceInstanceDataService = mock(ServiceInstanceDataService.class); + private final ServiceInstanceMapper serviceInstanceMapper = Mappers.getMapper(ServiceInstanceMapper.class); + private ServiceInstanceService serviceInstanceService; + + @BeforeEach + void setup() { + serviceInstanceService = new ServiceInstanceService(historyService, processConfigService, serviceInstanceAuthService, runtimeService, processInstanceInfoRepository, serviceInstanceMapper, historyTaskMapper, jsonSchemaService, serviceInstanceDataService); + } + + @Test + void test_getRootProcessInstanceReturnsRootInstance() { + // Arrange + final String rootInstanceId = "rootInstanceId"; + final String instanceId = "callActivityInstanceId"; + + final ProcessInstance instance = mock(ProcessInstance.class); + final ServiceInstanceEntity entity = ServiceInstanceEntity.builder() + .id(UUID.randomUUID().toString()) + .instanceId(rootInstanceId) + .definitionName("exampleDefinitionName") + .definitionKey("exampleDefinitionKey") + .build(); + + when(runtimeService.createProcessInstanceQuery()).thenReturn(mock(ProcessInstanceQuery.class)); + when(runtimeService.createProcessInstanceQuery().processInstanceId(instanceId)).thenReturn(mock(ProcessInstanceQuery.class)); + when(runtimeService.createProcessInstanceQuery().processInstanceId(instanceId).singleResult()).thenReturn(instance); + when(instance.getRootProcessInstanceId()).thenReturn(rootInstanceId); + when(processInstanceInfoRepository.findByInstanceId(rootInstanceId)).thenReturn(Optional.of(entity)); + + // Act + final ServiceInstance result = serviceInstanceService.getRootProcessInstance(instanceId); + + // Assert + assertThat(result) + .isNotNull() + .hasFieldOrPropertyWithValue("instanceId", rootInstanceId) + .hasFieldOrPropertyWithValue("definitionName", "exampleDefinitionName") + .hasFieldOrPropertyWithValue("definitionKey", "exampleDefinitionKey"); + } + + @Test + void test_getRootProcessInstanceReturnsInstanceIfTheInstanceHasNoRootInstance() { + // Arrange + final String instanceId = "processInstanceId"; + + final ProcessInstance instance = mock(ProcessInstance.class); + final ServiceInstanceEntity entity = ServiceInstanceEntity.builder() + .id(UUID.randomUUID().toString()) + .instanceId(instanceId) + .definitionName("exampleDefinitionName") + .definitionKey("exampleDefinitionKey") + .build(); + + when(runtimeService.createProcessInstanceQuery()).thenReturn(mock(ProcessInstanceQuery.class)); + when(runtimeService.createProcessInstanceQuery().processInstanceId(instanceId)).thenReturn(mock(ProcessInstanceQuery.class)); + when(runtimeService.createProcessInstanceQuery().processInstanceId(instanceId).singleResult()).thenReturn(instance); + when(instance.getRootProcessInstanceId()).thenReturn(instanceId); + when(processInstanceInfoRepository.findByInstanceId(instanceId)).thenReturn(Optional.of(entity)); + + // Act + final ServiceInstance result = serviceInstanceService.getRootProcessInstance(instanceId); + + // Assert + assertThat(result) + .isNotNull() + .hasFieldOrPropertyWithValue("instanceId", instanceId) + .hasFieldOrPropertyWithValue("definitionName", "exampleDefinitionName") + .hasFieldOrPropertyWithValue("definitionKey", "exampleDefinitionKey"); + } + + @Test + void test_getRootProcessInstanceThrowsExceptionIfInstanceDoesNotExist() { + // Arrange + final String instanceId = "nonExistingInstanceId"; + + final ProcessInstance instance = mock(ProcessInstance.class); + + when(runtimeService.createProcessInstanceQuery()).thenReturn(mock(ProcessInstanceQuery.class)); + when(runtimeService.createProcessInstanceQuery().processInstanceId(instanceId)).thenReturn(mock(ProcessInstanceQuery.class)); + when(runtimeService.createProcessInstanceQuery().processInstanceId(instanceId).singleResult()).thenReturn(null); + + assertThatThrownBy(() -> serviceInstanceService.getRootProcessInstance(instanceId)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessage("No process instance found for id: " + instanceId); + } + +} diff --git a/digiwf-engine/digiwf-engine-service/src/test/resources/dummy/StreamingTemplateV02.bpmn b/digiwf-engine/digiwf-engine-service/src/test/resources/dummy/StreamingTemplateV02.bpmn index 21f884e3a4..4af13f532c 100644 --- a/digiwf-engine/digiwf-engine-service/src/test/resources/dummy/StreamingTemplateV02.bpmn +++ b/digiwf-engine/digiwf-engine-service/src/test/resources/dummy/StreamingTemplateV02.bpmn @@ -1,5 +1,11 @@ - + Flow_0riqkf6 @@ -59,7 +65,7 @@ - + diff --git a/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-core/src/main/java/de/muenchen/oss/digiwf/address/integration/adapter/out/IntegrationOutAdapter.java b/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-core/src/main/java/de/muenchen/oss/digiwf/address/integration/adapter/out/IntegrationOutAdapter.java index 8f07e0e084..b62026d3ff 100644 --- a/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-core/src/main/java/de/muenchen/oss/digiwf/address/integration/adapter/out/IntegrationOutAdapter.java +++ b/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-core/src/main/java/de/muenchen/oss/digiwf/address/integration/adapter/out/IntegrationOutAdapter.java @@ -22,11 +22,12 @@ public class IntegrationOutAdapter implements IntegrationOutPort { @Override public void correlateProcessMessage(@NonNull MessageHeaders headers, Map payload) { final String processInstanceId = Objects.requireNonNull(headers.get(MessageConstants.DIGIWF_PROCESS_INSTANCE_ID)).toString(); - final String messageName = Objects.requireNonNull(headers.get(MessageConstants.DIGIWF_MESSAGE_NAME)).toString(); + final String integrationName = Objects.requireNonNull(headers.get(MessageConstants.DIGIWF_INTEGRATION_NAME)).toString(); + final String type = Objects.requireNonNull(headers.get(MessageConstants.TYPE)).toString(); if (payload == null) { payload = new HashMap<>(); } - this.processApi.correlateMessage(processInstanceId, messageName, payload); + this.processApi.correlateMessage(processInstanceId, type, integrationName, payload); } @Override diff --git a/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-core/src/test/java/integration/adapter/in/streaming/MessageProcessorTest.java b/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-core/src/test/java/integration/adapter/in/streaming/MessageProcessorTest.java index d4b1b25c5a..535719a469 100644 --- a/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-core/src/test/java/integration/adapter/in/streaming/MessageProcessorTest.java +++ b/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-core/src/test/java/integration/adapter/in/streaming/MessageProcessorTest.java @@ -19,7 +19,7 @@ import java.util.Map; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_MESSAGE_NAME; +import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_INTEGRATION_NAME; import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_PROCESS_INSTANCE_ID; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; @@ -248,7 +248,7 @@ public T getPayload() { @Override public MessageHeaders getHeaders() { - return new MessageHeaders(Map.of(DIGIWF_PROCESS_INSTANCE_ID, "exampleProcessInstanceId", DIGIWF_MESSAGE_NAME, "messageName")); + return new MessageHeaders(Map.of(DIGIWF_PROCESS_INSTANCE_ID, "exampleProcessInstanceId", DIGIWF_INTEGRATION_NAME, "addressIntegration")); } }; } diff --git a/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-core/src/test/java/integration/adapter/out/IntegrationOutAdapterTest.java b/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-core/src/test/java/integration/adapter/out/IntegrationOutAdapterTest.java index f863874887..751a6a4721 100644 --- a/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-core/src/test/java/integration/adapter/out/IntegrationOutAdapterTest.java +++ b/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-core/src/test/java/integration/adapter/out/IntegrationOutAdapterTest.java @@ -12,8 +12,7 @@ import java.util.Map; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_MESSAGE_NAME; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_PROCESS_INSTANCE_ID; +import static de.muenchen.oss.digiwf.message.common.MessageConstants.*; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -27,7 +26,8 @@ class IntegrationOutAdapterTest { private final MessageHeaders messageHeaders = new MessageHeaders(Map.of( DIGIWF_PROCESS_INSTANCE_ID, "processInstanceId", - DIGIWF_MESSAGE_NAME, "messageName" + DIGIWF_INTEGRATION_NAME, "addressIntegration", + TYPE, "addressType" )); @Test @@ -37,12 +37,14 @@ void testCorrelateProcessMessage() { integrationOutAdapter.correlateProcessMessage(messageHeaders, payload); final ArgumentCaptor processInstanceIdCaptor = ArgumentCaptor.forClass(String.class); - final ArgumentCaptor messageNameCaptor = ArgumentCaptor.forClass(String.class); + final ArgumentCaptor integrationNameCaptor = ArgumentCaptor.forClass(String.class); + final ArgumentCaptor typeCaptor = ArgumentCaptor.forClass(String.class); final ArgumentCaptor> payloadCaptor = ArgumentCaptor.forClass(Map.class); - verify(processApi).correlateMessage(processInstanceIdCaptor.capture(), messageNameCaptor.capture(), payloadCaptor.capture()); + verify(processApi).correlateMessage(processInstanceIdCaptor.capture(), typeCaptor.capture(), integrationNameCaptor.capture(), payloadCaptor.capture()); assertThat(processInstanceIdCaptor.getValue()).isEqualTo(messageHeaders.get(DIGIWF_PROCESS_INSTANCE_ID)); - assertThat(messageNameCaptor.getValue()).isEqualTo(messageHeaders.get(DIGIWF_MESSAGE_NAME)); + assertThat(integrationNameCaptor.getValue()).isEqualTo(messageHeaders.get(DIGIWF_INTEGRATION_NAME)); + assertThat(typeCaptor.getValue()).isEqualTo(messageHeaders.get(TYPE)); assertThat(payloadCaptor.getValue()).isEqualTo(payload); } diff --git a/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-service/src/main/resources/application.yml b/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-service/src/main/resources/application.yml index be005e559f..638679be04 100644 --- a/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-service/src/main/resources/application.yml +++ b/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-service/src/main/resources/application.yml @@ -31,6 +31,7 @@ spring: cloud: function: definition: functionRouter;sendMessage; + routing-expression: "headers['type']" stream: bindings: functionRouter-in-0: diff --git a/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-service/src/test/java/de/muenchen/oss/digiwf/address/integration/AddressIntegrationE2eTest.java b/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-service/src/test/java/de/muenchen/oss/digiwf/address/integration/AddressIntegrationE2eTest.java index aa6ecd1a33..70e25183dd 100644 --- a/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-service/src/test/java/de/muenchen/oss/digiwf/address/integration/AddressIntegrationE2eTest.java +++ b/digiwf-integrations/digiwf-address-integration/digiwf-address-integration-service/src/test/java/de/muenchen/oss/digiwf/address/integration/AddressIntegrationE2eTest.java @@ -48,7 +48,7 @@ void testSearchAddressesGermany() { DigiwfWiremockUtility.setupGET("/v2/adresse_bundesweit/search?ortsname=Augsburg", expectedResponse); // send and receive messages - final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(searchAdressenDeutschlandDto, processInstanceId, "searchAddressesGermany", 30); + final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(searchAdressenDeutschlandDto, processInstanceId, "addressIntegration", "searchAddressesGermany", 30); // assert assertThat(payload) @@ -77,7 +77,7 @@ void testCheckAddressMunich() { DigiwfWiremockUtility.setupGET("/v2/adresse/check?adresse=Agnes-Pockels-Bogen%2021%2C%2080992%20M%C3%BCnchen", expectedResponse); // send and receive messages - final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(checkAdresseMuenchenDto, processInstanceId, "checkAddressMunich"); + final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(checkAdresseMuenchenDto, processInstanceId,"addressIntegration", "checkAddressMunich"); assertThat(payload) .isNotNull() @@ -96,7 +96,7 @@ void testListAddressesMunich() { DigiwfWiremockUtility.setupGET("/v2/adresse/list?plz=80992", expectedResponse); // send and receive messages - final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(listAdressenMuenchenDto, processInstanceId, "listAddressesMunich"); + final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(listAdressenMuenchenDto, processInstanceId, "addressIntegration", "listAddressesMunich"); // assert final Map response = this.verifyAndGetResponseBody(payload); @@ -124,7 +124,7 @@ void testListChangesMunich() { DigiwfWiremockUtility.setupGET("/v2/adresse/aenderung?plz=80992", expectedResponse); // send and receive messages - final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(listAenderungenMuenchenDto, processInstanceId, "listChangesMunich"); + final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(listAenderungenMuenchenDto, processInstanceId, "addressIntegration", "listChangesMunich"); // assert final Map response = this.verifyAndGetResponseBody(payload); @@ -141,7 +141,7 @@ void testSearchAddressesMunich() { DigiwfWiremockUtility.setupGET("/v2/adresse/search?query=Agnes-Pockels-Bogen%2021", expectedResponse); // send and receive messages - final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(searchAdressenMuenchenDto, processInstanceId, "searchAddressesMunich"); + final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(searchAdressenMuenchenDto, processInstanceId, "addressIntegration", "searchAddressesMunich"); // assert final Map response = this.verifyAndGetResponseBody(payload); @@ -169,7 +169,7 @@ void testSearchAddressesGeoMunich() { DigiwfWiremockUtility.setupGET("/v2/adresse/search/geo?geometrie=Punkt&lat=5334745.607&lng=691641.878", expectedResponse); // send and receive messages - final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(searchAdressenGeoMuenchenDto, processInstanceId, "searchAddressesGeoMunich"); + final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(searchAdressenGeoMuenchenDto, processInstanceId, "addressIntegration", "searchAddressesGeoMunich"); // assert final Map response = this.verifyAndGetResponseBody(payload); @@ -192,7 +192,7 @@ void testFindStreetByIdMunich() { DigiwfWiremockUtility.setupGET("/v2/strasse/2996", expectedResponse); // send and receive messages - final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(strassenIdDto, processInstanceId, "findStreetByIdMunich"); + final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(strassenIdDto, processInstanceId, "addressIntegration", "findStreetByIdMunich"); // assert final Map response = this.verifyAndGetResponseBody(payload); @@ -211,7 +211,7 @@ void testListStreetMunich() { DigiwfWiremockUtility.setupGET("/v2/strasse/search?strassenname=Marienplatz", expectedResponse); // send and receive messages - final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(listStrassenDto, processInstanceId, "listStreetMunich"); + final Map payload = this.digiWFIntegrationE2eTestUtility.runIntegration(listStrassenDto, processInstanceId, "addressIntegration", "listStreetMunich"); // assert final Map response = this.verifyAndGetResponseBody(payload); diff --git a/digiwf-integrations/digiwf-alw-integration/digiwf-alw-integration-core/src/main/java/de/muenchen/oss/digiwf/alw/integration/adapter/out/integration/IntegrationOutAdapter.java b/digiwf-integrations/digiwf-alw-integration/digiwf-alw-integration-core/src/main/java/de/muenchen/oss/digiwf/alw/integration/adapter/out/integration/IntegrationOutAdapter.java index d970e102ab..d0f0deaaa5 100644 --- a/digiwf-integrations/digiwf-alw-integration/digiwf-alw-integration-core/src/main/java/de/muenchen/oss/digiwf/alw/integration/adapter/out/integration/IntegrationOutAdapter.java +++ b/digiwf-integrations/digiwf-alw-integration/digiwf-alw-integration-core/src/main/java/de/muenchen/oss/digiwf/alw/integration/adapter/out/integration/IntegrationOutAdapter.java @@ -22,11 +22,12 @@ public class IntegrationOutAdapter implements IntegrationOutPort { @Override public void correlateProcessMessage(@NonNull MessageHeaders headers, Map payload) { final String processInstanceId = Objects.requireNonNull(headers.get(MessageConstants.DIGIWF_PROCESS_INSTANCE_ID)).toString(); - final String messageName = Objects.requireNonNull(headers.get(MessageConstants.DIGIWF_MESSAGE_NAME)).toString(); + final String integrationName = Objects.requireNonNull(headers.get(MessageConstants.DIGIWF_INTEGRATION_NAME)).toString(); + final String type = Objects.requireNonNull(headers.get(MessageConstants.TYPE)).toString(); if (payload == null) { payload = new HashMap<>(); } - this.processApi.correlateMessage(processInstanceId, messageName, payload); + this.processApi.correlateMessage(processInstanceId, type, integrationName, payload); } @Override diff --git a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/adapter/in/MessageProcessor.java b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/adapter/in/MessageProcessor.java index fcfdda3359..6c1917b165 100644 --- a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/adapter/in/MessageProcessor.java +++ b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/adapter/in/MessageProcessor.java @@ -6,6 +6,7 @@ import de.muenchen.oss.digiwf.message.process.api.ErrorApi; import de.muenchen.oss.digiwf.message.process.api.error.BpmnError; import de.muenchen.oss.digiwf.message.process.api.error.IncidentError; +import jakarta.validation.ValidationException; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -13,11 +14,9 @@ import org.springframework.messaging.Message; import org.springframework.stereotype.Component; -import jakarta.validation.ValidationException; import java.util.function.Consumer; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_MESSAGE_NAME; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_PROCESS_INSTANCE_ID; +import static de.muenchen.oss.digiwf.message.common.MessageConstants.*; @Slf4j @Component @@ -43,7 +42,8 @@ public Consumer> cosysIntegration() { log.debug("Generate document request: {}", document); this.documentUseCase.createDocument( message.getHeaders().get(DIGIWF_PROCESS_INSTANCE_ID, String.class), - message.getHeaders().get(DIGIWF_MESSAGE_NAME, String.class), + message.getHeaders().get(TYPE, String.class), + message.getHeaders().get(DIGIWF_INTEGRATION_NAME, String.class), document); } catch (final BpmnError bpmnError) { this.errorApi.handleBpmnError(message.getHeaders(), bpmnError); diff --git a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/adapter/out/ProcessAdapter.java b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/adapter/out/ProcessAdapter.java index b9666f4b36..c8ff9b4b46 100644 --- a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/adapter/out/ProcessAdapter.java +++ b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/adapter/out/ProcessAdapter.java @@ -12,8 +12,8 @@ public class ProcessAdapter implements CorrelateMessagePort { private final ProcessApi processApi; @Override - public void correlateMessage(final String processInstanceId, final String messageName, final Map message) { - this.processApi.correlateMessage(processInstanceId, messageName, message); + public void correlateMessage(final String processInstanceId, final String type, final String integrationName, final Map message) { + this.processApi.correlateMessage(processInstanceId, type, integrationName, message); } } diff --git a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/application/port/in/CreateDocument.java b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/application/port/in/CreateDocument.java index 892ac79b0c..ac53824114 100644 --- a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/application/port/in/CreateDocument.java +++ b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/application/port/in/CreateDocument.java @@ -1,11 +1,10 @@ package de.muenchen.oss.digiwf.cosys.integration.application.port.in; import de.muenchen.oss.digiwf.cosys.integration.model.GenerateDocument; - import jakarta.validation.Valid; public interface CreateDocument { - void createDocument(final String processInstanceIde, final String messageName, @Valid final GenerateDocument generateDocument); + void createDocument(final String processInstanceIde, final String type, final String integrationName, @Valid final GenerateDocument generateDocument); } diff --git a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/application/port/out/CorrelateMessagePort.java b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/application/port/out/CorrelateMessagePort.java index 666dc31c5b..a9b0b6769b 100644 --- a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/application/port/out/CorrelateMessagePort.java +++ b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/application/port/out/CorrelateMessagePort.java @@ -4,6 +4,6 @@ public interface CorrelateMessagePort { - void correlateMessage(final String processInstanceId, final String messageName, final Map message); + void correlateMessage(final String processInstanceId, final String type, final String integrationName, final Map message); } diff --git a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/application/usecase/CreateDocumentUseCase.java b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/application/usecase/CreateDocumentUseCase.java index 7427d6bae6..f88dc0a232 100644 --- a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/application/usecase/CreateDocumentUseCase.java +++ b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/main/java/de/muenchen/oss/digiwf/cosys/integration/application/usecase/CreateDocumentUseCase.java @@ -1,15 +1,14 @@ package de.muenchen.oss.digiwf.cosys.integration.application.usecase; import de.muenchen.oss.digiwf.cosys.integration.application.port.in.CreateDocument; -import de.muenchen.oss.digiwf.cosys.integration.model.GenerateDocument; import de.muenchen.oss.digiwf.cosys.integration.application.port.out.CorrelateMessagePort; import de.muenchen.oss.digiwf.cosys.integration.application.port.out.GenerateDocumentPort; import de.muenchen.oss.digiwf.cosys.integration.application.port.out.SaveFileToStoragePort; +import de.muenchen.oss.digiwf.cosys.integration.model.GenerateDocument; +import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import jakarta.validation.Valid; - import java.util.HashMap; import java.util.Map; @@ -29,13 +28,13 @@ public class CreateDocumentUseCase implements CreateDocument { * @param generateDocument Data for generating documents */ @Override - public void createDocument(final String processInstanceIde, final String messageName, @Valid final GenerateDocument generateDocument) { + public void createDocument(final String processInstanceIde, final String type, final String integrationName, @Valid final GenerateDocument generateDocument) { final byte[] data = this.generateDocumentPort.generateCosysDocument(generateDocument).block(); this.saveFileToStoragePort.saveDocumentInStorage(generateDocument, data); final Map correlatePayload = new HashMap<>(); correlatePayload.put("status", true); - this.correlateMessagePort.correlateMessage(processInstanceIde,messageName,correlatePayload); + this.correlateMessagePort.correlateMessage(processInstanceIde,type,integrationName,correlatePayload); } diff --git a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/test/java/de/muenchen/oss/digiwf/cosys/integration/adapter/in/MessageProcessorTest.java b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/test/java/de/muenchen/oss/digiwf/cosys/integration/adapter/in/MessageProcessorTest.java index fb459ce1ba..7d0f8c7828 100644 --- a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/test/java/de/muenchen/oss/digiwf/cosys/integration/adapter/in/MessageProcessorTest.java +++ b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/test/java/de/muenchen/oss/digiwf/cosys/integration/adapter/in/MessageProcessorTest.java @@ -1,24 +1,23 @@ package de.muenchen.oss.digiwf.cosys.integration.adapter.in; import de.muenchen.oss.digiwf.cosys.integration.application.port.in.CreateDocument; -import de.muenchen.oss.digiwf.cosys.integration.model.GenerateDocument; import de.muenchen.oss.digiwf.cosys.integration.model.DocumentStorageUrl; +import de.muenchen.oss.digiwf.cosys.integration.model.GenerateDocument; import de.muenchen.oss.digiwf.message.process.api.ErrorApi; import de.muenchen.oss.digiwf.message.process.api.error.BpmnError; import de.muenchen.oss.digiwf.message.process.api.error.IncidentError; +import jakarta.validation.ValidationException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.springframework.messaging.Message; import org.springframework.messaging.MessageHeaders; -import jakarta.validation.ValidationException; import java.util.List; import java.util.Map; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_MESSAGE_NAME; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_PROCESS_INSTANCE_ID; -import static org.junit.jupiter.api.Assertions.*; +import static de.muenchen.oss.digiwf.message.common.MessageConstants.*; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.*; class MessageProcessorTest { @@ -35,7 +34,7 @@ class MessageProcessorTest { private List listOfURls = List.of(documentStorageUrl); private final GenerateDocument generateDocument = new GenerateDocument("Client", "Role", "guid", null, listOfURls); - private final MessageHeaders messageHeaders = new MessageHeaders(Map.of(DIGIWF_PROCESS_INSTANCE_ID, this.processInstanceId, DIGIWF_MESSAGE_NAME, "messageName")); + private final MessageHeaders messageHeaders = new MessageHeaders(Map.of(DIGIWF_PROCESS_INSTANCE_ID, this.processInstanceId, DIGIWF_INTEGRATION_NAME, "integrationName", TYPE, "type")); @BeforeEach void setup() { @@ -56,13 +55,13 @@ public MessageHeaders getHeaders() { @Test void cosysIntegrationCreateDocumentSuccessfully() { messageProcessor.cosysIntegration().accept(this.message); - verify(createDocumentMock).createDocument(processInstanceId,"messageName", generateDocument); + verify(createDocumentMock).createDocument(processInstanceId,"type", "integrationName", generateDocument); verifyNoMoreInteractions(createDocumentMock); } @Test void cosysIntegrationHandlesValidationException() { - doThrow(new ValidationException("ValidationException")).when(createDocumentMock).createDocument(any(),any(),any()); + doThrow(new ValidationException("ValidationException")).when(createDocumentMock).createDocument(any(),any(),any(),any()); messageProcessor.cosysIntegration().accept(this.message); final ArgumentCaptor messageHeaderArgumentCaptor = ArgumentCaptor.forClass(Map.class); verify(errorApiMock).handleBpmnError(messageHeaderArgumentCaptor.capture(), any(BpmnError.class)); @@ -72,7 +71,7 @@ void cosysIntegrationHandlesValidationException() { @Test void cosysIntegrationHandlesBpmnError() { - doThrow(new BpmnError("S3_FILE_SAVE_ERROR","BpmnErrorCode")).when(createDocumentMock).createDocument(any(),any(),any()); + doThrow(new BpmnError("S3_FILE_SAVE_ERROR","BpmnErrorCode")).when(createDocumentMock).createDocument(any(),any(),any(),any()); messageProcessor.cosysIntegration().accept(this.message); final ArgumentCaptor messageHeaderArgumentCaptor = ArgumentCaptor.forClass(Map.class); verify(errorApiMock).handleBpmnError(messageHeaderArgumentCaptor.capture(), any(BpmnError.class)); @@ -82,7 +81,7 @@ void cosysIntegrationHandlesBpmnError() { @Test void cosysIntegrationIncidentError() { - doThrow(new IncidentError("IncidentError")).when(createDocumentMock).createDocument(any(),any(),any()); + doThrow(new IncidentError("IncidentError")).when(createDocumentMock).createDocument(any(),any(),any(),any()); messageProcessor.cosysIntegration().accept(this.message); final ArgumentCaptor messageHeaderArgumentCaptor = ArgumentCaptor.forClass(Map.class); verify(errorApiMock).handleIncident(messageHeaderArgumentCaptor.capture(), any(IncidentError.class)); diff --git a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/test/java/de/muenchen/oss/digiwf/cosys/integration/adapter/out/ProcessAdapterTest.java b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/test/java/de/muenchen/oss/digiwf/cosys/integration/adapter/out/ProcessAdapterTest.java index 99f96a2ef6..293e829629 100644 --- a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/test/java/de/muenchen/oss/digiwf/cosys/integration/adapter/out/ProcessAdapterTest.java +++ b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/test/java/de/muenchen/oss/digiwf/cosys/integration/adapter/out/ProcessAdapterTest.java @@ -6,9 +6,7 @@ import java.util.HashMap; import java.util.Map; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.*; class ProcessAdapterTest { @@ -20,12 +18,13 @@ void correlateMessage() { final ProcessAdapter processAdapter = new ProcessAdapter(processApi); final String processInstanceId = "processInstanceId"; - final String messageName = "messageName"; + final String integrationName = "cosysIntegration"; + final String type = "type"; final Map message = new HashMap<>(); - processAdapter.correlateMessage(processInstanceId,messageName,message); + processAdapter.correlateMessage(processInstanceId,type,integrationName,message); - verify(processApi).correlateMessage(processInstanceId,messageName,message); + verify(processApi).correlateMessage(processInstanceId,type,integrationName,message); verifyNoMoreInteractions(processApi); } } diff --git a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/test/java/de/muenchen/oss/digiwf/cosys/integration/application/usecase/CreateDocumentUseCaseTest.java b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/test/java/de/muenchen/oss/digiwf/cosys/integration/application/usecase/CreateDocumentUseCaseTest.java index 9cc7f6fb07..fbd41600d2 100644 --- a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/test/java/de/muenchen/oss/digiwf/cosys/integration/application/usecase/CreateDocumentUseCaseTest.java +++ b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-core/src/test/java/de/muenchen/oss/digiwf/cosys/integration/application/usecase/CreateDocumentUseCaseTest.java @@ -49,7 +49,7 @@ void createDocument() { when(generateDocumentPort.generateCosysDocument(any())).thenReturn(Mono.just("Document".getBytes())); final CreateDocumentUseCase useCase = new CreateDocumentUseCase(saveFileToStoragePort, correlateMessagePort, generateDocumentPort); - useCase.createDocument("processInstanceIde", "messageName", generateDocument); + useCase.createDocument("processInstanceIde", "type", "integrationName", generateDocument); verify(generateDocumentPort).generateCosysDocument(generateDocument); verifyNoMoreInteractions(generateDocumentPort); diff --git a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-example/src/main/java/de/muenchen/oss/digiwf/cosys/integration/example/api/controller/ExampleController.java b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-example/src/main/java/de/muenchen/oss/digiwf/cosys/integration/example/api/controller/ExampleController.java index d87b7437a6..f5284799da 100644 --- a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-example/src/main/java/de/muenchen/oss/digiwf/cosys/integration/example/api/controller/ExampleController.java +++ b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-example/src/main/java/de/muenchen/oss/digiwf/cosys/integration/example/api/controller/ExampleController.java @@ -40,7 +40,7 @@ public void testEventBus(final @RequestBody DocumentStorageUrl body) { this.messageApi.sendMessage(body, Map.of( MessageConstants.TYPE, "createDocumentFromEventBus", MessageConstants.DIGIWF_PROCESS_INSTANCE_ID, "processInstanceId", - MessageConstants.DIGIWF_MESSAGE_NAME, "testCosysIntegration" + MessageConstants.DIGIWF_INTEGRATION_NAME, "testCosysIntegration" ), "dwf-cosys-local-01"); } diff --git a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-service/src/test/resources/process/CosysGenerateDocumentTestV02.bpmn b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-service/src/test/resources/process/CosysGenerateDocumentTestV02.bpmn index aef6f96f88..84f327cf37 100644 --- a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-service/src/test/resources/process/CosysGenerateDocumentTestV02.bpmn +++ b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-service/src/test/resources/process/CosysGenerateDocumentTestV02.bpmn @@ -32,7 +32,7 @@ execution.setVariable('cosysData', S(JSON.stringify(myjson))); - + @@ -56,7 +56,7 @@ execution.setVariable('cosysData', S(JSON.stringify(myjson))); - + diff --git a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-service/src/test/resources/process/cosys_generate_document_template_V02.json b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-service/src/test/resources/process/cosys_generate_document_template_V02.json index a05b93c4d1..eff0e58823 100644 --- a/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-service/src/test/resources/process/cosys_generate_document_template_V02.json +++ b/digiwf-integrations/digiwf-cosys-integration/digiwf-cosys-integration-service/src/test/resources/process/cosys_generate_document_template_V02.json @@ -29,20 +29,6 @@ "notEmpty": true } }, - { - "label": "Event Message", - "type": "String", - "value": "cosysMessage", - "description": "The name of the message that will be correlated with the instance", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, { "label": "Event Type", "type": "String", @@ -126,8 +112,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } -} \ No newline at end of file + ] +} diff --git a/digiwf-integrations/digiwf-dms-integration/digiwf-dms-integration-core/src/main/java/de/muenchen/oss/digiwf/dms/integration/adapter/in/MessageProcessor.java b/digiwf-integrations/digiwf-dms-integration/digiwf-dms-integration-core/src/main/java/de/muenchen/oss/digiwf/dms/integration/adapter/in/MessageProcessor.java index 75f5805e74..22a89fea41 100644 --- a/digiwf-integrations/digiwf-dms-integration/digiwf-dms-integration-core/src/main/java/de/muenchen/oss/digiwf/dms/integration/adapter/in/MessageProcessor.java +++ b/digiwf-integrations/digiwf-dms-integration/digiwf-dms-integration-core/src/main/java/de/muenchen/oss/digiwf/dms/integration/adapter/in/MessageProcessor.java @@ -16,8 +16,7 @@ import java.util.Objects; import java.util.function.Consumer; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_MESSAGE_NAME; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_PROCESS_INSTANCE_ID; +import static de.muenchen.oss.digiwf.message.common.MessageConstants.*; @Configuration @RequiredArgsConstructor @@ -46,7 +45,8 @@ public Consumer> createFile() { ); this.correlateMessage(Objects.requireNonNull(message.getHeaders().get(DIGIWF_PROCESS_INSTANCE_ID)).toString(), - Objects.requireNonNull(message.getHeaders().get(DIGIWF_MESSAGE_NAME)).toString(), Map.of("fileCOO", file)); + Objects.requireNonNull(message.getHeaders().get(TYPE)).toString(), + Objects.requireNonNull(message.getHeaders().get(DIGIWF_INTEGRATION_NAME)).toString(), Map.of("fileCOO", file)); }); }; } @@ -62,7 +62,8 @@ public Consumer> createProcedure() { ); this.correlateMessage(Objects.requireNonNull(message.getHeaders().get(DIGIWF_PROCESS_INSTANCE_ID)).toString(), - Objects.requireNonNull(message.getHeaders().get(DIGIWF_MESSAGE_NAME)).toString(), Map.of("procedureCOO", vorgang.getCoo())); + Objects.requireNonNull(message.getHeaders().get(TYPE)).toString(), + Objects.requireNonNull(message.getHeaders().get(DIGIWF_INTEGRATION_NAME)).toString(), Map.of("procedureCOO", vorgang.getCoo())); }); }; } @@ -77,7 +78,8 @@ public Consumer> depositObject() { ); this.correlateMessage(message.getHeaders().get(DIGIWF_PROCESS_INSTANCE_ID).toString(), - message.getHeaders().get(DIGIWF_MESSAGE_NAME).toString(), Map.of()); + message.getHeaders().get(TYPE).toString(), + message.getHeaders().get(DIGIWF_INTEGRATION_NAME).toString(), Map.of()); }); }; } @@ -96,7 +98,8 @@ public Consumer> createDocument() { ); this.correlateMessage(message.getHeaders().get(DIGIWF_PROCESS_INSTANCE_ID).toString(), - message.getHeaders().get(DIGIWF_MESSAGE_NAME).toString(), Map.of("documentCoo", document)); + message.getHeaders().get(TYPE).toString(), + message.getHeaders().get(DIGIWF_INTEGRATION_NAME).toString(), Map.of("documentCoo", document)); }); }; } @@ -114,7 +117,8 @@ public Consumer> updateDocument() { ); this.correlateMessage(message.getHeaders().get(DIGIWF_PROCESS_INSTANCE_ID).toString(), - message.getHeaders().get(DIGIWF_MESSAGE_NAME).toString(), Map.of()); + message.getHeaders().get(TYPE).toString(), + message.getHeaders().get(DIGIWF_INTEGRATION_NAME).toString(), Map.of()); }); }; } @@ -129,7 +133,8 @@ public Consumer> cancelObject() { ); this.correlateMessage(message.getHeaders().get(DIGIWF_PROCESS_INSTANCE_ID).toString(), - message.getHeaders().get(DIGIWF_MESSAGE_NAME).toString(), Map.of()); + message.getHeaders().get(TYPE).toString(), + message.getHeaders().get(DIGIWF_INTEGRATION_NAME).toString(), Map.of()); }); }; } @@ -145,7 +150,8 @@ public Consumer> readContent() { readContentDto.getFileContext() ); this.correlateMessage(message.getHeaders().get(DIGIWF_PROCESS_INSTANCE_ID).toString(), - message.getHeaders().get(DIGIWF_MESSAGE_NAME).toString(), Map.of()); + message.getHeaders().get(TYPE).toString(), + message.getHeaders().get(DIGIWF_INTEGRATION_NAME).toString(), Map.of()); }); }; } @@ -161,7 +167,8 @@ public Consumer> searchFile() { searchObjectDto.getValue() ); this.correlateMessage(message.getHeaders().get(DIGIWF_PROCESS_INSTANCE_ID).toString(), - message.getHeaders().get(DIGIWF_MESSAGE_NAME).toString(), Map.of("fileCoo", file)); + message.getHeaders().get(TYPE).toString(), + message.getHeaders().get(DIGIWF_INTEGRATION_NAME).toString(), Map.of("fileCoo", file)); }); }; } @@ -175,7 +182,8 @@ public Consumer> searchSubjectArea() { searchObjectDto.getUser() ); this.correlateMessage(message.getHeaders().get(DIGIWF_PROCESS_INSTANCE_ID).toString(), - message.getHeaders().get(DIGIWF_MESSAGE_NAME).toString(), Map.of("subjectAreaCoo", subjectArea)); + message.getHeaders().get(TYPE).toString(), + message.getHeaders().get(DIGIWF_INTEGRATION_NAME).toString(), Map.of("subjectAreaCoo", subjectArea)); }); }; } @@ -192,7 +200,7 @@ private void withErrorHandling(final Message message, final Runnable runnable } } - public void correlateMessage(final String processInstanceId, final String messageName, final Map message) { - this.processApi.correlateMessage(processInstanceId, messageName, message); + public void correlateMessage(final String processInstanceId, final String type, final String integrationName, final Map message) { + this.processApi.correlateMessage(processInstanceId, type, integrationName, message); } } diff --git a/digiwf-integrations/digiwf-dms-integration/digiwf-dms-integration-core/src/test/java/de/muenchen/oss/digiwf/dms/integration/adapter/in/MessageProcessorTestBase.java b/digiwf-integrations/digiwf-dms-integration/digiwf-dms-integration-core/src/test/java/de/muenchen/oss/digiwf/dms/integration/adapter/in/MessageProcessorTestBase.java index 71fa234c4c..e6c003c254 100644 --- a/digiwf-integrations/digiwf-dms-integration/digiwf-dms-integration-core/src/test/java/de/muenchen/oss/digiwf/dms/integration/adapter/in/MessageProcessorTestBase.java +++ b/digiwf-integrations/digiwf-dms-integration/digiwf-dms-integration-core/src/test/java/de/muenchen/oss/digiwf/dms/integration/adapter/in/MessageProcessorTestBase.java @@ -8,8 +8,7 @@ import java.util.Map; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_MESSAGE_NAME; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_PROCESS_INSTANCE_ID; +import static de.muenchen.oss.digiwf.message.common.MessageConstants.*; class MessageProcessorTestBase { protected final ErrorApi errorApiMock = Mockito.mock(ErrorApi.class); @@ -24,7 +23,7 @@ class MessageProcessorTestBase { protected final SearchFileUseCase searchFileUseCase = Mockito.mock(SearchFileUseCase.class); protected final SearchSubjectAreaUseCase searchSubjectAreaUseCase = Mockito.mock(SearchSubjectAreaUseCase.class); protected final String processInstanceId = "exampleProcessInstanceId"; - protected final MessageHeaders messageHeaders = new MessageHeaders(Map.of(DIGIWF_PROCESS_INSTANCE_ID, this.processInstanceId, DIGIWF_MESSAGE_NAME, "messageName")); + protected final MessageHeaders messageHeaders = new MessageHeaders(Map.of(DIGIWF_PROCESS_INSTANCE_ID, this.processInstanceId, DIGIWF_INTEGRATION_NAME, "dmsIntegration", TYPE, "type")); protected MessageProcessor messageProcessor; protected void setupBase() { diff --git a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/adapter/in/MessageProcessor.java b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/adapter/in/MessageProcessor.java index f3c0c829b2..892bff7583 100644 --- a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/adapter/in/MessageProcessor.java +++ b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/adapter/in/MessageProcessor.java @@ -12,8 +12,7 @@ import java.util.function.Consumer; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_MESSAGE_NAME; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_PROCESS_INSTANCE_ID; +import static de.muenchen.oss.digiwf.message.common.MessageConstants.*; @RequiredArgsConstructor public class MessageProcessor { @@ -27,7 +26,8 @@ public Consumer> emailIntegration() { try { this.mailUseCase.sendMail( message.getHeaders().get(DIGIWF_PROCESS_INSTANCE_ID, String.class), - message.getHeaders().get(DIGIWF_MESSAGE_NAME, String.class), + message.getHeaders().get(TYPE, String.class), + message.getHeaders().get(DIGIWF_INTEGRATION_NAME, String.class), message.getPayload()); this.monitoringService.sendMailSucceeded(); } catch (final BpmnError bpmnError) { diff --git a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/adapter/out/ProcessAdapter.java b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/adapter/out/ProcessAdapter.java index f80a24910a..b36dd5086d 100644 --- a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/adapter/out/ProcessAdapter.java +++ b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/adapter/out/ProcessAdapter.java @@ -12,8 +12,8 @@ public class ProcessAdapter implements CorrelateMessagePort { private final ProcessApi processApi; @Override - public void correlateMessage(final String processInstanceId, final String messageName, final Map message) { - this.processApi.correlateMessage(processInstanceId, messageName, message); + public void correlateMessage(final String processInstanceId, final String type, final String integrationName, final Map message) { + this.processApi.correlateMessage(processInstanceId, type, integrationName, message); } } diff --git a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/application/port/in/SendMail.java b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/application/port/in/SendMail.java index c06ec47813..2ab561535c 100644 --- a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/application/port/in/SendMail.java +++ b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/application/port/in/SendMail.java @@ -1,11 +1,10 @@ package de.muenchen.oss.digiwf.email.integration.application.port.in; import de.muenchen.oss.digiwf.email.integration.model.Mail; - import jakarta.validation.Valid; public interface SendMail { - void sendMail(final String processInstanceId, final String messageName, @Valid final Mail mail); + void sendMail(final String processInstanceId, final String type, final String integrationName, @Valid final Mail mail); } diff --git a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/application/port/out/CorrelateMessagePort.java b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/application/port/out/CorrelateMessagePort.java index a59c8bdd53..d3da6439cc 100644 --- a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/application/port/out/CorrelateMessagePort.java +++ b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/application/port/out/CorrelateMessagePort.java @@ -4,6 +4,6 @@ public interface CorrelateMessagePort { - void correlateMessage(final String processInstanceId, final String messageName, final Map message); + void correlateMessage(final String processInstanceId, final String type, final String integrationName, final Map message); } diff --git a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/application/usecase/SendMailUseCase.java b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/application/usecase/SendMailUseCase.java index 0621a057ff..9c36322d75 100644 --- a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/application/usecase/SendMailUseCase.java +++ b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/main/java/de/muenchen/oss/digiwf/email/integration/application/usecase/SendMailUseCase.java @@ -35,7 +35,7 @@ public class SendMailUseCase implements SendMail { * @param mail mail that is sent */ @Override - public void sendMail(final String processInstanceIde, final String messageName, @Valid final Mail mail) throws BpmnError { + public void sendMail(final String processInstanceIde, final String type, final String integrationName, @Valid final Mail mail) throws BpmnError { try { // load Attachments final List attachments = new ArrayList<>(); @@ -59,10 +59,11 @@ public void sendMail(final String processInstanceIde, final String messageName, // correlate message final Map correlatePayload = new HashMap<>(); correlatePayload.put("mailSentStatus", true); - this.correlateMessagePort.correlateMessage(processInstanceIde, messageName, correlatePayload); + this.correlateMessagePort.correlateMessage(processInstanceIde, type, integrationName, correlatePayload); } catch (final MessagingException ex) { log.error("Sending mail failed with exception: {}", ex.getMessage()); throw new BpmnError("MAIL_SENDING_FAILED", ex.getMessage()); } } + } diff --git a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/adapter/in/MessageProcessorTest.java b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/adapter/in/MessageProcessorTest.java index 2b663d4869..a58ab7e700 100644 --- a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/adapter/in/MessageProcessorTest.java +++ b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/adapter/in/MessageProcessorTest.java @@ -16,8 +16,7 @@ import java.util.Map; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_MESSAGE_NAME; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_PROCESS_INSTANCE_ID; +import static de.muenchen.oss.digiwf.message.common.MessageConstants.*; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; @@ -42,7 +41,7 @@ class MessageProcessorTest { "digiwf@muenchen.de", null ); - private final MessageHeaders messageHeaders = new MessageHeaders(Map.of(DIGIWF_PROCESS_INSTANCE_ID, this.processInstanceId, DIGIWF_MESSAGE_NAME, "messageName")); + private final MessageHeaders messageHeaders = new MessageHeaders(Map.of(DIGIWF_PROCESS_INSTANCE_ID, this.processInstanceId, DIGIWF_INTEGRATION_NAME, "emailIntegration", TYPE, "emailType")); @BeforeEach void setup() { @@ -64,37 +63,46 @@ public MessageHeaders getHeaders() { void testEmailIntegrationSendsMailSuccessfully() { messageProcessor.emailIntegration().accept(this.message); verify(monitoringServiceMock, times(1)).sendMailSucceeded(); - verify(sendMailMock, times(1)).sendMail(processInstanceId, "messageName", mail); + verify(sendMailMock, times(1)).sendMail(processInstanceId, "emailType", "emailIntegration", mail); } @Test void testEmailIntegrationHandlesValidationException() { - Mockito.doThrow(new ValidationException("Test ValidationException")).when(sendMailMock).sendMail(any(), any(), any()); + Mockito.doThrow(new ValidationException("Test ValidationException")).when(sendMailMock).sendMail(any(), any(), any(), any()); messageProcessor.emailIntegration().accept(this.message); verify(monitoringServiceMock, times(1)).sendMailFailed(); final ArgumentCaptor messageHeaderArgumentCaptor = ArgumentCaptor.forClass(Map.class); verify(errorApiMock, times(1)).handleBpmnError(messageHeaderArgumentCaptor.capture(), any(BpmnError.class)); - assertThat(messageHeaderArgumentCaptor.getValue()).containsKey(DIGIWF_PROCESS_INSTANCE_ID); + assertThat(messageHeaderArgumentCaptor.getValue()) + .containsKey(DIGIWF_PROCESS_INSTANCE_ID) + .containsKey(DIGIWF_INTEGRATION_NAME) + .containsKey(TYPE); } @Test void testEmailIntegrationHandlesBpmnError() { - Mockito.doThrow(new BpmnError("errorCode", "errorMessage")).when(sendMailMock).sendMail(any(), any(), any()); + Mockito.doThrow(new BpmnError("errorCode", "errorMessage")).when(sendMailMock).sendMail(any(), any(), any(), any()); messageProcessor.emailIntegration().accept(this.message); verify(monitoringServiceMock, times(1)).sendMailFailed(); final ArgumentCaptor messageHeaderArgumentCaptor = ArgumentCaptor.forClass(Map.class); verify(errorApiMock, times(1)).handleBpmnError(messageHeaderArgumentCaptor.capture(), any(BpmnError.class)); - assertThat(messageHeaderArgumentCaptor.getValue()).containsKey(DIGIWF_PROCESS_INSTANCE_ID); + assertThat(messageHeaderArgumentCaptor.getValue()) + .containsKey(DIGIWF_PROCESS_INSTANCE_ID) + .containsKey(DIGIWF_INTEGRATION_NAME) + .containsKey(TYPE); } @Test void testEmailIntegrationHandlesIncidentError() { - Mockito.doThrow(new IncidentError("Error Message")).when(sendMailMock).sendMail(any(), any(), any()); + Mockito.doThrow(new IncidentError("Error Message")).when(sendMailMock).sendMail(any(), any(), any(), any()); messageProcessor.emailIntegration().accept(this.message); verify(monitoringServiceMock, times(1)).sendMailFailed(); final ArgumentCaptor messageHeaderArgumentCaptor = ArgumentCaptor.forClass(Map.class); verify(errorApiMock, times(1)).handleIncident(messageHeaderArgumentCaptor.capture(), any(IncidentError.class)); - assertThat(messageHeaderArgumentCaptor.getValue()).containsKey(DIGIWF_PROCESS_INSTANCE_ID); + assertThat(messageHeaderArgumentCaptor.getValue()) + .containsKey(DIGIWF_PROCESS_INSTANCE_ID) + .containsKey(DIGIWF_INTEGRATION_NAME) + .containsKey(TYPE); } } diff --git a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/adapter/out/ProcessAdapterTest.java b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/adapter/out/ProcessAdapterTest.java index ee49b0226c..d6b9813fd5 100644 --- a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/adapter/out/ProcessAdapterTest.java +++ b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/adapter/out/ProcessAdapterTest.java @@ -19,11 +19,12 @@ public void testCorrelateMessage() { final ProcessAdapter processAdapter = new ProcessAdapter(processApiMock); final String processInstanceId = "exampleProcessInstanceId"; - final String messageName = "exampleMessageName"; + final String integrationName = "emailIntegration"; + final String type = "emailType"; final Map message = new HashMap<>(); - processAdapter.correlateMessage(processInstanceId, messageName, message); + processAdapter.correlateMessage(processInstanceId, type, integrationName, message); - verify(processApiMock, times(1)).correlateMessage(processInstanceId, messageName, message); + verify(processApiMock, times(1)).correlateMessage(processInstanceId, type, integrationName, message); } } diff --git a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/application/usecase/SendMailUseCaseTest.java b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/application/usecase/SendMailUseCaseTest.java index c95fd98e21..0f1c712ef5 100644 --- a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/application/usecase/SendMailUseCaseTest.java +++ b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-core/src/test/java/de/muenchen/oss/digiwf/email/integration/application/usecase/SendMailUseCaseTest.java @@ -37,7 +37,8 @@ class SendMailUseCaseTest { null ); private final String processInstanceId = "processInstanceId"; - private final String messageName = "messageName"; + private final String integrationName = "emailIntegration"; + private final String type = "type"; @BeforeEach void setUp() { @@ -46,7 +47,7 @@ void setUp() { @Test void sendMail() throws MessagingException { - sendMail.sendMail(processInstanceId, messageName, mail); + sendMail.sendMail(processInstanceId, type, integrationName, mail); final de.muenchen.oss.digiwf.email.model.Mail mailOutModel = de.muenchen.oss.digiwf.email.model.Mail.builder() .receivers(mail.getReceivers()) .subject(mail.getSubject()) @@ -57,7 +58,7 @@ void sendMail() throws MessagingException { .attachments(List.of()) .build(); verify(mailPort).sendMail(mailOutModel); - verify(correlateMessagePort).correlateMessage(processInstanceId, messageName, Map.of("mailSentStatus", true)); + verify(correlateMessagePort).correlateMessage(processInstanceId, type, integrationName, Map.of("mailSentStatus", true)); } @Test @@ -68,7 +69,7 @@ void sendMailWithAttachments() throws MessagingException { final FileAttachment fileAttachment = new FileAttachment("test.txt", new ByteArrayDataSource("Anhang Inhalt".getBytes(), "text/plain")); when(loadMailAttachmentPort.loadAttachment(presignedUrl)).thenReturn(fileAttachment); - sendMail.sendMail(processInstanceId, messageName, mail); + sendMail.sendMail(processInstanceId, type, integrationName, mail); final de.muenchen.oss.digiwf.email.model.Mail mailOutModel = de.muenchen.oss.digiwf.email.model.Mail.builder() .receivers(mail.getReceivers()) .subject(mail.getSubject()) @@ -79,12 +80,12 @@ void sendMailWithAttachments() throws MessagingException { .attachments(List.of(fileAttachment)) .build(); verify(mailPort).sendMail(mailOutModel); - verify(correlateMessagePort).correlateMessage(processInstanceId, messageName, Map.of("mailSentStatus", true)); + verify(correlateMessagePort).correlateMessage(processInstanceId, type, integrationName, Map.of("mailSentStatus", true)); } @Test void sendMailThrowsBpmnError() throws MessagingException { doThrow(new MessagingException("Test Exception")).when(mailPort).sendMail(any()); - assertThatThrownBy(() -> sendMail.sendMail(processInstanceId, messageName, mail)).isInstanceOf(BpmnError.class); + assertThatThrownBy(() -> sendMail.sendMail(processInstanceId, type, integrationName, mail)).isInstanceOf(BpmnError.class); } } diff --git a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-example/src/main/java/de/muenchen/oss/digiwf/email/integration/api/controller/ExampleController.java b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-example/src/main/java/de/muenchen/oss/digiwf/email/integration/api/controller/ExampleController.java index 218f090f42..9180ec01e5 100644 --- a/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-example/src/main/java/de/muenchen/oss/digiwf/email/integration/api/controller/ExampleController.java +++ b/digiwf-integrations/digiwf-email-integration/digiwf-email-integration-example/src/main/java/de/muenchen/oss/digiwf/email/integration/api/controller/ExampleController.java @@ -29,7 +29,7 @@ public void testEventBus(@RequestBody final Mail mail) { this.messageApi.sendMessage(mail, Map.of( MessageConstants.TYPE, "sendMailFromEventBus", MessageConstants.DIGIWF_PROCESS_INSTANCE_ID, "processInstanceId", - MessageConstants.DIGIWF_MESSAGE_NAME, "testEmailIntegration" + MessageConstants.DIGIWF_INTEGRATION_NAME, "testEmailIntegration" ), "dwf-email-local-01"); } diff --git a/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-core/src/main/java/de/muenchen/oss/digiwf/example/integration/core/adapter/MessageProcessor.java b/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-core/src/main/java/de/muenchen/oss/digiwf/example/integration/core/adapter/MessageProcessor.java index bb5375fe27..c0048d3bb3 100644 --- a/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-core/src/main/java/de/muenchen/oss/digiwf/example/integration/core/adapter/MessageProcessor.java +++ b/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-core/src/main/java/de/muenchen/oss/digiwf/example/integration/core/adapter/MessageProcessor.java @@ -1,7 +1,7 @@ package de.muenchen.oss.digiwf.example.integration.core.adapter; -import de.muenchen.oss.digiwf.example.integration.core.application.out.CorrelateMessagePort; import de.muenchen.oss.digiwf.example.integration.core.application.in.ExampleUseCase; +import de.muenchen.oss.digiwf.example.integration.core.application.out.CorrelateMessagePort; import de.muenchen.oss.digiwf.message.process.api.ErrorApi; import de.muenchen.oss.digiwf.message.process.api.ProcessApi; import de.muenchen.oss.digiwf.message.process.api.error.BpmnError; @@ -14,8 +14,7 @@ import java.util.Map; import java.util.function.Consumer; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_MESSAGE_NAME; -import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_PROCESS_INSTANCE_ID; +import static de.muenchen.oss.digiwf.message.common.MessageConstants.*; @Configuration @RequiredArgsConstructor @@ -34,7 +33,8 @@ public Consumer> exampleIntegration() { this.exampleUseCase.processExampleData(this.exampleMapper.toModel(exampleDto)); this.correlateMessage(message.getHeaders().get(DIGIWF_PROCESS_INSTANCE_ID).toString(), - message.getHeaders().get(DIGIWF_MESSAGE_NAME).toString(), Map.of("someData", exampleDto.getSomeData())); + message.getHeaders().get(TYPE).toString(), + message.getHeaders().get(DIGIWF_INTEGRATION_NAME).toString(), Map.of("someData", exampleDto.getSomeData())); } catch (final BpmnError bpmnError) { this.errorApi.handleBpmnError(message.getHeaders(), bpmnError); } catch (final IncidentError incidentError) { @@ -44,8 +44,8 @@ public Consumer> exampleIntegration() { } @Override - public void correlateMessage(final String processInstanceId, final String messageName, final Map message) { - this.processApi.correlateMessage(processInstanceId, messageName, message); + public void correlateMessage(final String processInstanceId, final String type, final String integrationName, final Map message) { + this.processApi.correlateMessage(processInstanceId, type, integrationName, message); } } diff --git a/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-core/src/main/java/de/muenchen/oss/digiwf/example/integration/core/application/out/CorrelateMessagePort.java b/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-core/src/main/java/de/muenchen/oss/digiwf/example/integration/core/application/out/CorrelateMessagePort.java index b3d71afeb6..3262b06090 100644 --- a/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-core/src/main/java/de/muenchen/oss/digiwf/example/integration/core/application/out/CorrelateMessagePort.java +++ b/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-core/src/main/java/de/muenchen/oss/digiwf/example/integration/core/application/out/CorrelateMessagePort.java @@ -4,6 +4,6 @@ public interface CorrelateMessagePort { - void correlateMessage(final String processInstanceId, final String messageName, final Map message); + void correlateMessage(final String processInstanceId, final String type, final String integrationName, final Map message); } diff --git a/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-example/src/main/java/de/muenchen/oss/digiwf/example/integration/api/HelperController.java b/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-example/src/main/java/de/muenchen/oss/digiwf/example/integration/api/HelperController.java index d05673d92f..1712114306 100644 --- a/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-example/src/main/java/de/muenchen/oss/digiwf/example/integration/api/HelperController.java +++ b/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-example/src/main/java/de/muenchen/oss/digiwf/example/integration/api/HelperController.java @@ -23,7 +23,7 @@ public void test() { final Map headers = new HashMap<>(Map.of( MessageConstants.TYPE, "exampleIntegration", MessageConstants.DIGIWF_PROCESS_INSTANCE_ID, "123456789", - MessageConstants.DIGIWF_MESSAGE_NAME, "test" + MessageConstants.DIGIWF_INTEGRATION_NAME, "exampleIntegration" )); this.messageApi.sendMessage( diff --git a/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-example/src/main/resources/example-process/ExampleProcess.bpmn b/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-example/src/main/resources/example-process/ExampleProcess.bpmn index 4cd8df565a..80cf0d863d 100644 --- a/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-example/src/main/resources/example-process/ExampleProcess.bpmn +++ b/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-example/src/main/resources/example-process/ExampleProcess.bpmn @@ -9,7 +9,6 @@ - diff --git a/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-example/src/main/resources/example-process/element-templates/ExampleIntegration.json b/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-example/src/main/resources/example-process/element-templates/ExampleIntegration.json index ad24914409..d9a3a9b0d6 100644 --- a/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-example/src/main/resources/example-process/element-templates/ExampleIntegration.json +++ b/digiwf-integrations/digiwf-example-integration/digiwf-example-integration-example/src/main/resources/example-process/element-templates/ExampleIntegration.json @@ -30,21 +30,6 @@ "notEmpty": true } }, - { - "label": "Event Message", - "type": "String", - "editable": false, - "value": "genericEvent", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, { "label": "Type Header", "type": "String", diff --git a/digiwf-integrations/digiwf-okewo-integration/digiwf-okewo-integration-core/src/main/java/de/muenchen/oss/digiwf/okewo/integration/adapter/out/IntegrationOutAdapter.java b/digiwf-integrations/digiwf-okewo-integration/digiwf-okewo-integration-core/src/main/java/de/muenchen/oss/digiwf/okewo/integration/adapter/out/IntegrationOutAdapter.java index 1a67a31ff7..8d058b8e44 100644 --- a/digiwf-integrations/digiwf-okewo-integration/digiwf-okewo-integration-core/src/main/java/de/muenchen/oss/digiwf/okewo/integration/adapter/out/IntegrationOutAdapter.java +++ b/digiwf-integrations/digiwf-okewo-integration/digiwf-okewo-integration-core/src/main/java/de/muenchen/oss/digiwf/okewo/integration/adapter/out/IntegrationOutAdapter.java @@ -24,11 +24,12 @@ public class IntegrationOutAdapter implements IntegrationOutPort { @Override public void correlateProcessMessage(@NonNull MessageHeaders headers, Map payload) { final String processInstanceId = Objects.requireNonNull(headers.get(MessageConstants.DIGIWF_PROCESS_INSTANCE_ID)).toString(); - final String messageName = Objects.requireNonNull(headers.get(MessageConstants.DIGIWF_MESSAGE_NAME)).toString(); + final String integrationName = Objects.requireNonNull(headers.get(MessageConstants.DIGIWF_INTEGRATION_NAME)).toString(); + final String type = Objects.requireNonNull(headers.get(MessageConstants.TYPE)).toString(); if (payload == null) { payload = new HashMap<>(); } - this.processApi.correlateMessage(processInstanceId, messageName, payload); + this.processApi.correlateMessage(processInstanceId, type, integrationName, payload); } @Override diff --git a/digiwf-integrations/digiwf-okewo-integration/digiwf-okewo-integration-service/src/test/java/de/muenchen/oss/digiwf/okewo/integration/OkEwoIntegrationApplicationE2eTest.java b/digiwf-integrations/digiwf-okewo-integration/digiwf-okewo-integration-service/src/test/java/de/muenchen/oss/digiwf/okewo/integration/OkEwoIntegrationApplicationE2eTest.java index 55ab8bcb05..0b95af0ba8 100644 --- a/digiwf-integrations/digiwf-okewo-integration/digiwf-okewo-integration-service/src/test/java/de/muenchen/oss/digiwf/okewo/integration/OkEwoIntegrationApplicationE2eTest.java +++ b/digiwf-integrations/digiwf-okewo-integration/digiwf-okewo-integration-service/src/test/java/de/muenchen/oss/digiwf/okewo/integration/OkEwoIntegrationApplicationE2eTest.java @@ -56,7 +56,7 @@ void shouldProcessGetPersonEvent() throws JsonProcessingException { DigiwfWiremockUtility.setupGETWithBasicAuth("/personen/2.0/rest/person/om?benutzerId=benutzerId", "username", "password", objectMapper.writeValueAsString(person)); // send and receive messages - final Map payload = digiWFIntegrationE2eTestUtility.runIntegration(request, processInstanceId, "getPerson"); + final Map payload = digiWFIntegrationE2eTestUtility.runIntegration(request, processInstanceId, "okEwoIntegration", "getPerson"); assertNotNull(payload); final Map response = (Map) payload.get("response"); assertNotNull(response); @@ -78,7 +78,7 @@ void shouldProcessSearchPersonEvent() throws JsonProcessingException { DigiwfWiremockUtility.setupPOSTWithBasicAuth("/personen/2.0/rest/person/search", objectMapper.writeValueAsString(searchRequest), "username", "password", objectMapper.writeValueAsString(apiResponse)); // send and receive messages - final Map payload = digiWFIntegrationE2eTestUtility.runIntegration(request, processInstanceId, "searchPerson"); + final Map payload = digiWFIntegrationE2eTestUtility.runIntegration(request, processInstanceId, "okEwoIntegration", "searchPerson"); assertNotNull(payload); final Map response = (Map) payload.get("response"); assertNotNull(response); @@ -97,7 +97,7 @@ void shouldProcessGetPersonErweitertEvent() throws JsonProcessingException { DigiwfWiremockUtility.setupGETWithBasicAuth("/personen/2.0/rest/personErweitert/om?benutzerId=benutzerId", "username", "password", objectMapper.writeValueAsString(person)); // send and receive messages - final Map payload = digiWFIntegrationE2eTestUtility.runIntegration(request, processInstanceId, "getPersonErweitert"); + final Map payload = digiWFIntegrationE2eTestUtility.runIntegration(request, processInstanceId, "okEwoIntegration", "getPersonErweitert"); assertNotNull(payload); final Map response = (Map) payload.get("response"); assertNotNull(response); @@ -119,7 +119,7 @@ void shouldProcessSearchPersonErweitertEvent() throws JsonProcessingException { DigiwfWiremockUtility.setupPOSTWithBasicAuth("/personen/2.0/rest/personErweitert/search", objectMapper.writeValueAsString(searchRequest), "username", "password", objectMapper.writeValueAsString(apiResponse)); // send and receive messages - final Map payload = digiWFIntegrationE2eTestUtility.runIntegration(request, processInstanceId, "searchPersonErweitert"); + final Map payload = digiWFIntegrationE2eTestUtility.runIntegration(request, processInstanceId, "okEwoIntegration", "searchPersonErweitert"); assertNotNull(payload); final Map response = (Map) payload.get("response"); assertNotNull(response); diff --git a/digiwf-integrations/digiwf-s3-integration/digiwf-s3-integration-core/src/main/java/de/muenchen/oss/digiwf/s3/integration/adapter/out/integration/IntegrationOutAdapter.java b/digiwf-integrations/digiwf-s3-integration/digiwf-s3-integration-core/src/main/java/de/muenchen/oss/digiwf/s3/integration/adapter/out/integration/IntegrationOutAdapter.java index 90ec5bb6a5..63718941ed 100644 --- a/digiwf-integrations/digiwf-s3-integration/digiwf-s3-integration-core/src/main/java/de/muenchen/oss/digiwf/s3/integration/adapter/out/integration/IntegrationOutAdapter.java +++ b/digiwf-integrations/digiwf-s3-integration/digiwf-s3-integration-core/src/main/java/de/muenchen/oss/digiwf/s3/integration/adapter/out/integration/IntegrationOutAdapter.java @@ -22,11 +22,12 @@ public class IntegrationOutAdapter implements IntegrationOutPort { @Override public void correlateProcessMessage(@NonNull MessageHeaders headers, Map payload) { final String processInstanceId = Objects.requireNonNull(headers.get(MessageConstants.DIGIWF_PROCESS_INSTANCE_ID)).toString(); - final String messageName = Objects.requireNonNull(headers.get(MessageConstants.DIGIWF_MESSAGE_NAME)).toString(); + final String integrationName = Objects.requireNonNull(headers.get(MessageConstants.DIGIWF_INTEGRATION_NAME)).toString(); + final String type = Objects.requireNonNull(headers.get(MessageConstants.TYPE)).toString(); if (payload == null) { payload = new HashMap<>(); } - this.processApi.correlateMessage(processInstanceId, messageName, payload); + this.processApi.correlateMessage(processInstanceId, type, integrationName, payload); } @Override diff --git a/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/common/MessageConstants.java b/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/common/MessageConstants.java index 39b7a652bb..6feb3da61c 100644 --- a/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/common/MessageConstants.java +++ b/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/common/MessageConstants.java @@ -5,6 +5,7 @@ */ public final class MessageConstants { public static final String TYPE = "type"; - public static final String DIGIWF_MESSAGE_NAME = "digiwf.messagename"; + public static final String DIGIWF_INTEGRATION_NAME = "digiwf.integrationname"; public static final String DIGIWF_PROCESS_INSTANCE_ID = "digiwf.processinstanceid"; + public static final String DIGIWF_PROCESS_DEFINITION = "digiwf.processdefinition"; } diff --git a/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/api/ErrorApi.java b/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/api/ErrorApi.java index 9137b31059..06d466eb1c 100644 --- a/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/api/ErrorApi.java +++ b/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/api/ErrorApi.java @@ -9,21 +9,20 @@ public interface ErrorApi { /** * Handles an incident with the specified process instance ID, origin message name, and error message. - * @param processInstanceId The ID of the process instance associated with the incident. - * @param originMessageName The name of the message that caused the incident. + * @param originMessageHeaders The headers of the message that caused the incident. * @param errorMessage The error message associated with the incident. * @return true if the incident was successfully handled, false otherwise. */ - boolean handleIncident(String processInstanceId, String originMessageName, String errorMessage); + boolean handleIncident(Map originMessageHeaders, String errorMessage); /** * Handles a bpmn error with the specified process instance ID, error code, and error message. - * @param processInstanceId The ID of the process instance associated with the technical error. + * @param originMessageHeaders The headers of the message that caused the bpmn error. * @param errorCode The error code associated with the technical error. * @param errorMessage The error message associated with the technical error. * @return true if the technical error was successfully handled, false otherwise. */ - boolean handleBpmnError(String processInstanceId, String errorCode, String errorMessage); + boolean handleBpmnError(Map originMessageHeaders, String errorCode, String errorMessage); /** * Handles a bpmn error with the specified origin message headers. diff --git a/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/api/ProcessApi.java b/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/api/ProcessApi.java index 79e011343b..ead6ea12a6 100644 --- a/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/api/ProcessApi.java +++ b/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/api/ProcessApi.java @@ -27,11 +27,12 @@ public interface ProcessApi { /** * Correlates a message with the specified process instance ID and payload variables. * @param processInstanceId The ID of the process instance to correlate the message with. - * @param messageName The name of the message to be correlated. + * @param type The type of the message to be correlated. + * @param integrationName The name of the integration to be correlated. * @param payloadVariables The payload variables to be included in the message correlation. * @return true if the message was successfully correlated, false otherwise. */ - boolean correlateMessage(String processInstanceId, String messageName, Map payloadVariables); + boolean correlateMessage(String processInstanceId, String type, String integrationName, Map payloadVariables); } diff --git a/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/impl/ErrorApiImpl.java b/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/impl/ErrorApiImpl.java index d4c42e549c..47c5dcb3b4 100644 --- a/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/impl/ErrorApiImpl.java +++ b/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/impl/ErrorApiImpl.java @@ -26,18 +26,16 @@ public class ErrorApiImpl implements ErrorApi { * Handles an incident by sending a message to the incident destination. * The incident message contains the process instance id, message name and error message. * - * @param processInstanceId The process instance id of the process to be correlated. - * @param messageName The message name to be correlated. + * @param originMessageHeaders The headers of the message that caused the incident. * @param errorMessage The error message to be passed to the process. * @return */ @Override - public boolean handleIncident(final String processInstanceId, final String messageName, final String errorMessage) { - log.error("Incident occured for process {} with error message {}", processInstanceId, errorMessage); + public boolean handleIncident(final Map originMessageHeaders, final String errorMessage) { final Map headers = Map.of( TYPE, this.incidentDestination, - DIGIWF_PROCESS_INSTANCE_ID, processInstanceId, - DIGIWF_MESSAGE_NAME, messageName + DIGIWF_PROCESS_INSTANCE_ID, originMessageHeaders.get(DIGIWF_PROCESS_INSTANCE_ID), + DIGIWF_INTEGRATION_NAME, originMessageHeaders.get(DIGIWF_INTEGRATION_NAME) ); return this.messageApi.sendMessage(errorMessage, headers, this.incidentDestination); } @@ -46,13 +44,14 @@ public boolean handleIncident(final String processInstanceId, final String messa * Handles a bpmn error by sending a message to the bpmn error destination. * The bpmn error message contains the process instance id, error code and error message. * - * @param processInstanceId The process instance id of the process to be correlated. + * @param originMessageHeaders The headers of the message that caused the bpmn error. * @param errorCode The error code to be passed to the process. * @param errorMessage The error message to be passed to the process. * @return */ @Override - public boolean handleBpmnError(final String processInstanceId, final String errorCode, final String errorMessage) { + public boolean handleBpmnError(final Map originMessageHeaders, final String errorCode, final String errorMessage) { + final String processInstanceId = originMessageHeaders.get(DIGIWF_PROCESS_INSTANCE_ID).toString(); log.warn("A technical error occured for process {} with error message {}", processInstanceId, errorMessage); final BpmnErrorDto payload = BpmnErrorDto.builder() .processInstanceId(processInstanceId) @@ -63,7 +62,7 @@ public boolean handleBpmnError(final String processInstanceId, final String erro final Map headers = Map.of( TYPE, BPMN_ERROR_MESSAGE_TYPE, DIGIWF_PROCESS_INSTANCE_ID, processInstanceId, - DIGIWF_MESSAGE_NAME, BPMN_ERROR_MESSAGE_NAME + DIGIWF_INTEGRATION_NAME, originMessageHeaders.get(DIGIWF_INTEGRATION_NAME) ); return this.messageApi.sendMessage(payload, headers, this.bpmnErrorDestination); } @@ -73,7 +72,7 @@ public boolean handleBpmnError(final Map originMessageHeaders, f if (!originMessageHeaders.containsKey(DIGIWF_PROCESS_INSTANCE_ID)) { throw new RuntimeException("The origin message headers do not contain a process instance id."); } - return this.handleBpmnError(originMessageHeaders.get(DIGIWF_PROCESS_INSTANCE_ID).toString(), + return this.handleBpmnError(originMessageHeaders, bpmnError.getErrorCode(), bpmnError.getErrorMessage()); } @@ -82,11 +81,10 @@ public boolean handleIncident(final Map originMessageHeaders, fi if (!originMessageHeaders.containsKey(DIGIWF_PROCESS_INSTANCE_ID)) { throw new RuntimeException("The origin message headers do not contain a process instance id."); } - if (!originMessageHeaders.containsKey(DIGIWF_MESSAGE_NAME)) { - throw new RuntimeException("The origin message headers do not contain a message name."); + if (!originMessageHeaders.containsKey(DIGIWF_INTEGRATION_NAME)) { + throw new RuntimeException("The origin message headers do not contain an integration name."); } - return this.handleIncident(originMessageHeaders.get(DIGIWF_PROCESS_INSTANCE_ID).toString(), - originMessageHeaders.get(DIGIWF_MESSAGE_NAME).toString(), incidentError.getErrorMessage()); + return this.handleIncident(originMessageHeaders, incidentError.getErrorMessage()); } } diff --git a/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/impl/ProcessApiImpl.java b/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/impl/ProcessApiImpl.java index e53818792d..732e16f5b1 100644 --- a/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/impl/ProcessApiImpl.java +++ b/digiwf-libs/digiwf-message/digiwf-message-core/src/main/java/de/muenchen/oss/digiwf/message/process/impl/ProcessApiImpl.java @@ -59,21 +59,23 @@ public boolean startProcess(final String processKey, final Map v * The correlate message contains the process instance id, message name and variables. * * @param processInstanceId The process instance id of the process to be correlated. - * @param messageName The message name to be correlated. + * @param integrationName The integration name to be correlated. + * @param type The type to be correlated. * @param payloadVariables The variables to be passed to the process. * @return */ @Override - public boolean correlateMessage(final String processInstanceId, final String messageName, final Map payloadVariables) { + public boolean correlateMessage(final String processInstanceId, final String type, final String integrationName, final Map payloadVariables) { + // message name = integration name -> camunda requires a message name final CorrelateMessageDto payload = CorrelateMessageDto.builder() .processInstanceId(processInstanceId) - .messageName(messageName) + .messageName(type) .payloadVariables(payloadVariables) .build(); final Map headers = Map.of( TYPE, CORRELATEMESSAGEV_01, DIGIWF_PROCESS_INSTANCE_ID, processInstanceId, - DIGIWF_MESSAGE_NAME, messageName + DIGIWF_INTEGRATION_NAME, integrationName ); return this.messageApi.sendMessage(payload, headers, this.correlateMessageDestination); } diff --git a/digiwf-libs/digiwf-message/digiwf-message-core/src/test/java/de/muenchen/oss/digiwf/message/process/impl/ErrorApiImplTest.java b/digiwf-libs/digiwf-message/digiwf-message-core/src/test/java/de/muenchen/oss/digiwf/message/process/impl/ErrorApiImplTest.java index 458ed117a2..9456d8c659 100644 --- a/digiwf-libs/digiwf-message/digiwf-message-core/src/test/java/de/muenchen/oss/digiwf/message/process/impl/ErrorApiImplTest.java +++ b/digiwf-libs/digiwf-message/digiwf-message-core/src/test/java/de/muenchen/oss/digiwf/message/process/impl/ErrorApiImplTest.java @@ -5,7 +5,6 @@ import de.muenchen.oss.digiwf.message.process.api.error.BpmnError; import de.muenchen.oss.digiwf.message.process.api.error.IncidentError; import de.muenchen.oss.digiwf.message.process.impl.dto.BpmnErrorDto; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; @@ -34,9 +33,9 @@ class ErrorApiImplTest { private final String processInstanceId = "processInstanceId-123"; private final String incidentDestination = "incidentMessageDestination"; private final String bpmnErrorDestination = "bpmnErrorMessageDestination"; - private final String messageName = "someMessageName"; + private final String integrationName = "exampleIntegration"; private final Map messageHeaders = Map.of(DIGIWF_PROCESS_INSTANCE_ID, this.processInstanceId, - DIGIWF_MESSAGE_NAME, this.messageName); + DIGIWF_INTEGRATION_NAME, this.integrationName); @BeforeEach @@ -46,16 +45,16 @@ void setUp() { @Test void testHandleIncident() { - final boolean success = this.errorApi.handleIncident(this.processInstanceId, this.messageName, "someErrorMessage"); + final boolean success = this.errorApi.handleIncident(messageHeaders, "someErrorMessage"); assertThat(success).isTrue(); - this.verifyIncidentMessageApiCall("someErrorMessage", this.incidentDestination, this.messageName, this.incidentDestination); + this.verifyIncidentMessageApiCall("someErrorMessage", this.incidentDestination, this.integrationName, this.incidentDestination); } @Test void testHandleBpmnError() { final String errorCode = "400"; final String errorMessage = "someErrorMessage"; - final boolean success = this.errorApi.handleBpmnError(this.processInstanceId, errorCode, errorMessage); + final boolean success = this.errorApi.handleBpmnError(messageHeaders, errorCode, errorMessage); assertThat(success).isTrue(); this.verifyBpmnErrorMessageApiCall(new BpmnError(errorCode, errorMessage), this.bpmnErrorDestination); } @@ -71,7 +70,7 @@ void testHandleBpmnErrorWithException() { @Test void testHandleBpmnErrorWithExceptionRaisesRuntimeExceptionOnMissingProcessInstance() { final BpmnError bpmnError = new BpmnError("400", "someErrorMessage"); - assertThatThrownBy(() -> this.errorApi.handleBpmnError(Map.of(DIGIWF_MESSAGE_NAME, "someMessage"), bpmnError)) + assertThatThrownBy(() -> this.errorApi.handleBpmnError(Map.of(DIGIWF_INTEGRATION_NAME, "someMessage"), bpmnError)) .isInstanceOf(RuntimeException.class); } @@ -80,13 +79,13 @@ void testHandleIncidentWithException() { final IncidentError incidentError = new IncidentError("someErrorMessage"); final boolean success = this.errorApi.handleIncident(this.messageHeaders, incidentError); assertThat(success).isTrue(); - this.verifyIncidentMessageApiCall("someErrorMessage", this.incidentDestination, this.messageName, this.incidentDestination); + this.verifyIncidentMessageApiCall("someErrorMessage", this.incidentDestination, this.integrationName, this.incidentDestination); } @Test void testHandleIncidentWithExceptionRaisesRuntimeExceptionOnMissingProcessInstance() { final IncidentError incidentError = new IncidentError("someErrorMessage"); - assertThatThrownBy(() -> this.errorApi.handleIncident(Map.of(DIGIWF_MESSAGE_NAME, "someMessage"), incidentError)) + assertThatThrownBy(() -> this.errorApi.handleIncident(Map.of(DIGIWF_INTEGRATION_NAME, "someMessage"), incidentError)) .isInstanceOf(RuntimeException.class); } @@ -103,15 +102,15 @@ private void verifyBpmnErrorMessageApiCall(final BpmnError payload, final String final ArgumentCaptor destinationCaptor = ArgumentCaptor.forClass(String.class); Mockito.verify(this.messageApi, times(2)).sendMessage(payloadCaptor.capture(), headersCaptor.capture(), destinationCaptor.capture()); - Assertions.assertEquals(payload.getErrorMessage(), payloadCaptor.getValue().getErrorMessage()); - Assertions.assertEquals(payload.getErrorCode(), payloadCaptor.getValue().getErrorCode()); - Assertions.assertEquals(this.processInstanceId, payloadCaptor.getValue().getProcessInstanceId()); - Assertions.assertEquals(destination, destinationCaptor.getValue()); - Assertions.assertEquals("bpmnError", headersCaptor.getValue().get(DIGIWF_MESSAGE_NAME), "Message name should be bpmnError"); - Assertions.assertEquals("bpmnerror", headersCaptor.getValue().get(TYPE), "Message type should be bpmnerror"); + assertThat(payload.getErrorMessage()).isEqualTo(payloadCaptor.getValue().getErrorMessage()); + assertThat(payload.getErrorCode()).isEqualTo(payloadCaptor.getValue().getErrorCode()); + assertThat(this.processInstanceId).isEqualTo(payloadCaptor.getValue().getProcessInstanceId()); + assertThat(destination).isEqualTo(destinationCaptor.getValue()); + assertThat(integrationName).isEqualTo(headersCaptor.getValue().get(DIGIWF_INTEGRATION_NAME)); + assertThat("bpmnerror").isEqualTo(headersCaptor.getValue().get(TYPE)); } - private void verifyIncidentMessageApiCall(final String payload, final String typeHeader, final String messageNameHeader, final String destination) { + private void verifyIncidentMessageApiCall(final String payload, final String typeHeader, final String integrationNameHeader, final String destination) { final ArgumentCaptor payloadCaptor = ArgumentCaptor.forClass(String.class); final ArgumentCaptor> headersCaptor = ArgumentCaptor.forClass(Map.class); final ArgumentCaptor destinationCaptor = ArgumentCaptor.forClass(String.class); @@ -123,7 +122,7 @@ private void verifyIncidentMessageApiCall(final String payload, final String typ .hasSize(3) .containsEntry(TYPE, typeHeader) .containsEntry(DIGIWF_PROCESS_INSTANCE_ID, this.processInstanceId) - .containsEntry(DIGIWF_MESSAGE_NAME, messageNameHeader); + .containsEntry(DIGIWF_INTEGRATION_NAME, integrationNameHeader); assertThat(destinationCaptor.getValue()).isEqualTo(destination); } diff --git a/digiwf-libs/digiwf-message/digiwf-message-core/src/test/java/de/muenchen/oss/digiwf/message/process/impl/ProcessApiImplTest.java b/digiwf-libs/digiwf-message/digiwf-message-core/src/test/java/de/muenchen/oss/digiwf/message/process/impl/ProcessApiImplTest.java index c769f81200..d46958146a 100644 --- a/digiwf-libs/digiwf-message/digiwf-message-core/src/test/java/de/muenchen/oss/digiwf/message/process/impl/ProcessApiImplTest.java +++ b/digiwf-libs/digiwf-message/digiwf-message-core/src/test/java/de/muenchen/oss/digiwf/message/process/impl/ProcessApiImplTest.java @@ -55,8 +55,9 @@ void testStartProcessWithFileContext() { @Test void testCorrelateMessage() { - final String messageName = "correlateMessage"; - final boolean success = this.processApi.correlateMessage(this.processInstanceId, messageName, this.variables); + final String integrationName = "exampleIntegration"; + final String type = "exampleType"; + final boolean success = this.processApi.correlateMessage(this.processInstanceId, type, integrationName, this.variables); assertThat(success).isTrue(); final ArgumentCaptor payloadCaptor = ArgumentCaptor.forClass(CorrelateMessageDto.class); @@ -68,14 +69,14 @@ void testCorrelateMessage() { final Map headers = headersCaptor.getValue(); assertThat(payload.getProcessInstanceId()).isEqualTo(this.processInstanceId); - assertThat(payload.getMessageName()).isEqualTo(messageName); + assertThat(payload.getMessageName()).isEqualTo(type); assertThat(payload.getPayloadVariables()).isEqualTo(this.variables); assertThat(headers) .hasSize(3) .containsEntry(TYPE, "correlatemessagev01") .containsEntry(DIGIWF_PROCESS_INSTANCE_ID, this.processInstanceId) - .containsEntry(DIGIWF_MESSAGE_NAME, messageName); + .containsEntry(DIGIWF_INTEGRATION_NAME, integrationName); assertThat(destinationCaptor.getValue()).isEqualTo("correlateMessageDestination"); } diff --git a/digiwf-libs/digiwf-message/digiwf-message-example/src/main/java/de/muenchen/oss/digiwf/message/example/process/api/ProcessController.java b/digiwf-libs/digiwf-message/digiwf-message-example/src/main/java/de/muenchen/oss/digiwf/message/example/process/api/ProcessController.java index efd475b6a3..f3106d19c4 100644 --- a/digiwf-libs/digiwf-message/digiwf-message-example/src/main/java/de/muenchen/oss/digiwf/message/example/process/api/ProcessController.java +++ b/digiwf-libs/digiwf-message/digiwf-message-example/src/main/java/de/muenchen/oss/digiwf/message/example/process/api/ProcessController.java @@ -13,6 +13,11 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.Map; + +import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_INTEGRATION_NAME; +import static de.muenchen.oss.digiwf.message.common.MessageConstants.DIGIWF_PROCESS_INSTANCE_ID; + @RequiredArgsConstructor @RestController @RequestMapping(value = "/process") @@ -37,7 +42,8 @@ public ResponseEntity correlateMessage(@RequestBody final ProcessMessageDto proc return ResponseEntity.ok().build(); } catch (final BpmnError ex) { log.warn("Handle technical error"); - this.errorApi.handleBpmnError(processMessageDto.getProcessInstanceId(), ex.getErrorCode(), ex.getErrorMessage()); + this.errorApi.handleBpmnError(Map.of(DIGIWF_PROCESS_INSTANCE_ID, processMessageDto.getProcessInstanceId(), DIGIWF_INTEGRATION_NAME, processMessageDto.getMessageName()), + ex.getErrorCode(), ex.getErrorMessage()); return ResponseEntity.badRequest().build(); } } diff --git a/digiwf-libs/digiwf-message/digiwf-message-example/src/main/java/de/muenchen/oss/digiwf/message/example/process/service/ProcessService.java b/digiwf-libs/digiwf-message/digiwf-message-example/src/main/java/de/muenchen/oss/digiwf/message/example/process/service/ProcessService.java index 8739f27268..0d1bf82f38 100644 --- a/digiwf-libs/digiwf-message/digiwf-message-example/src/main/java/de/muenchen/oss/digiwf/message/example/process/service/ProcessService.java +++ b/digiwf-libs/digiwf-message/digiwf-message-example/src/main/java/de/muenchen/oss/digiwf/message/example/process/service/ProcessService.java @@ -26,7 +26,7 @@ public void correlateMessage(final ProcessMessageDto messageDto) throws Incident if (messageDto.getVariables().isEmpty()) { throw new BpmnError("400", "No variables defined."); } - this.processApi.correlateMessage(messageDto.getProcessInstanceId(), messageDto.getMessageName(), messageDto.getVariables()); + this.processApi.correlateMessage(messageDto.getProcessInstanceId(), "type", messageDto.getMessageName(), messageDto.getVariables()); } } diff --git a/digiwf-libs/digiwf-testing/digiwf-e2e-test-core/src/main/java/de/muenchen/oss/digiwf/integration/e2e/test/DigiwfIntegrationE2eTestUtility.java b/digiwf-libs/digiwf-testing/digiwf-e2e-test-core/src/main/java/de/muenchen/oss/digiwf/integration/e2e/test/DigiwfIntegrationE2eTestUtility.java index c6421b904f..3430cae9ae 100644 --- a/digiwf-libs/digiwf-testing/digiwf-e2e-test-core/src/main/java/de/muenchen/oss/digiwf/integration/e2e/test/DigiwfIntegrationE2eTestUtility.java +++ b/digiwf-libs/digiwf-testing/digiwf-e2e-test-core/src/main/java/de/muenchen/oss/digiwf/integration/e2e/test/DigiwfIntegrationE2eTestUtility.java @@ -22,12 +22,12 @@ public class DigiwfIntegrationE2eTestUtility { private final int DEFAULT_TIMEOUT = 15; - public Map runIntegration(final Object payload, final String processInstanceId, final String messageType) { - return this.runIntegration(payload, processInstanceId, messageType, DEFAULT_TIMEOUT); + public Map runIntegration(final Object payload, final String processInstanceId, final String integrationName, final String messageType) { + return this.runIntegration(payload, processInstanceId, integrationName, messageType, DEFAULT_TIMEOUT); } - public Map runIntegration(final Object payload, final String processInstanceId, final String messageType, final int timeout) { - this.sendMessage(payload, processInstanceId, messageType); + public Map runIntegration(final Object payload, final String processInstanceId, final String integrationName, final String messageType, final int timeout) { + this.sendMessage(payload, processInstanceId, integrationName, messageType); // wait for the message to be received await().atMost(timeout, TimeUnit.SECONDS).until(() -> this.testMessageConsumer.hasReceivedMessage(processInstanceId)); @@ -35,8 +35,8 @@ public Map runIntegration(final Object payload, final String pro return this.testMessageConsumer.receiveMessage(processInstanceId); } - private void sendMessage(final Object payload, final String processInstanceId, final String messageType) { - final Map headers = Map.of(DIGIWF_PROCESS_INSTANCE_ID, processInstanceId, DIGIWF_MESSAGE_NAME, "messageName", TYPE, messageType); + private void sendMessage(final Object payload, final String processInstanceId, final String integrationName, final String messageType) { + final Map headers = Map.of(DIGIWF_PROCESS_INSTANCE_ID, processInstanceId, DIGIWF_INTEGRATION_NAME, integrationName, TYPE, messageType); messageApi.sendMessage(payload, headers, messageTopic); } diff --git a/docs/src/.vuepress/public/bpmn/StreamingTemplateV01.bpmn b/docs/src/.vuepress/public/bpmn/StreamingTemplateV01.bpmn index 5cd060f400..27769c0176 100644 --- a/docs/src/.vuepress/public/bpmn/StreamingTemplateV01.bpmn +++ b/docs/src/.vuepress/public/bpmn/StreamingTemplateV01.bpmn @@ -36,7 +36,7 @@ - + diff --git a/docs/src/.vuepress/public/bpmn/StreamingTemplateV02.bpmn b/docs/src/.vuepress/public/bpmn/StreamingTemplateV02.bpmn index 13d8245be8..c30ac4cd9d 100644 --- a/docs/src/.vuepress/public/bpmn/StreamingTemplateV02.bpmn +++ b/docs/src/.vuepress/public/bpmn/StreamingTemplateV02.bpmn @@ -1,5 +1,11 @@ - + Flow_0riqkf6 @@ -59,7 +65,7 @@ - + diff --git a/docs/src/.vuepress/public/element-template/address-integration/checkAddress.json b/docs/src/.vuepress/public/element-template/address-integration/checkAddress.json index a1c13af79a..ac52425753 100644 --- a/docs/src/.vuepress/public/element-template/address-integration/checkAddress.json +++ b/docs/src/.vuepress/public/element-template/address-integration/checkAddress.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "addressIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -149,8 +135,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/docs/src/.vuepress/public/element-template/address-integration/findStreetById.json b/docs/src/.vuepress/public/element-template/address-integration/findStreetById.json index 800bdc242d..9923e6d407 100644 --- a/docs/src/.vuepress/public/element-template/address-integration/findStreetById.json +++ b/docs/src/.vuepress/public/element-template/address-integration/findStreetById.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "addressIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -82,8 +68,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/docs/src/.vuepress/public/element-template/address-integration/listAenderungenMuenchen.json b/docs/src/.vuepress/public/element-template/address-integration/listAenderungenMuenchen.json index a22856d70d..18ba294185 100644 --- a/docs/src/.vuepress/public/element-template/address-integration/listAenderungenMuenchen.json +++ b/docs/src/.vuepress/public/element-template/address-integration/listAenderungenMuenchen.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "addressIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -162,8 +148,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/docs/src/.vuepress/public/element-template/address-integration/listStreet.json b/docs/src/.vuepress/public/element-template/address-integration/listStreet.json index 316fe6b582..4d9db70365 100644 --- a/docs/src/.vuepress/public/element-template/address-integration/listStreet.json +++ b/docs/src/.vuepress/public/element-template/address-integration/listStreet.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "addressIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -115,8 +101,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/docs/src/.vuepress/public/element-template/address-integration/searchAddressesGermany.json b/docs/src/.vuepress/public/element-template/address-integration/searchAddressesGermany.json index ae993ab7d3..fd55a77a7e 100644 --- a/docs/src/.vuepress/public/element-template/address-integration/searchAddressesGermany.json +++ b/docs/src/.vuepress/public/element-template/address-integration/searchAddressesGermany.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "addressIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -142,8 +128,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/docs/src/.vuepress/public/element-template/address-integration/searchAdressenGeoMuenchen.json b/docs/src/.vuepress/public/element-template/address-integration/searchAdressenGeoMuenchen.json index 3a559e231c..378a942a85 100644 --- a/docs/src/.vuepress/public/element-template/address-integration/searchAdressenGeoMuenchen.json +++ b/docs/src/.vuepress/public/element-template/address-integration/searchAdressenGeoMuenchen.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "addressIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -160,8 +146,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/docs/src/.vuepress/public/element-template/address-integration/searchAdressenMuenchen.json b/docs/src/.vuepress/public/element-template/address-integration/searchAdressenMuenchen.json index a222569b67..7d0b7b194e 100644 --- a/docs/src/.vuepress/public/element-template/address-integration/searchAdressenMuenchen.json +++ b/docs/src/.vuepress/public/element-template/address-integration/searchAdressenMuenchen.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "addressIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true @@ -112,8 +98,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/docs/src/.vuepress/public/element-template/cancelObject.json b/docs/src/.vuepress/public/element-template/cancelObject.json index 8ea5ea167d..1cd98bc9c5 100644 --- a/docs/src/.vuepress/public/element-template/cancelObject.json +++ b/docs/src/.vuepress/public/element-template/cancelObject.json @@ -29,21 +29,6 @@ "notEmpty": true } }, - { - "label": "Event Message", - "type": "String", - "editable": false, - "value": "genericEvent", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, { "label": "Type Header", "type": "String", diff --git a/docs/src/.vuepress/public/element-template/cosys-alle-daten.json b/docs/src/.vuepress/public/element-template/cosys-alle-daten.json deleted file mode 100644 index f06d4acf88..0000000000 --- a/docs/src/.vuepress/public/element-template/cosys-alle-daten.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "name": "Cosys: Dokument erstellen (alle Daten)", - "id": "de.muenchen.digitalwf.templates.GenerateDocumentWithAllVariables", - "appliesTo": [ - "bpmn:CallActivity" - ], - "properties": [ - { - "label": "Template", - "type": "String", - "editable": false, - "value": "StreamingTemplateV01", - "binding": { - "type": "property", - "name": "calledElement" - } - }, - { - "label": "Event Topic", - "type": "String", - "value": "dwf-cosys-XX", - "binding": { - "type": "camunda:in", - "target": "app_topic_name", - "expression": true - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", - "type": "Hidden", - "value": "cosysMessage", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Type", - "type": "Hidden", - "value": "createCosysDocument", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "app_type_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Client", - "type": "String", - "value": "9001", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "client" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Role", - "type": "String", - "value": "TESTER", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "role" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Guid", - "type": "String", - "value": "519650b7-87c2-41a6-8527-7b095675b13f", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "guid" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Document Storage Urls (S3)", - "type": "String", - "value": "", - "description": "Array of presigned urls created with s3 integration", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "documentStorageUrls", - "target": "documentStorageUrls" - }, - "constraints": { - "notEmpty": false - } - }, - { - "label": "Daten", - "type": "Hidden", - "value": "${JSON(execution.getVariables())}", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "variables" - }, - "constraints": { - "notEmpty": true - } - } - ], - "entriesVisible": { - "_all": false - } -} diff --git a/docs/src/.vuepress/public/element-template/cosys-dokument-erstellen.json b/docs/src/.vuepress/public/element-template/cosys-dokument-erstellen.json deleted file mode 100644 index fa54f5da80..0000000000 --- a/docs/src/.vuepress/public/element-template/cosys-dokument-erstellen.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "name": "Cosys: Dokument erstellen", - "id": "de.muenchen.digitalwf.templates.GenerateDocument", - "appliesTo": [ - "bpmn:CallActivity" - ], - "properties": [ - { - "label": "Template", - "type": "String", - "editable": false, - "value": "StreamingTemplateV01", - "binding": { - "type": "property", - "name": "calledElement" - } - }, - { - "label": "Event Topic", - "type": "String", - "value": "dwf-cosys-test", - "binding": { - "type": "camunda:in", - "target": "app_topic_name", - "expression": true - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", - "type": "String", - "value": "cosysMessage", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Type", - "type": "String", - "value": "createCosysDocument", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "app_type_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Client", - "type": "String", - "value": "9001", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "client" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Role", - "type": "String", - "value": "TESTER", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "role" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Guid", - "type": "String", - "value": "519650b7-87c2-41a6-8527-7b095675b13f", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "guid" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Document Storage Urls (S3)", - "type": "String", - "value": "", - "description": "Array of presigned urls created with s3 integration", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "documentStorageUrls", - "target": "documentStorageUrls" - }, - "constraints": { - "notEmpty": false - } - }, - { - "label": "Daten", - "type": "String", - "value": "${cosysData}", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "variables" - }, - "constraints": { - "notEmpty": true - } - } - ], - "entriesVisible": { - "_all": false - } -} diff --git a/docs/src/.vuepress/public/element-template/cosys_generate_document_template_V02.json b/docs/src/.vuepress/public/element-template/cosys_generate_document_template_V02.json index 430d521b84..854deb305d 100644 --- a/docs/src/.vuepress/public/element-template/cosys_generate_document_template_V02.json +++ b/docs/src/.vuepress/public/element-template/cosys_generate_document_template_V02.json @@ -16,31 +16,20 @@ } }, { - "label": "Event Topic", + "label": "Integration Name", "type": "String", - "value": "dwf-cosys-XX", + "editable": false, + "value": "cosysIntegration", "binding": { "type": "camunda:in", - "target": "app_topic_name", + "name": "app_integration_name", + "target": "app_integration_name", "expression": true }, "constraints": { "notEmpty": true } }, - { - "label": "Event Message", - "type": "Hidden", - "value": "cosysMessage", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, { "label": "Event Type", "type": "Hidden", @@ -120,8 +109,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } -} \ No newline at end of file + ] +} diff --git a/docs/src/.vuepress/public/element-template/createProcedure.json b/docs/src/.vuepress/public/element-template/dms-integration/create-vorgang.json similarity index 79% rename from docs/src/.vuepress/public/element-template/createProcedure.json rename to docs/src/.vuepress/public/element-template/dms-integration/create-vorgang.json index 2c414cfeca..b1a1a016e1 100644 --- a/docs/src/.vuepress/public/element-template/createProcedure.json +++ b/docs/src/.vuepress/public/element-template/dms-integration/create-vorgang.json @@ -1,5 +1,5 @@ { - "name": "DMS: Vorgang anlegen", + "name": "Create Vorgang", "id": "de.muenchen.digitalwf.templates.create-procedure", "appliesTo": [ "bpmn:CallActivity" @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "dmsIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true diff --git a/docs/src/.vuepress/public/element-template/createDocument.json b/docs/src/.vuepress/public/element-template/dms-integration/createDocument.json similarity index 87% rename from docs/src/.vuepress/public/element-template/createDocument.json rename to docs/src/.vuepress/public/element-template/dms-integration/createDocument.json index 636bc1c10a..eb3757f30b 100644 --- a/docs/src/.vuepress/public/element-template/createDocument.json +++ b/docs/src/.vuepress/public/element-template/dms-integration/createDocument.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "dmsIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true diff --git a/docs/src/.vuepress/public/element-template/createFile.json b/docs/src/.vuepress/public/element-template/dms-integration/createFile.json similarity index 81% rename from docs/src/.vuepress/public/element-template/createFile.json rename to docs/src/.vuepress/public/element-template/dms-integration/createFile.json index 9e3d9e5a20..4253c9c1e3 100644 --- a/docs/src/.vuepress/public/element-template/createFile.json +++ b/docs/src/.vuepress/public/element-template/dms-integration/createFile.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "dmsIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true diff --git a/docs/src/.vuepress/public/element-template/depositObject.json b/docs/src/.vuepress/public/element-template/dms-integration/depositObject.json similarity index 75% rename from docs/src/.vuepress/public/element-template/depositObject.json rename to docs/src/.vuepress/public/element-template/dms-integration/depositObject.json index 109afcf27d..757bfd0f26 100644 --- a/docs/src/.vuepress/public/element-template/depositObject.json +++ b/docs/src/.vuepress/public/element-template/dms-integration/depositObject.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "dmsIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true diff --git a/docs/src/.vuepress/public/element-template/readContent.json b/docs/src/.vuepress/public/element-template/dms-integration/readContent.json similarity index 81% rename from docs/src/.vuepress/public/element-template/readContent.json rename to docs/src/.vuepress/public/element-template/dms-integration/readContent.json index 37c4653601..8666c22d7f 100644 --- a/docs/src/.vuepress/public/element-template/readContent.json +++ b/docs/src/.vuepress/public/element-template/dms-integration/readContent.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "dmsIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true diff --git a/docs/src/.vuepress/public/element-template/searchFile.json b/docs/src/.vuepress/public/element-template/dms-integration/searchFile.json similarity index 84% rename from docs/src/.vuepress/public/element-template/searchFile.json rename to docs/src/.vuepress/public/element-template/dms-integration/searchFile.json index 1505cda849..38a9569247 100644 --- a/docs/src/.vuepress/public/element-template/searchFile.json +++ b/docs/src/.vuepress/public/element-template/dms-integration/searchFile.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "dmsIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true diff --git a/docs/src/.vuepress/public/element-template/searchSubjectArea.json b/docs/src/.vuepress/public/element-template/dms-integration/searchSubjectArea.json similarity index 79% rename from docs/src/.vuepress/public/element-template/searchSubjectArea.json rename to docs/src/.vuepress/public/element-template/dms-integration/searchSubjectArea.json index e56fddd21a..4dc236b206 100644 --- a/docs/src/.vuepress/public/element-template/searchSubjectArea.json +++ b/docs/src/.vuepress/public/element-template/dms-integration/searchSubjectArea.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "dmsIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true diff --git a/docs/src/.vuepress/public/element-template/sendSimpleMailV01.json b/docs/src/.vuepress/public/element-template/dms-integration/update-document.json similarity index 58% rename from docs/src/.vuepress/public/element-template/sendSimpleMailV01.json rename to docs/src/.vuepress/public/element-template/dms-integration/update-document.json index ac49f254df..353612b24d 100644 --- a/docs/src/.vuepress/public/element-template/sendSimpleMailV01.json +++ b/docs/src/.vuepress/public/element-template/dms-integration/update-document.json @@ -1,6 +1,6 @@ { - "name": "Send simple E-Mail", - "id": "de.muenchen.digitalwf.templates.send-simple-email", + "name": "Update document in dms", + "id": "de.muenchen.digitalwf.templates.update-document-in-dms", "appliesTo": [ "bpmn:CallActivity" ], @@ -9,123 +9,117 @@ "label": "Template", "type": "String", "editable": false, - "value": "StreamingTemplateV01", + "value": "StreamingTemplateV02", "binding": { "type": "property", "name": "calledElement" } }, { - "label": "Event Topic", + "label": "Integration Name", "type": "String", - "value": "", + "editable": false, + "value": "dmsIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true } }, { - "label": "Event Message", + "label": "Type Header", "type": "String", "editable": false, - "value": "genericEvent", + "value": "updateDocument", "binding": { "type": "camunda:in", "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_type_name", + "target": "app_type_name" }, "constraints": { "notEmpty": true } }, { - "label": "Type Header", + "label": "File Context", "type": "String", "editable": false, - "value": "sendMailFromEventBus", + "value": "${app_file_context}", "binding": { "type": "camunda:in", "expression": true, - "name": "app_type_name", - "target": "app_type_name" + "name": "fileContext", + "target": "fileContext" }, "constraints": { "notEmpty": true } }, { - "label": "Receiver", + "label": " Dokument-COO", "type": "String", "value": "", "binding": { "type": "camunda:in", "expression": true, - "name": "receivers", - "target": "receivers" + "name": "documentCoo", + "target": "documentCoo" }, "constraints": { "notEmpty": true } }, { - "label": "Subject", + "label": "User", "type": "String", "value": "", "binding": { "type": "camunda:in", "expression": true, - "name": "subject", - "target": "subject" + "name": "user", + "target": "user" }, "constraints": { "notEmpty": true } }, { - "label": "Body", - "type": "Text", - "value": "", + "label": "Typ (Ein-/Ausgehend/Intern)", + "type": "Dropdown", + "value": "EINGEHEND", + "choices": [ + { "name": "Eingehend", "value": "EINGEHEND" }, + { "name": "Ausgehend", "value": "AUSGEHEND" }, + { "name": "Intern", "value": "INTERN" } + ], "binding": { "type": "camunda:in", "expression": true, - "name": "body", - "target": "body" + "name": "type", + "target": "type" }, "constraints": { "notEmpty": true } }, { - "label": "Reply-To Address", + "label": "Pfad(e) im S3", "type": "String", "value": "", "binding": { "type": "camunda:in", "expression": true, - "name": "replyTo", - "target": "replyTo" - } - }, - { - "label": "Dispatch Status", - "value": "mailSentStatus", - "type": "String", - "binding": { - "type": "camunda:out", - "source": "mailSentStatus" + "name": "filepaths", + "target": "filepaths" }, "constraints": { - "notEmpty": false + "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/docs/src/.vuepress/public/element-template/updateDocument.json b/docs/src/.vuepress/public/element-template/dms-integration/upload-file.json similarity index 76% rename from docs/src/.vuepress/public/element-template/updateDocument.json rename to docs/src/.vuepress/public/element-template/dms-integration/upload-file.json index 5413d27fc6..e452894d93 100644 --- a/docs/src/.vuepress/public/element-template/updateDocument.json +++ b/docs/src/.vuepress/public/element-template/dms-integration/upload-file.json @@ -1,6 +1,6 @@ { - "name": "DMS: Dokument updaten", - "id": "de.muenchen.digitalwf.templates.update-document-in-dms", + "name": "Upload file to dms", + "id": "de.muenchen.digitalwf.templates.upload-file-to-dms", "appliesTo": [ "bpmn:CallActivity" ], @@ -16,73 +16,73 @@ } }, { - "label": "Event Topic", + "label": "Integration Name", "type": "String", - "value": "", + "editable": false, + "value": "dmsIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true } }, { - "label": "Event Message", + "label": "Type Header", "type": "String", "editable": false, - "value": "genericEvent", + "value": "createDocument", "binding": { "type": "camunda:in", "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_type_name", + "target": "app_type_name" }, "constraints": { "notEmpty": true } }, { - "label": "Type Header", + "label": "File Context", "type": "String", "editable": false, - "value": "updateDocument", + "value": "${app_file_context}", "binding": { "type": "camunda:in", "expression": true, - "name": "app_type_name", - "target": "app_type_name" + "name": "fileContext", + "target": "fileContext" }, "constraints": { "notEmpty": true } }, { - "label": "File Context", + "label": " Vorgang-COO", "type": "String", - "editable": false, - "value": "${app_file_context}", + "value": "", "binding": { "type": "camunda:in", "expression": true, - "name": "fileContext", - "target": "fileContext" + "name": "procedureCoo", + "target": "procedureCoo" }, "constraints": { "notEmpty": true } }, { - "label": "Dokument-COO", + "label": "Title", "type": "String", "value": "", "binding": { "type": "camunda:in", "expression": true, - "name": "documentCoo", - "target": "documentCoo" + "name": "title", + "target": "title" }, "constraints": { "notEmpty": true @@ -107,18 +107,9 @@ "type": "Dropdown", "value": "EINGEHEND", "choices": [ - { - "name": "Eingehend", - "value": "EINGEHEND" - }, - { - "name": "Ausgehend", - "value": "AUSGEHEND" - }, - { - "name": "Intern", - "value": "INTERN" - } + { "name": "Eingehend", "value": "EINGEHEND" }, + { "name": "Ausgehend", "value": "AUSGEHEND" }, + { "name": "Intern", "value": "INTERN" } ], "binding": { "type": "camunda:in", diff --git a/docs/src/.vuepress/public/element-template/okEwoIntegration.json b/docs/src/.vuepress/public/element-template/okEwoIntegration.json deleted file mode 100644 index 33b731b1fe..0000000000 --- a/docs/src/.vuepress/public/element-template/okEwoIntegration.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "name": "DigiWF OK EWO Integration", - "id": "de.muenchen.digitalwf.templates.digiwf-okewo-integration", - "appliesTo": [ - "bpmn:CallActivity" - ], - "properties": [ - { - "label": "Template", - "type": "String", - "editable": false, - "value": "StreamingTemplateV01", - "binding": { - "type": "property", - "name": "calledElement" - } - }, - { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", - "type": "String", - "editable": false, - "value": "genericOkEwoEvent", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "app_message_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Type Header", - "type": "String", - "value": "", - "choices": [ - { - "name": "Get Person on the basis of an Ordnungsmerkmal", - "value": "getPerson" - }, - { - "name": "Search Person based on search parameters", - "value": "searchPerson" - }, - { - "name": "Get PersonErweitert on the basis an Ordnungsmerkmal", - "value": "getPersonErweitert" - }, - { - "name": "Search PersonErweitert based on search parameters", - "value": "searchPersonErweitert" - } - ], - "binding": { - "type": "camunda:in", - "expression": true, - "target": "app_type_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "OK.EWO request as JSON object", - "type": "String", - "value": "${request}", - "binding": { - "type": "camunda:in", - "expression": true, - "target": "request" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "OK.EWO response as JSON object", - "value": "response", - "type": "String", - "binding": { - "type": "camunda:out", - "source": "response" - }, - "constraints": { - "notEmpty": true - } - } - ], - "entriesVisible": { - "_all": false - } -} diff --git a/docs/src/.vuepress/public/element-template/s3_create_presigned_url_template.json b/docs/src/.vuepress/public/element-template/s3_create_presigned_url_template.json index 8c89a64c88..4d1ce505e8 100644 --- a/docs/src/.vuepress/public/element-template/s3_create_presigned_url_template.json +++ b/docs/src/.vuepress/public/element-template/s3_create_presigned_url_template.json @@ -1,6 +1,6 @@ { - "name": "S3: Presigned Url erstellen", - "id": "de.muenchen.digitalwf.templates.S3CreatePresignedUrlTemplateV01", + "name": "S3: Presigned Url erstellen V02", + "id": "de.muenchen.digitalwf.templates.S3CreatePresignedUrlTemplateV02", "appliesTo": [ "bpmn:CallActivity" ], @@ -9,21 +9,21 @@ "label": "Template", "type": "String", "editable": false, - "value": "StreamingTemplateV01", + "value": "StreamingTemplateV02", "binding": { "type": "property", "name": "calledElement" } }, { - "label": "Event Topic", + "label": "Integration Name", "type": "String", "editable": false, - "value": "${app_file_s3_async_config}", + "value": "s3Integration", "binding": { "type": "camunda:in", - "name": "app_topic_name", - "target": "app_topic_name", + "name": "app_integration_name", + "target": "app_integration_name", "expression": true }, "constraints": { @@ -31,18 +31,18 @@ } }, { - "label": "Event Message", + "label": "Event Topic", "type": "String", - "editable": false, - "value": "createPresignedUrl", + "editable": true, + "value": "${app_file_s3_async_config}", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_topic_name", + "target": "app_topic_name", + "expression": true }, "constraints": { - "notEmpty": true + "notEmpty": false } }, { @@ -99,8 +99,5 @@ "notEmpty": true } } - ], - "entriesVisible": { - "_all": false - } + ] } diff --git a/docs/src/.vuepress/public/element-template/sendMailV02.json b/docs/src/.vuepress/public/element-template/sendMailV02.json index 5db8b3d1dc..8cd1864f2d 100644 --- a/docs/src/.vuepress/public/element-template/sendMailV02.json +++ b/docs/src/.vuepress/public/element-template/sendMailV02.json @@ -16,29 +16,15 @@ } }, { - "label": "Event Topic", - "type": "String", - "value": "", - "binding": { - "type": "camunda:in", - "expression": true, - "name": "app_topic_name", - "target": "app_topic_name" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Event Message", + "label": "Integration Name", "type": "String", "editable": false, - "value": "genericEvent", + "value": "emailIntegration", "binding": { "type": "camunda:in", - "expression": true, - "name": "app_message_name", - "target": "app_message_name" + "name": "app_integration_name", + "target": "app_integration_name", + "expression": true }, "constraints": { "notEmpty": true diff --git a/docs/src/documentation/components/connector.md b/docs/src/documentation/components/connector.md index 624aa13353..a47f3c2927 100644 --- a/docs/src/documentation/components/connector.md +++ b/docs/src/documentation/components/connector.md @@ -1,3 +1,41 @@ -# Connector +# DigiWF Connector + +Der DigiWF Connector ermöglicht eine nahtlose Verbindung zwischen der Camunda Engine (DigiWF Engine) und den [DigiWF Integrationen](/integrations/). +Er bietet eine einfache und effiziente Möglichkeit, Integrationen aufzurufen, Events zu handhaben und die Kommunikation zwischen den verschiedenen Systemen, +die in Ihren Geschäftsprozessen involviert sind, zu verwalten. + +## Verbindung zwischen DigiWF Engine und DigiWF Integrationen + +Der DigiWF Connector stellt eine Verbindung zur Camunda Engine (DigiWF Engine) über die ExternalTask-API her. +Diese ExternalTasks werden nacheinander vom Connector abgearbeitet, in dem aus den ExternalTasks Events erzeugt und an den Event Bus (Apache Kafka) gesendet werden. +Die Events werden von den DigiWF Integrationen verarbeitet und die Ergebnisse werden an den Connector zurückgegeben, der die Ergebnisse dann an die Camunda Engine (DigiWF Engine) weitergibt (CorrelateMessage). + +Im Bpmn Prozess wird dies als Call Activity modelliert, die das StreamingTemplateV02 aufruft. + +## Features + +Folgende Features unterstützt der DigiWF Connector: + +### Default Event Topics + +Im Connector können für die Integrationen default Event Topics definiert werden. Diese werden verwendet, wenn im Bpmn Prozess kein Event Topic angegeben wurde. +Das default Event Topic für eine Integration wird anhand des Integration Names aus der Config geladen. +Eine Liste der Integrationen mit default Event Topics wird unter `de.muenchen.oss.digiwf.connector.core.integrations` im Connector konfiguriert. + +### Custom Event Topics + +Wenn zusätzlich zum Integration-Name ein Event Topic im Bpmn Prozess angegeben wurde, wird dieses verwendet. +Dadurch können weitere Integrationen an die DigiWF Plattform angebunden werden. + +### Policies tbd. + + +### Fehlerbehandlung + +Wenn während des Aufrufs einer Integration oder beim Event-Handling ein Fehler auftritt, wirft die jeweilige Integration einen BPM Error oder Incident Error. +Diese werden an den Connector weitergeleitet und dieser behandelt sie. Im Falle eines BPM Errors wird der Fehler an den Prozess korreliert. +Bei einem Incident Error wird ein Incident erzeugt. + +Eine detaillierte Beschreibung der Fehlerbehandlung finden Sie unter [Fehlerbehandlung Integration](/integrations/concept/error-handling). diff --git a/docs/src/integrations/concept/integration-service.md b/docs/src/integrations/concept/integration-service.md index 6a8ebf5294..af7b4bf3a2 100644 --- a/docs/src/integrations/concept/integration-service.md +++ b/docs/src/integrations/concept/integration-service.md @@ -7,7 +7,8 @@ Für die Integration in Bpmn Prozesse werden Bausteine (Element-Templates) berei Die Integration wird über eine Call Activity aus dem Prozess aufgerufen. Dafür werden Element Templates bereitgestellt, mit deren Hilfe die Modellierer schnell und einfach die Integration in ihren Prozess einbinden können. -In den Element-Templates wird die Struktur der Daten, die an die Integration übergeben werden, definiert, das Kafka Topic sowie der Type Header erfasst. +In den Element-Templates wird die Struktur der Daten, die an die Integration übergeben werden, definiert, der Integration Name sowie der Type Header erfasst. +Zusätzlich kann ein Kafka Topic angegeben werden, falls nicht das Default Topic verwendet werden soll. > Der Type Header sollte bereits vom Developer vorausgefüllt werden. Die verfügbaren Topics sollten über eine Konfiguration gesetzt werden, da > sie sich je nach Umgebung unterscheiden können. @@ -19,7 +20,7 @@ Die Integrationsservices von DigiWF basieren auf einer Spring Boot Starter Paket - **core**, der die Businesslogik beinhaltet - **starter** Module, das den *core* verwendet, um Spring Beans zur Verfügung zu stellen - **example** Anwendung, die die Verwendung des Starters zeigt -- **service** Anwendung, die bereits vorkonfiguriert ist und direkt verwendet werden kann. Diese Service Anwendung ist üblicherweise als Docker Image im [dockerhub](https://hub.docker.com/u/itatm) veröffentlicht. Eine solche Service Anwendung ist nur bei generische Integrationen vorhanden. +- **service** Anwendung, die bereits vorkonfiguriert ist und direkt verwendet werden kann. Diese Service-Anwendung ist üblicherweise als Docker Image im [dockerhub](https://hub.docker.com/u/itatm) veröffentlicht. Eine solche Service-Anwendung ist nur bei generische Integrationen vorhanden. > Durch die Bereitstellung von Spring Boot Startern bietet es die nötige Flexibilität, um die Integrationsservices bei Bedarf zu erweitern oder zu verändern. diff --git a/docs/src/integrations/digiwf-address-integration.md b/docs/src/integrations/digiwf-address-integration.md index 5c95805978..04440e31f6 100644 --- a/docs/src/integrations/digiwf-address-integration.md +++ b/docs/src/integrations/digiwf-address-integration.md @@ -1,5 +1,7 @@ # DigiWF Address Integration +![](https://img.shields.io/badge/Integration_Name-addressIntegration-informational?style=flat&logoColor=white&color=2c73d2) + Die Address Integration bindet den Address-Service der Stadt München an die DigiWF Plattform an, wodurch Informationen zu Adressen sowie Straßen abgerufen werden können. diff --git a/docs/src/integrations/digiwf-alw-integration.md b/docs/src/integrations/digiwf-alw-integration.md index ceaf3fd4c1..7b7872bbea 100644 --- a/docs/src/integrations/digiwf-alw-integration.md +++ b/docs/src/integrations/digiwf-alw-integration.md @@ -1,5 +1,7 @@ # Digiwf ALW Integration +![](https://img.shields.io/badge/Integration_Name-alwIntegration-informational?style=flat&logoColor=white&color=2c73d2) + The goal of this library is to enable async communication with the ALW System dispatched by an EventBus of your environment. @@ -94,14 +96,3 @@ digiwf.alw.personeninfo: of [SachbearbeitungMapperConfig](https://github.com/it-at-m/digiwf-core/blob/dev/digiwf-integrations/digiwf-alw-integration/digiwf-alw-integration-core/src/main/java/io/muenchendigital/digiwf/alw/integration/configuration/SachbearbeitungMapperConfig.java) ) to support mapping of the ALW System responses to directory-ous. -For an example, please refer to -the [example project](https://github.com/it-at-m/digiwf-core/tree/dev/digiwf-integrations/digiwf-alw-integration/digiwf-alw-integration-example). -There you can: - -* Configure the example application (see above) -* Start the example application -* Make a http request to the configured test endpoints - from [ExampleController](https://github.com/it-at-m/digiwf-core/blob/dev/digiwf-integrations/digiwf-alw-integration/digiwf-alw-integration-example/src/main/java/io/muenchendigital/digiwf/alw/integration/api/controller/ExampleController.java) - on http://localhost:10006/testGetAlwZustaendigkeitEventBus -* Observe the output in the console - diff --git a/docs/src/integrations/digiwf-cosys-integration.md b/docs/src/integrations/digiwf-cosys-integration.md index 9eac8f879b..7fa4e76b57 100644 --- a/docs/src/integrations/digiwf-cosys-integration.md +++ b/docs/src/integrations/digiwf-cosys-integration.md @@ -1,5 +1,7 @@ # DigiWF Cosys Integration +![](https://img.shields.io/badge/Integration_Name-cosysIntegration-informational?style=flat&logoColor=white&color=2c73d2) + Die Cosys Integration ermöglicht eine asynchrone Erstellung von Dokumenten in [Cosys](https://www.cib.de/cosys/) mit anschließender Speicherung in einem S3 Speicher. Mit dieser Integration können Dokumente erstellt und in einem S3-kompatiblen Speicher abgelegt werden. Diese Dokumente können im Anschluss beispielweise in einer E-Mail versendet werden. @@ -38,13 +40,10 @@ Die Aktion `POST` wird für die Erstellung neuer Dateien im S3 Speicher verwende **Verwendung in BPMN Prozessen** -Verwenden Sie eines unsere Element-Templates in einer Call Activity um die Prozessentwicklung zu beschleunigen und befüllen Sie es mit den gewünschten Informationen: - -* [Cosys all data](https://github.com/it-at-m/digiwf-core/blob/dev/docs/src/.vuepress/public/element-template/cosys-alle-daten.json) -* [Cosys create document](https://github.com/it-at-m/digiwf-core/blob/dev/docs/src/.vuepress/public/element-template/cosys-dokument-erstellen.json) -* [Cosys create document (V02)](https://github.com/it-at-m/digiwf-core/blob/dev/docs/src/.vuepress/public/element-template/cosys_generate_document_template_V02.json) +Verwenden Sie eines unsere Element-Templates in einer Call Activity um die Prozessentwicklung zu beschleunigen und befüllen Sie es mit den gewünschten Informationen. +Eine Liste der Element-Templates finden Sie unter [Element Templates](/modeling/templates/element-templates/). -Zur Erstellung von presigned URLs können Sie das Element-Template [s3_create_presigned_url](https://github.com/it-at-m/digiwf-core/blob/dev/docs/src/.vuepress/public/element-template/s3_create_presigned_url_template.json) in einer Call Activity verwenden und das Ergebnis an die Cosys Integration übergeben. +Zur Erstellung von presigned URLs können Sie das Element-Template s3_create_presigned_url (siehe [Element Template](/modeling/templates/element-templates/)) in einer Call Activity verwenden und das Ergebnis an die Cosys Integration übergeben. In der folgenden Grafik wird ein Beispiel für einen BPMN Prozess dargestellt. Wie oben beschrieben, wird zuerst eine presigned URL erstellt bevor ein Dokument erstellt wird. diff --git a/docs/src/integrations/digiwf-dms-integration.md b/docs/src/integrations/digiwf-dms-integration.md index fa4509aab7..b9c08bd223 100644 --- a/docs/src/integrations/digiwf-dms-integration.md +++ b/docs/src/integrations/digiwf-dms-integration.md @@ -1,5 +1,7 @@ # DigiWF Dms Integration +![](https://img.shields.io/badge/Integration_Name-dmsIntegration-informational?style=flat&logoColor=white&color=2c73d2) + Die DMS Integration ermöglicht eine asynchrone Ablage von Dokumenten aus einem S3 Speicher in einem Dms System. Zudem können Dms Strukturen angelegt und verwaltete werden, darunter: @@ -38,8 +40,8 @@ Dafür muss vorab die ID des Aktenplans gesucht und über das Feld `apentryCOO` **Verwendung in BPMN Prozessen** Verwenden Sie eines das Element-Template in einer Call Activity, um die Prozessentwicklung zu beschleunigen und -befüllen Sie es mit den gewünschten Informationen: -[Sachakte anlegen](https://github.com/it-at-m/digiwf-core/blob/dev/docs/src/.vuepress/public/element-template/createFile.json) +befüllen Sie es mit den gewünschten Informationen. +Eine Liste der Element-Templates finden Sie unter [Element Templates](/modeling/templates/element-templates/). ### Vorgang anlegen @@ -66,8 +68,8 @@ Dafür muss vorab eine Akte angelegt und die Id über das Feld `fileCOO` überge **Verwendung in BPMN Prozessen** Verwenden Sie eines das Element-Template in einer Call Activity, um die Prozessentwicklung zu beschleunigen und -befüllen Sie es mit den gewünschten Informationen: -[Vorgang anlegenn](https://github.com/it-at-m/digiwf-core/blob/dev/docs/src/.vuepress/public/element-template/createProcedure.json) +befüllen Sie es mit den gewünschten Informationen. +Eine Liste der Element-Templates finden Sie unter [Element Templates](/modeling/templates/element-templates/). ### Dokument erstellen @@ -99,8 +101,8 @@ Bei `filepaths` können mehrere Pfade zu Dateien oder Ordnern mit einem Komma ge **Verwendung in BPMN Prozessen** Verwenden Sie eines das Element-Template in einer Call Activity, um die Prozessentwicklung zu beschleunigen und -befüllen Sie es mit den gewünschten Informationen: -[Dokument erstellen](https://github.com/it-at-m/digiwf-core/blob/dev/docs/src/.vuepress/public/element-template/createDocument.json) +befüllen Sie es mit den gewünschten Informationen. +Eine Liste der Element-Templates finden Sie unter [Element Templates](/modeling/templates/element-templates/). ### Dokument updaten @@ -131,8 +133,8 @@ Bei `filepaths` können mehrere Pfade zu Dateien oder Ordnern mit einem Komma ge **Verwendung in BPMN Prozessen** Verwenden Sie eines das Element-Template in einer Call Activity, um die Prozessentwicklung zu beschleunigen und -befüllen Sie es mit den gewünschten Informationen: -[Dokument updaten](https://github.com/it-at-m/digiwf-core/blob/dev/docs/src/.vuepress/public/element-template/updateDocument.json) +befüllen Sie es mit den gewünschten Informationen. +Eine Liste der Element-Templates finden Sie unter [Element Templates](/modeling/templates/element-templates/). ### Zu den Akten legen @@ -158,8 +160,8 @@ Dafür muss vorab ein Object angelegt und die Id über das Feld `objectCoo` übe **Verwendung in BPMN Prozessen** Verwenden Sie eines das Element-Template in einer Call Activity, um die Prozessentwicklung zu beschleunigen und -befüllen Sie es mit den gewünschten Informationen: -[Zu den Akten legen](https://github.com/it-at-m/digiwf-core/blob/dev/docs/src/.vuepress/public/element-template/depositObject.json) +befüllen Sie es mit den gewünschten Informationen. +Eine Liste der Element-Templates finden Sie unter [Element Templates](/modeling/templates/element-templates/). ### Objekt stornieren @@ -185,8 +187,8 @@ Dafür muss vorab ein Object angelegt und die Id über das Feld `objectCoo` übe **Verwendung in BPMN Prozessen** Verwenden Sie eines das Element-Template in einer Call Activity, um die Prozessentwicklung zu beschleunigen und -befüllen Sie es mit den gewünschten Informationen: -[Objekt stornieren](https://github.com/it-at-m/digiwf-core/blob/dev/docs/src/.vuepress/public/element-template/cancelObject.json) +befüllen Sie es mit den gewünschten Informationen. +Eine Liste der Element-Templates finden Sie unter [Element Templates](/modeling/templates/element-templates/). ### Dateien lesen und in den S3 Speicher übertragen @@ -217,8 +219,8 @@ Die Dms Integration liest die Inhalte mit den angegebenen `contentCoos` und übe **Verwendung in BPMN Prozessen** Verwenden Sie eines das Element-Template in einer Call Activity, um die Prozessentwicklung zu beschleunigen und -befüllen Sie es mit den gewünschten Informationen: -[Read Content](https://github.com/it-at-m/digiwf-core/blob/dev/docs/src/.vuepress/public/element-template/readContent.json) +befüllen Sie es mit den gewünschten Informationen. +Eine Liste der Element-Templates finden Sie unter [Element Templates](/modeling/templates/element-templates/). ### Sachakte suchen @@ -257,8 +259,8 @@ Ist keine vorhanden, wird ein `OBJECT_NOT_FOUND` BPMN Error geworfen. **Verwendung in BPMN Prozessen** Verwenden Sie eines das Element-Template in einer Call Activity, um die Prozessentwicklung zu beschleunigen und -befüllen Sie es mit den gewünschten Informationen: -[Search File](https://github.com/it-at-m/digiwf-core/blob/dev/docs/src/.vuepress/public/element-template/searchFile.json) +befüllen Sie es mit den gewünschten Informationen. +Eine Liste der Element-Templates finden Sie unter [Element Templates](/modeling/templates/element-templates/). ### Aktenplaneintrag suchen @@ -284,8 +286,8 @@ wird. Ist keine vorhanden, wird ein `OBJECT_NOT_FOUND` BPMN Error geworfen. **Verwendung in BPMN Prozessen** Verwenden Sie eines das Element-Template in einer Call Activity, um die Prozessentwicklung zu beschleunigen und -befüllen Sie es mit den gewünschten Informationen: -[Search Subject Area](https://github.com/it-at-m/digiwf-core/blob/dev/docs/src/.vuepress/public/element-template/searchSubjectArea.json) +befüllen Sie es mit den gewünschten Informationen. +Eine Liste der Element-Templates finden Sie unter [Element Templates](/modeling/templates/element-templates/). ### Fehlerbehandlung diff --git a/docs/src/integrations/digiwf-formserver-integration.md b/docs/src/integrations/digiwf-formserver-integration.md index 458cec9764..6312ca0881 100644 --- a/docs/src/integrations/digiwf-formserver-integration.md +++ b/docs/src/integrations/digiwf-formserver-integration.md @@ -1,5 +1,7 @@ # DigiWF Formserver Integration +![](https://img.shields.io/badge/Integration_Name-formserverIntegration-informational?style=flat&logoColor=white&color=2c73d2) + Die DigiWF Formserver Integration ist eine Integration, die es Benutzern ermöglicht Prozesse in DigiWF über den Formserver zu starten. Hierbei werden die Formulardaten an den zu startenden Prozess weitergegeben. diff --git a/docs/src/integrations/digiwf-mail-integration.md b/docs/src/integrations/digiwf-mail-integration.md index 399b136b3c..8679a09de2 100644 --- a/docs/src/integrations/digiwf-mail-integration.md +++ b/docs/src/integrations/digiwf-mail-integration.md @@ -1,5 +1,7 @@ # DigiWF Mail Integration +![](https://img.shields.io/badge/Integration_Name-emailIntegration-informational?style=flat&logoColor=white&color=2c73d2) + Die DigiWF Email Integration ist eine Integration, die es Benutzern ermöglicht, Emails über die DigiWF-Plattform zu senden. Mit dieser Integration können Prozessentwickler Email-Kommunikation in ihre BPMN Prozesse integrieren. diff --git a/docs/src/integrations/digiwf-ok.ewo-integration.md b/docs/src/integrations/digiwf-ok.ewo-integration.md index cfd00af6ad..ca1d44f018 100644 --- a/docs/src/integrations/digiwf-ok.ewo-integration.md +++ b/docs/src/integrations/digiwf-ok.ewo-integration.md @@ -1,5 +1,7 @@ # DigiWF OK.EWO Integration +![](https://img.shields.io/badge/Integration_Name-okewoIntegration-informational?style=flat&logoColor=white&color=2c73d2) + ## Documentation Basically, two artifacts are available. diff --git a/docs/src/integrations/digiwf-s3-integration.md b/docs/src/integrations/digiwf-s3-integration.md index 368650f7dc..a0893f4ec4 100644 --- a/docs/src/integrations/digiwf-s3-integration.md +++ b/docs/src/integrations/digiwf-s3-integration.md @@ -1,5 +1,7 @@ # DigiWF S3 Integration +![](https://img.shields.io/badge/Integration_Name-s3Integration-informational?style=flat&logoColor=white&color=2c73d2) + Die DigiWF S3 Integration ermöglicht Dateianhänge in Prozessen zu verwenden. Mit dieser Integration können Prozessentwickler Formulare entwickeln, in den Dateien hoch- und herunterladen werden können. Auch weitere Services können Dateien erzeugen und diese integriert über einen Prozess in einer Dateiablage ablegen, sodass andere Services diese wieder verwenden können. diff --git a/docs/src/integrations/guides/custom-integration-service.md b/docs/src/integrations/guides/custom-integration-service.md index 67cfbba6aa..d37cc08744 100644 --- a/docs/src/integrations/guides/custom-integration-service.md +++ b/docs/src/integrations/guides/custom-integration-service.md @@ -101,12 +101,13 @@ public class MessageProcessor { public Consumer> exampleIntegration() { return message -> { final String processInstanceId = message.getHeaders().get(MessageConstants.DIGIWF_PROCESS_INSTANCE_ID).toString(); - final String messageName = message.getHeaders().get(MessageConstants.DIGIWF_MESSAGE_NAME).toString(); + final String type = message.getHeaders().get(MessageConstants.TYPE).toString(); + final String integrationName = message.getHeaders().get(MessageConstants.DIGIWF_INTEGRATION_NAME).toString(); // do something with message // correlate message - processApi.correlateMessage(processInstanceId, messageName, new HashMap()); + processApi.correlateMessage(processInstanceId, type, integrationName, new HashMap()); }; } } @@ -137,12 +138,13 @@ public class MessageProcessor { return message -> { try { final String processInstanceId = message.getHeaders().get(MessageConstants.DIGIWF_PROCESS_INSTANCE_ID).toString(); - final String messageName = message.getHeaders().get(MessageConstants.DIGIWF_MESSAGE_NAME).toString(); + final String type = message.getHeaders().get(MessageConstants.TYPE).toString(); + final String integrationName = message.getHeaders().get(MessageConstants.DIGIWF_INTEGRATION_NAME).toString(); // do something with message // correlate message - this.processApi.correlateMessage(processInstanceId, messageName, new HashMap()); + this.processApi.correlateMessage(processInstanceId, type, integrationName, new HashMap()); } catch (final BpmnError bpmnError) { // handle bpmn errors this.errorApi.handleBpmnError(message.getHeaders(), bpmnError); diff --git a/docs/src/modeling/templates/element-templates/index.md b/docs/src/modeling/templates/element-templates/index.md index 528a6e2dee..5a5e8002d4 100644 --- a/docs/src/modeling/templates/element-templates/index.md +++ b/docs/src/modeling/templates/element-templates/index.md @@ -7,12 +7,6 @@ - - ## S3 Integration @@ -26,57 +20,70 @@ artifact="sendMailV02.json" type="element-template" /> -**Verwenden Streaming Template V01** +## Address-Service Integration + -## OK.EWO Integration + + artifact="address-integration/listStreet.json" + type="element-template" /> -## Address-Service Integration + +## Dms Integration + + + -## DMS Integration + + artifact="dms-integration/searchFile.json" + type="element-template" /> + artifact="dms-integration/searchSubjectArea.json" + type="element-template" /> diff --git a/pom.xml b/pom.xml index 5485c46786..f2dc4fe110 100644 --- a/pom.xml +++ b/pom.xml @@ -17,6 +17,8 @@ 1.18.30 0.2.0 1.5.5.Final + 17 + 17