Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/1.0.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
hhund committed Jun 28, 2023
2 parents 004edc5 + 159aa6c commit 6f03aa9
Show file tree
Hide file tree
Showing 400 changed files with 7,713 additions and 6,162 deletions.
22 changes: 11 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ dsf-docker-test-setup/fhir/secrets/*.pem
dsf-docker-test-setup/fhir/.env

###
# dsf-docker-test-setup-3medic-ttp ignores
# dsf-docker-test-setup-3dic-ttp ignores
###
dsf-docker-test-setup-3medic-ttp/**/bpe/log/*.log
dsf-docker-test-setup-3medic-ttp/**/bpe/log/*.log.gz
dsf-docker-test-setup-3medic-ttp/**/bpe/lib_external/*.jar
dsf-docker-test-setup-3medic-ttp/**/bpe/process/*.jar
dsf-docker-test-setup-3dic-ttp/**/bpe/log/*.log
dsf-docker-test-setup-3dic-ttp/**/bpe/log/*.log.gz
dsf-docker-test-setup-3dic-ttp/**/bpe/lib_external/*.jar
dsf-docker-test-setup-3dic-ttp/**/bpe/process/*.jar

dsf-docker-test-setup-3medic-ttp/**/fhir/log/*.log
dsf-docker-test-setup-3medic-ttp/**/fhir/log/*.log.gz
dsf-docker-test-setup-3dic-ttp/**/fhir/log/*.log
dsf-docker-test-setup-3dic-ttp/**/fhir/log/*.log.gz

dsf-docker-test-setup-3medic-ttp/secrets/*.pem
dsf-docker-test-setup-3medic-ttp/secrets/*.jks
dsf-docker-test-setup-3medic-ttp/.env
dsf-docker-test-setup-3medic-ttp/docker-compose.override.yml
dsf-docker-test-setup-3dic-ttp/secrets/*.pem
dsf-docker-test-setup-3dic-ttp/secrets/*.jks
dsf-docker-test-setup-3dic-ttp/.env
dsf-docker-test-setup-3dic-ttp/docker-compose.override.yml

###
# dsf-tools ignores
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ preferred-citation:
doi: 10.3233/SHTI210060
type: proceedings
title: "Data Sharing Framework (DSF)"
version: 1.0.0-M1
date-released: 2023-05-19
version: 1.0.0
date-released: 2023-06-28
url: https://dsf.dev
repository-code: https://github.com/datasharingframework/dsf
repository-artifact: https://github.com/datasharingframework/dsf/releases
Expand Down
2 changes: 1 addition & 1 deletion dsf-bpe/dsf-bpe-process-api-v1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.dsf</groupId>
<artifactId>dsf-bpe-pom</artifactId>
<version>1.0.0-M1</version>
<version>1.0.0</version>
</parent>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Register a singleton {@link Bean} implementing this interface to execute custom code like connection tests if a
* process has been deployed.
*/
public interface ProcessPluginDeplyomentStateListener
public interface ProcessPluginDeploymentStateListener
{
void onProcessesDeployed(List<String> processes);
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import dev.dsf.bpe.v1.variables.Targets;
import dev.dsf.bpe.v1.variables.Variables;
import dev.dsf.fhir.client.FhirWebserviceClient;
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response.StatusType;

/**
* Base class for implementing BPMN message send tasks, intermediate message throw events and message end events using
Expand Down Expand Up @@ -194,11 +196,19 @@ protected void doExecute(DelegateExecution execution, Variables variables) throw
}
catch (Exception e)
{
String exceptionMessage = e.getMessage();
if (e instanceof WebApplicationException && (e.getMessage() == null || e.getMessage().isBlank()))
{
StatusType statusInfo = ((WebApplicationException) e).getResponse().getStatusInfo();
exceptionMessage = statusInfo.getStatusCode() + " " + statusInfo.getReasonPhrase();
}

String errorMessage = "Task " + instantiatesCanonical + " send failed [recipient: "
+ target.getOrganizationIdentifierValue() + ", endpoint: " + target.getEndpointIdentifierValue()
+ ", businessKey: " + businessKey
+ (target.getCorrelationKey() == null ? "" : ", correlationKey: " + target.getCorrelationKey())
+ ", message: " + messageName + ", error: " + e.getClass().getName() + " - " + e.getMessage() + "]";
+ ", message: " + messageName + ", error: " + e.getClass().getName() + " - " + exceptionMessage
+ "]";
logger.warn(errorMessage);
logger.debug("Error while sending Task", e);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.hl7.fhir.r4.model.CodeableConcept;
import org.hl7.fhir.r4.model.Questionnaire;
import org.hl7.fhir.r4.model.QuestionnaireResponse;
import org.hl7.fhir.r4.model.QuestionnaireResponse.QuestionnaireResponseItemComponent;
import org.hl7.fhir.r4.model.Reference;
import org.hl7.fhir.r4.model.ResourceType;
import org.hl7.fhir.r4.model.StringType;
Expand Down Expand Up @@ -132,6 +131,7 @@ private Questionnaire readQuestionnaire(String urlWithVersion)
return questionnaires.get(0);
}


private QuestionnaireResponse createDefaultQuestionnaireResponse(String questionnaireUrlWithVersion,
String businessKey, String userTaskId)
{
Expand All @@ -143,12 +143,9 @@ private QuestionnaireResponse createDefaultQuestionnaireResponse(String question
.setIdentifier(api.getOrganizationProvider().getLocalOrganizationIdentifier()
.orElseThrow(() -> new IllegalStateException("Local organization identifier unknown"))));

if (addBusinessKeyToQuestionnaireResponse())
{
api.getQuestionnaireResponseHelper().addItemLeafWithAnswer(questionnaireResponse,
BpmnUserTask.Codes.BUSINESS_KEY, "The business-key of the process execution",
new StringType(businessKey));
}
api.getQuestionnaireResponseHelper().addItemLeafWithAnswer(questionnaireResponse,
BpmnUserTask.Codes.BUSINESS_KEY, "The business-key of the process execution",
new StringType(businessKey));

api.getQuestionnaireResponseHelper().addItemLeafWithAnswer(questionnaireResponse,
BpmnUserTask.Codes.USER_TASK_ID, "The user-task-id of the process execution",
Expand Down Expand Up @@ -183,13 +180,10 @@ private void transformItem(QuestionnaireResponse questionnaireResponse,

private void checkQuestionnaireResponse(QuestionnaireResponse questionnaireResponse)
{
if (addBusinessKeyToQuestionnaireResponse())
{
questionnaireResponse.getItem().stream().filter(i -> BpmnUserTask.Codes.BUSINESS_KEY.equals(i.getLinkId()))
.findFirst().orElseThrow(
() -> new RuntimeException("QuestionnaireResponse does not contain an item with linkId='"
+ BpmnUserTask.Codes.BUSINESS_KEY + "'"));
}
questionnaireResponse.getItem().stream().filter(i -> BpmnUserTask.Codes.BUSINESS_KEY.equals(i.getLinkId()))
.findFirst()
.orElseThrow(() -> new RuntimeException("QuestionnaireResponse does not contain an item with linkId='"
+ BpmnUserTask.Codes.BUSINESS_KEY + "'"));

questionnaireResponse.getItem().stream().filter(i -> BpmnUserTask.Codes.USER_TASK_ID.equals(i.getLinkId()))
.findFirst()
Expand All @@ -200,18 +194,6 @@ private void checkQuestionnaireResponse(QuestionnaireResponse questionnaireRespo
throw new RuntimeException("QuestionnaireResponse must be in status 'in-progress'");
}

/**
* <i>Override this method to decided if you want to add the Business-Key to the {@link QuestionnaireResponse}
* resource as an item with {@link QuestionnaireResponseItemComponent#getLinkId()} equal to
* {@link BpmnUserTask.Codes#BUSINESS_KEY}</i>
*
* @return <code>false</code>
*/
protected boolean addBusinessKeyToQuestionnaireResponse()
{
return false;
}

/**
* <i>Override this method to modify the {@link QuestionnaireResponse} before it will be created in state
* {@link QuestionnaireResponse.QuestionnaireResponseStatus#INPROGRESS} on the DSF FHIR server</i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public interface ConstantsExampleStarters
String TTP_FHIR_BASE_URL = "https://ttp/fhir/";
String NAMINGSYSTEM_DSF_ORGANIZATION_IDENTIFIER_VALUE_TTP = "Test_TTP";

String MEDIC_1_FHIR_BASE_URL = "https://medic1/fhir/";
String NAMINGSYSTEM_DSF_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1 = "Test_MeDIC_1";
String DIC_1_FHIR_BASE_URL = "https://dic1/fhir/";
String NAMINGSYSTEM_DSF_ORGANIZATION_IDENTIFIER_VALUE_DIC_1 = "Test_DIC_1";

String MEDIC_2_FHIR_BASE_URL = "https://medic2/fhir/";
String NAMINGSYSTEM_DSF_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2 = "Test_MeDIC_2";
String DIC_2_FHIR_BASE_URL = "https://dic2/fhir/";
String NAMINGSYSTEM_DSF_ORGANIZATION_IDENTIFIER_VALUE_DIC_2 = "Test_DIC_2";

String MEDIC_3_FHIR_BASE_URL = "https://medic3/fhir/";
String NAMINGSYSTEM_DSF_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3 = "Test_MeDIC_3";
String DIC_3_FHIR_BASE_URL = "https://dic3/fhir/";
String NAMINGSYSTEM_DSF_ORGANIZATION_IDENTIFIER_VALUE_DIC_3 = "Test_DIC_3";
}
2 changes: 1 addition & 1 deletion dsf-bpe/dsf-bpe-server-jetty/conf/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dev.dsf.bpe.db.user.camunda.password=arpJ2FgJuYvUJhbxeuh7

dev.dsf.bpe.fhir.server.organization.identifier.value=Test_Organization

dev.dsf.bpe.fhir.client.trust.certificates=target/testca_certificate.pem
dev.dsf.bpe.fhir.client.trust.server.certificate.cas=target/testca_certificate.pem
dev.dsf.bpe.fhir.client.certificate=target/test-client_certificate.pem
dev.dsf.bpe.fhir.client.certificate.private.key=target/test-client_private-key.pem
dev.dsf.bpe.fhir.client.certificate.private.key.password=password
Expand Down
14 changes: 7 additions & 7 deletions dsf-bpe/dsf-bpe-server-jetty/conf/jetty.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
jetty.port=8002
jetty.status.port=10002
jetty.context.path=/bpe
dev.dsf.server.api.port=8002
dev.dsf.server.status.port=10002
dev.dsf.server.context.path=/bpe

jetty.server.server.certificate=target/localhost_certificate.pem
jetty.server.certificate.private.key=target/localhost_private-key.pem
jetty.server.certificate.private.key.password=password
dev.dsf.server.certificate=target/localhost_certificate.pem
dev.dsf.server.certificate.key=target/localhost_private-key.pem
dev.dsf.server.certificate.key.password=password

jetty.auth.client.trust.certificates=target/testca_certificate.pem
dev.dsf.server.trust.client.certificate.cas=target/testca_certificate.pem
8 changes: 4 additions & 4 deletions dsf-bpe/dsf-bpe-server-jetty/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ COPY --from=builder /opt/bpe ./

USER java
ENTRYPOINT ["./dsf_bpe_start.sh"]
ENV JETTY_HOST="0.0.0.0"
ENV JETTY_PORT="8080"
ENV JETTY_STATUS_PORT="10000"
ENV JETTY_CONTEXT_PATH="/bpe"
ENV DEV_DSF_SERVER_API_HOST="0.0.0.0"
ENV DEV_DSF_SERVER_API_PORT="8080"
ENV DEV_DSF_SERVER_STATUS_PORT="10000"
ENV DEV_DSF_SERVER_CONTEXT_PATH="/bpe"
HEALTHCHECK --interval=10s --timeout=15s --start-period=10s --retries=5 CMD [ "java", "-cp", "dsf_status_client.jar", "dev.dsf.common.status.client.StatusClient" ]
3 changes: 2 additions & 1 deletion dsf-bpe/dsf-bpe-server-jetty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.dsf</groupId>
<artifactId>dsf-bpe-pom</artifactId>
<version>1.0.0-M1</version>
<version>1.0.0</version>
</parent>

<dependencies>
Expand Down Expand Up @@ -163,6 +163,7 @@
</executions>
<configuration>
<workingPackages>
<workingPackage>dev.dsf.common</workingPackage>
<workingPackage>dev.dsf.bpe</workingPackage>
</workingPackages>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
package dev.dsf.bpe;

import org.slf4j.bridge.SLF4JBridgeHandler;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import dev.dsf.bpe.config.BpeDbMigratorConfig;
import dev.dsf.bpe.config.BpeHttpJettyConfig;
import dev.dsf.common.jetty.JettyServer;
import dev.dsf.common.jetty.Log4jInitializer;
import dev.dsf.common.jetty.PropertyJettyConfig;
import dev.dsf.tools.db.DbMigrator;

public class BpeJettyServer
{
static
{
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();

Log4jInitializer.initializeLog4j();
}

public static void main(String[] args)
{
new BpeServer(PropertyJettyConfig.forHttp().read()).start();
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
BpeDbMigratorConfig.class))
{
DbMigrator migrator = context.getBean(DbMigrator.class);
DbMigrator.retryOnConnectException(3, migrator::migrate);
}

try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
BpeHttpJettyConfig.class))
{
JettyServer server = context.getBean(JettyServer.class);
server.start();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
package dev.dsf.bpe;

import org.slf4j.bridge.SLF4JBridgeHandler;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import dev.dsf.bpe.config.BpeDbMigratorConfig;
import dev.dsf.bpe.config.BpeHttpsJettyConfig;
import dev.dsf.common.jetty.JettyServer;
import dev.dsf.common.jetty.Log4jInitializer;
import dev.dsf.common.jetty.PropertyJettyConfig;
import dev.dsf.tools.db.DbMigrator;

public class BpeJettyServerHttps
{
static
{
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();

Log4jInitializer.initializeLog4j();
}

public static void main(String[] args)
{
new BpeServer(PropertyJettyConfig.forHttps().read()).start();
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
BpeDbMigratorConfig.class))
{
DbMigrator migrator = context.getBean(DbMigrator.class);
DbMigrator.retryOnConnectException(3, migrator::migrate);
}

try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
BpeHttpsJettyConfig.class))
{
JettyServer server = context.getBean(JettyServer.class);
server.start();
}
}
}

This file was deleted.

Loading

0 comments on commit 6f03aa9

Please sign in to comment.