From 0b65b578fc6c5a5c62a8daa0997bb5c89ae08216 Mon Sep 17 00:00:00 2001 From: martind260 <99957516+martind260@users.noreply.github.com> Date: Thu, 1 Sep 2022 12:25:18 +0200 Subject: [PATCH] fileContext added to dto (#10) * fileContext added to dto * second method * first method shortened --- .../process/service/StartProcessService.java | 15 ++++++++++++++- .../digiwf/process/api/StartProcess.java | 5 +++++ .../digiwf/process/api/StartProcessEvent.java | 5 +++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/digiwf-libs/digiwf-spring-cloudstream-utils/digiwf-spring-cloudstream-utils-core/src/main/java/io/muenchendigital/digiwf/spring/cloudstream/utils/api/streaming/process/service/StartProcessService.java b/digiwf-libs/digiwf-spring-cloudstream-utils/digiwf-spring-cloudstream-utils-core/src/main/java/io/muenchendigital/digiwf/spring/cloudstream/utils/api/streaming/process/service/StartProcessService.java index a833649fea..6c38f15293 100644 --- a/digiwf-libs/digiwf-spring-cloudstream-utils/digiwf-spring-cloudstream-utils-core/src/main/java/io/muenchendigital/digiwf/spring/cloudstream/utils/api/streaming/process/service/StartProcessService.java +++ b/digiwf-libs/digiwf-spring-cloudstream-utils/digiwf-spring-cloudstream-utils-core/src/main/java/io/muenchendigital/digiwf/spring/cloudstream/utils/api/streaming/process/service/StartProcessService.java @@ -29,11 +29,24 @@ public class StartProcessService { * * @param processKey key of the process * @param payload Data to start the process - * @return + * @return the emit result */ public boolean startProcess(final String processKey, final Map payload) { + return startProcess(processKey, null, payload); + } + + /** + * Starts a process with the given payload and file context. + * + * @param processKey key of the process + * @param fileContext file context for document storage + * @param payload Data to start the process + * @return the emit result + */ + public boolean startProcess(final String processKey, final String fileContext, final Map payload) { final StartProcessEvent startProcessEvent = StartProcessEvent.builder() .key(processKey) + .fileContext(fileContext) .data(payload) .build(); diff --git a/digiwf-process/digiwf-process-api/src/main/java/io/muenchendigital/digiwf/process/api/StartProcess.java b/digiwf-process/digiwf-process-api/src/main/java/io/muenchendigital/digiwf/process/api/StartProcess.java index 7fedda6916..c4bdd4864d 100644 --- a/digiwf-process/digiwf-process-api/src/main/java/io/muenchendigital/digiwf/process/api/StartProcess.java +++ b/digiwf-process/digiwf-process-api/src/main/java/io/muenchendigital/digiwf/process/api/StartProcess.java @@ -14,6 +14,11 @@ public interface StartProcess { */ String getKey(); + /** + * Return the file context for document storage. + */ + String getFileContext(); + /** * Returns the data that is passed to the created process instance * diff --git a/digiwf-process/digiwf-process-api/src/main/java/io/muenchendigital/digiwf/process/api/StartProcessEvent.java b/digiwf-process/digiwf-process-api/src/main/java/io/muenchendigital/digiwf/process/api/StartProcessEvent.java index 4e068ab3e7..1992ec0472 100644 --- a/digiwf-process/digiwf-process-api/src/main/java/io/muenchendigital/digiwf/process/api/StartProcessEvent.java +++ b/digiwf-process/digiwf-process-api/src/main/java/io/muenchendigital/digiwf/process/api/StartProcessEvent.java @@ -21,6 +21,11 @@ public class StartProcessEvent implements StartProcess { @NotBlank private String key; + /** + * File context for document storage + */ + private String fileContext; + /** * Data that is set */