Questions tagged [mvel]

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

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

192 questions
12
votes
2 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,243
  • 1
  • 11
  • 10
11
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
  • 499
  • 8
  • 21
9
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
  • 189
  • 2
  • 8
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
  • 734
  • 8
  • 20
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
  • 545
  • 1
  • 6
  • 17
7
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
  • 847
  • 4
  • 19
  • 33
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
  • 6,652
  • 12
  • 43
  • 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
  • 456
  • 1
  • 6
  • 16
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,110
  • 1
  • 29
  • 44
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
  • 1,674
  • 5
  • 21
  • 29
5
votes
2 answers

MVEL2 on android throws exception

Did anyone has experience with MVEL2 on android? i've tried out the same code with a simple java program and later on android: The following exception is thrown when executed on android: E/AndroidRuntime(30793):…
5
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
  • 13,099
  • 21
  • 76
  • 137
5
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,050
  • 3
  • 10
  • 26
4
votes
2 answers

How to call an external method from within an MVEL expression?

I have a JAVA class that has two methods. The first one is the main method and the second one is method1(). Let's say the following is the class: public class SomeClass() { public static void main(String[] args){ …
Anuj
  • 87
  • 1
  • 9
1
2 3
12 13