Reputation: 11
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
Upvotes: 0
Views: 376
Reputation: 31290
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
Upvotes: 2