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

Update Scenario Cheatsheet to mention MVEL and Background

XMLWordPrintable

    • 2019 Week 44-46 (from Okt 28), 2019 Week 47-49 (from Nov 18), 2019 Week 50-52 (from Dec 9), 2020 Week 01-03 (from Dec 30), 2020 Week 04-06 (from Jan 20)
    • 1
    • NEW
    • NEW

      Update Scenario Cheatsheet for MVEL expression usage.

      Here are some topics that could be mentioned:

      Expressions for Rule based scenarios for simple types

      • Starts from "#"
      • Runs for properties
      • Runs for duplicated properties
      • Returns the same type as property type in GIVEN
      • Returns boolean in EXPECTED
      • Receives rule processed value as a parameter in EXPECTED via keyword "actualValue"
      • Applies java.util.Objects.equals(actualValue, expression result) on the expression result if the EXPECTED value not a boolean
      • Could run any of java function for the project
      • Exports and imports as any other value

      Limitations
      1. Mvel expression results not property same type - drives scenario failure, error reason and highlighted
      Use case:
      User inputs 1/2 to Integer property
      2.Mvel execution throws exception - drives scenario execution stopping, failure, error alert
      Use case:
      User inputs inexistent MVEL function in one of the properties
      3.Mvel expression exception stops expression execution for all EXPECT colons
      Use case:
      User got one of the GIVEN fact expression excepted
      4.Mvel cannot be mixed with simple expressions in one cell
      Use case:
      For cell inputs :

      [#4+4,68]
      #actualvalue>1
      

              dzonca@redhat.com Daniele Zonca
              adupliak Anna Dupliak
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: