[jboss-jira] [JBoss JIRA] Updated: (JBRULES-3187) GetFactHandlesCommand does not return FactHandles when "connected"

Marco Rietveld (JIRA) jira-events at lists.jboss.org
Thu Aug 25 06:52:17 EDT 2011


     [ https://issues.jboss.org/browse/JBRULES-3187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marco Rietveld updated JBRULES-3187:
------------------------------------

    Description: 
The GetFactHandlesCommand contains a bug that means that an empty collection (instead of a possibly filled one) of FactHandles is returned when the GetFactHandlesCommand.disconnected boolean is false. 

You can recreate this by doing one of the following: 

{code}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
ksession = kbase.newStatefulKnowledgeSession();
KnowledgeCommandContext kContext 
  = new KnowledgeCommandContext( new ContextImpl( "ksession", null ), null, null, this.ksession, null );
commandService = new DefaultCommandService(kContext);
ksession.insert("fact");
      
GetFactHandlesCommand command = new GetFactHandlesCommand();
Object result = commandService.execute(command);

Collection<FactHandle> factHandles = (Collection<FactHandle>) result;
Assert.assertTrue( "FactHandles collection should contain at least one fact!", !(factHandles.isEmpty()) );
{code}

  was:
The GetFactHandlesCommand contains a bug that means that an empty collection (instead of a possibly filled one) of FactHandles is returned when the GetFactHandlesCommand.disconnected boolean is false. 

You can recreate this by doing one of the following: 

{code}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
ksession = kbase.newStatefulKnowledgeSession();
KnowledgeCommandContext kContext 
  = new KnowledgeCommandContext( new ContextImpl( "ksession", null ), null, null, this.ksession, null );
commandService = new DefaultCommandService(kContext);
ksession.insert("fact");
      
GetFactHandlesCommand command = new GetFactHandlesCommand();
Object result = commandService.execute(command);

Collection<FactHandle> factHandles = (Collection<FactHandle>) result;
Assert.assertTrue( "FactHandles collection should contain at least one fact!", (factHandles.isEmpty()) );
{code}



> GetFactHandlesCommand does not return FactHandles when "connected"
> ------------------------------------------------------------------
>
>                 Key: JBRULES-3187
>                 URL: https://issues.jboss.org/browse/JBRULES-3187
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-core
>    Affects Versions: 5.3.0.Beta1
>            Reporter: Marco Rietveld
>            Assignee: Marco Rietveld
>            Priority: Minor
>
> The GetFactHandlesCommand contains a bug that means that an empty collection (instead of a possibly filled one) of FactHandles is returned when the GetFactHandlesCommand.disconnected boolean is false. 
> You can recreate this by doing one of the following: 
> {code}
> KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
> ksession = kbase.newStatefulKnowledgeSession();
> KnowledgeCommandContext kContext 
>   = new KnowledgeCommandContext( new ContextImpl( "ksession", null ), null, null, this.ksession, null );
> commandService = new DefaultCommandService(kContext);
> ksession.insert("fact");
>       
> GetFactHandlesCommand command = new GetFactHandlesCommand();
> Object result = commandService.execute(command);
> Collection<FactHandle> factHandles = (Collection<FactHandle>) result;
> Assert.assertTrue( "FactHandles collection should contain at least one fact!", !(factHandles.isEmpty()) );
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list