Solved

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

Posted on 2010-09-07
2
967 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now