Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-7568

Assigned variable doesn't match when it's on the left side of a constraint

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • None
    • Ansible Integration
    • None
    • 2024 Week 07-09 (from Feb 12)
    • NEW
    • NEW
    • ---
    • ---

    Description

      Issue Description:

      An assigned variable doesn't match when it's on the left side of a constraint

      For example,

      [
          {
              "RuleSet": {
                  "name": "demo",
                  "hosts": [
                      "localhost"
                  ],
                  "sources": [
                      {
                          "EventSource": {
                              "name": "ansible.eda.generic",
                              "source_name": "ansible.eda.generic",
                              "source_args": {
                                  "payload": [
                                      {
                                          "xyz": 300,
                                          "pr": 456
                                      },
                                      {
                                          "prs_list": [
                                              456,
                                              457
                                          ]
                                      }
                                  ]
                              },
                              "source_filters": []
                          }
                      }
                  ],
                  "rules": [
                      {
                          "Rule": {
                              "name": "r41",
                              "condition": {
                                  "AllCondition": [
                                      {
                                          "AssignmentExpression": {
                                              "lhs": {
                                                  "Events": "varname"
                                              },
                                              "rhs": {
                                                  "EqualsExpression": {
                                                      "lhs": {
                                                          "Event": "xyz"
                                                      },
                                                      "rhs": {
                                                          "Integer": 300
                                                      }
                                                  }
                                              }
                                          }
                                      },
                                      {
                                          "ItemInListExpression": {
                                              "lhs": {
                                                  "Events": "varname.pr"
                                              },
                                              "rhs": {
                                                  "Event": "prs_list"
                                              }
                                          }
                                      }
                                  ]
                              },
                              "actions": [
                                  {
                                      "Action": {
                                          "action": "debug",
                                          "action_args": {
                                              "msg": "Assignment works"
                                          }
                                      }
                                  }
                              ],
                              "enabled": true
                          }
                      }
                  ]
              }
          }
      ]
      

      Acceptance Criteria:

      Match the rule.

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            rhn-support-tkobayas Toshiya Kobayashi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: