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
13
votes
2 answers

remove objects from array elastic search

I have required to remove object from array that satisfies the condition, I am able to update the object of array on the basis of condition, which is as follow: PUT twitter/twit/1 {"list": [ { "tweet_id": "1", …
Rajit Garg
  • 529
  • 9
  • 22
12
votes
3 answers

Conditional Sorting in ElasticSearch

I have some documents that I would like to sort on a date field. For documents with date equal to a specified date, example today, and all dates after that I would like to sort ascending. For dates before the specified date I would like to sort in…
Javid Al Karuzi
  • 1,477
  • 2
  • 12
  • 10
10
votes
5 answers

Where is the MVEL Language Reference found?

http://www.codehaus.org/ is no longer a supported site. No pointer to a new site for MVEL is mentioned. The github site: https://github.com/mvel/mvel has source and a few trivial samples but no reference.
rmp
  • 199
  • 2
  • 9
8
votes
5 answers

What is Mvel dialect in Drools?

I am new to Drools. I am creating a rule but I get a compile time error "field is not visible'. I've tried to check with Jboss examples, where they use dialect "mvel". It compiled. I didn't understand about dialect. So what is dialect=mvel?
tech2504
  • 947
  • 4
  • 19
  • 34
7
votes
1 answer

How to evaluate user expressions in a sandbox

I want my app to evaluate an expression from an untrusted user, that I'll be reading from a JSON file. Such as: value = "(getTime() == 60) AND isFoo('bar')" I've found many threads about this here on StackOverflow. Usually recommending using Java's…
VIBrunazo
  • 1,340
  • 14
  • 21
7
votes
1 answer

How to use a Spring Service in Drools rules?

I'm working with drools engine in the construction of an alert system. we need to execute a method of a @Service instantiated by Spring Framework on the actions of the rule (RHS), when the conditions are met. What would be the way to get the…
Hector Gomez
  • 71
  • 1
  • 4
7
votes
1 answer

elasticsearch aggregation using a script to transform field value being aggregated

I currently have something like: "aggs": { "group_by_myfield": { "terms": { "field": "myfield" } } } However the value for myfield is "alpha 1.0", "alpha 2.0", "beta 1.0". Now I want to…
bagi
  • 627
  • 1
  • 8
  • 20
6
votes
2 answers

Drools rule iterate collections and verify property

With Drools Rules "mvel" how to iterate over a collection and verify a property for each object in the collection?
joshjdevl
  • 7,092
  • 12
  • 45
  • 57
6
votes
0 answers

Drools 6.1 - How to disable strict mode?

Short version: How can I disable the MVEL strict mode using the new KIE API? I know that there is a configuration property "drools.dialect.mvel.strict" that can be set using the old KnowledgeBuilder API. However I can not find a way to accomplish…
Dimitrios Menounos
  • 545
  • 1
  • 6
  • 17
6
votes
3 answers

MVEL: how to keep java.lang.* classes out of expressions?

I'm trying to sandbox MVEL expression evaluation. Unfortunately, by default MVEL includes all java.lang.* classes in the expression language, so a user could call "Runtime.exit()" and kill the whole system. How can I exclude all classes that I…
ccleve
  • 15,239
  • 27
  • 91
  • 157
6
votes
1 answer

how to break or continue in MVEL for / foreach loop

I see MVEL supports for loop and foreach templating, but how to "break" or "continue" from the loop?
D.S
  • 1,110
  • 3
  • 11
  • 26
5
votes
1 answer

Stringtemplate low performance in comparison to Velocity and Mvel

I am trying to do some evaluation of template frameworks. For a simple performance test I'm using these templates private static String mvelTemplate = "Hello, my name is @{name}," + " @foreach{user :…
Roman K
  • 3,309
  • 1
  • 33
  • 49
5
votes
3 answers

Create a array in mvel expression and check if variable exists in array

I have a variable having some numeric value x = 5;. I want to right an expression like: if arr = [4,7,10] contains x in mvel. Is that possible, if yes, how ? As of now I will have to right expression as : x == 4 || x == 7 || x == 10 but since i may…
GP007
  • 691
  • 2
  • 9
  • 24
5
votes
1 answer

Mvel iterate a list

I have this class hierarchy StudentClass .java public class StudentClass { private List studentList; public List getStudentList() { return studentList; } public void setStudentList(List
Ankur Singhal
  • 26,012
  • 16
  • 82
  • 116
5
votes
1 answer

Type conversion in elasticsearch scripts

I would like to use a script to do the following: { "query": { "match_all": {} }, "facets": { "user_facet": { "terms": { "field": "user_id", "script": "term + \"_\" + _source.code" } } } } This is similar…
Christopher H
  • 2,044
  • 6
  • 24
  • 30
1
2 3
13 14