Recently we started exploring OpenRules and was trying to make a decisionmodel based on excel only.
And we are stuck in a situation for which were not able to locate any suitable sample application in 6.4.1 download.
I want to know is it possible to put decisions from different DTs in to an array.
So what we want to achieve is, let we have possible decisions
|
Data DecisionImportance decisionImportances |
|
|
myDecision |
importance |
|
My Decision |
Importance |
|
Decision1 |
9 |
|
Decision2 |
10 |
|
Decision3 |
15 |
|
Decision4 |
12 |
|
Decision5 |
6 |
|
-99 //null or no decision |
|
Now based on customer data(input), 1st decision table will give Decision 1/null, 2nd decision table will give Decision2 or null etc.
So I want to collect all these decisions in a Array and want to do some logic based on importance to provide the final decision.
|
//DecisionTable ViewMyShipment1 |
||
|
If |
If |
Then |
|
var1 |
var2 |
Recommendation[0] |
|
Yes |
Yes |
Decision1 |
|
//DecisionTable ViewMyShipment2 |
||
|
If |
If |
Then |
|
Var3 |
Var4 |
Recommendation[1] |
|
Yes |
Yes |
Decision2 |
So my question is how to write this (Then/Action/Conclusion) to put into decision array.
Believe I can do += and to concatenate all decisions in a String and then split in Java. But is there any other alternative.
|
Glossary glossary |
||
|
Variable |
Business Concept |
Attribute |
|
Var 1 |
Customer |
var1 |
|
Var 2 |
var2 |
|
|
Var 3 |
var3 |
|
|
Var 4 |
var4 |
|
|
Var 5 |
var5 |
|
|
Var 6 |
var6 |
|
|
Var 7 |
var7 |
|
|
Var 8 |
var8 |
|
|
Var 9 |
var9 |
|
|
Var 10 |
var10 |
|
|
Recommendations |
Recommendations |
recommendations |
|
Recommendation Name |
RecommendationWeightage |
recommendationName |
|
Weight |
weight |
|
|
Recommendation Name For Consumers |
recommendationNameForConsumers |
|
|
Datatype Recommendations |
||
|
String[] |
recommendations |
|
|
Data RecommendationWeightage recommendationWeightages |
||
|
recommendationName |
weight |
recommendationNameForConsumers |
|
Recommendation Name |
Weight |
Recommendation Name For Consumers |
|
recommendation1 |
1 |
IS_ELIGIBLE_FOR_RECOMMENDATION_1 |
|
recommendation2 |
2 |
IS_ELIGIBLE_FOR_RECOMMENDATION_2 |
|
recommendation3 |
4 |
IS_ELIGIBLE_FOR_RECOMMENDATION_3 |
|
DT DeciosnForRecommendation1 |
||
|
If |
If |
Conclusion |
|
Var1 |
Var2 |
Recommendations |
|
A |
B |
recommendation1 |
|
DT DeciosnForRecommendation2 |
||
|
If |
If |
Conclusion |
|
Var3 |
Var4 |
Recommendations |
|
C |
D |
recommendation2 |
In Java side:
I am reading the Constant data recommendationWeightage from Excel file.
And I am expecting the recommendation[] will contain some data like [“recommendation1”, “recommendation5”, “recommendation6”] etc.
Now based on priority/weightage I am going to sort those data. And give some top 5 or top 2 record.
So I have doubt in how to add recommendations dynamically in to the array.
Cause the examples I saw, there it is part of data which is fed in to the decision model.
But what I want, is to add output of different decision tables into the array.
So believe I have to update something in the sections of DT highlighted in yellow.
-----------------------------------------------------
----------------------------------------------------------------------------------------------------------
-----------------------------------------------------