1. Home
  2. Sample Projects
  3. Firearm License Eligibility

Firearm License Eligibility

◷ Reading Time: 4 minutes

The process of determining provision of a firearm licenses eligibility contains a set of serious rules that require 100% accuracy as it is related to security. The example will show how FlexRule can be used to automate this process.

  1. Read data from the previous applicant list
  2. Check whether the applicant is already applied
  3. For previous applicants, get the previous score
  4. For new applicants, calculate the score
  5. Determine eligibility

An Excel sheet contains a list of previous applicants along with their scores (records.csv is inside the project folder).

How to Run the Firearm License Eligibility project

1. Open the file Flow.xml from the Firearm License Eligibility project

Project Explorer view showing the Flow document selected

2. Click on Debug with JSON composer.

Detail of the Debug with JSON composer menu item

3. Load one of the given sample JSON files (samples are in the folder Sample JSONs in your project folder) or enter the data manually.

Detail of the Load JSON File menu item

4. Click OK.

OK button detail

5. Click Next Step to go step by step.

6. You will see the output under the Parameters window.

Process Steps

These are the steps for creating this project.

1. Create the Fact Concept file to model the input and variables.

Fact concept for the Firearm License Eligibility project

2. Create a Decision Table to add rules according to calculate the score.

Decision Table to calculate the eligibility score

3. Create a Decision Table to determine the eligibility according to the calculated score.

Decision Table to calculate the eligibility from the calculate score

4. Create a Flow and a node to read data from an Excel sheet to get a list of previous applicants.

Example of the the Firearm License Eligibility flow with embedded Excel file

5. Add a node to decide whether the applicant has applied previously.

Example of the the Firearm License Eligibility Flow with embedded Excel file with a check for previous application

6. Add the decision table that calculates the score of a new applicant to the ‘No’ side of the decision node.

Example of the Firearm License Eligibility Flow with embedded Excel file with a check for previous application and the NO section of the flow

7. Add a node to the ‘Yes’ side of the decision node to get the score of the previous application.

Example of the Firearm License Eligibility Flow with embedded Excel file with a check for previous application. There is both a YES and NO decision in the flow

8. Add the decision table that determines the eligibility of the applicant according to the score and completes the flow.

Downloadable Project

The project can be downloaded from the attachment at the end of the page.

Updated on February 6, 2024

Article Attachments

Was this article helpful?

Related Articles