Hello! I installed Drools Workbench and Kie Server 7.23.0.Final-showcase. The documentation (
https://docs.jboss.org/drools/release/7.23.0.Final/drools-docs/html_single) says that salience value affects rules execution order so the higher the value the higher the priority.
But in my example DRL file with two rules with same conditions, the rule with less salience is selected. It's confirmed by Test Scenarios and KIE API calls.
What can i do to change execution order as stated in documentation?
My DRL file:
package com.main.bucket;
import com.main.bucket.lead;
package com.main.bucket;
import com.main.bucket.lead;
rule "test 2"
salience 2
when
$lead:lead(utmSource == "test")
then
$lead.setBucket("test 2");
end
rule "test 1"
salience 1
when
$lead:lead(utmSource == "test")
then
$lead.setBucket("test 1");
end
My KIE Server API request:
{
"lookup": null,
"commands": [
{
"insert": {
"object": {
"com.main.bucket.lead": {
"utmSource": "test"
}
},
"out-identifier": 1,
"return-object": true
}
},
{
"fire-all-rules": {
"max": -1
}
}
]
}
and response:
"type": "SUCCESS",
"msg": "Container bucket_1.0.0-SNAPSHOT successfully called.",
"result": {
"execution-results": {
"results": [
{
"value": {
"com.main.bucket.lead": {
"bucket": "test 1",
"utmSource": "test"
}
},
"key": "1"
}
],
"facts": [
{
"value": {
"org.drools.core.common.DefaultFactHandle": {
"external-form": "0:44:675213773:675213773:44:DEFAULT:NON_TRAIT:com.main.bucket.lead"
}
},
"key": "1"
}
]
}
}
}