Solved

Drools - how to pass parameters in "when" clause?

Posted on 2010-09-07
2
994 Views
Last Modified: 2012-06-27
Hi experts,

I am trying to pass parameters in "when", something like

when
            $c: Cart($d.memberLevel != null &&
                  $c.alreadyApplied("my_disc") == false
                  )
and it does not want to compile on the last line. So if it is not a simple bean property, but it is depending on something, how do I express this?

Thank you.
0
Comment
Question by:kerzner
2 Comments
 
LVL 26

Accepted Solution

by:
ksivananth earned 500 total points
ID: 33624685
you may want to write a function and call that i n the when clause!

for e.g.,

eval( isMemberValid( $d ) && isAlreadyApplied( $c ) )
0
 
LVL 1

Author Comment

by:kerzner
ID: 33627722
Yes, the combination of eval and function did the trick, thank you.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Maven Project: Hibernate Dependencies Conflict 10 38
Problem to Alipay 10 42
How to configure empty element in XML Document parser? 15 35
hashmap order 17 36
One of Google's most recent algorithm changes affecting local searches is entitled "The Pigeon Update." This update has dramatically enhanced search inquires for the keyword "Yelp." Google searches with the word "Yelp" included will now yield Yelp a…
Iteration: Iteration is repetition of a process. A student who goes to school repeats the process of going to school everyday until graduation. We go to grocery store at least once or twice a month to buy products. We repeat this process every mont…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question