Skip to content

Latest commit

 

History

History
102 lines (80 loc) · 9.96 KB

exercise-6.md

File metadata and controls

102 lines (80 loc) · 9.96 KB

PrerequisitesExercise 0Exercise 1Exercise 1.1Exercise 2Exercise 3Exercise 4Exercise 5Exercise 6Exercise 7


Exercise 6 - Event Based Gateways and Intermediate Events

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.

Exercise Tasks

  1. Modify the dsfdev_dicProcess:

  2. Modify the dsfdev_cosProcess to use a Message End Event to trigger the process in file hrp-process.bpmn. Figure out the values for the instantiatesCanonical, profile and messageName input parameters of the Message End Event based on the AcitvityDefinition in file hrp-process.xml. Change the Cos Task element into a Service Task and include the CosTask as the implementation.

  3. 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 file hrp-process.xml.

  4. 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 of medizininformatik-initiative.de and have the HRP role are allowed to request goodByeDic messages and only organizations which are part of medizininformatik-initiative.de and have the DIC role are allowed to receive goodByeDic messages

    Don't know which values to choose for roles?

    Take a look at the dsf-organization-role CodeSystem.

  5. Forward the value from the Task.input parameter of the dicProcess Task to the dsfdev_cosProcess using the HelloCosMessage. To do this, you need to override HelloCosMessage#getAdditionalInputParameters. Don't forget to also add the definition of your tutorial-input Input Parameter from task-start-dic-process.xml to task-hello-cos.xml.

  6. Add the process in file hrp-process.bpmn to the TutorialProcessPluginDefinition and configure the FHIR resources needed for the three processes.

  7. Add the CosTask, HelloHrpMessage , HrpTask and GoodbyeDicMessage classes as Spring Beans. Don't forget the scope.

  8. 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.

Solution Verification

Maven Build and Automated Tests

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.

Process Execution and Manual Tests

To verify the dsfdev_dicProcess, dsfdev_cosProcess and dsfdev_hrpProcesses 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).

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. Start the dsfdev_dicProcess by posting a specific FHIR Task resource to the DSF FHIR server of the dic.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 the dic.dsf.test organization. The DSF BPE server of the dic.dsf.test organization should print a message showing that a Task resource to start the dsfdev_cosProcess was sent to the cos.dsf.test organization.
    Verify that a FHIR Task resource was created at the DSF FHIR server of the cos.dsf.test organization and the dsfdev_cosProcess was executed by the DSF BPE server of the cos.dsf.test organization. The DSF BPE server of the cos.dsf.test organization should print a message showing that a Task resource to start the dsfdev_hrpProcess was sent to the hrp.dsf.test organization.

    Based on the value of the Task.input parameter you send, the dsfdev_hrpProcess will either send a goodbyeDic message to the dic.dsf.test organization or finish without sending a message.

    To trigger the goodbyeDic message, use send-response as the http://dsf.dev/fhir/CodeSystem/tutorial#tutorial-input input parameter.

    Verify that the dsfdev_dicProcess either finishes with the arrival of the goodbyeDic message or after waiting for two minutes.


PrerequisitesExercise 0Exercise 1Exercise 1.1Exercise 2Exercise 3Exercise 4Exercise 5Exercise 6Exercise 7