On 03/10/2011 18:03, Wolfgang Laun wrote:
A condition does not have a "name", as you write; values of
the cells
below a condition are (usually) literals.
There is no API for extracting parts of a spreadsheet. You can look at
the Drools source code (in the packages org.drools.decisiontable and
.../parser) and write whatever you need - it is not too difficult.
You can also
look at drools-verifier, as that shows ho to analyse
resulting rule fragments.
Mark
-W
On 3 October 2011 17:05, RaviCKota<Ravi.Kota(a)wellsfargo.com> wrote:
> Hi All, for suppose I have a DecisionTable like below
>
> CONDITION ACTION
> -----------------------------
> COND1 ACTION1
> COND2 ACTION2
> COND3 ACTION3
> -----------------------------
>
> This is just a representation of the DecisionTable. So I need to retrieve
> all the conditions and store them into a Collection like Set. Does Drools
> provide any such feature.
>
> We load the drools as below
> PackageBuilder builder = new PackageBuilder();
> builder.addPackageFromDrl(new StringReader(drl)); //drl is the filepath of
> decisiontable excel
>
> // add the package to a rulebase (deploy the rule package).
> RuleBase ruleBase = RuleBaseFactory.newRuleBase();
> ruleBase.addPackage(builder.getPackage());
>
> I tried to look into api of RuleBase, tried to get the packages, Rules,
> Consequence, etc etc, but could not find any method, that gets me the
> condition name.
>
> When I tried to do
> Package[] packages = rulebase.getPackages();
>
> for(Package pack : packages){
> System.out.println("Package Name is : "+pack.getName());
> Rule[] rules = pack.getRules();
> for(Rule rule : rules){
> System.out.println("Rule name is : "+rule.getName());
>
> All I get is some representation of each row, but I'm specifically looking
> for the value of the first column (CONDITION) for each rule.
>
> Please offer some guidance here.
>
> --
> View this message in context:
http://drools.46999.n3.nabble.com/Is-it-possible-to-retrieve-the-collecti...
> Sent from the Drools: User forum mailing list archive at
Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users