RuleFlow only calling first RuleFlowGroup when called through drools-server

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

RuleFlow only calling first RuleFlowGroup when called through drools-server

elitwin
I have a RuleFlow that has some sequential steps at the beginning with a couple of Gateways later in the flow.

When I run the flow through Eclipse, everything works fine and all the Rule Task nodes are processed (and the underlying rules assigned to those RuleFlowGroups are fired properly).

When I run the flow using Drools-Server 5.1, only the first RuleFlowGroup is fired. For example, I have an "Initialize" group followed by a "Validate" group. Only the rules belonging to the "Initialize" rule flow group get activated. None of the "Validate" rules get fired. When I reverse the order in my RuleFlow, the "Validate" rules get fired, but not the "Initialize" rules.

Is there something different that needs to be done to make sure a RuleFlow group is fired properly through drools-server? I haven't been able to find anything online about this issue.
Reply | Threaded
Open this post in threaded view
|

Re: RuleFlow only calling first RuleFlowGroup when called through drools-server

rtmacphail
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: RuleFlow only calling first RuleFlowGroup when called through drools-server

salaboy
I'm trying to understand the problem.
Can you share an isolated test and the process file? i will be happy to test it and make it work..
Greetings.

On Thu, Feb 17, 2011 at 1:04 PM, rtmacphail <[hidden email]> wrote:

I am new to Drools and I am having the exact same problem. Have you found any
resolution yet? How are you starting the ruleflow? I'm creating a
StartProcessCommand object and adding it to the BatchExecution Command. I am
not sending a FireAllRules command as this seems to make the rules fire
independently of the flow.

Basically I do something like this:

               //create an insertCommand object and insert the passed in fact model into
it.
               InsertObjectCommand insertCommand = (InsertObjectCommand)
CommandFactory.newInsert(factModel);
               insertCommand.setObject(factModel);
               //set the out identifier. This is a string that will be used to identify
               //this particular fact model in the execution result response.
               insertCommand.setOutIdentifier(factHandle);
               insertCommand.setEntryPoint("DEFAULT"); //not sure what this does.
               //tell the drools server to pass the fact model back to the client
               //as part of the response
               insertCommand.setReturnObject(true);

               StartProcessCommand startProcessCommand = new StartProcessCommand();
               startProcessCommand.setProcessId(processId);
               commandList.add(startProcessCommand);
               //add the command to the passed in array list
               commandList.add(insertCommand);

               BatchExecutionCommand batchCommand =
CommandFactory.newBatchExecution(commandList,knowledgeSession);
               //Use the BatchExecutionHelper class to convert the batch command to an
XML stream to be sent to the
               //drool-server's rest api.
               String commandXML =
BatchExecutionHelper.newXStreamMarshaller().toXML(batchCommand);

Then I send the commandXML to the server using HttpClient. Is this similar
to what you do?
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/RuleFlow-only-calling-first-RuleFlowGroup-when-called-through-drools-server-tp2514244p2520132.html
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users



--
 - CTO @ http://www.plugtree.com 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jbug.com.ar
 
 - Salatino "Salaboy" Mauricio -

_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: RuleFlow only calling first RuleFlowGroup when called through drools-server

elitwin
salaboy wrote
I'm trying to understand the problem.
Can you share an isolated test and the process file? i will be happy to test
it and make it work..
Greetings.

 - Salatino "Salaboy" Mauricio -
I am going to try to create a simplified ruleflow that I can test to see if I can reproduce the problem.

If the problem persists, I will share the configuration and package files.

Eric
Reply | Threaded
Open this post in threaded view
|

Re: RuleFlow only calling first RuleFlowGroup when called through drools-server

rtmacphail
In reply to this post by elitwin
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: RuleFlow only calling first RuleFlowGroup when called through drools-server

rtmacphail
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: RuleFlow only calling first RuleFlowGroup when called through drools-server

JeffMax
This is actually a problem with using Drools Flow in stateless sessions in general, regardless of the Drools-Server.

See this post for details:
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-within-Stateless-Session-in-Drools-5-1-td2094451.html#a2105016

This may be fixed in the trunk. I am not sure.
Reply | Threaded
Open this post in threaded view
|

Re: RuleFlow only calling first RuleFlowGroup when called through drools-server

