cancel
Showing results for 
Search instead for 
Did you mean: 

BRMS Rules Edit API decision table queries

prasad
Participant
0 Kudos

Hi all,

I was using the BRMS Rules Edit API . and was able to query the decision table but rather confused while obtaining the cell values

below is decision table columns

with query on decision table as below

IProject project = api.getProject(projectName);
IRuleset ruleset = project.getRuleset(rulesetName);
IDecisionTable dt = ruleset.getDecisionTable(decisiontableName);
IDecisionTableQuery query = dt.createQuery();
query.setConditionValue("Org","Org2");
 IDecisionTableRow[] dtRow = dt.getRows(query);

I was able to get the Org2 row using query

ArrayList<String> arrli = new ArrayList<String>();
          for ( IDecisionTableRow brmRow : dtRow){
          ICell[] cell =  brmRow.getCells();
         for (ICell cellvalues : cell)
         arrli.add(cellvalues.getValue().toString());
          }
return (arrli.toString());
};

i was able to get the cellvalues using cellvalues.getValue().toString . and its returning as string seperated by comma.

My question is

  • How to get the value of each header in cell row for the given query of Condition
  • whats the significance of ActionHeaderName as below query.setActionValue("ActionHeaderName","ActionValue");

What is the difference between setActionValue and SetConditonValue for the above decision table .

Thanks in advance

Prasad

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

do you know what are action column and condition column?

prasad
Participant
0 Kudos

Hi Jun Wu,

The action column is Group as shown in above example and all . how can i add a condition in above decision table using BRM api .

Thanks

Prasad

junwu
Active Contributor
0 Kudos

if you know what is action and condition, then you should have no problem to understand setActionValue and SetConditonValue

prasad
Participant
0 Kudos

Hi Jun Wu,

I understood the action and condition but facing issues while commiting the project using

project.commit(rulesets , true);

how can we get the rulesets after generating a query setting action and condition headers.

I was getting error

The method commit(IRuleset[], boolean) in the type IProject is not applicable for the arguments (IRuleset, boolean)

Regards

Prasad