[JBoss JIRA] Created: (JBRULES-372) QueryResult.get fires ClassCastException when using the string argument
by Giovanni Cuccu (JIRA)
QueryResult.get fires ClassCastException when using the string argument
-----------------------------------------------------------------------
Key: JBRULES-372
URL: http://jira.jboss.com/jira/browse/JBRULES-372
Project: JBoss Rules
Issue Type: Bug
Security Level: Public (Everyone can see)
Environment: JBoss Rules 3.0.1 and JBoss Rules as downloaded from svn trunk as of 12/07/06
Reporter: Giovanni Cuccu
Assigned To: Mark Proctor
here is the simple test case:
package simpletest;
public class AssertedObject {
private String value;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public AssertedObject(String value) {
// TODO Auto-generated constructor stub
this.value = value;
}
}
package simpletest;
import simpletest.AssertedObject;
rule rule1
when
then
assert( new AssertedObject( "value1") );
assert( new AssertedObject( "value2") );
end
query "assertedobjquery"
assertedobj : AssertedObject( value=="value1" )
end
package simpletest;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import mit.rules.test.Prestazione;
import mit.rules.test.StrutturaErogante;
import mit.rules.test.TempiAttesa;
import mit.rules.test.TestRules;
import org.drools.QueryResult;
import org.drools.QueryResults;
import org.drools.RuleBase;
import org.drools.RuleBaseFactory;
import org.drools.WorkingMemory;
import org.drools.audit.WorkingMemoryFileLogger;
import org.drools.compiler.PackageBuilder;
public class TestQuery {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
final PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl( new InputStreamReader( TestQuery.class.getResourceAsStream( "testquery.drl" ) ) );
final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage( builder.getPackage() );
final WorkingMemory workingMemory = ruleBase.newWorkingMemory();
fireRules(workingMemory);
}
public static void fireRules(WorkingMemory workingMemory) {
final WorkingMemoryFileLogger logger = new WorkingMemoryFileLogger( workingMemory );
logger.setFileName( "log/testquery" );
workingMemory.fireAllRules();
QueryResults results = workingMemory.getQueryResults( "assertedobjquery" );
if (results==null || !results.iterator().hasNext()) {
System.err.println("Empty list");
} else {
for ( Iterator it = results.iterator(); it.hasNext(); ) {
QueryResult result = ( QueryResult )it.next();;
AssertedObject assertedObject=(AssertedObject)result.get( "assertedobj" );
System.out.println("AssertedObject with value " + assertedObject.getValue());
}
}
logger.writeToDisk();
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 11 months
[JBoss JIRA] Created: (JBPM-792) Add support for JNDI bound SessionFactory
by C??dric Vidal (JIRA)
Add support for JNDI bound SessionFactory
-----------------------------------------
Key: JBPM-792
URL: http://jira.jboss.com/jira/browse/JBPM-792
Project: JBoss jBPM
Issue Type: Feature Request
Components: Core Engine
Reporter: C??dric Vidal
Assigned To: Tom Baeyens
Today, jBPM manages the configuration of Hibernate which is fine in simple applications where jBPM is the main piece but in a enterprise application where jBPM is one of the many modules that are using Hibernate as a persistence mechanism, you don't want to configure your hibernate SessionFactory multiple times, so you want to configure your SessionFactory once, bind it to JNDI and tell jBPM to use it.
It would be great if out of the box, jBPM would be able to lookup the SessionFactory it uses out of JNDI instead of configuring it locally.
Regards,
Cédric
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 11 months
[JBoss JIRA] Created: (JBRULES-445) behavior of globals?
by G£bor Lipt£k (JIRA)
behavior of globals?
--------------------
Key: JBRULES-445
URL: http://jira.jboss.com/jira/browse/JBRULES-445
Project: JBoss Rules
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: Drl Parser/Builder
Affects Versions: 3.0.4
Reporter: G£bor Lipt£k
Assigned To: Mark Proctor
Priority: Minor
It seems that the value of DRL globals without external env backup is removed between rules:
package globaltest
import Policy;
global java.lang.String text;
rule "Foo"
salience 999
when
Policy()
then
text="foo";
System.out.println("foo+"+text);
end
rule "Bar"
salience 998
when
Policy()
then
System.out.println("bar+"+text);
text="bar";
System.out.println("bar+"+text);
end
results in:
foo+foo
bar+null
bar+bar
The documentation does not seem to provide details if this is the expected behavior.
Please comment. Thanks
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 11 months
[JBoss JIRA] Created: (JBRULES-520) How to refer one rule in another
by Sridhar Ramaswamy (JIRA)
How to refer one rule in another
--------------------------------
Key: JBRULES-520
URL: http://jira.jboss.com/jira/browse/JBRULES-520
Project: JBoss Rules
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Affects Versions: 3.0.4
Environment: WSAD
Reporter: Sridhar Ramaswamy
Assigned To: Mark Proctor
I have the following three rules created in a drl:
rule "Sales"
when
abc: abcData( $abcName : abcName,
$value: value > 20)
then
abc.setFlagColor("RED");
end
rule "Count"
when
bcd: bcdData( $bcdName : bcdName,
$count: count < 120)
then
abc.setFlagColor("RED");
end
How to create a new rule which will use these rules, for instance
rule "sales & count"
when
either rule "sales" is true or "count" is true
and
aaa: aaaData($aaaName: aaaName, $amount: amount < 1000)
then
aaa.setFlag("Critical");
end
I am not able to call a rule into another rule to check that is also true.
Thanks/Sri.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 11 months
[JBoss JIRA] Created: (JBBUILD-332) Anonymous implementation of abstract methods in enums causes Weaver to barf
by Manik Surtani (JIRA)
Anonymous implementation of abstract methods in enums causes Weaver to barf
---------------------------------------------------------------------------
Key: JBBUILD-332
URL: http://jira.jboss.com/jira/browse/JBBUILD-332
Project: JBoss Build System
Issue Type: Bug
Components: JBossRetro
Affects Versions: JBossRetro-1.0.4.GA
Environment: Tested with JBoss Retro snapshot (10 Jan 2007) as well as 1.0.4.GA
java version "1.5.0_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03)
Java HotSpot(TM) Client VM (build 1.5.0_09-b03, mixed mode, sharing)
Linux hobbes 2.6.18-1.2869.fc6xen #1 SMP Wed Dec 20 15:28:06 EST 2006 i686 i686 i386 GNU/Linux
Reporter: Manik Surtani
For example, see
http://fisheye.jboss.com/browse/~raw,r=1.7/JBoss/JBossCache/src/org/jboss...
When attempting to retroweave this enum, we see an NPE trying to get a hold of the enums in the class.
[retro] Attempting to retroweave class org.jboss.cache.lock.IsolationLevel$1
[retro] Exception in thread "main" java.lang.NullPointerException
[retro] at org.jboss.ant.tasks.retro.Weaver.rewriteEnum(Weaver.java:581)
[retro] at org.jboss.ant.tasks.retro.Weaver.doWeave(Weaver.java:463)
[retro] at org.jboss.ant.tasks.retro.Weaver.compileFile(Weaver.java:415)
[retro] at org.jboss.ant.tasks.retro.Weaver.weave(Weaver.java:328)
[retro] at org.jboss.ant.tasks.retro.Weaver.main(Weaver.java:110)
(I added the sys out in my local copy of Weaver.java to spit out the name of the offending class)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 11 months