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
3
votes
1 answer

Calculating Distance on a MultiValueField Location

In my ElasticSearch index, location is a MultiValueField. When I write a custom scoring formula for my documents involving location, I want the script to pick up on whichever location is the closest to the point in my query. So, I have this part of…
ajyang818
  • 495
  • 1
  • 5
  • 16
3
votes
1 answer

Error: expected receiver of type com.MyApp.Main, but got java.lang.Class

I'm trying to import a class into an implementation of MVEL, and I get the following error: [Error: expected receiver of type com.MyApp.Main, but got java.lang.Class] Here's the method that sets up MVEL: public void runCode() { final String theCode…
user2651293
  • 65
  • 1
  • 6
3
votes
2 answers

How to iterate over a map created in MVEL

I have created a map in MVEL and I have to iterate over it using foreach. How would I do that? There is a similar question: How to iterate over a map in mvel But in that case the map was created in Java and had a method to return array of keys…
Fakhruddin
  • 43
  • 1
  • 5
3
votes
3 answers

Checking whether a element present in List using mvel

I had a list with me. The list is like. List locations=new ArrayList(); locations.add("California"); location.add("sydney"); location.add("Egypt"); Now I want to check in mvel whether this list contains California and Sydney. I…
Narendra
  • 5,635
  • 10
  • 42
  • 54
3
votes
2 answers

Disabling another drools rule from firing

Hi I want to disable some other drools rules from firing when another set of drools rules fire, how would you do that? Say I have an agenda-group "Daily", which has two sets of drools rules set A has rules "Default-1", "Default-2", "Default-3" set B…
user1589188
  • 5,316
  • 17
  • 67
  • 130
2
votes
0 answers

Maven project: method defineClass in class sun.misc.Unsafe cannot be applied to given types with latest Java version

I am trying to modify an mvel2 library open source code date back from < 2010. https://github.com/mvel/mvel THis is a maven project. I recently downloaded the source code and when I tried to compile the project, it gives an error message. public…
mcmattu
  • 101
  • 1
  • 2
  • 5
2
votes
1 answer

is mvel suitable for templating JavaScript

We have some JavaScript code templates that we need to interpolate server-side with code like: var version = ${appVersion}; I thought MVEL would be suitable to this, but it appears to be too smart: String input = "foo()"; …
Nikita
  • 6,019
  • 8
  • 45
  • 54
2
votes
1 answer

Difference btw MVEL.eval and MVEL.executeExpression

I'm using a MVEL script (string expression) in my java application and trying to decide between running the script with MVEL. eval(script, container) or with MVEL.executeExpression(compiledScript, container). To be honest, I don't understand the…
SuperDuper
  • 21
  • 4
2
votes
1 answer

Unable to load dialect 'org.drools.rule.builder.dialect.mvel.MVEL DialectConfiguration:mvel

I am using drools for processing rules. Web-service calls a method in a class which is in jar included in lib directory of web-service. And this method in turn uses drools. Now the problem is web-service is able to find jar that is using drools but…
user581119
  • 21
  • 4
2
votes
1 answer

How can I use substring string function in MVEL expressions

I am using Studio and have a need to use MVEL expressions. Can someone please tell me how can I extract all the characters in a field after underscore character.I am reading these values from an XML file.Please see below…
Sudha Rani
  • 89
  • 3
  • 9
2
votes
2 answers

Mule MEL usage difference

I have been using different forms of Mule's Expression language. I couldn't figure out the difference between #[flowVars.myVariable] and #[flowVars['myVariable']] They both give the result when there is a variable. But why do they behave…
user1760178
  • 6,277
  • 5
  • 27
  • 57
2
votes
0 answers

MVEL executeExpression function cannot be concurrent

Run the main function in File2 , the problem is : threads stuck at "rval=MVEL.executeExpression(compiledExpression, vars);" , 10 threads run in sequential order, not parallel , I wanna know why this happened. PS: I'm using MVEL 2.2 , the latest…
Tredency
  • 31
  • 7
2
votes
0 answers

IllegalAccessError after a few queries when using script filter in elasticsearch query

I have a 'users' elasticsearch index, where a user looks like: { "id" : 1, "name" : "Jeroen", "hours": [8,9,10,11,12,19,20,21,22,23], "country": "NL", "utc_offset": 1.0 } I want to find all users of which the 'hours' field contains the…
Jeroen Rosenberg
  • 4,552
  • 3
  • 27
  • 39
2
votes
1 answer

drools mvel for each element in a map

One of the no-nos in drools includes manually iterating over collections in the consequence (then clause). I need to write a drool which is effectively iterating over a map while doing something for each key value pair in that map. In other words, I…
melchoir55
  • 6,842
  • 7
  • 60
  • 106
2
votes
0 answers

How to make a bitwise comparison with MVEL in Elasticsearch Script Filter

I'm using bitwise stored information. To deal with it in elasticsearchs Script Filter I have to use MVEL. The MVEL Docs says to calculate bitwise the operators are the quite usual ones, so: & -> Bitwise AND | -> Bitwise OR ^ -> Bitwise XOR If I…
maddin2code
  • 1,334
  • 1
  • 14
  • 16
1 2
3
13 14