rtmacphail
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: RuleFlow only calling first RuleFlowGroup when called through drools-server

JeffMax
My experience has been (and I believe the expected behavior of stateful sessions) is that the state of your working memory will not be cleaned up between flow executions. If,for example, one flow execution inserts a new fact into working memory, then a subsequent flow execution would see that fact in working memory.

For my requirements, which was to use Drools-Server as a stateless, request - response server, with no shared state between requests, it was necessary to use a stateless session.

- Jeff
Reply | Threaded
Open this post in threaded view
|

Re: RuleFlow only calling first RuleFlowGroup when called through drools-server

rtmacphail
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: RuleFlow only calling first RuleFlowGroup when called through drools-server

elitwin
In reply to this post by JeffMax
JeffMax wrote
This is actually a problem with using Drools Flow in stateless sessions in general, regardless of the Drools-Server.

See this post for details:
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-within-Stateless-Session-in-Drools-5-1-td2094451.html#a2105016

This may be fixed in the trunk. I am not sure.
There are two issues posted in Jira about this.

https://issues.jboss.org/browse/JBRULES-2718
https://issues.jboss.org/browse/JBRULES-2728 (duplicate of 2718)

I am not sure if/when there is any plan to fix this in 5.1.x.

I may have to revert back to 5.0.1.
I was also going to try 5.2.0.M1 to see if it works, but a 5.2 FINAL release is probably pretty far off, so I don't think that is a realistic alternative.

Eric
Reply | Threaded
Open this post in threaded view
|

Re: RuleFlow only calling first RuleFlowGroup when called through drools-server

elitwin
elitwin wrote
There are two issues posted in Jira about this.

https://issues.jboss.org/browse/JBRULES-2718
https://issues.jboss.org/browse/JBRULES-2728 (duplicate of 2718)

I am not sure if/when there is any plan to fix this in 5.1.x.

I may have to revert back to 5.0.1.
I was also going to try 5.2.0.M1 to see if it works, but a 5.2 FINAL release is probably pretty far off, so I don't think that is a realistic alternative.
I decided to try using salience instead of RuleFlow to try to control the order in which the rules fire. It is not ideal, but I thought I could get it to work. However, I am seeing rules with higher salience firing after rules with much lower salience. It doesn't consistently happen, but it seems that salience is not very reliable across a large number of rules.

Still curious to know if there are plans to address the above issues (2718) in 5.1.1. It seems like this is fairly important functionality.

Eric
Reply | Threaded
Open this post in threaded view
|

Re: RuleFlow only calling first RuleFlowGroup when called through drools-server

laune
Activating and deactivating rules in batches (i.e., groups of one sort
or other) cannot be imitated by salience.

If you leave a group, no rule from that group stands a chance to
become active again. But a high-salience rule that isn't activated
before 0:12:34.567 may (after some firings of low-salience rules)
become activated at 0:12:34.567, after its LHS has finally made the
match point.

I have used agenda groups to achieve a flow of rule batches --- no
problem in 5.1.

-W



On 23 February 2011 17:34, elitwin <[hidden email]> wrote:

>
>
> elitwin wrote:
>>
>> There are two issues posted in Jira about this.
>>
>> https://issues.jboss.org/browse/JBRULES-2718
>> https://issues.jboss.org/browse/JBRULES-2728 (duplicate of 2718)
>>
>> I am not sure if/when there is any plan to fix this in 5.1.x.
>>
>> I may have to revert back to 5.0.1.
>> I was also going to try 5.2.0.M1 to see if it works, but a 5.2 FINAL
>> release is probably pretty far off, so I don't think that is a realistic
>> alternative.
>>
>>
>
> I decided to try using salience instead of RuleFlow to try to control the
> order in which the rules fire. It is not ideal, but I thought I could get it
> to work. However, I am seeing rules with higher salience firing after rules
> with much lower salience. It doesn't consistently happen, but it seems that
> salience is not very reliable across a large number of rules.
>
> Still curious to know if there are plans to address the above issues (2718)
> in 5.1.1. It seems like this is fairly important functionality.
>
> Eric
> --
> View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/RuleFlow-only-calling-first-RuleFlowGroup-when-called-through-drools-server-tp2514244p2561201.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users