Yes it's slower. Using globals in this manner is not adviseable - if a global is used in Rete it must be considered final. If you alter the global's value and you use it in the manner you describe you will make the Rete network invalid. Its too late to add this feature now. Also I may come up with another mechanism which is specified at ruleBase.addPackage( ... ) time - i.e. proper finalised parameters. But this is now 3.1 territory.

Mark
Yuesong Wang wrote:
Hi,

I wanted to know if it is possible to support the use
of globals in column constraint, like this:


  global java.lang.String value

  rule "Sample rule"
    when
      # this does not work, because drools expects
      # value to be a declaration
      MyBean( prop == value)
    then
System.out.println("fired"); end

The motivation is to have a kind of "parameterized"
rule, where parameters will be provided as globals.
I'm working around this by doing:

      Exception( m : message -> (m == param) )

but this is slower, right?

Thanks,

Yuesong


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com


Reply via email to