◷ Reading Time: 8 minutes
The tutorial will use the scenario of checking the symptoms of a patient and alert the carer with the next best action to be taken.
How to Run
Before starting the run, set up the project following the instructions under Project Setup.
- Double-click and open the file MainFlow.xml

2. Click on Debug with JSON composer

3. Load the given sample JSON file Symptoms.jc.json in the folder SampleInput in your project folder,
or enter data manually.


4. If you loaded the sample input we provided, you have to manually enter the following input parameters. You can use the same email address in all three places.
- emailsender.EmailAddress: The email address that will be used to send emails from
- emailsender.EmailPassword: Password of the email address that will be used to send emails from
- PrimaryCarePartnershipEmailAddresses: Email addresses of the primary care partnership. You can add a list of email addresses.
- ControlSelfAssessmentEmailAddresses: Email addresses of the control self-assessment. You can add a list of email addresses.
See the example below.

5. Click OK

6. Click Next Step to go step by step.

7. Once the execution is successful, you will see the actions under the Parameters window

You will also receive alert emails to the email addresses given under PrimaryCarePartnershipEmailAddresses and ControlSelfAssessmentEmailAddresses


Process Steps
These are the process steps.
- The patient can select the symptoms and their status
- The system will go through a set of business rules to do the initial diagnosis and decide the next best action to be taken
- Finally, an alert email will be sent to the carers along with the next best action
Project Description
In this project, we have used the Dynamic Routing capability of FlexRule. It allows you to make decisions dynamically during runtime. Therefore, if you want to update the project by adding more symptoms that can be done easily.
The project contains the following files:
- MainFlow.xml: This is the flow that connects all the steps. Therefore, it works as the orchestration layer
- Symptom Decisions.xml: Select the symptom decision tables during the runtime depending on the inputs
- Symptoms Decision Tables (ChestPain.xml, Cough.xml, etc.): Business rules on each symptom
- Carer Instructions.xml: Build instructions for the next best action
- Concept.xml: Define the symptom and action concepts
- BusinessGlossary.xml: Define the business terms of the project
- BoxedExpression.xml: Define the expressions of the project
Video Description
The Flow Design
1. Define the symptom and action concepts.
- Concept.xml

2. Define the business terms
- BusinessGlossary.xml

3. Define the expressions
- BoxedExpression.xml

4. Create the symptom decision tables
- Temperature.xml, Cough.xml, etc.

5. Create a decision table to route the symptoms to each symptom table
- Symptom Decisions.xml

6. Create a decision table to build instructions
- Carer Instructions.xml

7. Create the Flow and connect all the decision tables.
- MainFlow.xml

8. Add a decision node to define the two paths
– If there is any alert
– If there are no alerts

9. Terminate the flow if there are no alerts

10. If there is any alert, use the Send Email option to email the carers.

Project Setup
In this project, we will be using an email address to send alert emails. Therefore, as the input, you will have to enter the following data.
You can use the same email address in all three places.
Sender email
- emailsender.EmailAddress: The email address that will be used to send emails from
- emailsender.EmailPassword: Password of the email address that will be used to send emails from
Reciever email
- PrimaryCarePartnershipEmailAddresses: Email addresses of the primary care partnership. You can add a list of email addresses.
- ControlSelfAssessmentEmailAddresses: Email addresses of the control self-assessment. You can add a list of email addresses.
Therefore, the following settings need to be updated before running the project.
1. Email server
You may have to update the email server settings (SMTP configurations) in MainFlow.xml according to the email provider you use.
In this example, we have used the settings for Gmail.

2. Turn on Third-party access to your email account
You may have to change certain security features of your email address provided under the input variable emailSender.EmailAddress in order to run this project.
In Gmail, you have to turn on Third-party access under your Gmail account settings. This will allow the FlexRule project to access your email account to send emails.

Download Project
Download the project using the attachment at the end of the page.