[Red Hat JIRA] (DROOLS-5921) Declared type fields implicit default values
by Toshiya Kobayashi (Jira)
[ https://issues.redhat.com/browse/DROOLS-5921?page=com.atlassian.jira.plug... ]
Toshiya Kobayashi updated DROOLS-5921:
--------------------------------------
Description:
When we define a declared type and omit field default values, default values will be given implicitly. The values differ between standard-drl and executable-model.
{code:java}
@Test
public void testDefaultValues() throws Exception {
String str =
"package org.test;\n" +
"declare MyFact\n" +
" stringValue : String\n" +
" intValue : Integer\n" +
" booleanValue : Boolean\n" +
"end\n" +
"rule R when\n" +
" MyFact( )\n" +
"then\n" +
"end";
KieSession ksession = getKieSession(str);
FactType factType = ksession.getKieBase().getFactType("org.test", "MyFact");
Object factInstance = factType.newInstance();
System.out.println(factInstance);
}
{code}
{noformat}
STANDARD_FROM_DRL : MyFact( stringValue=null, intValue=0, booleanValue=false )
FLOW_DSL : MyFact( stringValue=null, intValue=null, booleanValue=null )
PATTERN_DSL : MyFact( stringValue=null, intValue=null, booleanValue=null )
{noformat}
standard-drl seems to intentionally set the values to meet primitives' default values but probably "null" is the better default.
https://github.com/kiegroup/drools/blob/master/drools-core/src/main/java/...
https://github.com/kiegroup/drools/blob/master/drools-core/src/main/java/...
Also we need to consider backward compatibility.
Note: You can work around this issue by explicitly setting default values.
{noformat}
declare MyFact
strValue: java.lang.String = null
intValue: java.lang.Integer = null
booleanValue: java.lang.Boolean = null
end
{noformat}
was:
When we define a declared type and omit field default values, default values will be given implicitly. The values differ between standard-drl and executable-model.
{code:java}
@Test
public void testDefaultValues() throws Exception {
String str =
"package org.test;\n" +
"declare MyFact\n" +
" stringValue : String\n" +
" intValue : Integer\n" +
" booleanValue : Boolean\n" +
"end\n" +
"rule R when\n" +
" MyFact( )\n" +
"then\n" +
"end";
KieSession ksession = getKieSession(str);
FactType factType = ksession.getKieBase().getFactType("org.test", "MyFact");
Object factInstance = factType.newInstance();
System.out.println(factInstance);
}
{code}
{noformat}
STANDARD_FROM_DRL : MyFact( stringValue=null, intValue=0, booleanValue=false )
FLOW_DSL : MyFact( stringValue=null, intValue=null, booleanValue=null )
PATTERN_DSL : MyFact( stringValue=null, intValue=null, booleanValue=null )
{noformat}
standard-drl seems to intentionally set the values to meet primitives' default values but probably "null" is the better default value.
https://github.com/kiegroup/drools/blob/master/drools-core/src/main/java/...
https://github.com/kiegroup/drools/blob/master/drools-core/src/main/java/...
Also we need to consider backward compatibility.
Note: You can work around this issue by explicitly setting default values.
{noformat}
declare MyFact
strValue: java.lang.String = null
intValue: java.lang.Integer = null
booleanValue: java.lang.Boolean = null
end
{noformat}
> Declared type fields implicit default values
> --------------------------------------------
>
> Key: DROOLS-5921
> URL: https://issues.redhat.com/browse/DROOLS-5921
> Project: Drools
> Issue Type: Task
> Components: core engine, executable model
> Affects Versions: 7.47.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Toshiya Kobayashi
> Priority: Major
>
> When we define a declared type and omit field default values, default values will be given implicitly. The values differ between standard-drl and executable-model.
> {code:java}
> @Test
> public void testDefaultValues() throws Exception {
> String str =
> "package org.test;\n" +
> "declare MyFact\n" +
> " stringValue : String\n" +
> " intValue : Integer\n" +
> " booleanValue : Boolean\n" +
> "end\n" +
> "rule R when\n" +
> " MyFact( )\n" +
> "then\n" +
> "end";
> KieSession ksession = getKieSession(str);
> FactType factType = ksession.getKieBase().getFactType("org.test", "MyFact");
> Object factInstance = factType.newInstance();
> System.out.println(factInstance);
> }
> {code}
> {noformat}
> STANDARD_FROM_DRL : MyFact( stringValue=null, intValue=0, booleanValue=false )
> FLOW_DSL : MyFact( stringValue=null, intValue=null, booleanValue=null )
> PATTERN_DSL : MyFact( stringValue=null, intValue=null, booleanValue=null )
> {noformat}
> standard-drl seems to intentionally set the values to meet primitives' default values but probably "null" is the better default.
> https://github.com/kiegroup/drools/blob/master/drools-core/src/main/java/...
> https://github.com/kiegroup/drools/blob/master/drools-core/src/main/java/...
> Also we need to consider backward compatibility.
> Note: You can work around this issue by explicitly setting default values.
> {noformat}
> declare MyFact
> strValue: java.lang.String = null
> intValue: java.lang.Integer = null
> booleanValue: java.lang.Boolean = null
> end
> {noformat}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
2 years, 11 months
[Red Hat JIRA] (DROOLS-5921) Declared type fields implicit default values
by Toshiya Kobayashi (Jira)
Toshiya Kobayashi created DROOLS-5921:
-----------------------------------------
Summary: Declared type fields implicit default values
Key: DROOLS-5921
URL: https://issues.redhat.com/browse/DROOLS-5921
Project: Drools
Issue Type: Task
Components: core engine, executable model
Affects Versions: 7.47.0.Final
Reporter: Toshiya Kobayashi
Assignee: Toshiya Kobayashi
When we define a declared type and omit field default values, default values will be given implicitly. The values differ between standard-drl and executable-model.
{code:java}
@Test
public void testDefaultValues() throws Exception {
String str =
"package org.test;\n" +
"declare MyFact\n" +
" stringValue : String\n" +
" intValue : Integer\n" +
" booleanValue : Boolean\n" +
"end\n" +
"rule R when\n" +
" MyFact( )\n" +
"then\n" +
"end";
KieSession ksession = getKieSession(str);
FactType factType = ksession.getKieBase().getFactType("org.test", "MyFact");
Object factInstance = factType.newInstance();
System.out.println(factInstance);
}
{code}
{noformat}
STANDARD_FROM_DRL : MyFact( stringValue=null, intValue=0, booleanValue=false )
FLOW_DSL : MyFact( stringValue=null, intValue=null, booleanValue=null )
PATTERN_DSL : MyFact( stringValue=null, intValue=null, booleanValue=null )
{noformat}
standard-drl seems to intentionally set the values to meet primitives' default values but probably "null" is the better default value.
https://github.com/kiegroup/drools/blob/master/drools-core/src/main/java/...
https://github.com/kiegroup/drools/blob/master/drools-core/src/main/java/...
Also we need to consider backward compatibility.
Note: You can work around this issue by explicitly setting default values.
{noformat}
declare MyFact
strValue: java.lang.String = null
intValue: java.lang.Integer = null
booleanValue: java.lang.Boolean = null
end
{noformat}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
2 years, 11 months
[Red Hat JIRA] (DROOLS-5919) KieServiceImpl is not exposing getter for kContainers map.
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-5919?page=com.atlassian.jira.plug... ]
Mario Fusco updated DROOLS-5919:
--------------------------------
Sprint: 2020 Week 52-03 (from Dec 21)
> KieServiceImpl is not exposing getter for kContainers map.
> -----------------------------------------------------------
>
> Key: DROOLS-5919
> URL: https://issues.redhat.com/browse/DROOLS-5919
> Project: Drools
> Issue Type: Enhancement
> Components: core engine
> Reporter: Tomasz Maciejewski
> Assignee: Mario Fusco
> Priority: Major
>
> KieServiceImpl is not exposing getter for kContainers map.
> The scenario description:
> 1) Client application creates kieContainers (not classpathKContainer)
> 2) Client application wants to update kieContainer to the new version with updateToVersion
> 3) Currently it seems like there is *no* getter method exposed to retrieve an entry from kContainers map by containerId, same like getKieClasspathContainer for the classpathKContainer
>
> Proposed solution (KieServiceImpl class):
> _public KieContainer getKieContainer(String containerId) {_
> _return kContainers.get(containerId);_
> _}_
>
> Is there any reason it is not exposed or it is possible to find it somewhere else?
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
2 years, 11 months
[Red Hat JIRA] (DROOLS-5920) Wrong BetaIndex offset with Or in executable-model
by Toshiya Kobayashi (Jira)
Toshiya Kobayashi created DROOLS-5920:
-----------------------------------------
Summary: Wrong BetaIndex offset with Or in executable-model
Key: DROOLS-5920
URL: https://issues.redhat.com/browse/DROOLS-5920
Project: Drools
Issue Type: Bug
Components: executable model
Affects Versions: 7.47.0.Final
Reporter: Toshiya Kobayashi
Assignee: Toshiya Kobayashi
Fix for DROOLS-5916 was not enough. LambdaConstraint.indexingDeclaration needs to be updated when an original Declaration is replaced. If not, betaIndex uses a wrong offset to retrieve a fact from a tuple.
This rule can reproduce the offset problem.
{noformat}
import org.drools.modelcompiler.domain.Person;rule R when
$e : Person(name == "Edson")
$p : Person(name == "Mark") or
( $mark : Person(name == "Mark")
and
$p : Person(age == $mark.age) )
$s: String(this == $p.name)
then
System.out.println("Found: " + $s);
end
{noformat}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
2 years, 11 months
[Red Hat JIRA] (DROOLS-5919) KieServiceImpl is not exposing getter for kContainers map.
by Tomasz Maciejewski (Jira)
Tomasz Maciejewski created DROOLS-5919:
------------------------------------------
Summary: KieServiceImpl is not exposing getter for kContainers map.
Key: DROOLS-5919
URL: https://issues.redhat.com/browse/DROOLS-5919
Project: Drools
Issue Type: Enhancement
Components: core engine
Reporter: Tomasz Maciejewski
Assignee: Mario Fusco
KieServiceImpl is not exposing getter for kContainers map.
The scenario description:
1) Client application creates kieContainers (not classpathKContainer)
2) Client application wants to update kieContainer to the new version with updateToVersion
3) Currently it seems like there is *no* getter method exposed to retrieve an entry from kContainers map by containerId, same like getKieClasspathContainer for the classpathKContainer
Proposed solution (KieServiceImpl class):
_public KieContainer getKieContainer(String containerId) {_
_return kContainers.get(containerId);_
_}_
Is there any reason it is not exposed or it is possible to find it somewhere else?
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
2 years, 11 months
[Red Hat JIRA] (DROOLS-5778) Rule evaluation optimization : alpha node range index additional enhancements
by Kris Verlaenen (Jira)
[ https://issues.redhat.com/browse/DROOLS-5778?page=com.atlassian.jira.plug... ]
Kris Verlaenen updated DROOLS-5778:
-----------------------------------
Sprint: 2020 Week 46-48 (from Nov 9), 2020 Week 49-51 (from Nov 30), 2020 Week 52-03 (from Dec 21) (was: 2020 Week 46-48 (from Nov 9), 2020 Week 49-51 (from Nov 30))
> Rule evaluation optimization : alpha node range index additional enhancements
> -----------------------------------------------------------------------------
>
> Key: DROOLS-5778
> URL: https://issues.redhat.com/browse/DROOLS-5778
> Project: Drools
> Issue Type: Story
> Components: core engine
> Affects Versions: 7.45.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Toshiya Kobayashi
> Priority: Major
>
> Motivation: This Story follows up DROOLS-5631 to embrace additional enhancements related to alpha node range index.
> Goals: Better rule execution performance.
> Impact: Better rule execution performance. It might have slight overhead during rule build time.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
2 years, 11 months
[Red Hat JIRA] (DROOLS-5724) Fix DMN-PMML integration
by Kris Verlaenen (Jira)
[ https://issues.redhat.com/browse/DROOLS-5724?page=com.atlassian.jira.plug... ]
Kris Verlaenen updated DROOLS-5724:
-----------------------------------
Sprint: 2020 Week 46-48 (from Nov 9), 2020 Week 49-51 (from Nov 30), 2020 Week 52-03 (from Dec 21) (was: 2020 Week 46-48 (from Nov 9), 2020 Week 49-51 (from Nov 30))
> Fix DMN-PMML integration
> ------------------------
>
> Key: DROOLS-5724
> URL: https://issues.redhat.com/browse/DROOLS-5724
> Project: Drools
> Issue Type: Task
> Reporter: Gabriele Cardosi
> Assignee: Matteo Mortari
> Priority: Critical
> Labels: TrustyAI
>
> To have Trusty-PMML working withouth MVEL (i.e. drools-7.45) a fix has been made.
> Unfortunately, that modification broke DMN-PMML integration inside drools.
> -A very quick and dirty solution has been to-
> -1) expose the-
> -DMNRuntimeKB runtimeKB inside DMNRuntimeImpl-
> -2) based on the actual class at runtime, if it is "DMNRuntimeKBWrappingIKB" use a code patch the works in drools, otherwise the "kogito" one.-
> -This has been done only for extreme needs, but must be redisigned and properly implemented ASAP-
> The root cause of that is DMN ignoring the Kogito API.
> Kogito defines a _container_ class (org.kie.kogito.app.Application) that is meant to be used by all components (processes, ruleunits, decisions and predictions) to invoke the others.
> Trusty PMML fullfill this API, exposing predictive models throught the the
> {code:java}
> org.kie.kogito.app.PredictionModels.getPredictionModel(String modelName)
> {code}
> but since DMNKogito completely ignore this, a painful workaround has been needed to solve the issue.
> Instead of adding workarounds one on top of the other, a different approach on DMN side is required, respecting the constraints put by the containers.
> Having done that, the DMN-PMML integration would be automatically resolved.
> I'll be available for more explanation, if needed.
> [~evacchi] [~danielezonca] [~tirelli] FYI
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
2 years, 11 months