Solved

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

Posted on 2010-09-07
2
1,013 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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
When there is a disconnect between the intentions of their creator and the recipient, when algorithms go awry, they can have disastrous consequences.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

749 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