[JBoss JIRA] (DROOLS-2133) Rule Unit unbind using `run` causes wrong lookup of DS on the wrong unit
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-2133?page=com.atlassian.jira.plugi... ]
Mario Fusco updated DROOLS-2133:
--------------------------------
Sprint: 2018 Week 39-41
> Rule Unit unbind using `run` causes wrong lookup of DS on the wrong unit
> ------------------------------------------------------------------------
>
> Key: DROOLS-2133
> URL: https://issues.jboss.org/browse/DROOLS-2133
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Reporter: Matteo Mortari
> Assignee: Mario Fusco
>
> Please reference test {{testGuardAndRunBack}}
> {code:java}
> public static class MainHouseUnit implements RuleUnit {
> private DataSource<Date> now;
> private DataSource<String> part;
> private DataSource<Boolean> switch1;
> public MainHouseUnit() {
> super();
> }
> public DataSource<Date> getNow() {
> return now;
> }
> public DataSource<String> getPart() {
> return part;
> }
> public DataSource<Boolean> getSwitch1() {
> return switch1;
> }
> }
> public static class DayPartUnit implements RuleUnit {
> private DataSource<Date> now;
> private DataSource<Date> aScopedDS;
> private DataSource<String> part;
> public DayPartUnit() {
> super();
> }
> public DataSource<Date> getNow() {
> return now;
> }
> public DataSource<String> getPart() {
> return part;
> }
> public DataSource<Date> getaScopedDS() {
> return aScopedDS;
> }
> }
> public static class SwitchUnit implements RuleUnit {
> private DataSource<String> part;
> private DataSource<Boolean> switch1;
> public SwitchUnit() {
> super();
> }
> public DataSource<String> getPart() {
> return part;
> }
> public DataSource<Boolean> getSwitch1() {
> return switch1;
> }
> }
> private KieBase kieBaseMainGuardSubunitRunBackToMain(boolean currentStyle) {
> // use "hammer" approach with external multiple call to fire, or "drools.run()" approach in rules.
> System.out.println("Running with style: " + currentStyle);
> String drl1 = "package org.drools.compiler.integrationtests\n" +
> "unit " + getCanonicalSimpleName(MainHouseUnit.class) + "\n" +
> "import " + DayPartUnit.class.getCanonicalName() + "\n" +
> "import " + SwitchUnit.class.getCanonicalName() + "\n" +
> "rule GuardDayPartUnit when\n" +
> " Object() from now \n" +
> " not( String() from part ) \n" +
> "then\n" +
> " System.out.println(\"Guarding DayPartUnit\");\n" +
> " drools.guard(DayPartUnit.class);\n" +
> "end\n" +
> "rule GuardSwitchUnit when\n" +
> " String() from part \n" +
> " not( Boolean() from switch1 ) \n" +
> "then\n" +
> " System.out.println(\"Guarding SwitchUnit\");\n" +
> " drools.guard(SwitchUnit.class);\n" +
> "end\n";
> String drl2 = "package org.drools.compiler.integrationtests\n" +
> "unit " + getCanonicalSimpleName(DayPartUnit.class) + "\n" +
> "import " + MainHouseUnit.class.getCanonicalName() + "\n" +
> "rule doDayPartUnit when\n" +
> " $n : Object() from now \n" +
> "then\n" +
> " System.out.println(\"Inside DayPartUnit: \"+$n);\n" +
> " part.insert(\"Morning\");\n" +
> (currentStyle ? "//" : "") + " drools.run(MainHouseUnit.class);\n" +
> "end\n";
> String drl3 = "package org.drools.compiler.integrationtests\n" +
> "unit " + getCanonicalSimpleName(SwitchUnit.class) + "\n" +
> "import " + MainHouseUnit.class.getCanonicalName() + "\n" +
> "rule doSwitchUnit when\n" +
> " $n : String() from part \n" +
> "then\n" +
> " System.out.println(\"Inside SwitchUnit: \"+$n);\n" +
> " switch1.insert(true);\n" +
> (currentStyle ? "//" : "") + " drools.run(MainHouseUnit.class);\n" +
> "end\n";
> KieBase kbase = new KieHelper().addContent(drl1, ResourceType.DRL)
> .addContent(drl2, ResourceType.DRL)
> .addContent(drl3, ResourceType.DRL)
> .build();
> return kbase;
> }
> @Test
> public void testMainGuardSubunitRunBackToMain_usingHammerStyle() throws Exception {
> KieBase kbase = kieBaseMainGuardSubunitRunBackToMain(true);
> RuleUnitExecutor executor = RuleUnitExecutor.create().bind(kbase);
> executor.newDataSource("now", LocalDateTime.now());
> executor.newDataSource("part");
> executor.newDataSource("aScopedDS");
> DataSource<Boolean> switch1 = executor.newDataSource("switch1");
> RuleUnit adultUnit = new MainHouseUnit();
> executor.run(adultUnit);
> // need a second, "hammer" run.
> executor.run(adultUnit);
> assertEquals(true, switch1.iterator().next());
> }
> @Test
> public void testMainGuardSubunitRunBackToMain_usingRunStyle() throws Exception {
> KieBase kbase = kieBaseMainGuardSubunitRunBackToMain(false);
> RuleUnitExecutor executor = RuleUnitExecutor.create().bind(kbase);
> executor.newDataSource("now", LocalDateTime.now());
> executor.newDataSource("part");
> executor.newDataSource("aScopedDS");
> DataSource<Boolean> switch1 = executor.newDataSource("switch1");
> RuleUnit adultUnit = new MainHouseUnit();
> executor.run(adultUnit); // FAILs with trying to lookup method getaScopedDS() on the MainHouseUnit (which is not correct unit).
> // does NOT need a second, "hammer" run.
> assertEquals(true, switch1.iterator().next());
> }
> public static class EmptyUnit implements RuleUnit {
> public EmptyUnit() {
> // no-args constructor.
> }
> }
> public static class StringDSUnit implements RuleUnit {
> private DataSource<String> strings;
> public StringDSUnit() {
> // no-args constructor.
> }
> public DataSource<String> getStrings() {
> return strings;
> }
> }
> @Test
> public void testGuardAndRunBack() {
> String drl1 = "package org.drools.compiler.integrationtests\n" +
> "unit " + getCanonicalSimpleName(EmptyUnit.class) + "\n" +
> "import " + StringDSUnit.class.getCanonicalName() + "\n" +
> "rule RGuard when\n" +
> "then\n" +
> " System.out.println(\"Guarding StringDSUnit\");\n" +
> " drools.guard(StringDSUnit.class);\n" +
> "end\n";
> String drl2 = "package org.drools.compiler.integrationtests\n" +
> "unit " + getCanonicalSimpleName(StringDSUnit.class) + "\n" +
> "import " + EmptyUnit.class.getCanonicalName() + "\n" +
> "rule RGoBack when\n" +
> "then\n" +
> " System.out.println(\"Inside StringDSUnit: \");\n" +
> " drools.run(EmptyUnit.class);\n" +
> "end\n";
> KieBase kbase = new KieHelper().addContent(drl1, ResourceType.DRL)
> .addContent(drl2, ResourceType.DRL)
> .build();
> RuleUnitExecutor executor = RuleUnitExecutor.create().bind(kbase);
> executor.newDataSource("strings", "abc", "xyz");
> RuleUnit adultUnit = new EmptyUnit();
> executor.run(adultUnit); // FAILs with trying to lookup method getStrings() on the EmptyUnit (which is not correct unit).
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 10 months
[JBoss JIRA] (DROOLS-2997) [DMN Designer] Add support for DMN v1.2
by Michael Anstis (JIRA)
Michael Anstis created DROOLS-2997:
--------------------------------------
Summary: [DMN Designer] Add support for DMN v1.2
Key: DROOLS-2997
URL: https://issues.jboss.org/browse/DROOLS-2997
Project: Drools
Issue Type: Epic
Components: DMN Editor
Affects Versions: 7.11.0.Final
Reporter: Michael Anstis
Assignee: Michael Anstis
Priority: Critical
The DMN Editor needs to support DMN v1.2
This requires enhancements to the marshalling and UI.
More specifically we need both to support DMN v1.1 and v1.2 models and restrict the operations that can be performed by the User in the editor when handling a v1.1 model (the editor needs to support v1.2 operations).
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 10 months
[JBoss JIRA] (DROOLS-1669) NullPointerException in FlatQueryResults.<init> ("left join" query)
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1669?page=com.atlassian.jira.plugi... ]
Mario Fusco updated DROOLS-1669:
--------------------------------
Sprint: 2018 Week 39-41
> NullPointerException in FlatQueryResults.<init> ("left join" query)
> -------------------------------------------------------------------
>
> Key: DROOLS-1669
> URL: https://issues.jboss.org/browse/DROOLS-1669
> Project: Drools
> Issue Type: Bug
> Components: core engine, kie server
> Affects Versions: 6.5.0.Final
> Environment: Win7 x64, Tomcat 9, workbench-built DRL, managed KIE Server execution
> Reporter: Russell Morrisey
> Assignee: Mario Fusco
>
> The following DRL query passes build and validation in the workbench, but fails at runtime in KIE Server:
> {code:java}
> query "questionsKnowledge" ()
> $question: Question()
> $visible: QuestionVisible(question == $question) or not QuestionVisible(question == $question)
> end
> {code}
> The intent is that $visible may or may not be bound, depending on whether QuestionVisible is present. It looks like this causes an error in FlatQueryResults.(init):
> {code:java}
> 15:59:30.897 ERROR o.k.s.s.d.DroolsKieContainerCommandServiceImpl - Error calling container 'qna2'
> java.lang.NullPointerException: null
> at org.drools.core.QueryResultsRowImpl.getFactHandle(QueryResultsRowImpl.java:99) ~[drools-core-6.5.0.Final.jar:6.5.0.Final]
> at org.drools.core.QueryResultsRowImpl.getFactHandle(QueryResultsRowImpl.java:95) ~[drools-core-6.5.0.Final.jar:6.5.0.Final]
> at org.drools.core.runtime.rule.impl.FlatQueryResults.<init>(FlatQueryResults.java:116) ~[drools-core-6.5.0.Final.jar:6.5.0.Final]
> at org.drools.core.command.runtime.rule.QueryCommand.execute(QueryCommand.java:109) ~[drools-core-6.5.0.Final.jar:6.5.0.Final]
> at org.drools.core.command.runtime.rule.QueryCommand.execute(QueryCommand.java:39) ~[drools-core-6.5.0.Final.jar:6.5.0.Final]
> at org.drools.core.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:137) ~[drools-core-6.5.0.Final.jar:6.5.0.Final]
> at org.drools.core.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:51) ~[drools-core-6.5.0.Final.jar:6.5.0.Final]
> at org.drools.core.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:254) ~[drools-core-6.5.0.Final.jar:6.5.0.Final]
> at org.kie.server.services.drools.RulesExecutionService.call(RulesExecutionService.java:52) ~[kie-server-services-drools-6.5.0.Final.jar:6.5.0.Final]
> at org.kie.server.services.drools.DroolsKieContainerCommandServiceImpl.callContainer(DroolsKieContainerCommandServiceImpl.java:69) ~[kie-server-services-drools-6.5.0.Final.jar:6.5.0.Final
> ]
> at org.kie.server.remote.rest.drools.CommandResource.manageContainer(CommandResource.java:72) [kie-server-rest-drools-6.5.0.Final.jar:6.5.0.Final]
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 10 months
[JBoss JIRA] (DROOLS-1409) Infinite loop when using maps
by mourad ouachani (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1409?page=com.atlassian.jira.plugi... ]
mourad ouachani commented on DROOLS-1409:
-----------------------------------------
Bonjour,
N'étant plus en mesure de répondre à votre demande, merci dâadresser
votre email à pbaroux(a)redhat.com
Cordialement.
-
Dear Sender,
I will not be able to respond to your query, please send an email to
pbaroux(a)redhat.com
Many thanks.
> Infinite loop when using maps
> -----------------------------
>
> Key: DROOLS-1409
> URL: https://issues.jboss.org/browse/DROOLS-1409
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.3.0.Final, 6.4.0.Final, 6.5.0.Final
> Environment: Windows/Linux /MacOs
> Reporter: mourad ouachani
> Assignee: Mario Fusco
> Attachments: engineMapBug.zip
>
>
> Infinite loop when using maps instead collections.
> The problem appears before the 10th iteration, however if you run it 10 times it could end properly without infinite loop.
>
> We thought it could be linked to the concurrent access to HashMap and we tried with concurrent HashMap but still got the same problem.
> It could be probably linked to the fact that we use maps not only to store the result of some rules evaluation but also as a functional way to prevent rule to be fired again (see rule "FLG1" and the condition "FLG1 not memberof matchMap"
> Thanks.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 10 months
[JBoss JIRA] (DROOLS-1409) Infinite loop when using maps
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1409?page=com.atlassian.jira.plugi... ]
Mario Fusco updated DROOLS-1409:
--------------------------------
Sprint: 2018 Week 39-41
> Infinite loop when using maps
> -----------------------------
>
> Key: DROOLS-1409
> URL: https://issues.jboss.org/browse/DROOLS-1409
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.3.0.Final, 6.4.0.Final, 6.5.0.Final
> Environment: Windows/Linux /MacOs
> Reporter: mourad ouachani
> Assignee: Mario Fusco
> Attachments: engineMapBug.zip
>
>
> Infinite loop when using maps instead collections.
> The problem appears before the 10th iteration, however if you run it 10 times it could end properly without infinite loop.
>
> We thought it could be linked to the concurrent access to HashMap and we tried with concurrent HashMap but still got the same problem.
> It could be probably linked to the fact that we use maps not only to store the result of some rules evaluation but also as a functional way to prevent rule to be fired again (see rule "FLG1" and the condition "FLG1 not memberof matchMap"
> Thanks.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 10 months
[JBoss JIRA] (DROOLS-1354) Drools PermGen OOM When create kiebulider several times
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1354?page=com.atlassian.jira.plugi... ]
Mario Fusco resolved DROOLS-1354.
---------------------------------
Resolution: Out of Date
> Drools PermGen OOM When create kiebulider several times
> -------------------------------------------------------
>
> Key: DROOLS-1354
> URL: https://issues.jboss.org/browse/DROOLS-1354
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.4.0.Final
> Environment: Windows7 Tomcat7 JDK1.7
> Reporter: Shukang Guo
> Assignee: Mario Fusco
>
> When i need updating the rule , first i will delete it from kieFileSystem , then add it .Second i will create a new KieBuilder and buildAll().But after several time i have done , it would be gone by PermGen OOM.
> {code:java}
> @Autowired
> private RuleService ruleService;
> private KieServices ks = KieServices.Factory.get();
> private KieFileSystem kFileSystem = ks.newKieFileSystem();
> private KieContainer kContainer;
> private KieBase kieBase;
> private KieBuilder kbuilder;
> private String defaultPath;
> /*
> * (non-Javadoc)
> */
> @Override
> @PostConstruct
> public void init() {
> List<Rule> rules = new ArrayList<>();
> rules.add(ruleService.selectById(15));
> // List<Rule> rules = ruleService.selectAll(0, 0);
> String[] paths = new String[rules.size()];
> for (int i = 0; i < paths.length; i++) {
> paths[i] = rules.get(i).getPath();
> }
> init(paths);
> }
> public void init(String[] paths) {
> boolean isSetDefaultPath = false;
> for (String path : paths) {
> if (isSetDefaultPath)
> kFileSystem
> .write(ks.getResources().newClassPathResource(path));
> else {
> Resource resource = ks.getResources().newClassPathResource(
> path);
> kFileSystem.write(resource);
> defaultPath = resource.getResourceType().getDefaultPath() + "/";
> isSetDefaultPath = true;
> }
> }
> kbuilder = ks.newKieBuilder(kFileSystem);
> kbuilder.buildAll();
> kContainer = ks.newKieContainer(ks.getRepository()
> .getDefaultReleaseId());
> kieBase = kContainer.getKieBase();
> }
> /*
> * (non-Javadoc)
> */
> public void refresh() {
> kbuilder = ks.newKieBuilder(kFileSystem);
> kbuilder.buildAll();
> kContainer.updateToVersion(ks.getRepository().getDefaultReleaseId());
> }
> /*
> * (non-Javadoc)
> */
> @Override
> public KieSession getKieSession() {
> return kieBase.newKieSession();
> }
> @Override
> public void add(String path) {
> kFileSystem.write(ks.getResources().newClassPathResource(path));
> refresh();
> }
> @Override
> public void delete(String path) {
> kFileSystem.delete(defaultPath + path);
> refresh();
> }
> @Override
> public void update(String path) {
> kFileSystem.delete(defaultPath + path);
> kFileSystem.write(ks.getResources().newClassPathResource(path));
> refresh();
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 10 months
[JBoss JIRA] (DROOLS-2709) Revise and align visual presentation of tables (DMN, scenario, DT)
by Michael Anstis (JIRA)
[ https://issues.jboss.org/browse/DROOLS-2709?page=com.atlassian.jira.plugi... ]
Michael Anstis updated DROOLS-2709:
-----------------------------------
Sprint: (was: 2018 Week 39-41)
> Revise and align visual presentation of tables (DMN, scenario, DT)
> -------------------------------------------------------------------
>
> Key: DROOLS-2709
> URL: https://issues.jboss.org/browse/DROOLS-2709
> Project: Drools
> Issue Type: Enhancement
> Components: DMN Editor, Scenario Simulation and Testing, Test Scenarios Editor
> Reporter: Liz Clayton
> Assignee: Michael Anstis
> Labels: UX, UXTeam, VisualDesign, drools-tools
>
> As a practitioner I need a clear and consistent presentation of table styles, so that I can learn the visual cues once for all tables in the application suite.
> When possible, iteratively update visual styles for tables using the following proposed options: https://redhat.invisionapp.com/share/RXLG7XB2TCW
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 10 months
[JBoss JIRA] (DROOLS-2804) [DMN Designer] Properties Panel to drill-down to DMN component level
by Michael Anstis (JIRA)
[ https://issues.jboss.org/browse/DROOLS-2804?page=com.atlassian.jira.plugi... ]
Michael Anstis updated DROOLS-2804:
-----------------------------------
Sprint: 2018 Week 39-41
> [DMN Designer] Properties Panel to drill-down to DMN component level
> --------------------------------------------------------------------
>
> Key: DROOLS-2804
> URL: https://issues.jboss.org/browse/DROOLS-2804
> Project: Drools
> Issue Type: Feature Request
> Components: DMN Editor
> Reporter: Michael Anstis
> Assignee: Michael Anstis
> Priority: Critical
> Labels: drools-tools
>
> The Properties Panel currently shows properties for Stunner-level "graph" components.
> We need, for DMN, the Properties Panel to show the properties of DMN elements' properties at the "grid" level. For example, when a {{Context}} is selected the Properties Panel should show only the top level properties for the {{Context}} (i.e. not those of its {{ContextEntries}}). Selection of a {{ContextEntry}} should refresh the Properties Panel to show only the top-level properties of the {{ContextEntry}}. Selection of the {{ContextEntry}}'s {{Expression}} should again refresh the Properties Panel to show only the top-level properties of the {{Expression}} and so forth.
> h2. Properties on the Grid Level
> The selection on the grid level should show the properties below. Please notice that selection of multiple cells, rows or columns should show empty properties panel.
> h3. Literal expression
> ||Selected item||Properties panel items||
> |Cell|(?)|
> h3. Context
> ||Selected item||Properties panel items||
> |Row|(?)|
> |Column|(?)|
> |Cell|(?)|
> h3. Decision Table
> ||Selected item||Properties panel items||
> |Row|(?)|
> |Column|(?)|
> |Cell|(?)|
> h3. Relation
> ||Selected item||Properties panel items||
> |Row|(?)|
> |Column|(?)|
> |Cell|(?)|
> h3. Function
> ||Selected item||Properties panel items||
> |Row|(?)|
> |Column|(?)|
> |Cell|(?)|
> h3. Invocation
> ||Selected item||Properties panel items||
> |Row|(?)|
> |Column|(?)|
> |Cell|(?)|
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 10 months