Creating the Rule Scripts
Procedure
-
In the Project Explorer view, expand the creditcard_rules node and in the context menu of the Check_CreditCard_Eligibility node, choose New Rule Script .
-
In the dialog box that appears, enter Check Standard Card Eligibility in the field and choose OK .
-
Create two more rule scripts as follows:
-
Check Gold Card Eligibility
-
Check Platinum Card Eligibility
In the Project Explorer view, when you expand the Check_CreditCard_Eligibility node and the Rule Scripts folder, you should see all the relevant rule script nodes.
-
-
Save the changes.
Editing the Check Standard Card Eligibility Rule Script
-
Double-click the Check Standard Card Eligibility node.
-
In the rule script editor that appears in the Actions section, choose the Add icon and in the drop down menu choose If-else if
The If-else if block appears.
-
Edit the default condition: Operation.isSuccessful Equals true as follows:
-
Choose the LHS value: Operation.isSuccessful and in the drop down menu expand the CreditCard node and choose Applicant Age .
-
Choose the comparator: Equals and in the drop down menu choose Greater Than Equals .
-
Choose the RHS value: 0 and enter 21 in the inline text box.
-
Choose the Add icon and add another condition and edit as follows:
-
Choose the LHS value: Operation.isSuccessful and in the drop down menu expand the Definitions node and choose CreditScore .
-
Choose the comparator: Equals and in the drop down menu choose Greater Than Equals .
-
Choose the RHS value: 0 and in the inline text box enter 54 .
-
Under the Then section, choose the Add icon and in the drop down menu that appears, expand the Execute node, the CreditCard node and choose Set Applicant Eligibility = {String} .
-
Choose {String} and in the inline text box enter Is Eligible for Standard Credit Card .
-
Choose <Add Else> and in the drop down menu expand the Execute node, the CreditCard node and choose Set Applicant Eligibility = {String}
-
Choose {String} and in the inline text box enter Is Not Eligible for Standard Credit Card .
Editing the Check Gold Card Eligibility Rule Script
-
Double-click the Check Gold Card Eligibility node.
-
In the rule script editor that appears in the Actions section, choose the Add icon and in the drop down menu choose If-else if
The If-else if block appears.
-
Edit the default condition: Operation.isSuccessful Equals true as follows:
-
Choose the LHS value: Operation.isSuccessful and in the drop down menu expand the CreditCard node and choose Applicant Age .
-
Leave the comparator: Equals as it is
-
Choose the RHS value: 0 and enter 25 in the inline text box.
-
Choose the Add icon and add another condition and edit as follows:
-
Choose the LHS value: Operation.isSuccessful and in the drop down menu expand the Definitions node and choose Credit Score .
-
Choose the comparator: Equals and in the drop down menu choose Greater Than Equals .
-
Choose the RHS value: 0 and in the inline text box enter 51 .
-
Under the Then section, choose the Add icon and in the drop down menu that appears, expand the Execute node, the CreditCard node and choose Set Applicant Eligibility = {String} .
-
Choose {String} and in the inline text box enter Is Eligible for Gold Credit Card .
-
Choose <Add Else> and in the drop down menu expand the Execute node, the CreditCard node and choose Set Applicant Eligibility = {String}
-
Choose {String} and in the inline text box enter Is Not Eligible for Gold Credit Card .
Editing the Check Platinum Card Eligibility Rule Script
-
Double-click the Check Platinum Card Eligibility node.
-
In the rule script editor that appears in the Actions section, choose the Add icon and in the drop down menu choose If-else if
The If-else if block appears.
-
Edit the default condition: Operation.isSuccessful Equals true as follows:
-
Choose the LHS value: Operation.isSuccessful and in the drop down menu expand the CreditCard node and choose Applicant Age .
-
Choose the comparator: Equals and in the drop down menu choose Greater Than Equals .
-
Choose the RHS value: 0 and enter 25 in the inline text box.
-
-
Choose the Add icon and add another condition and edit as follows:
-
Choose the LHS value: Operation.isSuccessful and in the drop down menu expand the CreditCard node and choose Total Assets of Applicant .
-
Choose the comparator: Equals and in the drop down menu choose Greater Than Equals .
-
Choose the RHS value: 0 and enter 1500000 in the inline text box.
-
-
Add another condition and edit as follows:
-
Choose the LHS value: Operation.isSuccessful and in the drop down menu expand the CreditCard node and choose Credit History of Applicant .
-
Leave the comparator: Equals as it is.
-
Choose the RHS value: Default Value and enter GOOD in the inline text box.
-
-
Add another condition and edit as follows:
-
Choose the LHS value: Operation.isSuccessful and in the drop down menu expand the CreditCard node and choose Annual Income of Applicant .
-
Choose the comparator: Equals and in the drop down menu choose Greater Than Equals .
-
Choose the RHS value: 0 and enter 250000 in the inline text box.
-
-
Under the Then section, choose the Add icon and in the drop down menu that appears, expand the Execute node, the CreditCard node and choose Set Applicant Eligibility = {String} .
-
Choose {String} and in the inline text box enter Is Eligible for Platinum Card .
-
Choose <Add Else> and in the drop down menu expand the Execute node, the CreditCard node and choose Set Applicant Eligibility = {String}
-
Choose {String} and in the inline text box enter Is Not Eligible for Platinum Credit Card .
Next Step