Prerequisites • Exercise 0 • Exercise 1 • Exercise 1.1 • Exercise 2 • Exercise 3 • Exercise 4 • Exercise 5 • Exercise 6 • Exercise 7
In this 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 dic.dsf.test
to cos.dsf.test
to hrp.dsf.test
and back to dic.dsf.test
.
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
.
-
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
goodbyeDic
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
-
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
. Change theCos Task
element into a Service Task and include theCosTask
as the implementation. -
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 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.
-
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
. -
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. -
Again, we introduced changes that break compatibility. Older plugin versions won't execute the HRP process because the process ID in the BPMN model is still invalid and it is missing a version. Increment your resource version to
1.4
.
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
and COS
instances
in exercise 1 and exercise 4 or use the Keycloak user Tyler Tester
with username test
and password test
. 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
dic.dsf.test
organization in a console at location.../dsf-process-tutorial/dev-setup
:docker-compose up dic-fhir
Verify the DSF FHIR server started successfully at https://dic/fhir.
-
Start the DSF BPE server for the
dic.dsf.test
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
cos.dsf.test
organization in a third console at location.../dsf-process-tutorial/dev-setup
:docker-compose up cos-fhir
Verify the DSF FHIR server started successfully at https://cos/fhir.
-
Start the DSF BPE server for the
cos.dsf.test
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
hrp.dsf.test
organization in a fifth at location.../dsf-process-tutorial/dev-setup
:docker-compose up hrp-fhir
Verify the DSF FHIR server started successfully at https://hrp/fhir.
-
Start the DSF BPE server for the
hrp.dsf.test
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 thedic.dsf.test
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 thedic.dsf.test
organization. The DSF BPE server of thedic.dsf.test
organization should print a message showing that a Task resource to start thedsfdev_cosProcess
was sent to thecos.dsf.test
organization.
Verify that a FHIR Task resource was created at the DSF FHIR server of thecos.dsf.test
organization and thedsfdev_cosProcess
was executed by the DSF BPE server of thecos.dsf.test
organization. The DSF BPE server of thecos.dsf.test
organization should print a message showing that a Task resource to start thedsfdev_hrpProcess
was sent to thehrp.dsf.test
organization.Based on the value of the Task.input parameter you send, the
dsfdev_hrpProcess
will either send agoodbyeDic
message to thedic.dsf.test
organization or finish without sending a message.To trigger the
goodbyeDic
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 thegoodbyeDic
message or after waiting for two minutes.
Prerequisites • Exercise 0 • Exercise 1 • Exercise 1.1 • Exercise 2 • Exercise 3 • Exercise 4 • Exercise 5 • Exercise 6 • Exercise 7