Drools Flow - Session objects
by jawa
Hi,
I am writing a small drools flow app. My flow starts off with a RuleGroup
node then I've two User Task nodes. What i do is this:
StatefulKnowledgeSession session =
JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBase, null,
environment);
WorkItemManager manager = session.getWorkItemManager();
manager.registerWorkItemHandler("Human Task", new MyWorkItemHandler(false));
MyVO vo = new MyVO();
vo.setComment("These are comments !!");
session.insert(vo);
ProcessInstance processInstance = session.startProcess("pocflow", null);
session.fireAllRules();
session.dispose();
As you can see i am inserting an object of type MyVO into the knowledge base
session. I am using JPA to store my flow in db. Now when I execute this
code, it starts my flow then calls my drl file for RuleGroup node then calls
human tasks etc. In my drl file I've this code:
package mypackage
import net.plus.kbd.poc.MyVO;
rule "Displaycomments"
ruleflow-group "display_comments"
when $vo: MyVO()
then
System.out.println("Inside Rule->MyVoComments->" + $vo.getComment());
end
rule "NotDisplaycomments"
ruleflow-group "display_comments"
when not $v: MyVO()
then
System.out.println("Inside Rule->MyVoComments not found");
end
So when this rule gets executed it always run "NotDisplaycomments" rule and
prints out that MyVoComments not found. As far as I know it should find my
vo which i inserted into the session. isn't it?
I am using drools 5.1.1 on jboss 5.
Any idea what am I doing wrong?
Thanks
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-Session-o...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 2 months
Another Drools reference
by Wolfgang Laun
The Drools Development Team is devotedly nursing Drools, providing the
essential platform for my article, and the Drools Community has helped me to
collect material for it. Therefore, I think it is only proper to inform you
all that - provided you can read German - you can peruse a copy of the
article Regelbasiertes Programmieren in der
Bahntechnik<http://members.inode.at/w.laun/articles/Signal+Draht.html>(Rule
Based Programming for Railway Applications), featuring Drools on my
home page.
Kind Regards
Wolfgang
14 years, 2 months
Re: [rules-users] How to create logfile when using ruleAgent
by Solingen, Stephanie
What user guide do you mean?
I've already read this one:
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-guvnor/h
tml_single/index.html
But it does not say anything about globals nor how to make a rule with
Log() (instead of System.out.println()) , so the information is added to
a logfile. The only information I've found was in de user guide of
drools flow (section 5.3)
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-flow/htm
l_single/index.html
But I'm not using ruleflow
And in de Drools Expert guide:
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/h
tml_single/index.html in section 3.3.5 there is information how to make
an audit log, which one can view via Eclipse.
But I want to make a simple log file (like a server.log) but for the
rules I've made in Guvnor. Which is in the system and testers can check
if something strange happens or pure for their own information. so they
can watch the process without any technical knowledge.
I hope you can help me further as where to find some information or
example how to use a global object that handles logging...
Or where to find the guide your talking about...
Using a "global" object that handles logging would probably be the
simplest.
Look at the User Guide for use of globals.
2010/9/2 Solingen, Stephanie <stephanie.solingen(a)atosorigin.com>
> Hi,
>
> Can anyone give me a code example how to create a logfile when using a
rule
> agent (rulebase) and statefulsession?
> The goals is to replace all system.out.println(); statements in de
rules
> with Log();
> (the rules are made with the Guvnor GUI, and I am using Guvnor 5.1
with a
> oc4j server)
> The text that is in de Log() should then appear in an existing
logfile.
>
> Thanx in advance.
14 years, 2 months
Minimizing Drools Flow Persistence when choreographing services
by rg64
I am considering using Drools Flow to choreograph services in an automated
processing system I am building. The proposed Drools Flow-based
"choreography service" as well as most of the other services in the
environment consume requests from transactional JMS queues. In this
architecture, I would like to reduce Drools Flow persistence-related i/o by
embedding session-state in the JMS messages whenever possible instead of
writing it to the persistent store.
My current thought is to use Apache Camel to implement a custom, async
WorkItemHandler that would somehow override the default RDBMS-based
persistence operations and instead marshal and unmarshal the process info
state to/from the transactional JMS message alongside with the rest of the
payload. Other Drools Flow wait states, such as joins, human tasks, etc.
which are encountered much less frequently in our environment would ideally
continue to use the traditional RDBMS-based persistence mechanism.
What are your thoughts about this approach? Is it reasonable? Do hooks exist
that allow the persistence mechanism to be conditionally overridden
depending on the type of wait state?
BTW, since you have already integrated Apache Camel with the Drools engine
itself, would it make sense to provide an out-of-the-box Apache Camel
WorkItemHandler to tighten the integration of Apache Camel with the Drools
Flow module? If the community is interested and I move forward with this
approach, I might consider contributing an Apache Camel WorkItemHandler.
Thanks in advance,
/Ron
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Minimizing-Drools-Flo...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 2 months
NPE in Guvnor Analysis w/Decision Table
by Lawrence Terrill
It seems every time I try to perform a rule analysis in the QA tab of Guvnor on a package containing a decision table, I get an NPE, both in 5.1 and 5.2.SNAPSHOT.
User error or bug? Anyone seen this work?
Larry
14 years, 2 months
where can I find the changes between Drools 5.0 and Drools 5.1
by Jeff Parks
I am in the process of updating some of my code to Drools 5.1.1. Classes
have changed packages, which isn't too much of an issue, but other classes,
e.g. org.drools.util.ProviderLocator have disappeared. I need to know what
class has replaced the classes that have disappeared. Is there a document
that describes the changes?
14 years, 2 months
How to create logfile when using ruleAgent and statefulSession
by Solingen, Stephanie
Hi,
Can anyone give me a code example how to create a logfile when using a
rule agent (rulebase) and statefulsession?
The goals is to replace all system.out.println(); statements in de rules
with Log();
(the rules are made with the Guvnor GUI, and I am using Guvnor 5.1 with
a oc4j server)
The text that is in de Log() should then appear in an existing logfile.
Thanx in advance.
14 years, 2 months
I'd like to get Drools 5.0
by 多田丈晃
Hi,
Does anyone know where I can get older version Drools archive?
On my work, I need to use Drools 5.0.
but In Drools download page only have latest version.
Please let me know where is older version archive download page.
14 years, 2 months
Re: [rules-users] Incorrect allowable comparison when using Guvnor GUI Rules - known bug?
by Alex.Porras@dds.net
Stephen Mcgruer <s0840449 <at> sms.ed.ac.uk> wrote:
> Now, I want to match on the fooBar's barInt property being less than a
hundred. So, I click on fooBar,
> and choose the 'barInt' subfield. It appears, *BUT* there is no option
for "is greater than" or "is
> less than", only "is equals to" and "is not equals to"!
I recently downloaded drools 5.1.1 and am experiencing the same issue.
Anyone else?
Cheers,
Alex
14 years, 2 months