For ResourceType.DRL, the DumpDirOption isn't going to help. It is provided for compilations where the source is "pre-DRL", such as decision tables.
-W On 19/11/2012, Cotton, Ben <[email protected]> wrote: > Also, FYI, I tried to use the following explicit DROOLs code to see if I > could gain a view of the staged .DRL generation. No luck, my > $DroolsDumpDir/ directory has nothing any it. > > Do I need to do some kind of > > File droolsDumpDir = new File( "C:/MSDE/cottoben/DroolsDumpDir/" ); > SingleValueKnowledgeBuilderOption ddOption = > org.drools.builder.conf.DumpDirOption.get( droolsDumpDir ); > KnowledgeBuilderConfiguration kbConfig = > KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(); > kbConfig.setOption( ddOption ); > KnowledgeBuilder kbuilder = > KnowledgeBuilderFactory.newKnowledgeBuilder( kbConfig ); > > kbuilder.add(new ByteArrayResource(drl.getBytes()), > ResourceType.DRL); > > //compilation errors? > if (kbuilder.hasErrors()) { > System.out.println("Error compiling resources:"); > Iterator<KnowledgeBuilderError> errors = > kbuilder.getErrors().iterator(); > while (errors.hasNext()) { > System.out.println("\t" + errors.next().getMessage()); > } > throw new IllegalStateException("Error compiling resources"); > } > > //print out the generated .DRL > System.out.println(drl); > > From: [email protected] > [mailto:[email protected]] On Behalf Of Cotton, Ben > (ISGT) > Sent: Monday, November 19, 2012 11:49 AM > To: [email protected] > Subject: [rules-users] expectation for -Ddrools.dump.dir to show DRL error > context .. > > Hi, > > I thought this worked for me at some point, but, I now seem to have lost my > ability to get any debuggable DRL error contexts via the -Ddrools.dump.dir > property. > > Here is my command line, that simply borrows from the DROOLs sample > package's Cheese.xls SpreadsheetCompiler example , to produce a .DRL from > an (.XLS, .DRT) input pair: > > java > com.ms.fast.triclear.eligibility.rules.GenerateDRLfromEligibilityRulesRepoViaDRT > \ > -Ddrools.dump.dir=./DroolsDumpDir \ > > ../main/packages/com/ms/fast/triclear/eligibility/rules/IRD_PRODUCT_RULES_FEED_TO_DRT_Template-BASIS.xls > \ > > ../main/packages/com/ms/fast/triclear/eligibility/rules/IRD_PRODUCT_RULES_TEMPLATE-BASIS.drt > \ > 2>&1 | grep -v Picked | \ > tee > ../main/packages/com/ms/fast/triclear/eligibility/rules/IRD_PRODUCT_RULES=RENDERED.drl > > This command line produces the following errors: > > Error compiling resources: > [ERR 102] Line 923:0 mismatched input '' > [ERR 101] Line 8:60 no viable alternative at input '"LCH US"' in > rule "IRD_PRODUCT_RULE_24" > [ERR 101] Line 46:60 no viable alternative at input '"LCH EU. SCM"' > in rule "IRD_PRODUCT_RULE_23" > Parser returned a null Package > Exception in thread "main" java.lang.IllegalStateException: Error compiling > resources > at > com.ms.fast.triclear.eligibility.rules.GenerateDRLfromEligibilityRulesRepoViaDRT.buildKBase(GenerateDRLfromEligibilityRulesRepoViaDRT.java:93) > at > com.ms.fast.triclear.eligibility.rules.GenerateDRLfromEligibilityRulesRepoViaDRT.execute(GenerateDRLfromEligibilityRulesRepoViaDRT.java:50) > at > com.ms.fast.triclear.eligibility.rules.GenerateDRLfromEligibilityRulesRepoViaDRT.main(GenerateDRLfromEligibilityRulesRepoViaDRT.java:44) > > Unfortunately, my ./DroolsDumpDir/ directory contents are completely empty. > I was hopeful it might contain a staged .DRL context from which I could more > easily debug my roadblock. > > Is there more that I have to do, beyond just passing > -Ddrools.dump.dir=./DroolsDumpDir on the command line? > > > Ben D Cotton III > Morgan Stanley & Co. > OTC Derivatives Clearing Technology > 1221 AOTA Rockefeller Ctr - Flr 27 > New York, NY 10020 > (212)762.9094 > [email protected]<mailto:[email protected]> > > > > ________________________________ > > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions > or views contained herein are not intended to be, and do not constitute, > advice within the meaning of Section 975 of the Dodd-Frank Wall Street > Reform and Consumer Protection Act. If you have received this communication > in error, please destroy all electronic and paper copies and notify the > sender immediately. Mistransmission is not intended to waive confidentiality > or privilege. Morgan Stanley reserves the right, to the extent permitted > under applicable law, to monitor electronic communications. This message is > subject to terms available at the following link: > http://www.morganstanley.com/disclaimers If you cannot access these links, > please notify us by reply message and we will send the contents to you. By > messaging with Morgan Stanley you consent to the foregoing. > > > ________________________________ > > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions > or views contained herein are not intended to be, and do not constitute, > advice within the meaning of Section 975 of the Dodd-Frank Wall Street > Reform and Consumer Protection Act. If you have received this communication > in error, please destroy all electronic and paper copies and notify the > sender immediately. Mistransmission is not intended to waive confidentiality > or privilege. Morgan Stanley reserves the right, to the extent permitted > under applicable law, to monitor electronic communications. This message is > subject to terms available at the following link: > http://www.morganstanley.com/disclaimers If you cannot access these links, > please notify us by reply message and we will send the contents to you. By > messaging with Morgan Stanley you consent to the foregoing. > _______________________________________________ rules-users mailing list [email protected] https://lists.jboss.org/mailman/listinfo/rules-users
