Questions tagged [mvel]

MVEL is a powerful expression language for Java-based applications.

MVEL is a powerful expression language for Java-based applications.

201 questions
0
votes
1 answer

How do I create MVEL evaluation context?

I want to sequentially parse MVEL as follows: HashMap myData = new HashMap(){{ put("x", 1); }} eval("y = 2", ...) // assign value to y ... eval("x + y", myData, ...) // expect 3 Is this possible? If so, how?
kevin cline
  • 2,608
  • 2
  • 25
  • 38
0
votes
1 answer

Get expression with runtime value of parameters in MVEL

I am using MVEL to execute an expression which is a mathematical formula. The expression is in this format 10 * availableSI I have a DataObject which has availableSI as a parameter which has its getter and setter. When I say…
Harshul Pandav
  • 1,016
  • 11
  • 23
-1
votes
1 answer

MVEL not evaluating and throwing invalid number literal

MVEL is not evaluating the expression properly which contains the string with number like below

@{11412Test}
Caused by: [Error: invalid number literal: 11412Test] [Near : {... v>@{11412Test} ....}] [Line: 1, Column: 57] at…
moh
  • 1,426
  • 2
  • 16
  • 43
-1
votes
1 answer

How to add element to array with Drools (mvel)

I need insert a new value in a exist array with Drools. My example: rule "insert new address" dialect "java" when $data : Data( source.address != null) then Address address = (Address) $data.source.address System.out.println("Element:…
Ransarot
  • 9
  • 1
  • 3
-3
votes
1 answer

Regex for integer followed by single character

Can anyone please let me know the regex code to enter digit(1 to 31) followed by one single character for example: 2d or 3d. The character will always remain 'd' or 'D' and number can be any number from 1 to 31. Basically this denotes 2 days or 3…
Raghav
  • 1
-4
votes
2 answers

How to check the if statement value in drools using dialect "Mvel"?

I have a json below "root":[ { "refDataId": 1, "children": [ { "refDataId": 20 }, { "refDataId": 99, "otherValue": "Facility" } ] }, { "refDataId": 2, "children": [ { …
1 2 3
13
14