[jboss-jira] [JBoss JIRA] Created: (JBRULES-2319) When using from (CE) the objects loaded are not available to RHS if the objects are events

Richard Ambridge (JIRA) jira-events at lists.jboss.org
Thu Oct 29 13:01:06 EDT 2009


When using from (CE) the objects loaded are not available to RHS if the objects are events
------------------------------------------------------------------------------------------

                 Key: JBRULES-2319
                 URL: https://jira.jboss.org/jira/browse/JBRULES-2319
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-core
    Affects Versions: 5.0.1.FINAL
         Environment: Ubuntu, Eclipse
            Reporter: Richard Ambridge
            Assignee: Mark Proctor


If I create the sample project from Eclipse, and modify DroolsTest to contain:

ArrayList<Message> a=new ArrayList<Message>();
Message a1=new Message(); a1.setId(1); a1.setMessage("mesC:7"); a1.setStatus(Message.HELLO); a.add(a1);
Message a2=new Message(); a2.setId(2);a2.setMessage("mesC:8"); a2.setStatus(Message.HELLO);a.add(a2);
ksession.setGlobal("data", a);

And set the environment as STREAM,
        conf.setOption( EventProcessingOption.STREAM );

and then have a rule:

package com.sample
 
import com.sample.DroolsTest.Message;
global java.util.ArrayList data;
 
declare Message
	@role( event )
end
rule "Hello World"
	when
	    a : Message(id==4)
		m : Message(id!=a.id, message==a.message) from data
	then
		System.out.println( "a is:"+a+" m is:"+m ); 		
end


The result is:
a is:Message:[4] msg:mesC:7 m is:null

Notice, m is NULL

if you change this to fact based,  m will contain the correct value.


-- 
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

        



More information about the jboss-jira mailing list