1. Home
  2. Sample Projects
  3. Residency Permit Eligibility

Residency Permit Eligibility

◷ Reading Time: 6 minutes

Introduction

The sample project shows how to implement residency permit eligibility regulations and determine the permit eligibility.

Scenario

In this example, we determine the residency permit eligibility using the following rule.

  • An applicant is eligible for a resident permit if the applicant has lived at an address while married and in that time period, they have shared the same address at least 7 of the last 10 years.

A sample input data for this scenario will be as follows:

A list of periods living at an address for applicant (From, To, Address):
2010-01-01,2015-12-31,”123 Main St, Anytown, USA”
2016-01-01,2020-12-31,”456 Oak St, Anytown, USA”
2021-01-01,2023-03-04,”789 Elm St, Anytown, USA”

A list of periods living at an address for spouse (From, To, Address):
2010-01-01,2015-12-31,”123 Main St, Anytown, USA”
2016-01-01,2020-12-31,”120 Maple St, Anytown, USA”
2021-01-01,2023-03-04,”789 Elm St, Anytown, USA”

A list of applicant and spouse marriage periods (From, To):
2010-01-01,2015-12-31
2021-01-01,2023-03-04

Running the Sample

  • Open the file MainFlow.xml
Main flow of residency Permit Eligibility
  • Click on the Logic Run template.
  • Click on the given run template.
Logic run template for Permit Eligibility
  • You can click the ‘Next Step’ button to go step by step to follow the flow.
  • Now you can see the output values in the ‘Parameters’ window.
Output values for Permit Eligibility

Process Steps

The process contains the following steps to determine “Residency Permit Eligibility.”

  1. Check whether the couple has been married for at least 7 years with in last 10 years time.
  2. Adjust input data for 10 Years history
  3. Match Applicants’ addresses
  4. List of periods that Applicant and spouse living together
  5. Calculate Duration
  6. Determine Permit Eligibility 

Project Description

The project contains the following documents.

Decision Table

  • CalculateDuration.xml – Calculate the duration of married and lived together.
  • DetermineEligibility.xml – Determines permit eligibility based on lived together duration and set a notification.

Business Glossaries

  • Concept.xml – Allows reusing the input data throughout the model.

Boxed Expression

BoxedExpressions.xml – Allows define functions to use in the model.

Decision Graph

  • DeterminePermitEligibility.xml – Determines the residency permit eligibility.

The Flow Design

Concept.xml

Fact Concept document is created to map the business concept along with data.

concept document for permit eligibility

DeterminePermitEligibility.xml

Decision graph for determining permit eligibility.

Decision Graph for Permit Eligibility
  1. Adjust for 10 Years History – This decision call to the boxed expression function DateAdjustment(). What it does is, it adjust the input dates for last 10 years.

    Date adjust boxed expression
  2. Match Applicants – This expression join the applicant and spouse collection using their common addresses.

    Join expression for Residency Permit
  3. List of Applicant and Spouse living together – This expression determine the common date period for applicant and spouse where they shared the same address.

    Common dates for Residency Permit
  4. Calculate Duration – This decision table calculates the married and lived together duration by iterating married periods.

    Calculate Duration for Permit Eligibility
    At the end of this decision table execution, a function calculates the total married and lived together duration.

    function for permit eligibility
  5. Determine Permit Eligibility – This decision table determines permit eligibility based on total married and lived together duration.

    Determine Permit Eligibility

MainFlow.xml

main Flow Permit Eligibility

Permit Eligibility decision graph was added into the flow.. If the married period is less than 7 years, the Permit Eligibility will be ineligible and notification is set. The decision graph only execute if the total married period is greater than or equal to 7 years along with those married period falls in between last 10 years. This condition is defined as a Boxed Expression.

Boxed-expression-condition-for-permit-eligibility

Test Cases

Multiple test cases has been added to the project to cover various test case scenarios. You can run the test cases by click on “Run Tests” in the TestCase.xml

Test Cases for Permit Eligibility

Download the project

Use the attachment at the end of the page to download the sample project.

Updated on May 4, 2023

Article Attachments

Was this article helpful?

Related Articles