[JBoss JIRA] Created: (JBRULES-2432) TemplateDataListener.newCell filters out correctly blank values; this leads to incorrect template processing
by Denis Robert (JIRA)
TemplateDataListener.newCell filters out correctly blank values; this leads to incorrect template processing
------------------------------------------------------------------------------------------------------------
Key: JBRULES-2432
URL: https://jira.jboss.org/jira/browse/JBRULES-2432
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.0.1.FINAL
Environment: Any
Reporter: Denis Robert
Assignee: Mark Proctor
When using a DataProviderCompiler(), a blank column returned by the DataProvider causes an entire line to not be outputted in the result. I tracked this to a line in TemplateDataListener.newCell which explicitly filters out blank cells, even though such cells should be allowed.
The template I'm using is:
<snip>
template header
ruleID
object
field
regexp
replacement
package standardization
import [removed].*
template std_rule
rule "@{ruleID}"
dialect "mvel"
when
$o: @{object}()
then
$o.@{field} = $o.?(a){field}.replaceFirst("@{regexp}", "@{replacement}");
end
end template
<snip>
Whenever "replacement" is blank, the consequent does not get generated.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months
[JBoss JIRA] Created: (JBRULES-2453) Marshalling issue with not rules
by Kris Verlaenen (JIRA)
Marshalling issue with not rules
--------------------------------
Key: JBRULES-2453
URL: https://jira.jboss.org/jira/browse/JBRULES-2453
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.1.0.M1
Reporter: Kris Verlaenen
Assignee: Mark Proctor
Fix For: 5.1.0.M2
Issue with OutputMarshaller in specific case of Not rules:
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2786)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
at
java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1838)
at
java.io.ObjectOutputStream$BlockDataOutputStream.write(ObjectOutputStream.java:1769)
at java.io.DataOutputStream.writeInt(DataOutputStream.java:182)
at
java.io.ObjectOutputStream$BlockDataOutputStream.writeInt(ObjectOutputStream.java:1904)
at java.io.ObjectOutputStream.writeInt(ObjectOutputStream.java:769)
at
org.drools.marshalling.impl.OutputMarshaller.writeLeftTuple(OutputMarshaller.java:459)
at
org.drools.marshalling.impl.OutputMarshaller.writeInitialFactHandleLeftTuples(OutputMarshaller.java:356)
at
org.drools.marshalling.impl.OutputMarshaller.writeFactHandles(OutputMarshaller.java:251)
at
org.drools.marshalling.impl.OutputMarshaller.writeSession(OutputMarshaller.java:85)
at
org.drools.marshalling.impl.DefaultMarshaller.marshall(DefaultMarshaller.java:117)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months
[JBoss JIRA] Created: (JBRULES-2463) Deadlock between ResourceChangeNotifierImpl.subscribeResourceChangeListener and ResourceChangeScannerImpl.subscribeNotifier
by Andreas Kohn (JIRA)
Deadlock between ResourceChangeNotifierImpl.subscribeResourceChangeListener and ResourceChangeScannerImpl.subscribeNotifier
---------------------------------------------------------------------------------------------------------------------------
Key: JBRULES-2463
URL: https://jira.jboss.org/jira/browse/JBRULES-2463
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.0.1.FINAL
Reporter: Andreas Kohn
Assignee: Mark Proctor
This deadlock was found by our continouos integration system which is building drools using mvn.
Found one Java-level deadlock:
=============================
"Thread-42":
waiting to lock monitor 0x00002aaaf8f2e8d0 (object 0x00002aaab4645830, a java.util.HashMap),
which is held by "main"
"main":
waiting to lock monitor 0x00002aaaf4f3a028 (object 0x00002aaab46459b0, a java.util.HashMap),
which is held by "Thread-42"
Java stack information for the threads listed above:
===================================================
"Thread-42":
at org.drools.io.impl.ResourceChangeNotifierImpl.subscribeResourceChangeListener(ResourceChangeNotifierImpl.java:64)
- waiting to lock <0x00002aaab4645830> (a java.util.HashMap)
at org.drools.io.impl.ResourceChangeNotifierImpl.subscribeChildResource(ResourceChangeNotifierImpl.java:103)
at org.drools.io.impl.ResourceChangeScannerImpl.scan(ResourceChangeScannerImpl.java:128)
- locked <0x00002aaab46459b0> (a java.util.HashMap)
at org.drools.io.impl.ResourceChangeScannerImpl$ProcessChangeSet.run(ResourceChangeScannerImpl.java:276)
- locked <0x00002aaab46459b0> (a java.util.HashMap)
- locked <0x00002aaade2c97d8> (a org.drools.io.impl.ResourceChangeScannerImpl$ProcessChangeSet)
at java.lang.Thread.run(Thread.java:619)
"main":
at org.drools.io.impl.ResourceChangeScannerImpl.subscribeNotifier(ResourceChangeScannerImpl.java:64)
- waiting to lock <0x00002aaab46459b0> (a java.util.HashMap)
at org.drools.io.impl.ResourceChangeNotifierImpl.subscribeResourceChangeListener(ResourceChangeNotifierImpl.java:70)
- locked <0x00002aaab4645830> (a java.util.HashMap)
at org.drools.agent.impl.KnowledgeAgentImpl.processChangeSet(KnowledgeAgentImpl.java:150)
- locked <0x00002aaade2c9c18> (a java.util.HashMap)
at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:117)
- locked <0x00002aaade2c9c18> (a java.util.HashMap)
at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:109)
at org.drools.agent.KnowledgeAgentTest.testModifyDirectory(KnowledgeAgentTest.java:776)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Found 1 deadlock.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months
[JBoss JIRA] Created: (JBRULES-2457) Wrong evaluation of rules and PseudoClock NPE
by Vítor Moreira (JIRA)
Wrong evaluation of rules and PseudoClock NPE
---------------------------------------------
Key: JBRULES-2457
URL: https://jira.jboss.org/jira/browse/JBRULES-2457
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.1.0.M1, 5.0.1.FINAL
Environment: Windows 7, Eclipse 3.4, Java 1.6.0_u18, JUnit 4
Reporter: Vítor Moreira
Assignee: Mark Proctor
I've got a DRL file, having the following rules:
- offline event for 3 minutes withou any online event meanwhile => send an offline notification
- online event after offline event (within 3 minute range) => send an online notification
I've also got an junit test:
- insert offline event
- pseudoclock advances 2m50s
- insert online event
- pseudoclock advances 15s
- check if there's any notification
And the result of the junit is:
1) NPE when clock advances 15s
java.lang.NullPointerException
at org.drools.util.LinkedList.remove(LinkedList.java:113)
at org.drools.common.Scheduler$DuractionJob.execute(Scheduler.java:71)
at org.drools.time.impl.PseudoClockScheduler$ScheduledJob.call(PseudoClockScheduler.java:219)
at org.drools.time.impl.PseudoClockScheduler.runCallBacks(PseudoClockScheduler.java:168)
at org.drools.time.impl.PseudoClockScheduler.advanceTime(PseudoClockScheduler.java:130)
2) When checking for a notification, it should have one online notification but has on offline notification
At the bottom of this issue, there are snippets of junit code and drools rule file.
Probably, the problem relies on Junit initialization code.
T.I.A.
-- DRL file (snippet) --
dialect "java"
declare Event
@role( event )
@expires ( 7d )
end
global ISnmpNotifier snmpNotifier;
/*************************/
/* OFFLINE FOR 3 MINUTES */
/*************************/
rule "bit\dom - events offline (device offline for 3 minutes)"
when
$offline : Event( freeField == "101", $offlineLane : lane ) from entry-point "incoming"
not ( $online : Event (freeField == "102", lane == $offlineLane, this after [0s,3m] $offline ) from entry-point "incoming" )
then
snmpNotifier.send( new Notification("101", "offline") );
end
rule "bit\dom - events online (device offline for 3 minutes)"
when
$offline: Event( freeField == "101", $lane : lane ) from entry-point "incoming"
$online : Event( freeField == "102", lane == $lane, this after [3m] $offline ) from entry-point "incoming"
then
snmpNotifier.send( new Notification("102", "online") );
end
-- DRL file (snippet) --
-- JUnit code (snippet) --
package pt.brisa.sam.agent.rules.bit_dom;
import java.util.concurrent.TimeUnit;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseConfiguration;
import org.drools.KnowledgeBaseFactory;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.conf.EventProcessingOption;
import org.drools.io.ResourceFactory;
import org.drools.runtime.KnowledgeSessionConfiguration;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.conf.ClockTypeOption;
import org.drools.runtime.rule.WorkingMemoryEntryPoint;
import org.drools.time.impl.PseudoClockScheduler;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class Jira_Drools {
// values used to create test
private String offlineEventCode = "101";
private String onlineEventCode = "102";
private String device = "device";
// drools specific vars
private WorkingMemoryEntryPoint workingMemoryEntryPoint;
private PseudoClockScheduler clock = null;
private StatefulKnowledgeSession kSession;
/**
* SnmpNotificationEventCase.getNumberOfNotificationsByExample(example)
* .getNumberOfNotificationsByExample => from the notification queue, returns the number of notifications matching the given example
*/
private SnmpNotificationEventCase snmpNotificationEventCase;
@Before
public void droolsSetup() {
KnowledgeBaseConfiguration baseConfig;
KnowledgeSessionConfiguration sessionConfig;
KnowledgeBase kBase;
KnowledgeBuilder kBuilder;
baseConfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
baseConfig.setOption( EventProcessingOption.STREAM ); // Use stream mode
kBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kBuilder.add(ResourceFactory.newFileResource( "test.drl"), ResourceType.DRL);
kBase = KnowledgeBaseFactory.newKnowledgeBase(baseConfig);
kBase.addKnowledgePackages(kBuilder.getKnowledgePackages());
sessionConfig = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
sessionConfig.setOption( ClockTypeOption.get( "pseudo" ) );
kSession = kBase.newStatefulKnowledgeSession( sessionConfig, null );
kSession.setGlobal( "snmpNotifier", snmpNotificationEventCase );
workingMemoryEntryPoint = kSession.getWorkingMemoryEntryPoint("incoming");
clock = (PseudoClockScheduler) kSession.getSessionClock();
snmpNotificationEventCase = new SnmpNotificationEventCase();
}
/* offline online 3min */
/* -----|-------------------|------/----^----- */
/* check */
@Test
public void deviceOffline_onlineBefore3minutes_checkAfter3minutes() {
/* alocates OFFLINE and ONLINE events, EXAMPLE */
Event offlineEvent = new Event();
Event onlineEvent = new Event();
Notification example = new Notification();
/* configures the events */
offlineEvent.setFreeField( offlineEventCode );
offlineEvent.setEventType( (byte)5 );
offlineEvent.setEventCode( "0001000" + offlineEventCode );
offlineEvent.setFormattedMessage( "JUnit string test" );
offlineEvent.setLane( "102" );
onlineEvent.setFreeField( onlineEventCode );
onlineEvent.setEventType( (byte)3 );
onlineEvent.setEventCode( "0001000" + onlineEventCode );
onlineEvent.setFormattedMessage( "JUnit string test" );
onlineEvent.setLane( "102" );
/* insert offline event */
workingMemoryEntryPoint.insert( offlineEvent );
kSession.fireAllRules();
/* intermediary check - offline notification */
example.setRuleCode( "31" );
example.setEventCode( offlineEventCode );
Assert.assertTrue(
"(device "+device+")(ruleCode 31): There are OFFLINE notifications, when it shouldn't have",
snmpNotificationEventCase.getNumberOfNotificationsByExample(example) == 0 );
/* advances the clock */
clock.advanceTime( 2, TimeUnit.MINUTES );
clock.advanceTime( 50, TimeUnit.SECONDS );
/* intermediary check - offline notification */
example.setRuleCode( "31" );
example.setEventCode( offlineEventCode );
Assert.assertTrue(
"(device "+device+")(ruleCode 31): There are OFFLINE notifications, when it shouldn't have",
snmpNotificationEventCase.getNumberOfNotificationsByExample(example) == 0 );
/* insert online event */
workingMemoryEntryPoint.insert( onlineEvent );
kSession.fireAllRules();
/* intermediary check - offline notification */
example.setRuleCode( "31" );
example.setEventCode( offlineEventCode );
Assert.assertTrue(
"(device "+device+")(ruleCode 31): There are OFFLINE notifications, when it shouldn't have",
snmpNotificationEventCase.getNumberOfNotificationsByExample(example) == 0 );
/* intermediary check - online notification */
example.setRuleCode( "31" );
example.setEventCode( onlineEventCode );
Assert.assertTrue(
"(device "+device+")(ruleCode 31): There are ONLINE notifications, when it shouldn't have",
snmpNotificationEventCase.getNumberOfNotificationsByExample(example) == 0 );
/* advances the clock */
clock.advanceTime( 15, TimeUnit.SECONDS );
/* since there's an ONLINE before the 3 minute's limit, there shouldn't be any trap regarding "last offline 3 minutes ago" */
example.setRuleCode( "31" );
example.setEventCode( offlineEventCode );
Assert.assertTrue(
"(device "+device+")(ruleCode 31): There are OFFLINE notifications, when it shouldn't have",
snmpNotificationEventCase.getNumberOfNotificationsByExample(example) == 0 );
example.setRuleCode( "31" );
example.setEventCode( onlineEventCode );
Assert.assertTrue(
"(device "+device+")(ruleCode 31): There are ONLINE notifications, when it shouldn't have",
snmpNotificationEventCase.getNumberOfNotificationsByExample(example) == 1 );
}
}
-- JUnit code (snippet) --
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months
[JBoss JIRA] Created: (JBRULES-2554) Adding a StatefulKnowledgeSessionAware Interface
by Anatoly Polinsky (JIRA)
Adding a StatefulKnowledgeSessionAware Interface
------------------------------------------------
Key: JBRULES-2554
URL: https://jira.jboss.org/browse/JBRULES-2554
Project: Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: drools-api
Affects Versions: 5.1.0.M2
Environment: N/A
Reporter: Anatoly Polinsky
Assignee: Mark Proctor
Priority: Minor
Interface to be implemented by any object that wishes to be notified of the {@link org.drools.runtime.StatefulKnowledgeSession} that it runs in.
Implementing this interface makes sense for example when an object requires access to session artifacts/details such as rule facts, sessionID, etc.
This interface can be implemented by a custom {@link org.drools.process.instance.WorkItemHandler} in case, for example, it needs to access a session to insert / retract some facts before proceeding further to the process node that fires rules ( groups, agendas, etc.. ).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months
[JBoss JIRA] Created: (JGRP-1052) Ergonomics
by Bela Ban (JIRA)
Ergonomics
----------
Key: JGRP-1052
URL: https://jira.jboss.org/jira/browse/JGRP-1052
Project: JGroups
Issue Type: Feature Request
Reporter: Bela Ban
Assignee: Bela Ban
Fix For: 3.0
The goal is to (a) reduce the number of properties needed and (b) determine the values dynamically.
Examples:
- Determine the best min/max size of a thread pool
- Find out what the best timeout values are for retransmission, e.g. based on average retransmission times
- Determine the optimal number of credits in FC
This is similar to the JVM setting where, starting with 1.5, the initial values can be set, but over time, the JVM dynamically changes them.
In the best case, a config contains only a list of protocols without any properties, and JGroups will figure out the correct values.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months
[JBoss JIRA] Created: (JBRULES-2438) loading multiple sheets of single Excel book by one change-set xml
by Toshiya Kobayashi (JIRA)
loading multiple sheets of single Excel book by one change-set xml
------------------------------------------------------------------
Key: JBRULES-2438
URL: https://jira.jboss.org/jira/browse/JBRULES-2438
Project: Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.0.1.FINAL
Reporter: Toshiya Kobayashi
Assignee: Mark Proctor
I'm trying to use rules via DecisionTable using change-set.
I wrote rules in multiple sheets of single Excel book.
Then I configured my change-set xml like:
...
<add>
<resource source='classpath:data/dtable.xls' type="DTABLE">
<decisiontable-conf input-type="XLS" worksheet-name="sheet1" />
</resource>
<resource source='classpath:data/dtable.xls' type="DTABLE">
<decisiontable-conf input-type="XLS" worksheet-name="sheet2" />
</resource>
</add>
...
But only rules of sheet1 were loaded.
As far as I observed source codes, KnowledgeAgentImpl.java puts resource into "Map<Resource, ResourceMapping> resources". But even if multiple resources are configured in change-set, it appears to me like those resources are considered as the same resource and eventually only one resource will be registered.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 11 months