PackageBuilder.java not available in Drools 6.1.0.final

469 views
Skip to first unread message

ajit sharma

unread,
Nov 20, 2014, 5:20:34 AM11/20/14
to drools...@googlegroups.com
I am new to drools and we are currently using Drools 5.4.0 in our project. Currently we are using RuleCompiler.java and PackageBuilder.java classes of Drools 5.4.0 to compile the .xls files and create ruleSetObject. The code snippet is as given below

String drlFromFile = null;
if (Pattern.matches(regexPattern, file.getName())) {
    if (file.getName().contains("csv") || file.getName().contains("CSV")) {
        drlFromFile = RuleCompiler.compileCSV(file);
    } else {
        drlFromFile = RuleCompiler.compileSpreadSheet(file);
    }
    if (drlFromFile == null || drlFromFile.isEmpty()) {
        logger.debug("Unable to Compile Rule Sheet: " + file.getName());
        throw new DroolsParserException("Unable to Compile Rule Sheet: " + file.getName());
    }
    PackageBuilder builder = new PackageBuilder();
    builder.addPackageFromDrl(new StringReader(drlFromFile));
    Package ruleSetObject = builder.getPackage();

    // Registering the compiled drl object in ruleExecutionSetRegistry
    ruleExecutionSetRegistry.registerRuleSetObject(file.getName(), ruleSetObject,
                    getRuleEngineProviderName());
}

Now we need to upgrade to Drools 6.1.0.final, but I can not find the PackageBuilder.java class there. I tried to search for its replacement but didn't get anything.

Is any new class has been introduced in place of PackageBuilder.java? Does any one guide me how to use that class?

Mark Proctor

unread,
Nov 20, 2014, 8:52:18 AM11/20/14
to drools...@googlegroups.com
As per the documentation. We have moved from a programmatic to a configuration and convention approach. There are around 10 documented examples showing these work. It’s now much simpler, all you need to do is drop your xls in a folder.

See build, deploy and utilise

See build, deploy and utilise examples:
--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage...@googlegroups.com.
To post to this group, send email to drools...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/6791394a-70a0-4cdb-9495-3d597bac9d1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ajit sharma

unread,
Nov 26, 2014, 2:19:03 AM11/26/14
to drools...@googlegroups.com
Hello Mark,

Thanks for your reply.

I have one more question. I want to keep my project JSR94 compliant. I was looking for an example of Drools 6.1.0.final using JSR94 and found the below discussion where dropping JSR94 support is discussed.


I can see the drools-jsr94-6.1.0.Final.jar in the Drools 6.1.0.final binaries. But I couldn't find any example of using it. Could you please guide me for the same.

Mark Proctor

unread,
Nov 26, 2014, 7:55:51 AM11/26/14
to drools...@googlegroups.com
JSR94 is an abomination. It only supports programmatic use and you won’t be able to take advantage of any of the 6.x stuff around convention and configuration for build, deploy, utilise and run. The only reason why it hasn’t been removed yet, is leaving it in has not been too much of a problem - the moment it is, it’s being removed. It’s usage has not chainged in years and as it’s a standard there are various tutorials out there.

So if your project is already JSR94 you don’t need to change anything, it hasn’t changed. If this is a new project and you are looking to be JSR94 compliant, you’ll need to google for tutorials.

Mark

manjunath

unread,
Aug 26, 2015, 4:08:56 AM8/26/15
to Drools Usage
I am new to drools... we have just updated from 5.2 to 6.1.. but its operation speed got decreased by 50%.. can someone please suggest what can i do to increase or maintain its earlier speed.....

Mark Proctor

unread,
Aug 26, 2015, 8:01:22 AM8/26/15
to drools...@googlegroups.com
You spammed the group three times, with the same message. This is bad netiquette, if you do it again I will ban you from the group.

Please try 6.3 snapshot, there were some fixes in there related to a regression in performance for ksession creation time.

Mark
On 26 Aug 2015, at 09:08, manjunath <anush...@gmail.com> wrote:

I am new to drools... we have just updated from 5.2 to 6.1.. but its operation speed got decreased by 50%.. can someone please suggest what can i do to increase or maintain its earlier speed.....

--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage...@googlegroups.com.
To post to this group, send email to drools...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages