0

I am trying to create a dynamic salience in drools6.
My project requirement is to create a salience like "Sailence (1000*weighting+sequence)".

Where weighting == (10-priority)

Is it possible to create this?
If yes, can you provide any example or links?

Thanks in advance

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
siddu
  • 11
  • 1
  • 4

1 Answers1

2

It is indeed possible to define a salience expression by using variables bound to fields in patterns:

rule hugo
salience 1000*(10-$priority)+$sequence
when
    Foo( $priority: priority )
    Bar( $sequence: sequence )
then ... end
laune
  • 31,114
  • 3
  • 29
  • 42