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
exampleorg_dicProcess:- Change the Message End Event to an Intermediate Message Throw Event. This also means that
HelloCosMessage.javaneeds to implementMessageIntermediateThrowEventinstead ofMessageEndEvent. - 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
goodbyeDicmessage from theexampleorg_hrpProcess. - An Intermediate Timer Catch Event to end the process if no message is sent by the
exampleorg_hrpProcessafter two minutes. Make sure both cases finish with a process End Event.
- An Intermediate Message Catch Event to catch the
- Change the Message End Event to an Intermediate Message Throw Event. This also means that
-
Modify the
exampleorg_cosProcessto use a Message End Event to trigger the process in filehrp-process.bpmn. Figure out the values for theinstantiatesCanonical,profileandmessageNameinput parameters of the Message End Event based on the ActivityDefinition in filehrp-process.xml. Change theCos Taskelement into a Service Task and include theCosTaskas the implementation. -
Modify the process in file
hrp-process.bpmnand 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
exampleorg_dicProcessusing the parent organization role coding where only remote organizations which are part ofmedizininformatik-initiative.deand have theHRProle are allowed to requestgoodByeDicmessages and only organizations which are part ofmedizininformatik-initiative.deand have theDICrole are allowed to receivegoodByeDicmessagesDon'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
dicProcessTask to theexampleorg_cosProcessusing theHelloCosMessage. To do this, you need to overrideHelloCosMessage#getAdditionalInputParameters. Don't forget to also add the definition of yourtutorial-inputInput Parameter fromtask-start-dic-process.xmltotask-hello-cos.xml.HelloHrpMessagealready implements the forwarding of the Input Parameter to the HRP instance and might have to be adjusted e.g. if other the Input Parameter was named differently. -
Add the process in file
hrp-process.bpmnto theTutorialProcessPluginDefinitionand configure the FHIR resources needed for the three processes. -
Add the
CosTask,HelloHrpMessage,HrpTaskandGoodbyeDicMessageclasses 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 exampleorg_dicProcess, exampleorg_cosProcess and exampleorg_hrpProcesses can be executed successfully, we need to deploy them into DSF instances and execute the exampleorg_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/browser-certs/hrp/hrp-client.p12 (password: password).
-
Start the DSF FHIR server for the
dic.dsf.testorganization in a console at location.../dsf-process-tutorial/dev-setup:docker compose up dic-fhirVerify the DSF FHIR server started successfully at https://dic/fhir.
-
Start the DSF BPE server for the
dic.dsf.testorganization in a second console at location.../dsf-process-tutorial/dev-setup:docker compose up dic-bpeVerify the DSF BPE server started successfully and deployed the
exampleorg_dicProcess. -
Start the DSF FHIR server for the
cos.dsf.testorganization in a third console at location.../dsf-process-tutorial/dev-setup:docker compose up cos-fhirVerify the DSF FHIR server started successfully at https://cos/fhir.
-
Start the DSF BPE server for the
cos.dsf.testorganization in a fourth console at location.../dsf-process-tutorial/dev-setup:docker compose up cos-bpeVerify the DSF BPE server started successfully and deployed the
exampleorg_cosProcess. -
Start the DSF FHIR server for the
hrp.dsf.testorganization in a fifth console at location.../dsf-process-tutorial/dev-setup:docker compose up hrp-fhirVerify the DSF FHIR server started successfully at https://hrp/fhir.
-
Start the DSF BPE server for the
hrp.dsf.testorganization in a sixth console at location.../dsf-process-tutorial/dev-setup:docker compose up hrp-bpeVerify the DSF BPE server started successfully and deployed the
exampleorg_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 three ActivityDefinition resources. Also, go to https://hrp/fhir/StructureDefinition?url=http://example.org/fhir/StructureDefinition/task-hello-hrp to check if the expected Task profile was created. -
Start the
exampleorg_dicProcessby posting a specific FHIR Task resource to the DSF FHIR server of thedic.dsf.testorganization 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
exampleorg_dicProcesswas executed by the DSF BPE server of thedic.dsf.testorganization. The DSF BPE server of thedic.dsf.testorganization should print a message showing that a Task resource to start theexampleorg_cosProcesswas sent to thecos.dsf.testorganization.
Verify that a FHIR Task resource was created at the DSF FHIR server of thecos.dsf.testorganization and theexampleorg_cosProcesswas executed by the DSF BPE server of thecos.dsf.testorganization. The DSF BPE server of thecos.dsf.testorganization should print a message showing that a Task resource to start theexampleorg_hrpProcesswas sent to thehrp.dsf.testorganization.Based on the value of the Task.input parameter you send, the
exampleorg_hrpProcesswill either send agoodbyeDicmessage to thedic.dsf.testorganization or finish without sending a message.To trigger the
goodbyeDicmessage, usesend-responseas thetutorial-inputinput parameter.Verify that the
exampleorg_dicProcesseither finishes with the arrival of thegoodbyeDicmessage 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