Fork me on GitHub

This example combines Rio and Drools Fusion through the use of the Gnostic service. This example demonstrates the use of associations, association based dependency injection, watches, and the incorporation of rules to manage SLA behavior.

You interact with a user interface to admit patients to the hospital. You can admit them one by one, or several at a time. The Hospital has a rule (DoctorRule.drl) that when a Doctor has more than 3 patients, an ON CALL Doctor is changed to ON DUTY.

If the number of patients being admitted exceeds the amount of available beds, beds are dynamically scaled (each Bed is a dynamic service) to meet the needs of the Hospital. The rule that scales beds is found in AvailableBedRule.drl.

Check out how to use the user interface provided with the example.

Building the example

The Hospital example is a multi-module Maven project, with the following structure (just inter-project dependencies are shown):

The example produces the following artifacts:

Artifact Description
hospital-service-2.0.jar Artifact containing service implementation classes
hospital-rule-2.0.jar Artifact containing service rules resources
hospital-api-2.0.jar Artifact that contains classes required for a client to invoke methods on the hospital services
hospital-ui-2.0.jar Artifact that contains classes required for a user interface to the hospital
hospital-2.0.oar The OperationalString archive, contains the configuration artifacts used to deploy the hospital application

Running mvn install will result in the execution of integration tests that use the Rio test infrastructure

Running the example

Look here for information on running the example

The example also provides test cases that use the Rio test infrastructure to create and invoke methods on the Hospital application.

Back to top

Version: 5.6. Last Published: 2017-01-01.