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

Residency Permit Eligibility

◷ Reading Time: 6 minutes

Introduction

The Residency Permit Eligibility 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 Residency Permit Eligibility sample

  • Open the file MainFlow.xml
Project explorer view showing the MainFlow.xml document selected
  • Click on the Logic Run template.
Detail of the Logic Run Template menu item
  • Click on the given run template.
Logic run template modal showing the MainFlow selected
Detail of the Debug menu item
  • You can click the ‘Next Step’ button to go step by step to follow the flow.
Detail of the Debug Next Step menu item
  • Now you can see the output values in the ‘Parameters’ window.
Parameters modal showing the execution output results

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 Residency Permit Eligibility 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.

Business Formula

BusinessFormula.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 Residency Permit Eligibility business concept along with data.

DeterminePermitEligibility.xml

Decision graph for determining permit eligibility.

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

    Date adjust business formula
  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 for the decision project

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 Business Formula

Business formula 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 March 7, 2024

Article Attachments

Was this article helpful?

Related Articles