Skip to content

Commit

Permalink
feature(#1023): clean up after spring boot 3 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoesle authored and Lukas Mösle committed Nov 30, 2023
1 parent 44270f8 commit 332a474
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import de.muenchen.oss.digiwf.email.api.DigiwfEmailApi;
import de.muenchen.oss.digiwf.email.model.Mail;
import jakarta.mail.MessagingException;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.apache.logging.log4j.util.Strings;
Expand Down Expand Up @@ -92,8 +93,7 @@ public Incident handleIncident(final IncidentContext context, final String messa
.replyTo(this.fromAddress)
.build();
this.digiwfEmailApi.sendMailWithDefaultLogo(mail);
} catch (final Exception error) {
// TODO fixme after Spring Boot 3 migration - use MessagingException
} catch (final MessagingException error) {
log.error("Die Mail für den Incident konnte nicht gesendet werden.", error);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import de.muenchen.oss.digiwf.shared.properties.DigitalWFProperties;
import de.muenchen.oss.digiwf.task.TaskVariables;
import io.holunda.camunda.bpm.data.factory.VariableFactory;
import jakarta.mail.MessagingException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
Expand Down Expand Up @@ -125,8 +126,7 @@ private void notifyAssignee(final DelegateTask delegateTask) throws Exception {
.body(emailBody)
.build();
this.digiwfEmailApi.sendMailWithDefaultLogo(mail);
} catch (final Exception ex) {
// TODO fixme after Spring Boot 3 migration - use MessagingException
} catch (final MessagingException ex) {
log.warn("Notification failed: {}", ex.getMessage());
throw ex;
}
Expand Down Expand Up @@ -225,8 +225,7 @@ private void sendGroupMail(final List<String> addresses, final DelegateTask dele
.body(emailBody)
.build();
this.digiwfEmailApi.sendMailWithDefaultLogo(mail);
} catch (final Exception ex) {
// TODO fixme after Spring Boot 3 migration - use MessagingException
} catch (final MessagingException ex) {
log.warn("Notification failed: {}", ex.getMessage());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import de.muenchen.oss.digiwf.email.model.FileAttachment;
import de.muenchen.oss.digiwf.email.model.Mail;
import de.muenchen.oss.digiwf.legacy.document.domain.DocumentService;
import jakarta.mail.util.ByteArrayDataSource;
import lombok.RequiredArgsConstructor;
import lombok.val;
import org.camunda.bpm.engine.delegate.DelegateExecution;
Expand Down Expand Up @@ -43,8 +44,7 @@ public void execute(final DelegateExecution delegateExecution) throws Exception
final List<FileAttachment> fileAttachments = new ArrayList<>();
if (attachmentGuid.isPresent()) {
val document = this.documentService.createDocument(attachmentGuid.get(), delegateExecution.getProcessInstance().getVariables());
// TODO fixme after Spring Boot 3 migration
// fileAttachments.add(new FileAttachment(attachmentName.orElse("anhang.pdf"), new ByteArrayDataSource(document, "application/pdf")));
fileAttachments.add(new FileAttachment(attachmentName.orElse("anhang.pdf"), new ByteArrayDataSource(document, "application/pdf")));
}

final Mail mail = Mail.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import de.muenchen.oss.digiwf.email.model.FileAttachment;
import de.muenchen.oss.digiwf.email.model.Mail;
import de.muenchen.oss.digiwf.legacy.document.domain.DocumentService;
import jakarta.mail.util.ByteArrayDataSource;
import lombok.val;
import org.apache.commons.lang3.StringUtils;
import org.camunda.bpm.engine.delegate.DelegateExecution;
Expand Down Expand Up @@ -57,8 +58,7 @@ public void execute(final DelegateExecution delegateExecution) throws Exception
final List<FileAttachment> fileAttachments = new ArrayList<>();
if (attachmentGuid.isPresent()) {
val document = this.documentService.createDocument(attachmentGuid.get(), delegateExecution.getProcessInstance().getVariables());
// TODO fixme after Spring Boot 3 migration
// fileAttachments.add(new FileAttachment(attachmentName.orElse("anhang.pdf"), new ByteArrayDataSource(document, "application/pdf")));
fileAttachments.add(new FileAttachment(attachmentName.orElse("anhang.pdf"), new ByteArrayDataSource(document, "application/pdf")));
}

final Mail mail = Mail.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import de.muenchen.oss.digiwf.email.model.FileAttachment;
import de.muenchen.oss.digiwf.email.model.Mail;
import de.muenchen.oss.digiwf.legacy.document.domain.DocumentService;
import jakarta.mail.util.ByteArrayDataSource;
import lombok.val;
import org.apache.commons.lang3.StringUtils;
import org.camunda.bpm.engine.delegate.DelegateExecution;
Expand Down Expand Up @@ -59,8 +60,7 @@ public void execute(final DelegateExecution delegateExecution) throws Exception
final List<FileAttachment> fileAttachments = new ArrayList<>();
if (attachmentGuid.isPresent()) {
val document = this.documentService.createDocument(attachmentGuid.get(), delegateExecution.getProcessInstance().getVariables());
// TODO fixme after Spring Boot 3 migration
// fileAttachments.add(new FileAttachment(attachmentName.orElse("anhang.pdf"), new ByteArrayDataSource(document, "application/pdf")));
fileAttachments.add(new FileAttachment(attachmentName.orElse("anhang.pdf"), new ByteArrayDataSource(document, "application/pdf")));
}

final Mail mail = Mail.builder()
Expand Down

0 comments on commit 332a474

Please sign in to comment.