[JBoss JIRA] (DROOLS-3337) ClassCastException while using SessionPseudoClock
by Mario Fusco (Jira)
[ https://issues.jboss.org/browse/DROOLS-3337?page=com.atlassian.jira.plugi... ]
Mario Fusco resolved DROOLS-3337.
---------------------------------
Resolution: Explained
You're creating the KieSession in the wrong way.
If you do
{code}
KieBase kbase = kieContainer.getKieBase("rules");
KieSession ksession = kbase.newKieSession(null, env);
{code}
the session is not under the control of the kiecontainer and then cannot take the conf in kmodule file. Conversely if you create the kiesession directly from the container like in:
{code}
KieSession ksession = kieContainer.newKieSession("ksession-rules", env);
{code}
then the session can be initialized with what defined in the kmodule file.
Note that your reproducer was wrong anyway because you missed to specify clockType="pseudo" in the kmodule.xml
> ClassCastException while using SessionPseudoClock
> -------------------------------------------------
>
> Key: DROOLS-3337
> URL: https://issues.jboss.org/browse/DROOLS-3337
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.1.0.Final
> Reporter: Bishnu Shankar Pandey
> Assignee: Mario Fusco
> Priority: Major
> Attachments: RuleEngineTest (2).zip
>
>
> I am using 6.1.0.Final version of Drool. I am getting
> {code:java}
> java.lang.ClassCastException: org.drools.core.time.impl.JDKTimerService cannot be cast to org.drools.core.time.SessionPseudoClock
> {code}
> exception when I am trying to get session clock from the KieSession.
> I am using Persistence and getting the KieSession using this
> {code:java}
> val kieSession = kieServices.getStoreServices.newKieSession(kiebase,null,environment);
> {code}
> My kmodule.xml is:
> {code:java}
> <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
> <kbase name="rules" packages="rules" eventProcessingMode="stream">
> <ksession name="ksession-rules" clockType="pseudo"/>
> </kbase>
> </kmodule>
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 8 months
[JBoss JIRA] (DROOLS-3337) ClassCastException while using SessionPseudoClock
by Mario Fusco (Jira)
[ https://issues.jboss.org/browse/DROOLS-3337?page=com.atlassian.jira.plugi... ]
Mario Fusco updated DROOLS-3337:
--------------------------------
Security: (was: Red Hat Internal)
> ClassCastException while using SessionPseudoClock
> -------------------------------------------------
>
> Key: DROOLS-3337
> URL: https://issues.jboss.org/browse/DROOLS-3337
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.1.0.Final
> Reporter: Bishnu Shankar Pandey
> Assignee: Mario Fusco
> Priority: Major
> Attachments: RuleEngineTest (2).zip
>
>
> I am using 6.1.0.Final version of Drool. I am getting
> {code:java}
> java.lang.ClassCastException: org.drools.core.time.impl.JDKTimerService cannot be cast to org.drools.core.time.SessionPseudoClock
> {code}
> exception when I am trying to get session clock from the KieSession.
> I am using Persistence and getting the KieSession using this
> {code:java}
> val kieSession = kieServices.getStoreServices.newKieSession(kiebase,null,environment);
> {code}
> My kmodule.xml is:
> {code:java}
> <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
> <kbase name="rules" packages="rules" eventProcessingMode="stream">
> <ksession name="ksession-rules" clockType="pseudo"/>
> </kbase>
> </kmodule>
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 8 months
[JBoss JIRA] (DROOLS-3237) Using -DgenerateModel=YES skips resources compilation check
by Luca Molteni (Jira)
[ https://issues.jboss.org/browse/DROOLS-3237?page=com.atlassian.jira.plugi... ]
Luca Molteni resolved DROOLS-3237.
----------------------------------
Resolution: Done
> Using -DgenerateModel=YES skips resources compilation check
> -----------------------------------------------------------
>
> Key: DROOLS-3237
> URL: https://issues.jboss.org/browse/DROOLS-3237
> Project: Drools
> Issue Type: Bug
> Components: tools
> Reporter: Matteo Mortari
> Assignee: Luca Molteni
> Priority: Major
>
> Usually the standard kie-maven-plugin mojo compiles any Drools resource at compile time in order to check for errors.
> Using -DgenerateModel=YES instead generate the exec model, but skips resource compilation.
> To replicate:
> introduce a Drools resource which does NOT compile in the KJAR. Without the flag, it fail maven compilation. With the flag, maven compilation succeeds.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 8 months
[JBoss JIRA] (DROOLS-3347) Implement Undo/Redo
by Gabriele Cardosi (Jira)
[ https://issues.jboss.org/browse/DROOLS-3347?page=com.atlassian.jira.plugi... ]
Gabriele Cardosi updated DROOLS-3347:
-------------------------------------
Sprint: (was: 2018 Week 45-47)
> Implement Undo/Redo
> -------------------
>
> Key: DROOLS-3347
> URL: https://issues.jboss.org/browse/DROOLS-3347
> Project: Drools
> Issue Type: Enhancement
> Components: Scenario Simulation and Testing
> Reporter: Gabriele Cardosi
> Assignee: Gabriele Cardosi
> Priority: Major
>
> Provide actual implementation of undo/redo.
> Step:
> 1) verify that all model modification happen through commands (check "flush" methods inside grid cells and other access to model)
> 2) implement columns size persistence inside backend model (wrap simulation inside another object to store dimension size)
> 3) implement actual undo/redo
> 4) add Undo/Redo buttons
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 8 months
[JBoss JIRA] (DROOLS-3348) Support Compiled Feel Expression in the kie-maven-plugin
by Luca Molteni (Jira)
Luca Molteni created DROOLS-3348:
------------------------------------
Summary: Support Compiled Feel Expression in the kie-maven-plugin
Key: DROOLS-3348
URL: https://issues.jboss.org/browse/DROOLS-3348
Project: Drools
Issue Type: Enhancement
Components: executable model
Reporter: Luca Molteni
Assignee: Luca Molteni
Currently the kie-maven-plugin avoid generating and compiles FEELExpression from DMN such as
```
import static org.kie.dmn.feel.codegen.feel11.CompiledFEELSemanticMappings.*;
import org.kie.dmn.feel.codegen.feel11.CompiledCustomFEELFunction;
import org.kie.dmn.feel.codegen.feel11.CompiledFEELExpression;
import org.kie.dmn.feel.codegen.feel11.CompiledFEELSupport;
import org.kie.dmn.feel.lang.EvaluationContext;
public class TemplateCompiledFEELExpression implements CompiledFEELExpression {
/**
* FEEL: 20
*/
@Override
public Object apply(EvaluationContext feelExprCtx) {
return K_20;
}
public static final java.math.BigDecimal K_20 = new java.math.BigDecimal(20, java.math.MathContext.DECIMAL128);
}
```
These are jitted at runtime.
We could compile them in kjar to have a faster runtime
Poker: 5
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 8 months