Drools Decision Table Multiple Parameters

Melissa Source

I have a drools decision table with conditions level="l0" and positiontype="Replacement".
My excel looks like the below

My Code to set the parameters looks like

        Requirement requirement = new Requirement();
        requirement.setLevel("L0");
        requirement.setPositiontype("Replacement");

My excel file condition i am giving as requirementObject:

Requirement level==$param positiontype==$param

When i set like above i get the below error:

Error while creating KieBase[Message [id=1, level=ERROR, path=rules.xls, line=8, column=0 text=[ERR 102] Line 8:14 mismatched input '==' in rule "Rule for Replacement"], Message [id=2, level=ERROR, path=rules.xls, line=18, column=0 text=[ERR 102] Line 18:14 mismatched input '==' in rule "Rule for Budgeted"], Message [id=3, level=ERROR, path=rules.xls, line=28, column=0 text=[ERR 102] Line 28:14 mismatched input '==' in rule "Rule for Additional"], Message [id=4, level=ERROR, path=rules.xls, line=0, column=0
text=Parser returned a null Package]]

Please help me fix this

droolsdrools-kie-server

Answers

answered 3 months ago learner #1

The condition in the excel file should as follows :

Requirement(level == $param); Requirement(positiontype == $param );

This will solve your issue.

comments powered by Disqus