top of page
Forum Posts
Veselin Pizurica
Oct 25, 2023
In Use Cases
Let's start with a template used in one of the previous examples.(https://www.fraudaway.io/forum/questions-answers/how-to-run-fraud-tests-in-the-bulk-mode)
This time, we will focus on one particular threshold, just for simplification, that checks if the fund transfer is below a given threshold or not:
We want to change the hard coded value from 0.7 with a variable that can be changed at the runtime, while still keeping the default value as it is:
here is what we will do:
${variables.Transaction_Value} >= ${variables.Monthly_Revenue} * ${variables.THR_NO_RISK_VALUE}
As soon as I have added a new variable, my setting for this template was added, so I only had to change a type of the variable to double and add the default value 0.7
From then ownards, template will still work as before, but now if we run a bulk run test, I can change this value at runtime to any other value.
More about this feature you can find here(https://docs.waylay.io/#/api/rules/?id=running-a-template)
We can as well test this using our console, first as a subrule by running it in the debug mode:
or we can try the same from the parent template, that it is using this subflow as a policy rule, by hitting the button Test on the node AML_FundTransfer
here is the answer after hitting the test button and leaving variables empty (it uses defaults from the subflow for other values)
Now let's change this value to a very small value
and hit the test button again:
Now we see that the value was taken into account and that the policy rule evaulated it to the RISK for that transaction. Obviosuly we could have changed any other value and repeat the same process.
1
0
26
Veselin Pizurica
Oct 24, 2023
In Use Cases
Before you start you will need the following:
• You need a template, for instance, let's give it a name AML_test
• You need to cut API kyes in console (https://docs.waylay.io/#/api/)(* later reffered as apiKey:apiSecret)
• You need a test file.
How to create a template
Click create template, select one time type and give it a name
Template
Template is created only using native sensors (executed within a rules engine)
You can upload this file in your enviroment, no further sensors are needed, as these come together with the engine.
Template also come with set of default variables:(https://docs.waylay.io/#/features/rules/?id=playbook) so you can test the template directly in the debugger:
We can test the template by running it in a debugger mode, let's say once every second (using periodic setting), eventhough it is configured to run once, we can change that setting while debugging a task:
This template will later be part of the sublfow (https://docs.waylay.io/#/features/rules/?id=subflows)(policy rule) which can be then combined with other subflows.
So, let's create one parent template which will call this one:
Note that the Subflow node is going to consume stream of data (variables settings points to stream data), and that template that this sensor will be calling is AML_test:
Note that conditional evaluator node enables you to test if the calling subflow (policy rule) has evaluated data to be in RISK or not this way:
${nodes.AML_FundTransfer.rawData.Risk} == "True"
This can be later enhaced with sending results to a kinesis stream, or calling other functions or storing the input data and results into another database.
Here is the file you can upload in your enviroment:
In case you have a bulk file that you would like to use for tests or in production, it needs to be first transformed into a JSON format.
For instance, this is a BULK file with only one data entry:
{ "data": [ [ { "resource": "AML_Resource, "Txns": 35, "Field": 100, "Transaction_Value": 0.1, "Instrument": "Wire", "Transaction_Type": "Transfer", "Monthly_Revenue": 0.04, "Transaction_Date": "2022-11-10 00:00:00", "AvgMonthlyTransactionValue": 17142.8571428571, "Avg12MonthTransactionValue": 271428.5714285714, "ClientGroup": "Platinum", "PeerGroup": 17142.8571428571, "TransactionFlow": "Dr", "TransactionCounterparty": "Beneficiary", "CounterpartyLocation": "HK", "TaxHaven": "Yes", "BeneficialOwnerResidence": "HK", "CustomerStatus": "A", "Transaction_Value_Monthly": 1, "Transaction_Volume": 1, "Avg_Monthly_Transaction_volume": 0.75, "Last_two_days_trn_value": 922000.0, "DrDate": "2022-11-10", "CrDate": "2022-11-10" } ] ] }
Imagine that this file is stored on your laptop under the name dataInput.json.
After that, you can test the template with this curl command:
curl --user apiKey:apiSecret -H "Content-Type: application/json" -X POST -d @./dataInputOne.json https://<yourdomain>/rules/v1/templates/AML_Parent/run
The outcome of the test run we can see in the task logs (not that last line says that we are in the RISK)
So, that's it. If you have your ETL process running, you can simple extend it with this call and let the rest happen in our system. In some other blogs, you will see how we can first send data to a pub/sub (for instance Kinesis) and consume messages from there and forward them to our platform.
In some of the following posts, we shall see how to extend this use case with case management and analytics reports (see the figure below), so stay tunned and have fun!
Full video with end to end test is below:
1
0
61
Veselin Pizurica
Oct 23, 2023
In General Discussion
We're thrilled to have you join our community. 🎉 Whether you're here to share your knowledge, learn something new, or simply connect with like-minded individuals, you're in the right place.
A Little About Us: FraudAway is a vibrant and inclusive space for people that want to share their expirence in domain of fraud prevention. We value respectful and constructive discussions and aim to create a welcoming environment for everyone.
Your First Steps: Here are a few steps to help you get started:
1. Introduce Yourself:Â Head over to our "Introduce Yourself" thread and tell us a bit about you, your interests, and why you decided to join our community. We can't wait to get to know you better!
2. Read the Guidelines:Â Take a moment to familiarize yourself with our guidelines. They're here to ensure a positive experience for everyone.
3. Explore and Engage:Â Dive into the discussions, ask questions, and contribute to existing topics that interest you. Don't hesitate to share your insights or start a new conversation.
4. Need Help? If you have any questions or encounter any issues, feel free to reach out to our friendly moderators.
0
0
8
Veselin Pizurica
Oct 23, 2023
In General Discussion
We'd love to get to know you better. Take a moment to say hi to the community in the comments.
0
2
10
Veselin Pizurica
Oct 23, 2023
In General Discussion
We want everyone to get the most out of this community, so we ask that you please read and follow these guidelines:
• Respect each other
• Keep posts relevant to the forum topic
• No spamming
0
0
5
Veselin Pizurica
Admin
COO
More actions
bottom of page