Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2010-09-07
2
Medium Priority
?
1,111 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 26

Accepted Solution

by:
ksivananth earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Article by: Nadia
Suppose you use Uber application as a rider and you request a ride to go from one place to another. Your driver just arrived at the parking lot of your place. The only thing you know about the ride is the license plate number. How do you find your U…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

610 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