[jboss-jira] [JBoss JIRA] (DROOLS-496) Rules in Drools 6.x cannot use more than 64 patterns
Davide Sottara (JIRA)
issues at jboss.org
Wed Aug 6 22:12:30 EDT 2014
[ https://issues.jboss.org/browse/DROOLS-496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Davide Sottara updated DROOLS-496:
----------------------------------
Summary: Rules in Drools 6.x cannot use more than 64 patterns (was: Working rule script in version 5.6.0 does not work in 6.0.1)
Affects Version/s: 6.2.0.Beta1
6.1.0.Final
6.0.0.Final
> Rules in Drools 6.x cannot use more than 64 patterns
> ----------------------------------------------------
>
> Key: DROOLS-496
> URL: https://issues.jboss.org/browse/DROOLS-496
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 6.0.0.Final, 6.0.1.Final, 6.1.0.Final, 6.2.0.Beta1
> Reporter: Jörgen Risholt
> Assignee: Mark Proctor
> Priority: Critical
> Attachments: drools-test_5.6.0.tar, drools-test_6.0.1.tar
>
>
> When trying a script as shown below we can not get it to work with 6.0.1 but with 5.6.0. There seems to be some relation to the number of facts, the more facts the higher probablity that the 6.0.1 version do not trigger. We have made two simple singelthreaded scenarios that I can upload if wanted.
> The examle has a lot of facts, but we notice that from about 50 it seems that the problam may occur.
> rule "TestRule"
> Person(name == "Name0")
> Person(name == "Name1")
> ....
> Person(name == "Name1000")
> then
> System.out.println("Successfully trigged");
> end
> This is the testcode for 5.6.0.Final (work always):
> package drools_test;
> import org.drools.KnowledgeBase;
> import org.drools.builder.KnowledgeBuilder;
> import org.drools.builder.KnowledgeBuilderFactory;
> import org.drools.builder.ResourceType;
> import org.drools.io.ResourceFactory;
> import org.drools.runtime.StatefulKnowledgeSession;
> import drools_test.data.Person;
> public class App {
> private final static int NUMBER_OF_PERSONS = 3000;
> public static void main(String[] args) {
> KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
> kbuilder.add(ResourceFactory.newClassPathResource("rules.drl",
> App.class), ResourceType.DRL);
> KnowledgeBase kb = kbuilder.newKnowledgeBase();
> StatefulKnowledgeSession session = null;
> try {
> session = kb.newStatefulKnowledgeSession();
> for (int i = 0; i < NUMBER_OF_PERSONS; ++i) {
> session.insert(new Person(String.format("Name%s", i)));
> session.fireAllRules();
> }
> session.fireAllRules();
> } finally {
> if (session != null) {
> session.dispose();
> }
> }
> }
> }
> And this is the same code for 6.0.1.Final which always fails:
> package drools_test;
> import org.kie.api.KieServices;
> import org.kie.api.runtime.KieContainer;
> import org.kie.api.runtime.KieSession;
> import drools_test.data.Person;
> public class App
> {
> private final static int NUMBER_OF_PERSONS = 3000;
> public static void main(String[] args)
> {
> KieServices kieServices = KieServices.Factory.get();
> KieContainer kContainer = kieServices.getKieClasspathContainer();
> KieSession session = null;
> try {
> session = kContainer.newKieSession();
> for (int i = 0; i < NUMBER_OF_PERSONS; ++i) {
> session.insert(new Person(String.format("Name%s", i)));
> session.fireAllRules(); // Comment out this line and the rule will fire.
> }
> session.fireAllRules();
> } finally {
> if (session != null) {
> session.dispose();
> }
> }
> }
> }
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
More information about the jboss-jira
mailing list