MVEL expression
by Femke De Backere
Hi,
The following expression keeps returning the error [112,32]: [ERR 103]
Line 112:32 no viable alternative at input '+' in rule "RuleFlow-Split-
masterproef.ruleflows.shortsedation-18-22" in pattern Patient:
Patient(sedation.ultiva+0.02 > 0.1)
with sedation.ultiva returning a double
What am I doing wrong?
Thx,
Femke
13 years
[MVEL]user typed in free format expression and advanced property/expression handler integration issue
by kapokfly
I have been trying and evaluating MVEL in past few days and in general, I
love this small kids but with 1 doubt needs ask for suggestions here.
The key scenario is, we have an UI to allow users type in free format
expression and we have a couple of custom property/variable even expression
handler classes needs to be integrated with.
Example sub-expression:
1) person.name.isVisiable --> Please note, the isVisisble is not a java
property of name (it is name field's meta data which requires a quite
different resolver other than how we resolve the person and how we resolve
to name field).
2) person.name --> normal property resolver.
Now with the user typed in expression:
(person.name.isVisiable == true) && (person.name == "Joe Wang"), what is
the best way to utilize MVEL to be able to parse/compile and execute this
expression?
the first thing the API needs to know is whether it is a meta field
evaluation or a normal java property evaluation, there is no such clue on
user typed in expression unless we can parse the expression and scan its
full text like 'person.name.isVisiable'
The thing I am currently looking at is @Interceptor or custom function, and
looking for a way to be able to translate the expression into an easier
format like (@meta person.name.isVisiable == true) && (person.name == "Joe
Wang").
Is there any API in MVEL exists can make such transformation easier? Or
maybe we can use a hidden field on UI to append @meta tag when user types
in?
Once 1st question is satisfied, the next one should be how we should proceed
@meta interceptor with the ASTNode passed in.
Looking forward to your comments.
Thanks.
-----
Ivan, your Panda, forever
--
View this message in context: http://drools.46999.n3.nabble.com/MVEL-user-typed-in-free-format-expressi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years
display all rules name.
by srinivasasanda
Hi All,
Thanks in advance, Please clear this problem.
Please sort out my problem. I am able to display the package
names(Specification and GeoArea) but i want to display no. of rules names
which are available under each package.
(Under Specification package i have 2 rules & GeoArea package i have 2
rules)
I am getting the output Rule names as HashCode.
Specification
org.drools.definitions.rule.impl.RuleImpl@e483a8f
org.drools.definitions.rule.impl.RuleImpl@7d897ca2
GeoArea
org.drools.definitions.rule.impl.RuleImpl@9b82c6e5
org.drools.definitions.rule.impl.RuleImpl@5e6f671d
My Code is below:
KnowledgeBuilder kbuilder1 = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder1.add(ResourceFactory.newUrlResource("http://localhost:8082/guvnor-5.2.0.Final-jboss-as-5.1/org.drools.guvnor.G..."),ResourceType.PKG);
kbuilder1.add(ResourceFactory.newUrlResource("http://localhost:8082/guvnor-5.2.0.Final-jboss-as-5.1/org.drools.guvnor.G..."),ResourceType.PKG);
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder1.getKnowledgePackages());
for( KnowledgePackage kp : kbase.getKnowledgePackages() ){
System.out.println("------------------->"+kp.getName());
Collection c=kp.getRules();
Iterator it=c.iterator();
while(it.hasNext())
{
Object ruleName=it.next();
System.out.println("-------------------->"+ruleName);
}
Regards,
Srinivasa
--
View this message in context: http://drools.46999.n3.nabble.com/display-all-rules-name-tp3553740p355374...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years
facts custom sort
by Syargey
Hello all,
I experienced a problem I can't solve.
After rules firing I got a number of facts of certain type.
I would like to get a collection of facts sorted by custom field with a
query.
Drools guide proposes to sort facts by a rule like:
rule "Rule 03"
when
$number : Number( )
not Number( intValue < $number.intValue )
then
System.out.println("Number found with value: "+$number.intValue() );
retract( $number );
end
But it doesn't suit me:
1) I can't retract facts from session
2) I need to get sorted collection with a query which doesn't have 'then'
part.
Is there any method to get custom sorted collection with a query?
--
View this message in context: http://drools.46999.n3.nabble.com/facts-custom-sort-tp3538410p3538410.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years
Guvnor Versioning - eclipse plug-in
by Ronald Albury
JBoss Developer Studio 4.1.1.GA
Guvnor 5.2.0.Final
Tomcat 7.0.23
Guvnor: Created categories and packages. Imported Pojo jar file
Eclipse: Created drl rules. Added to Guvnor via plug-in
Guvnor: Confirmed drl rules showed up. Everything validated and verified
Eclipse: Modified drl rule. Update via plug-in and discovered that update
meant that I got a new copy from Guvnor and overwrote my changes ....
rats-changing the name for that command would be nice.
Eclipse: Modified drl rule again. Commit via plug-in.
Guvnor: The drl changes didn't show up when I opened the rule. Checked
Version History - it showed three versions (the third being the one with my
changes), but indicated that Current Version is 2. If I 'view' version 3 I
see my changes.
I tried re-validating and re-verifying rule. I tried saving rule (didn't
work). I tried re-validating and rebuilding the package.
I give up ... how do I get Version 3 to be the 'Current Version'.
13 years
Autoreply: Travis Smith is out of the office
by Travis_Smith@bnz.co.nz
I will be out of the office starting 02/12/2011 and will return on
12/12/2011.
I am on Annual Leave for the above duration.
For any URGENT issues in Lending Manager, HotDocs or Transact, please
contact BNZ Systems Support.
Regards,
-Trav
_______________________________________________
Travis Smith
Analyst Programmer
BTS Development Centre
Tel: +64 4 474 6356 Email: Travis_Smith(a)bnz.co.nz
CAUTION - This message may contain privileged and confidential information
intended only for the use of the addressee named above. If you are not the
intended recipient of this message you are hereby notified that any use,
dissemination, distribution or reproduction of this message is prohibited.
This email was sent by the Bank of New Zealand. You can contact us on
0800 ASK BNZ (0800 275 269). Any views expressed in this message are those
of the individual sender and may not necessarily reflect the views of Bank
of New Zealand.
13 years
Re: [rules-users] Guvnor hates me
by Ronald Albury
Guvnor hated me at home on Linux.
I had to install/config everything again at work - only on Windows-7
Things are behaving much differently here at work ... in a good way
I will wipe and reinstall at home and see if it all gets better there
Thanks for your help and for your patience.
Ron
13 years