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

Drools templates header arguments

I am working on a project, using templates to generate all my rules. I have one problem though, I wanna parse my arguments to the template as a ArrayList, and do somthing like this: template header ruleId args package dk.prks import…
2
votes
3 answers

Drl file cannot be opened because it does not exist

I'm starting out with drools. I'm getting a class path error. Not sure, what I'm missing here. Any hints? Main Class KnowledgeBuilder kbuilder =…
AppSensei
  • 8,270
  • 22
  • 71
  • 99
2
votes
0 answers

array creation in MVEL expression language

I have a list of entities where i have to sort them based on their amount, i am trying to iterate the list and get the amount from the entity object and want to create an array to sort it in MVEL. i am stuck in array creation. here is my code for…
Pruthviraj
  • 1,689
  • 2
  • 14
  • 18
2
votes
0 answers

drools 5: NullPointerException when sharing KnowledgeBase across processes

We have a cluster of jboss instances running drools. We generate the KnowledgeBase on one instance, then store it in a database; the other instances can then load it from the database instead of generating it themselves. This has worked well for…
Dan Prince
  • 25
  • 5
2
votes
1 answer

What is advantage of using MVEL?

I'm learning jBPM engine, and what I have noticed is that it uses MVEL dialect by default in process design. So the question is: what is the advantage of using MVEL instead of pure Java? Will I have troubles with more complex processes if I'll start…
andriy
  • 4,074
  • 9
  • 44
  • 71
2
votes
1 answer

How to create custom Orb Tags for MVEL

I am using MVEL 2.x to do some email generation and was wondering if it is possible to create custom Orb tags. I've searched on stackoverflow and google but could not find anything.
Thim Anneessens
  • 398
  • 2
  • 11
1
vote
0 answers

Access and process field in an Apache Camel exchange

In several of my camel routes, I need to access a field of an object, process it, and use it for something. For example: Say I have an object of class myClass { int fieldA; String fieldB; } which is used as an exchange header, say on…
Ulrich Schuster
  • 1,670
  • 15
  • 24
1
vote
0 answers

MVEL2 Handle a try/catch block

I need to handle a try catch block in a mvel compiled expression called from Java, something like this try { func1() } catch (Exception e) { ...do something } func2() From my understandings of http://mvel.documentnode.com/ it's not possible. Am…
tommaso.normani
  • 260
  • 2
  • 12
1
vote
1 answer

Formatting orb tags in MVEL

How to remove the whitespace line generated by @code{}, @if{}, @foreach{}, @end{} etc or Tags in the result of MVEL 2.0 templating?
IT DAIMON
1
vote
0 answers

Pattern Matching not working for MVEL.eval

I am trying to evaluate a pattern or regular based expression in Java using the MVEL library. However, the "matches" function is not working fine and is giving compilation error. I have tried to create a an expression like below in MVEL but regular…
Vaski Nath
  • 11
  • 1
1
vote
1 answer

Drols exception Unable to load dialect 'mvel'

I'm trying to start a rather trivial example KieContainer kieContainer = KieServices.Factory.get().getKieClasspathContainer(); StatelessKieSession kieSession = kieContainer.newStatelessKieSession("MyStatelessValidationStep"); and at the 2nd line I…
trimtosize
  • 213
  • 2
  • 10
1
vote
1 answer

How to fix the DROOL error "Field Reader does not exist for declaration '$emp_id' in '$emp_id : emp_id' in drool?

I am working on a drool(drl) POC in which I create java beans at run time using reflection. I have set the below property in the config: KnowledgeBuilderConfiguration config =…
Pawan Singh
  • 63
  • 2
  • 12
1
vote
1 answer

Evaluate Json based Rule at runtime in Java

I have a requirement to convert rules present in json format in database to code in Java at runtime. For example, { "id": "g-KqVJwrEMUYNOEVEnNxxqc", "rules": [ { "id": "r-2VC4YQOkYu-lxkGgMABRc", "field": "firstName", …
z3r0
  • 93
  • 6
1
vote
0 answers

Use Java MVEL to Compare Expressions

Is it possible to use java MVEL library to determine if one boolean expression is covered by another boolean expression? Here boolean expression A is 'covered' by boolean expression B if whatever value that satisfies B will surely satisfy A. For…
Mohamed
  • 87
  • 1
  • 9
1
vote
3 answers

How can I expose constant values in MVEL?

I have a constant that I want to import/expose to MVEL expressions: public static final String PRODUCT_NAME; I know I can import classes, packages and static methods using addImport, but there is no support for constants. I have looked at writing a…
Frederik
  • 14,156
  • 10
  • 45
  • 53