Skip to content

Commit

Permalink
Merge branch 'dev' into feature/#768-upgrade-spring-boot-in-integrati…
Browse files Browse the repository at this point in the history
…ons_email_integration
  • Loading branch information
lehju committed Nov 13, 2023
2 parents 2b27dcd + 004c67a commit a9a1f0f
Show file tree
Hide file tree
Showing 76 changed files with 1,296 additions and 364 deletions.
6 changes: 3 additions & 3 deletions digiwf-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,15 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.1</version>
<version>3.2.2</version>
<configuration>
<runOrder>random</runOrder>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.2.1</version>
<version>3.2.2</version>
<executions>
<execution>
<id>run-itests</id>
Expand Down Expand Up @@ -275,7 +275,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.0</version>
<version>3.6.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_0sduois" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.11.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.17.0">
<bpmn:collaboration id="Collaboration_0iserd2">
<bpmn:participant id="Participant_141ljpi" name="Create File process" processRef="create-file-integration-example" />
</bpmn:collaboration>
<bpmn:process id="create-file-integration-example" name="Example Create File Integration" isExecutable="true">
<bpmn:documentation />
<bpmn:extensionElements />
<bpmn:startEvent id="StartEvent_1" name="Started" camunda:formKey="dms-integration-create-file_start">
<bpmn:outgoing>Flow_16a04uf</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:subProcess id="Activity_000hd7z" triggeredByEvent="true">
<bpmn:startEvent id="Event_1v0winq" name="1 hour passed">
<bpmn:outgoing>Flow_1tpc9wl</bpmn:outgoing>
<bpmn:timerEventDefinition id="TimerEventDefinition_1hzdam7">
<bpmn:timeDuration xsi:type="bpmn:tFormalExpression">PT1H</bpmn:timeDuration>
</bpmn:timerEventDefinition>
</bpmn:startEvent>
<bpmn:endEvent id="End_terminated" name="Terminated">
<bpmn:incoming>Flow_1tpc9wl</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_1tpc9wl" sourceRef="Event_1v0winq" targetRef="End_terminated" />
</bpmn:subProcess>
<bpmn:sequenceFlow id="Flow_16a04uf" sourceRef="StartEvent_1" targetRef="create-file" />
<bpmn:sequenceFlow id="Flow_021rbp5" sourceRef="create-file" targetRef="Event_completed" />
<bpmn:endEvent id="Event_completed" name="Ended">
<bpmn:incoming>Flow_021rbp5</bpmn:incoming>
</bpmn:endEvent>
<bpmn:callActivity id="create-file" name="Create File" camunda:modelerTemplate="de.muenchen.digitalwf.templates.create-file" calledElement="StreamingTemplateV02">
<bpmn:extensionElements>
<camunda:in sourceExpression="genericEvent" target="app_message_name" />
<camunda:in sourceExpression="createFile" target="app_type_name" />
<camunda:in sourceExpression="${title}" target="title" />
<camunda:in sourceExpression="${user}" target="user" />
<camunda:in sourceExpression="${apentryCOO}" target="apentryCOO" />
<camunda:in sourceExpression="${topic}" target="app_topic_name" />
<camunda:in sourceExpression="fileCOO" target="fileCoo" />
</bpmn:extensionElements>
<bpmn:incoming>Flow_16a04uf</bpmn:incoming>
<bpmn:outgoing>Flow_021rbp5</bpmn:outgoing>
</bpmn:callActivity>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_0iserd2">
<bpmndi:BPMNShape id="Participant_141ljpi_di" bpmnElement="Participant_141ljpi" isHorizontal="true">
<dc:Bounds x="160" y="40" width="440" height="270" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="252" y="82" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="252" y="125" width="36" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_000hd7z_di" bpmnElement="Activity_000hd7z" isExpanded="true">
<dc:Bounds x="210" y="160" width="335" height="130" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_1v0winq_di" bpmnElement="Event_1v0winq">
<dc:Bounds x="262" y="192" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="246" y="235" width="70" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0dekx0j_di" bpmnElement="End_terminated">
<dc:Bounds x="462" y="192" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="453" y="235" width="55" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_1tpc9wl_di" bpmnElement="Flow_1tpc9wl">
<di:waypoint x="298" y="210" />
<di:waypoint x="462" y="210" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="Event_15xklzj_di" bpmnElement="Event_completed">
<dc:Bounds x="509" y="79" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="511" y="122" width="32" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_169lyjt_di" bpmnElement="create-file">
<dc:Bounds x="350" y="60" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_16a04uf_di" bpmnElement="Flow_16a04uf">
<di:waypoint x="288" y="100" />
<di:waypoint x="350" y="100" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_021rbp5_di" bpmnElement="Flow_021rbp5">
<di:waypoint x="450" y="97" />
<di:waypoint x="509" y="97" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"key": "dms-integration-create-file_start",
"schema": {
"type": "object",
"x-display": "stepper",
"allOf": [
{
"title": "Abschnitt",
"description": "",
"type": "object",
"x-options": {
"sectionsTitlesClasses": [
"d-none"
]
},
"allOf": [
{
"containerType": "group",
"title": "Group",
"description": "",
"x-options": {
"childrenClass": "pl-0"
},
"properties": {
"FormField_StartInfo": {
"fieldType": "markdown",
"title": "Info",
"type": "string",
"x-display": "markdown",
"key": "FormField_StartInfo",
"readOnly": true,
"default": "With this test process create a file with the information from the form below.",
"x-options": {
"fieldColProps": {
"cols": 12,
"sm": 12,
"messages": {}
}
},
"x-props": {
"outlined": true,
"dense": true
},
"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",
"type": "string",
"key": "title",
"x-options": {
"fieldColProps": {
"cols": 12,
"sm": 12,
"messages": {}
}
},
"x-props": {
"outlined": true,
"dense": true
},
"x-rules": []
},
"apentryCOO": {
"fieldType": "text",
"title": "Aktenplan (COO)",
"type": "string",
"key": "apentryCOO",
"x-options": {
"fieldColProps": {
"cols": 12,
"sm": 12,
"messages": {}
}
},
"x-props": {
"outlined": true,
"dense": true
},
"x-rules": []
},
"user": {
"fieldType": "text",
"title": "Dms User",
"type": "string",
"key": "user",
"x-options": {
"fieldColProps": {
"cols": 12,
"sm": 12,
"messages": {}
}
},
"x-props": {
"outlined": true,
"dense": true
},
"x-rules": []
}
},
"key": "f9d53bb5-e08a-454b-bcdf-9b654f3331e5"
}
],
"key": "74924cdc-184a-4319-9f62-cf7f256f9282"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package de.muenchen.oss.digiwf.dms.integration.adapter.in;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@AllArgsConstructor
@NoArgsConstructor
@Setter
@Getter
public class CreateFileDto {

private String apentryCOO;

private String title;

private String user;

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,30 @@ public class MessageProcessor {

private final ProcessApi processApi;
private final ErrorApi errorApi;
private final CreateFileUseCase createFileUseCase;
private final CreateProcedureUseCase createProcedureUseCase;
private final CreateDocumentUseCase createDocumentUseCase;
private final UpdateDocumentUseCase updateDocumentUseCase;
private final DepositObjectUseCase depositObjectUseCase;
private final CancelObjectUseCase cancelObjectUseCase;
private final ReadContentUseCase readContentUseCase;

public Consumer<Message<CreateFileDto>> createFile() {
return message -> {
withErrorHandling(message, () -> {
final CreateFileDto createFileDto = message.getPayload();
final String file = this.createFileUseCase.createFile(
createFileDto.getTitle(),
createFileDto.getApentryCOO(),
createFileDto.getUser()
);

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));
});
};
}

public Consumer<Message<CreateProcedureDto>> createProcedure() {
return message -> {
withErrorHandling(message, () -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

import com.fabasoft.schemas.websvc.lhmbai_15_1700_giwsd.*;
import de.muenchen.oss.digiwf.dms.integration.application.port.out.*;
import de.muenchen.oss.digiwf.dms.integration.domain.Content;
import de.muenchen.oss.digiwf.dms.integration.domain.Document;
import de.muenchen.oss.digiwf.dms.integration.domain.DocumentType;
import de.muenchen.oss.digiwf.dms.integration.domain.Procedure;
import de.muenchen.oss.digiwf.dms.integration.domain.*;
import de.muenchen.oss.digiwf.message.process.api.error.IncidentError;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand All @@ -17,6 +14,7 @@
@Slf4j
@RequiredArgsConstructor
public class FabasoftAdapter implements
CreateFilePort,
CreateProcedurePort,
CreateDocumentPort,
UpdateDocumentPort,
Expand All @@ -29,6 +27,32 @@ public class FabasoftAdapter implements

private final DMSErrorHandler dmsErrorHandler = new DMSErrorHandler();

@Override
public String createFile(File file, String user) {
//logging for dms team
log.info("calling CreateFileGI"
+ " Userlogin: " + user
+ " Apentry: " + file.getApentryCOO()
+ " Filesubj: " + file.getTitle()
+ " Shortname: " + file.getTitle()
+ " Apentrysearch: true"
);

final CreateFileGI request = new CreateFileGI();
request.setUserlogin(user);
request.setBusinessapp(this.properties.getBusinessapp());
request.setApentry(file.getApentryCOO());
request.setFilesubj(file.getTitle());
request.setShortname(file.getTitle());
request.setApentrysearch(true); // looks for free parent entry

final CreateFileGIResponse response = this.wsClient.createFileGI(request);

dmsErrorHandler.handleError(response.getStatus(), response.getErrormessage());

return response.getObjid();
}

@Override
public Procedure createProcedure(Procedure procedure, String user) {
log.info("calling CreateProcedureGI: " + procedure.toString());
Expand All @@ -43,10 +67,7 @@ public Procedure createProcedure(Procedure procedure, String user) {

final CreateProcedureGIResponse response = this.wsClient.createProcedureGI(request);

final DMSStatusCode statusCode = DMSStatusCode.byCode(response.getStatus());
if (statusCode != DMSStatusCode.UEBERTRAGUNG_ERFORLGREICH) {
throw new IncidentError(response.getErrormessage());
}
dmsErrorHandler.handleError(response.getStatus(), response.getErrormessage());

return new Procedure(response.getObjid(), procedure.getFileCOO(), procedure.getTitle());
}
Expand Down Expand Up @@ -122,8 +143,6 @@ private String createOutgoingDocument(final Document document, final String user
}

request.setGiattachmenttype(attachmentType);
//request.setSubfiletype("Dokumenttyp für Ausgangsdokumente");
//request.setSubfiletype("BeZweck-Ausgang");

final CreateOutgoingGIResponse response = this.wsClient.createOutgoingGI(request);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package de.muenchen.oss.digiwf.dms.integration.application.port.in;

import javax.validation.constraints.NotBlank;

public interface CreateFileUseCase {

String createFile(@NotBlank final String titel, @NotBlank final String apentryCOO, @NotBlank final String user);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package de.muenchen.oss.digiwf.dms.integration.application.port.out;

import de.muenchen.oss.digiwf.dms.integration.domain.File;

public interface CreateFilePort {

String createFile(File file, String user);

}
Loading

0 comments on commit a9a1f0f

Please sign in to comment.