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

Guided Rule Editor does not support Magic Characters in DSLs

    XMLWordPrintable

Details

    • Hide

      1. Write a DSL with a magic character on the matching side:
      e.g.: [when]Assignment "{$assignment}" is

      {numberOfDays}

      days? overdue = //etc

      2. Create a rule with this DSL in the Guided Editor

      3. Try to verify the rule

      Show
      1. Write a DSL with a magic character on the matching side: e.g.: [when] Assignment "{$assignment}" is {numberOfDays} days? overdue = //etc 2. Create a rule with this DSL in the Guided Editor 3. Try to verify the rule

    Description

      Validation of a DSL rule in the guided editor fails when the DSL contains regex magic characters, such as '?'.

      Example DSL:
      [when]Assignment "{$assignment}" is

      {numberOfDays} days? overdue = {$assignment}: Assignment( hasDeadline before daysAgo({numberOfDays}

      ) )

      In the textual rule editor, this works fine:

      • Assignment "$a" is 1 day overdue
      • Assignment "$b" is 2 days overdue

      In the guided rule editor, it doesnt. Magic characters appear to be ignored, and no match with the DSL is made.

      Verification gives the following errors:
      [Assignment Overdue (Guided DSL)] [ERR 102] Line 5:13 mismatched input '"$assignment"' in rule "Assignment Overdue (Guided DSL)"
      [Assignment Overdue (Guided DSL)] Parser returned a null Package

      Attachments

        Activity

          People

            Unassigned Unassigned
            ooliebol Hendrik Wouters (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: