diff --git a/.gitignore b/.gitignore
index c90a78c3f..686ced3ca 100755
--- a/.gitignore
+++ b/.gitignore
@@ -12,7 +12,11 @@
###
# dsf-bpe ignores
###
+dsf-bpe/dsf-bpe-server-jetty/api/v1/*.jar
+dsf-bpe/dsf-bpe-server-jetty/api/v2/*.jar
dsf-bpe/dsf-bpe-server-jetty/conf/config.properties
+dsf-bpe/dsf-bpe-server-jetty/docker/api/v1/*.jar
+dsf-bpe/dsf-bpe-server-jetty/docker/api/v2/*.jar
dsf-bpe/dsf-bpe-server-jetty/docker/dsf_bpe.jar
dsf-bpe/dsf-bpe-server-jetty/docker/dsf_status_client.jar
dsf-bpe/dsf-bpe-server-jetty/docker/lib/*.jar
diff --git a/dsf-bpe/dsf-bpe-process-api-v1-impl/pom.xml b/dsf-bpe/dsf-bpe-process-api-v1-impl/pom.xml
new file mode 100644
index 000000000..d27cfd40c
--- /dev/null
+++ b/dsf-bpe/dsf-bpe-process-api-v1-impl/pom.xml
@@ -0,0 +1,66 @@
+
+ 4.0.0
+
+ dsf-bpe-process-api-v1-impl
+
+
+ dev.dsf
+ dsf-bpe-pom
+ 2.0.0-SNAPSHOT
+
+
+
+
+ dev.dsf
+ dsf-bpe-process-api
+
+
+ dev.dsf
+ dsf-bpe-process-api-v1
+
+
+
+ org.glassfish.jersey.core
+ jersey-client
+
+
+ org.glassfish.jersey.inject
+ jersey-hk2
+
+
+ org.glassfish.jersey.media
+ jersey-media-jaxb
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+
+
+ org.glassfish.jersey.connectors
+ jersey-apache-connector
+
+
+ commons-logging
+ commons-logging
+
+
+
+
+
+ ca.uhn.hapi.fhir
+ hapi-fhir-structures-r4
+ ${hapi.fhir.version.v1}
+
+
+
+ org.apache.logging.log4j
+ log4j-slf4j2-impl
+ test
+
+
+ org.mockito
+ mockito-core
+ test
+
+
+
\ No newline at end of file
diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/dev/dsf/bpe/v1/ProcessPluginApiImpl.java b/dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/ProcessPluginApiImpl.java
similarity index 98%
rename from dsf-bpe/dsf-bpe-server/src/main/java/dev/dsf/bpe/v1/ProcessPluginApiImpl.java
rename to dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/ProcessPluginApiImpl.java
index 0f4c5c3e3..8ad20b9e2 100644
--- a/dsf-bpe/dsf-bpe-server/src/main/java/dev/dsf/bpe/v1/ProcessPluginApiImpl.java
+++ b/dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/ProcessPluginApiImpl.java
@@ -16,7 +16,7 @@
import dev.dsf.bpe.v1.service.QuestionnaireResponseHelper;
import dev.dsf.bpe.v1.service.TaskHelper;
import dev.dsf.bpe.v1.variables.Variables;
-import dev.dsf.bpe.variables.VariablesImpl;
+import dev.dsf.bpe.v1.variables.VariablesImpl;
import dev.dsf.fhir.authorization.process.ProcessAuthorizationHelper;
import dev.dsf.fhir.authorization.read.ReadAccessHelper;
diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/dev/dsf/bpe/v1/config/ProxyConfigDelegate.java b/dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/config/ProxyConfigDelegate.java
similarity index 82%
rename from dsf-bpe/dsf-bpe-server/src/main/java/dev/dsf/bpe/v1/config/ProxyConfigDelegate.java
rename to dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/config/ProxyConfigDelegate.java
index 8da1d0ace..b9cf3d258 100644
--- a/dsf-bpe/dsf-bpe-server/src/main/java/dev/dsf/bpe/v1/config/ProxyConfigDelegate.java
+++ b/dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/config/ProxyConfigDelegate.java
@@ -4,9 +4,9 @@
public class ProxyConfigDelegate implements ProxyConfig
{
- private final dev.dsf.common.config.ProxyConfig delegate;
+ private final dev.dsf.bpe.api.config.ProxyConfig delegate;
- public ProxyConfigDelegate(dev.dsf.common.config.ProxyConfig delegate)
+ public ProxyConfigDelegate(dev.dsf.bpe.api.config.ProxyConfig delegate)
{
this.delegate = delegate;
}
diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/dev/dsf/bpe/listener/AbstractListener.java b/dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/listener/AbstractListener.java
similarity index 98%
rename from dsf-bpe/dsf-bpe-server/src/main/java/dev/dsf/bpe/listener/AbstractListener.java
rename to dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/listener/AbstractListener.java
index 5b45b603f..e8be4669e 100644
--- a/dsf-bpe/dsf-bpe-server/src/main/java/dev/dsf/bpe/listener/AbstractListener.java
+++ b/dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/listener/AbstractListener.java
@@ -1,4 +1,4 @@
-package dev.dsf.bpe.listener;
+package dev.dsf.bpe.v1.listener;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/dev/dsf/bpe/listener/ContinueListener.java b/dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/listener/ContinueListener.java
similarity index 93%
rename from dsf-bpe/dsf-bpe-server/src/main/java/dev/dsf/bpe/listener/ContinueListener.java
rename to dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/listener/ContinueListener.java
index a64fe6948..3f160d899 100644
--- a/dsf-bpe/dsf-bpe-server/src/main/java/dev/dsf/bpe/listener/ContinueListener.java
+++ b/dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/listener/ContinueListener.java
@@ -1,4 +1,4 @@
-package dev.dsf.bpe.listener;
+package dev.dsf.bpe.v1.listener;
import java.util.function.Function;
@@ -8,7 +8,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import dev.dsf.bpe.subscription.TaskHandler;
+import dev.dsf.bpe.api.Constants;
import dev.dsf.bpe.v1.constants.CodeSystems.BpmnMessage;
public class ContinueListener extends AbstractListener implements ExecutionListener
@@ -23,8 +23,8 @@ public ContinueListener(String serverBaseUrl, Function getSpringServiceConfigClass()
+ {
+ return ApiServiceConfig.class;
+ }
+}
diff --git a/dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/plugin/ProcessPluginFactoryImpl.java b/dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/plugin/ProcessPluginFactoryImpl.java
new file mode 100644
index 000000000..e742af88e
--- /dev/null
+++ b/dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/plugin/ProcessPluginFactoryImpl.java
@@ -0,0 +1,49 @@
+package dev.dsf.bpe.v1.plugin;
+
+import java.net.URLClassLoader;
+import java.nio.file.Path;
+import java.util.stream.Stream;
+
+import org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer;
+import org.springframework.context.ApplicationContext;
+import org.springframework.core.env.ConfigurableEnvironment;
+
+import dev.dsf.bpe.api.listener.ListenerFactory;
+import dev.dsf.bpe.api.plugin.AbstractProcessPluginFactory;
+import dev.dsf.bpe.api.plugin.ProcessPlugin;
+import dev.dsf.bpe.api.plugin.ProcessPluginFactory;
+import dev.dsf.bpe.v1.ProcessPluginDefinition;
+import dev.dsf.bpe.v1.activity.DefaultUserTaskListener;
+
+public class ProcessPluginFactoryImpl extends AbstractProcessPluginFactory implements ProcessPluginFactory
+{
+ public static final int API_VERSION = 1;
+
+ public ProcessPluginFactoryImpl(ClassLoader apiClassLoader, ApplicationContext apiApplicationContext,
+ ConfigurableEnvironment environment)
+ {
+ super(API_VERSION, apiClassLoader, apiApplicationContext, environment, ProcessPluginDefinition.class,
+ DefaultUserTaskListener.class);
+ }
+
+ @Override
+ protected ProcessPlugin createProcessPlugin(Object processPluginDefinition, boolean draft, Path jarFile,
+ URLClassLoader pluginClassLoader)
+ {
+ return new ProcessPluginImpl((ProcessPluginDefinition) processPluginDefinition, API_VERSION, draft, jarFile,
+ pluginClassLoader, environment, apiApplicationContext);
+ }
+
+ @Override
+ @SuppressWarnings("rawtypes")
+ public Stream getSerializer()
+ {
+ return apiApplicationContext.getBeansOfType(TypedValueSerializer.class).values().stream();
+ }
+
+ @Override
+ public ListenerFactory getListenerFactory()
+ {
+ return apiApplicationContext.getBean(ListenerFactory.class);
+ }
+}
\ No newline at end of file
diff --git a/dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/plugin/ProcessPluginImpl.java b/dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/plugin/ProcessPluginImpl.java
new file mode 100644
index 000000000..d45c4506b
--- /dev/null
+++ b/dsf-bpe/dsf-bpe-process-api-v1-impl/src/main/java/dev/dsf/bpe/v1/plugin/ProcessPluginImpl.java
@@ -0,0 +1,258 @@
+package dev.dsf.bpe.v1.plugin;
+
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Path;
+import java.time.LocalDate;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import java.util.function.Predicate;
+
+import org.camunda.bpm.engine.variable.value.PrimitiveValue;
+import org.hl7.fhir.instance.model.api.IBaseResource;
+import org.hl7.fhir.r4.model.ActivityDefinition;
+import org.hl7.fhir.r4.model.CodeSystem;
+import org.hl7.fhir.r4.model.Identifier;
+import org.hl7.fhir.r4.model.Library;
+import org.hl7.fhir.r4.model.Measure;
+import org.hl7.fhir.r4.model.MetadataResource;
+import org.hl7.fhir.r4.model.NamingSystem;
+import org.hl7.fhir.r4.model.Questionnaire;
+import org.hl7.fhir.r4.model.QuestionnaireResponse;
+import org.hl7.fhir.r4.model.Resource;
+import org.hl7.fhir.r4.model.StructureDefinition;
+import org.hl7.fhir.r4.model.Task;
+import org.hl7.fhir.r4.model.Task.TaskStatus;
+import org.hl7.fhir.r4.model.ValueSet;
+import org.springframework.context.ApplicationContext;
+import org.springframework.core.env.ConfigurableEnvironment;
+
+import ca.uhn.fhir.context.FhirContext;
+import ca.uhn.fhir.parser.IParser;
+import dev.dsf.bpe.api.plugin.AbstractProcessPlugin;
+import dev.dsf.bpe.api.plugin.ProcessPlugin;
+import dev.dsf.bpe.api.plugin.ProcessPluginDeploymentListener;
+import dev.dsf.bpe.api.plugin.ProcessPluginFhirConfig;
+import dev.dsf.bpe.v1.ProcessPluginApi;
+import dev.dsf.bpe.v1.ProcessPluginDefinition;
+import dev.dsf.bpe.v1.ProcessPluginDeploymentStateListener;
+import dev.dsf.bpe.v1.constants.CodeSystems;
+import dev.dsf.bpe.v1.constants.NamingSystems.OrganizationIdentifier;
+import dev.dsf.bpe.v1.constants.NamingSystems.TaskIdentifier;
+import dev.dsf.bpe.v1.variables.FhirResourceValues;
+
+public class ProcessPluginImpl extends AbstractProcessPlugin implements ProcessPlugin
+{
+ private final ProcessPluginDefinition processPluginDefinition;
+ private final ProcessPluginApi processPluginApi;
+
+ public ProcessPluginImpl(ProcessPluginDefinition processPluginDefinition, int processPluginApiVersion,
+ boolean draft, Path jarFile, ClassLoader classLoader, ConfigurableEnvironment environment,
+ ApplicationContext apiApplicationContext)
+ {
+ super(ProcessPluginDefinition.class, processPluginApiVersion, draft, jarFile, classLoader, environment,
+ apiApplicationContext, ApiServicesSpringConfiguration.class);
+
+ this.processPluginDefinition = processPluginDefinition;
+ processPluginApi = apiApplicationContext.getBean(ProcessPluginApi.class);
+ }
+
+ @Override
+ protected ProcessPluginFhirConfig createFhirConfig()
+ {
+ BiFunction parseResource = (String filename, String content) ->
+ {
+ if (filename.endsWith(JSON_SUFFIX))
+ return newJsonParser().parseResource(content);
+ else if (filename.endsWith(XML_SUFFIX))
+ return newXmlParser().parseResource(content);
+ else
+ throw new IllegalArgumentException("FHIR resource filename not ending in .json or .xml");
+ };
+
+ Function