[JBoss JIRA] (DROOLS-5100) KieBase build fails with forall patterns containing "not equal" constraints
by Matteo Casalino (Jira)
Matteo Casalino created DROOLS-5100:
---------------------------------------
Summary: KieBase build fails with forall patterns containing "not equal" constraints
Key: DROOLS-5100
URL: https://issues.redhat.com/browse/DROOLS-5100
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 7.33.0.Final
Reporter: Matteo Casalino
Assignee: Mario Fusco
Attachments: forall-not-equal-constraint.tgz
as of Drools 7.33.0.Final, forall patterns with "not equal" (!=) constraints will break when building the KieBase.
For example the following DRL:
{noformat}
rule "forall with not equal"
when forall(String(this != "foo"))
then
end
{noformat}
generates the following error:
{noformat}
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1967)
at org.drools.core.rule.constraint.MvelConstraint.getLeftInExpression(MvelConstraint.java:608)
at org.drools.core.rule.constraint.MvelConstraint.hashCode(MvelConstraint.java:602)
at org.drools.core.reteoo.AlphaNode.calculateHashCode(AlphaNode.java:189)
at org.drools.core.reteoo.AlphaNode.<init>(AlphaNode.java:89)
at org.drools.core.reteoo.builder.PhreakNodeFactory.buildAlphaNode(PhreakNodeFactory.java:88)
at org.drools.core.reteoo.builder.PatternBuilder.buildAlphaNodeChain(PatternBuilder.java:360)
at org.drools.core.reteoo.builder.PatternBuilder.attachAlphaNodes(PatternBuilder.java:346)
at org.drools.core.reteoo.builder.PatternBuilder.attachPattern(PatternBuilder.java:136)
at org.drools.core.reteoo.builder.PatternBuilder.build(PatternBuilder.java:84)
at org.drools.core.reteoo.builder.GroupElementBuilder$NotBuilder.build(GroupElementBuilder.java:220)
at org.drools.core.reteoo.builder.GroupElementBuilder.build(GroupElementBuilder.java:68)
at org.drools.core.reteoo.builder.GroupElementBuilder$AndBuilder.build(GroupElementBuilder.java:108)
at org.drools.core.reteoo.builder.GroupElementBuilder.build(GroupElementBuilder.java:68)
at org.drools.core.reteoo.builder.ReteooRuleBuilder.addSubRule(ReteooRuleBuilder.java:167)
at org.drools.core.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.java:139)
at org.drools.core.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:110)
at org.drools.core.impl.KnowledgeBaseImpl.internalAddRule(KnowledgeBaseImpl.java:1525)
at org.drools.core.impl.KnowledgeBaseImpl.internalAddPackages(KnowledgeBaseImpl.java:926)
at org.drools.core.impl.KnowledgeBaseImpl.lambda$addPackages$2(KnowledgeBaseImpl.java:728)
at org.drools.core.impl.KnowledgeBaseImpl.enqueueModification(KnowledgeBaseImpl.java:745)
at org.drools.core.impl.KnowledgeBaseImpl.addPackages(KnowledgeBaseImpl.java:728)
at org.drools.compiler.kie.builder.impl.AbstractKieModule.createKieBase(AbstractKieModule.java:226)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:407)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:375)
{noformat}
This is working fine when using Drools <= 7.32.0.Final.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months
[JBoss JIRA] (DROOLS-2352) Executable model test coverage: run the optaplanner turtleTests with the executable model turned on and see if it survives the ordeal
by Tibor Zimanyi (Jira)
[ https://issues.redhat.com/browse/DROOLS-2352?page=com.atlassian.jira.plug... ]
Tibor Zimanyi commented on DROOLS-2352:
---------------------------------------
Radek moving this to you. Feel free to close this if it is not relevant anymore.
> Executable model test coverage: run the optaplanner turtleTests with the executable model turned on and see if it survives the ordeal
> -------------------------------------------------------------------------------------------------------------------------------------
>
> Key: DROOLS-2352
> URL: https://issues.redhat.com/browse/DROOLS-2352
> Project: Drools
> Issue Type: Task
> Components: core engine
> Reporter: Geoffrey De Smet
> Assignee: Radovan Synek
> Priority: Major
>
> For now, we're looking for a one time test. Later I presume the exe model will be come the default, so these tests would just run?
> To run the optaplanner turtle tests, run all tests in optaplanner-examples with the VM parameter `-DrunTurtleTests=true`. They take 48 hours to run. You can also just run one, for example NurseRosteringSolveAllTurtleTest, but don't forget that VM parameter.
> Mario Fusco says you can do this to turn on the executable model:
> {code}
> kieBuilder.buildAll( ExecutableModelProject.class );
> {code}
> I presume you 'd need to hack that in `ScoreDirectorFactoryConfig.buildDroolsScoreDirectorFactory()`.
> Note: I have no idea if this even make sense: those turtle tests use a drl file input and don't use the kie-maven-plugin. We're looking for a switch to just turn it on and see if they are all still green. Mario thinks it's possible, if I understand it correctly.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months
[JBoss JIRA] (DROOLS-2352) Executable model test coverage: run the optaplanner turtleTests with the executable model turned on and see if it survives the ordeal
by Tibor Zimanyi (Jira)
[ https://issues.redhat.com/browse/DROOLS-2352?page=com.atlassian.jira.plug... ]
Tibor Zimanyi reassigned DROOLS-2352:
-------------------------------------
Assignee: Radovan Synek (was: Tibor Zimanyi)
> Executable model test coverage: run the optaplanner turtleTests with the executable model turned on and see if it survives the ordeal
> -------------------------------------------------------------------------------------------------------------------------------------
>
> Key: DROOLS-2352
> URL: https://issues.redhat.com/browse/DROOLS-2352
> Project: Drools
> Issue Type: Task
> Components: core engine
> Reporter: Geoffrey De Smet
> Assignee: Radovan Synek
> Priority: Major
>
> For now, we're looking for a one time test. Later I presume the exe model will be come the default, so these tests would just run?
> To run the optaplanner turtle tests, run all tests in optaplanner-examples with the VM parameter `-DrunTurtleTests=true`. They take 48 hours to run. You can also just run one, for example NurseRosteringSolveAllTurtleTest, but don't forget that VM parameter.
> Mario Fusco says you can do this to turn on the executable model:
> {code}
> kieBuilder.buildAll( ExecutableModelProject.class );
> {code}
> I presume you 'd need to hack that in `ScoreDirectorFactoryConfig.buildDroolsScoreDirectorFactory()`.
> Note: I have no idea if this even make sense: those turtle tests use a drl file input and don't use the kie-maven-plugin. We're looking for a switch to just turn it on and see if they are all still green. Mario thinks it's possible, if I understand it correctly.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months
[JBoss JIRA] (DROOLS-3402) Encoding set in constructor not taking effect
by Tibor Zimanyi (Jira)
[ https://issues.redhat.com/browse/DROOLS-3402?page=com.atlassian.jira.plug... ]
Tibor Zimanyi closed DROOLS-3402.
---------------------------------
Resolution: Cannot Reproduce
> Encoding set in constructor not taking effect
> ---------------------------------------------
>
> Key: DROOLS-3402
> URL: https://issues.redhat.com/browse/DROOLS-3402
> Project: Drools
> Issue Type: Bug
> Affects Versions: 7.13.0.Final
> Reporter: Barnabás Kurucz
> Assignee: Tibor Zimanyi
> Priority: Major
>
> In my drl file, I'm using German characters such as Umlauts or ß. Thus, I am setting the encoding to UTF-8 with the overloaded constructor when creating the Resource for the Kie File System. However, after firing the rules on the inserted Fact Drools does not seem to apply the specified encoding. I insert the fact, and if the condition is true to that fact it should modify the Action1 (String) attribute of the fact to "Rückfrage" and return the modified fact. However, when I look at the retrieved bean's Action1 attribute I am seeing "Rückfrage" instead of "Rückfrage". I tried both UTF-8 and ISO-8859-1 encoding. Any ideas what's wrong?
> Drools 7.13
> *KieSessionGenerator*:
> public KieSessionGenerator() {
> KieServices kieServices = KieServices.Factory.get();
> KieFileSystem kieFileSystem = kieServices.newKieFileSystem();
> kieFileSystem.write(ResourceFactory.newClassPathResource(drlFile, "UTF-8"));
> KieBuilder kieBuilder = kieServices.newKieBuilder(kieFileSystem);
> kieBuilder.buildAll();
> KieModule kieModule = kieBuilder.getKieModule();
> KieContainer kieContainer = kieServices.newKieContainer(kieModule.getReleaseId());
> kieSession = kieContainer.newKieSession();
> }
> *Snippet from DRL:*
> rule "813"
> when
> $bean : Bean(longDesc == "Infektion")
> then
> $bean.setAction1("Rückfrage");
> end
> *Inserting the fact:*
> public Bean lookupBean(Bean bean) {
> kieSessionGenerator.getKieSession().insert(bean);
> kieSessionGenerator.getKieSession().fireAllRules();
> return bean;
> }
> UPDATE: After some further investigation it looks the issue can be reproduced only when the default system encoding is set to CP-1252.
> Since the system default was CP-1252, the JVM was running with that encoding and the KIE Resource also had used this encoding, even though I set UTF-8 in its conctructor.
> Once I changed the system default to UTF-8, the special characters (ä, etc.) were shown correctly.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months
[JBoss JIRA] (DROOLS-3402) Encoding set in constructor not taking effect
by Tibor Zimanyi (Jira)
[ https://issues.redhat.com/browse/DROOLS-3402?page=com.atlassian.jira.plug... ]
Tibor Zimanyi closed DROOLS-3402.
---------------------------------
Resolution: Done
> Encoding set in constructor not taking effect
> ---------------------------------------------
>
> Key: DROOLS-3402
> URL: https://issues.redhat.com/browse/DROOLS-3402
> Project: Drools
> Issue Type: Bug
> Affects Versions: 7.13.0.Final
> Reporter: Barnabás Kurucz
> Assignee: Tibor Zimanyi
> Priority: Major
>
> In my drl file, I'm using German characters such as Umlauts or ß. Thus, I am setting the encoding to UTF-8 with the overloaded constructor when creating the Resource for the Kie File System. However, after firing the rules on the inserted Fact Drools does not seem to apply the specified encoding. I insert the fact, and if the condition is true to that fact it should modify the Action1 (String) attribute of the fact to "Rückfrage" and return the modified fact. However, when I look at the retrieved bean's Action1 attribute I am seeing "Rückfrage" instead of "Rückfrage". I tried both UTF-8 and ISO-8859-1 encoding. Any ideas what's wrong?
> Drools 7.13
> *KieSessionGenerator*:
> public KieSessionGenerator() {
> KieServices kieServices = KieServices.Factory.get();
> KieFileSystem kieFileSystem = kieServices.newKieFileSystem();
> kieFileSystem.write(ResourceFactory.newClassPathResource(drlFile, "UTF-8"));
> KieBuilder kieBuilder = kieServices.newKieBuilder(kieFileSystem);
> kieBuilder.buildAll();
> KieModule kieModule = kieBuilder.getKieModule();
> KieContainer kieContainer = kieServices.newKieContainer(kieModule.getReleaseId());
> kieSession = kieContainer.newKieSession();
> }
> *Snippet from DRL:*
> rule "813"
> when
> $bean : Bean(longDesc == "Infektion")
> then
> $bean.setAction1("Rückfrage");
> end
> *Inserting the fact:*
> public Bean lookupBean(Bean bean) {
> kieSessionGenerator.getKieSession().insert(bean);
> kieSessionGenerator.getKieSession().fireAllRules();
> return bean;
> }
> UPDATE: After some further investigation it looks the issue can be reproduced only when the default system encoding is set to CP-1252.
> Since the system default was CP-1252, the JVM was running with that encoding and the KIE Resource also had used this encoding, even though I set UTF-8 in its conctructor.
> Once I changed the system default to UTF-8, the special characters (ä, etc.) were shown correctly.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months
[JBoss JIRA] (DROOLS-3402) Encoding set in constructor not taking effect
by Tibor Zimanyi (Jira)
[ https://issues.redhat.com/browse/DROOLS-3402?page=com.atlassian.jira.plug... ]
Tibor Zimanyi reopened DROOLS-3402:
-----------------------------------
> Encoding set in constructor not taking effect
> ---------------------------------------------
>
> Key: DROOLS-3402
> URL: https://issues.redhat.com/browse/DROOLS-3402
> Project: Drools
> Issue Type: Bug
> Affects Versions: 7.13.0.Final
> Reporter: Barnabás Kurucz
> Assignee: Tibor Zimanyi
> Priority: Major
>
> In my drl file, I'm using German characters such as Umlauts or ß. Thus, I am setting the encoding to UTF-8 with the overloaded constructor when creating the Resource for the Kie File System. However, after firing the rules on the inserted Fact Drools does not seem to apply the specified encoding. I insert the fact, and if the condition is true to that fact it should modify the Action1 (String) attribute of the fact to "Rückfrage" and return the modified fact. However, when I look at the retrieved bean's Action1 attribute I am seeing "Rückfrage" instead of "Rückfrage". I tried both UTF-8 and ISO-8859-1 encoding. Any ideas what's wrong?
> Drools 7.13
> *KieSessionGenerator*:
> public KieSessionGenerator() {
> KieServices kieServices = KieServices.Factory.get();
> KieFileSystem kieFileSystem = kieServices.newKieFileSystem();
> kieFileSystem.write(ResourceFactory.newClassPathResource(drlFile, "UTF-8"));
> KieBuilder kieBuilder = kieServices.newKieBuilder(kieFileSystem);
> kieBuilder.buildAll();
> KieModule kieModule = kieBuilder.getKieModule();
> KieContainer kieContainer = kieServices.newKieContainer(kieModule.getReleaseId());
> kieSession = kieContainer.newKieSession();
> }
> *Snippet from DRL:*
> rule "813"
> when
> $bean : Bean(longDesc == "Infektion")
> then
> $bean.setAction1("Rückfrage");
> end
> *Inserting the fact:*
> public Bean lookupBean(Bean bean) {
> kieSessionGenerator.getKieSession().insert(bean);
> kieSessionGenerator.getKieSession().fireAllRules();
> return bean;
> }
> UPDATE: After some further investigation it looks the issue can be reproduced only when the default system encoding is set to CP-1252.
> Since the system default was CP-1252, the JVM was running with that encoding and the KIE Resource also had used this encoding, even though I set UTF-8 in its conctructor.
> Once I changed the system default to UTF-8, the special characters (ä, etc.) were shown correctly.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months