fact params is not working when I am using fact in evaluationDetails > currentValue

Open
#424 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
javascript
Domain
backend

Research direction

Start at the evaluationDetails.currentValue handling and trace how it invokes the documentsCount fact resolver. Reproduce the supplied rule with status and hasPayments parameters, then verify that the resolver receives those values and that currentValue contains the resolved result when the rule fails.

Written by the indexing model from the issue text.

Description

I am using these params to create a rule. When rule is failing I want it to return currentValue by resolving fact documentsCount . Although It is resolving this fact documentsCount but not with the params which I passed. The params receiving params in fact fact resolver is {}.

{
            baseNumber: 1,
            evaluationDetails: {
                code: "RuleEventErrorCode",
                currentValue: {
                    fact: "documentsCount",
                    params: {
                      status: "approved",
                      hasPayments: true,
                      
                },
                },
                message: 'The documents number does not meet the requirements',
                targetValue: {
                    fact: "stdDocCount",
                },
            }
        };
Dominant language
JavaScript
Stars
3.1k
Forks
507
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CacheControl/json-rules-engine

All issues in CacheControl/json-rules-engine

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.