Prerequisites • Exercise 0 • Exercise 1 • Exercise 1.1 • Exercise 2 • Exercise 3 • Exercise 4 • Exercise 5 • Exercise 6 • Exercise 7
Communication between organizations in BPMN processes is modeled using message flow. The fourth exercise shows how a process at one organization can trigger a process at another organization.
To demonstrate communication between two organizations we will configure message flow between the processes exampleorg_dicProcess and exampleorg_cosProcess. After that, the processes are to be executed at the organizations dic.dsf.test and cos.dsf.test respectively in the docker dev setup, with the former triggering execution of the latter by automatically sending a Task resource from organization dic.dsf.test to organization cos.dsf.test.
In order to solve this exercise, you should have solved exercise 2 and read the topics on Messaging, Message Activities, Version Pattern, URLs and Target and Targets.
Solutions to this exercise are found on the branch solutions/exercise-4.
-
Replace the End Event of the
exampleorg_dicProcessin thedic-process.bpmnfile with a Message End Event. Give the Message End Event a name and an ID and set its implementation to theHelloCosMessageclass.
Configure field injectionsinstantiatesCanonical,profileandmessageNamein the BPMN model for the Message End Event. Usehttp://example.org/fhir/StructureDefinition/task-hello-cos|#{version}as the profile andhelloCosas the message name. Figure out what the appropriateinstantiatesCanonicalvalue is, based on the name (process definition key) of the process to be triggered.Can't remember how instantiatesCanonical is built?
Read the concept here again.
-
Modify the
exampleorg_cosProcessin thecos-process.bpmnfile and configure the message name of the Message Start Event with the same value as the message name of the Message End Event in theexampleorg_dicProcess. -
Create a new StructureDefinition with a Task profile for the
helloCosmessage.Don't know how to get started?
You can base this Task profile off the
StructureDefinition/task-start-dic-process.xmlresource. Then look for elements that need to be added, changed or can be omitted. -
Create a new ActivityDefinition resource for the
exampleorg_cosProcessand configure the authorization extension to allow thedic.dsf.testorganization as the requester and thecos.dsf.testorganization as the recipient. The file has to be calledcos-process.xml.Don't know how to get started?
You can base this ActivityDefinition off the
ActivityDefinition/dic-process.xmlresource. Then look for elements that need to be added, changed or can be omitted. Or you can take a look at the guide on creating ActivityDefinitions. -
Add the
exampleorg_cosProcessand its resources to theTutorialProcessPluginDefinitionclass. This will require a new mapping entry with the full process name of thecosProcessas the key and a List of associated FHIR resources as the value. -
Modify
DicTaskservice class to set thetargetprocess variable for thecos.dsf.testorganization. -
Configure the
HelloCosMessageclass as a Spring Bean in theTutorialConfigclass. Don't forget the right scope. -
Again, we introduced changes that break compatibility. Older plugin versions at the COS instance won't be able to handle the Task resource type we added earlier. Increment your resource version to
1.3.
Execute a maven build of the dsf-process-tutorial parent module via:
mvn clean install -Pexercise-4
Verify that the build was successful and no test failures occurred.
To verify the exampleorg_dicProcess and exampleorg_cosProcesses 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 COS instance to your browser the same way you added it for the DIC instance
in exercise 1 or use the Keycloak user Tyler Tester with username test and password test. Otherwise, you won't be able to access https://cos/fhir. You can find the client certificate
in .../dsf-process-tutorial/browser-certs/cos/cos-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 another 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 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 another console at location.../dsf-process-tutorial/dev-setup:docker-compose up cos-bpeVerify the DSF BPE server started successfully and deployed the
exampleorg_cosProcess. 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://cos/fhir/ActivityDefinition to check if the expected resource was created by the BPE while deploying the process. The returned FHIR Bundle should contain two ActivityDefinition resources. Also, go to https://cos/fhir/StructureDefinition?url=http://example.org/fhir/StructureDefinition/task-hello-cos 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 then executed by the DSF BPE server of thecos.dsf.testorganization.
Prerequisites • Exercise 0 • Exercise 1 • Exercise 1.1 • Exercise 2 • Exercise 3 • Exercise 4 • Exercise 5 • Exercise 6 • Exercise 7