Prerequisites • Exercise 1 • Exercise 1.1 • Exercise 2 • Exercise 3 • Exercise 4 • Exercise 5 • Exercise 6
In the final exercise we will look at message flow between three organizations as well as how to continue a waiting process if no return message arrives.
With this exercise we will add a third process and complete a message loop from Test_DIC
to Test_COR
to Test_HRP
back to Test_DIC
.
In order to solve this exercise, you should have solved exercise 5 and read the topics on Managing Multiple Incoming Messages and Missing Messages and Message Correlation.
Solutions to this exercise are found on the branch solutions/exercise-6
.
- Forward the value from the Task.input parameter of the
dicProcess
Task to thedsfdev_cosProcess
using theHelloCosMessage
. To do this, you need to overrideHelloCosMessage#getAdditionalInputParameters
. Don't forget to also add the definition of yourtutorial-input
Input Parameter fromtask-start-dic-process.xml
totask-hello-cos.xml
. - Modify the
dsfdev_cosProcess
to use a Message End Event to trigger the process in filehrp-process.bpmn
. Figure out the values for theinstantiatesCanonical
,profile
andmessageName
input parameters of the Message End Event based on the AcitvityDefinition in filehrp-process.xml
. - Modify the process in file
hrp-process.bpmn
and set the process definition key and version. Figure out the appropriate values based on the AcitvityDefinition in filehrp-process.xml
. - Add the process in file
hrp-process.bpmn
to theTutorialProcessPluginDefinition
and configure the FHIR resources needed for the three processes. - Add the
CosTask
,HelloHrpMessage
,HrpTask
andGoodbyeDicMessage
classes as Spring Beans. Don't forget the scope. - Modify the
dsfdev_dicProcess
:-
Change the Message End Event to an Intermediate Message Throw Event
-
Add an Event Based Gateway after the throw event
-
Configure two cases for the Event Based Gateway:
- An Intermediate Message Catch Event to catch the
goodbyDic
message from thedsfdev_hrpProcess
. - An Intermediate Timer Catch Event to end the process if no message is sent by the
dsfdev_hrpProcess
after two minutes. Make sure both cases finish with a process End Event.
- An Intermediate Message Catch Event to catch the
-
Add a new process authorization extension element to the ActivityDefinition for
dsfdev_dicProcess
using the parent organization role coding where only remote organizations which are part ofmedizininformatik-initiative.de
and have theHRP
role are allowed to requestgoodByeDic
messages and only organizations which are part ofmedizininformatik-initiative.de
and have theDIC
role are allowed to receivegoodByeDic
messagesDon't know which values to choose for roles?
Take a look at the dsf-organization-role CodeSystem.
-
Execute a maven build of the dsf-process-tutorial
parent module via:
mvn clean install -Pexercise-6
Verify that the build was successful and no test failures occurred.
To verify the dsfdev_dicProcess
, dsfdev_cosProcess
and dsfdev_hrpProcess
es can be executed successfully, we need to deploy them into DSF instances and execute the dsfdev_dicProcess
. The maven install
build is configured to create a process jar file with all necessary resources and copy the jar to the appropriate locations of the docker dev setup.
Don't forget that you will have to add the client certificate for the HRP
instance to your browser the same way you added it for the DIC
instance
in exercise 1 and exercise 4 or use the Keycloak user you created in exercise 3 for the hrp
realm. Otherwise, you won't be able to access https://hrp/fhir. You can find the client certificate
in .../dsf-process-tutorial/test-data-generator/cert/hrp-client/hrp-client_certificate.p12
(password: password).
-
Start the DSF FHIR server for the
Test_DIC
organization in a console at location.../dsf-process-tutorial/dev-setup
:docker-compose up dic-fhir
Verify the DSF FHIR server started successfully.
-
Start the DSF BPE server for the
Test_DIC
organization in a second console at location.../dsf-process-tutorial/dev-setup
:docker-compose up dic-bpe
Verify the DSF BPE server started successfully and deployed the
dsfdev_dicProcess
. -
Start the DSF FHIR server for the
Test_COS
organization in a third console at location.../dsf-process-tutorial/dev-setup
:docker-compose up cos-fhir
Verify the DSF FHIR server started successfully.
-
Start the DSF BPE server for the
Test_COS
organization in a fourth console at location.../dsf-process-tutorial/dev-setup
:docker-compose up cos-bpe
Verify the DSF BPE server started successfully and deployed the
dsfdev_dicProcess
. -
Start the DSF FHIR server for the
Test_HRP
organization in a fifth at location.../dsf-process-tutorial/dev-setup
:docker-compose up hrp-fhir
Verify the DSF FHIR server started successfully. You can access the webservice of the DSF FHIR server at https://hrp/fhir.
-
Start the DSF BPE server for the
Test_HRP
organization in a sixth console at location.../dsf-process-tutorial/dev-setup
:docker-compose up hrp-bpe
Verify the DSF BPE server started successfully and deployed the
dsfdev_hrpProcess
. The DSF BPE server should print a message that the process was deployed. The DSF FHIR server should now have a new ActivityDefinition resource. Go to https://hrp/fhir/ActivityDefinition to check if the expected resource was created by the BPE while deploying the process. The returned FHIR Bundle should contain a three ActivityDefinition resources. Also, go to https://hrp/fhir/StructureDefinition?url=http://dsf.dev/fhir/StructureDefinition/task-hello-hrp to check if the expected Task profile was created. -
Start the
dsfdev_dicProcess
by posting a specific FHIR Task resource to the DSF FHIR server of theTest_DIC
organization using either cURL or the DSF FHIR server's web interface. Check out Starting A Process Via Task Resources again if you are unsure.Verify that the FHIR Task resource was created at the DSF FHIR server and the
dsfdev_dicProcess
was executed by the DSF BPE server of theTest_DIC
organization. The DSF BPE server of theTest_DIC
organization should print a message showing that a Task resource to start thedsfdev_cosProcess
was sent to theTest_COS
organization.
Verify that a FHIR Task resource was created at the DSF FHIR server of theTest_COS
organization and thedsfdev_cosProcess
was executed by the DSF BPE server of theTest_COS
organization. The DSF BPE server of theTest_COS
organization should print a message showing that a Task resource to start thedsfdev_hrpProcess
was sent to theTest_HRP
organization.Based on the value of the Task.input parameter you send, the
dsfdev_hrpProcess
will either send agoodbyDic
message to theTest_DIC
organization or finish without sending a message.To trigger the
goodbyDic
message, usesend-response
as thehttp://dsf.dev/fhir/CodeSystem/tutorial#tutorial-input
input parameter.Verify that the
dsfdev_dicProcess
either finishes with the arrival of thegoodbyDic
message or after waiting for two minutes.
Prerequisites • Exercise 1 • Exercise 1.1 • Exercise 2 • Exercise 3 • Exercise 4 • Exercise 5 • Exercise 6