cancel
Showing results for 
Search instead for 
Did you mean: 
surinderp
Cadet
Cadet
  • 799 Views

BRMS setup - guidance needed

I am trying to setup BRMS, however the rules do not get hit.

 

I have create a set of data models and rules. I am trying to send APIs request for testing and getting back only nulls in the fields i am trying to set.

setup screenshots are here https://access.redhat.com/discussions/5191941 

request api:
curl --location --request POST 'http://localhost:8080/kie-server/services/rest/server/containers/instances/loan-application_1.1.0' \
--header 'Authorization: Basic ZG1BZG1pbjpyZWRoYXRkbTEh' \
--header 'Content-Type: application/json' \
--data-raw '{
"lookup": "default-stateless-ksession",
"commands": [
{
"insert": {
"object": {
"com.redhat.demos.dm.loan.model.Applicant": {
"creditScore": 230,
"name": "Jim Whitehurst"
}
},
"out-identifier": "applicant"
}
},
{
"insert": {
"object": {
"com.redhat.demos.dm.loan.model.Loan": {
"amount": 2500,
"approved": false,
"duration": 24,
"interestRate": 1.5
}
},
"out-identifier": "loan"
}
},
{
"fire-all-rules": {}
}
]
}'

response api:
{
"type" : "SUCCESS",
"msg" : "Container loan-application_1.1.0 successfully called.",
"result" : {
"execution-results" : {
"results" : [ {
"value" : {"com.redhat.demos.dm.loan.model.Loan":{
"amount" : 2500,
"duration" : 24,
"interestRate" : 1.5,
"approved" : true,
"reason" : "Congratulation your loan is approved!"
}},
"key" : "loan"
}, {
"value" : {"com.redhat.demos.dm.loan.model.Applicant":{
"name" : "Jim Whitehurst",
"creditScore" : 230
}},
"key" : "applicant"
} ],
"facts" : [ {
"value" : {"org.drools.core.common.DefaultFactHandle":{
"external-form" : "0:2:1433454381:1433454381:2:DEFAULT:NON_TRAIT:com.redhat.demos.dm.loan.model.Loan"
}},
"key" : "loan"
}, {
"value" : {"org.drools.core.common.DefaultFactHandle":{
"external-form" : "0:1:2063239414:2063239414:1:DEFAULT:NON_TRAIT:com.redhat.demos.dm.loan.model.Applicant"
}},
"key" : "applicant"
} ]
}
}
}

Labels (2)
0 Kudos
0 Replies
Join the discussion
You must log in to join this conversation.