{"id":17451343,"url":"https://github.com/gautric/dmn-lambda","last_synced_at":"2025-04-02T06:42:58.462Z","repository":{"id":141915941,"uuid":"540378787","full_name":"gautric/dmn-lambda","owner":"gautric","description":"DMN KYC implementation into AWS Lambda","archived":false,"fork":false,"pushed_at":"2023-09-13T19:44:26.000Z","size":54,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-07T21:28:37.050Z","etag":null,"topics":["aws","aws-lambda","dmn","java-11","kogito","kyc"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gautric.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-23T09:58:19.000Z","updated_at":"2024-11-30T06:06:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"0b93ab9a-9b47-49ab-bc8c-4c63f77760ea","html_url":"https://github.com/gautric/dmn-lambda","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gautric%2Fdmn-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gautric%2Fdmn-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gautric%2Fdmn-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gautric%2Fdmn-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gautric","download_url":"https://codeload.github.com/gautric/dmn-lambda/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246769984,"owners_count":20830769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","dmn","java-11","kogito","kyc"],"created_at":"2024-10-17T22:53:26.775Z","updated_at":"2025-04-02T06:42:58.440Z","avatar_url":"https://github.com/gautric.png","language":null,"readme":"# DMN Lambda\n\nimage::https://github.com/gautric/dmn-lambda/actions/workflows/build-and-deploy-dmn-lambda-pipeline.yml/badge.svg[Build and Deploy DMN Lambda] \nimage::https://img.shields.io/badge/DMN-1.3-blue?style=flat-square[DMN]  \nimage::https://img.shields.io/badge/Quarkus-2.13-blue?style=flat-square\u0026logo=quarkus\u0026logoColor=white[Quarkus 2.13] \nimage::https://img.shields.io/badge/AWS-Lambda-%23FF9900?style=flat-square\u0026logo=amazon-aws\u0026logoColor=white[Lambda]\n\n## DMN \n\nlink:https://www.omg.org/dmn/[DMN™](Decision Model and Notation™) is an link:https://www.omg.org/[OMG] standard to develop complex rules engine. \nThis standard provides some graphical components designer can use easily for building complex rule system.\nDesigner is mainly a business analyst, because DMN is a low-code standard.\n\n## Requirements\n\n* AWS Account with Lamdba Function Grant\n\n## Compile\n\nThis sample uses Maven configuration file. Execute the command below to compile/build. \n\n    mvn clean package\n\n## Deploy\n\nHere is the command to deploy the DMN Lambda function to AWS.\n\n    sam deploy  --confirm-changeset -t src/main/aws/sam.tmpl.yaml\n\nThis command will create all stuffs into AWS infrastructure for executing the Lambda.\n\n### Lambda URL\n\nTo retrieve URL Lambda.\n\n    export AWS_STACK_NAME=dmn-lambda-sam\n\n    aws apigatewayv2 get-apis --output json --query \"Items[?Tags.\\\"aws:cloudformation:stack-name\\\"=='${AWS_STACK_NAME}'].ApiEndpoint | [0] \"  | jq -r\n\nYou should get this kind of output.\n\n```\nhttps://AAABBBDDDCCCC.execute-api.AWS_REGION.amazonaws.com\n```\n\nExecute this command once for exporting DMN_LAMBDA_URL to bash env\n\n    export DMN_LAMBDA_URL=`aws apigatewayv2 get-apis --output json --query \"Items[?Tags.\\\"aws:cloudformation:stack-name\\\"=='${AWS_STACK_NAME}'].ApiEndpoint | [0] \"  | jq -r`\n\n### CURL Execution\n\nExecute a curl command\n\n    curl ${DMN_LAMBDA_URL}/KYC -X POST  -H 'Accept: application/json'  -H 'Content-Type: application/json'   --data-raw '{\"PEP\":true,\"Amount\":100000,\"Fiscal Residency\":\"FR\"}' | jq\n\n```\n{\n    \"Amount Rule\": \"HIGH\",\n    \"Level to Int\": \"function Level to Int( Level )\",\n    \"Max Level\": \"function Max Level( list of Level )\",\n    \"KYC\": {\n        \"Score\": \"HIGH\",\n        \"Level\": 150\n    },\n    \"Fiscal Residency Rule\": \"LOW\",\n    \"Amount\": 100000,\n    \"Int to Level\": \"function Int to Level( Int )\",\n    \"PEP Rule\": \"HIGH\",\n    \"PEP\": true,\n    \"Fiscal Residency\": \"FR\",\n    \"Level to Score\": \"function Level to Score( Level )\"\n}\n\n```\n\n### Newman (Postman) Execution\n\n\nA Postman collection is available inside `src/main/postman` folder. Newman provides a command line tool to execute a postman collection. Don't forget to pass some AWS Credential too.\n\n    newman run  src/main/postman/KYC-DMN.postman_collection.json  --env-var DMN_LAMBDA_URL=${DMN_LAMBDA_URL} --env-var  AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} --env-var AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} --env-var  AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION} --verbose\n\n\n\nHere is the Newman output.\n\n```\nnewman\n\nKYC-DMN\n\n→ Call DMN\n  POST https://AAABBBDDDCCCC.execute-api.AWS_REGION.amazonaws.com/KYC  \n  200 OK ★ 229ms time ★ 721B↑ 534B↓ size ★ 12↑ 5↓ headers ★ 0 cookies\n  ┌ ↑ raw ★ 52B\n  │ {\"PEP\":true,\"Amount\":100000,\"Fiscal Residency\":\"FR\"}\n  └ \n  ┌ ↓ application/json ★ text ★ json ★ utf8 ★ 352B\n  │ {\"Amount Rule\":\"HIGH\",\"Level to Int\":\"function Level to Int( Level )\",\"Max Level\":\"function Max Level( list of Level )\",\"KYC\":{\"Score\":\"HIGH\",\"Level\":150},\"Fiscal Residency Rule\":\"LOW\",\"Amount\":1000\n  │ 00,\"Int to Level\":\"function Int to Level( Int )\",\"PEP Rule\":\"HIGH\",\"PEP\":true,\"Fiscal Residency\":\"FR\",\"Level to Score\":\"function Level to Score( Level )\"}\n  └\n  prepare   wait   dns-lookup   tcp-handshake   ssl-handshake   transfer-start   download   process   total \n  78ms      9ms    37ms         24ms            58ms            89ms             8ms        481µs     307ms \n\n  ✓  response must be valid and have a body\n\n┌─────────────────────────┬────────────────────┬───────────────────┐\n│                         │           executed │            failed │\n├─────────────────────────┼────────────────────┼───────────────────┤\n│              iterations │                  1 │                 0 │\n├─────────────────────────┼────────────────────┼───────────────────┤\n│                requests │                  1 │                 0 │\n├─────────────────────────┼────────────────────┼───────────────────┤\n│            test-scripts │                  2 │                 0 │\n├─────────────────────────┼────────────────────┼───────────────────┤\n│      prerequest-scripts │                  1 │                 0 │\n├─────────────────────────┼────────────────────┼───────────────────┤\n│              assertions │                  1 │                 0 │\n├─────────────────────────┴────────────────────┴───────────────────┤\n│ total run duration: 394ms                                        │\n├──────────────────────────────────────────────────────────────────┤\n│ total data received: 352B (approx)                               │\n├──────────────────────────────────────────────────────────────────┤\n│ average response time: 229ms [min: 229ms, max: 229ms, s.d.: 0µs] │\n├──────────────────────────────────────────────────────────────────┤\n│ average DNS lookup time: 37ms [min: 37ms, max: 37ms, s.d.: 0µs]  │\n├──────────────────────────────────────────────────────────────────┤\n│ average first byte time: 89ms [min: 89ms, max: 89ms, s.d.: 0µs]  │\n└──────────────────────────────────────────────────────────────────┘\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgautric%2Fdmn-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgautric%2Fdmn-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgautric%2Fdmn-lambda/lists"}