Adding packages to a KnowledgeBase being watched by KnowledgeAgent?
by ljnelson
Suppose I have a KnowledgeBase that I've built with the usual factory method.
I've added nothing to it yet.
I park a KnowledgeAgent on top of it, using the
KnowledgeAgentFactory#newKnowledgeAgent(String, KnowledgeBase,
KnowledgeAgentConfiguration) call.
The KnowledgeAgent now, of course, monitors some resource somewhere and
periodically constructs new KnowledgeBases with the changed stuff it
discovers from monitoring resources.
If I get a handle on one of these KnowledgeBases by periodically asking the
KnowledgeAgent via its #getKnowledgeBase() method:
1. May I add KnowledgePackages "by hand" to it?
2. If I do (1), I assume if the KnowledgeAgent builds a new KnowledgeBase,
the new KnowledgeBase has no knowledge :-) of the packages I just added,
right?
3. Is there any way to tell as an end user when a KnowledgeBase has been
"detached" from a KnowledgeAgent?
I suspect I know the answer--which is that I should configure my
KnowledgeAgent to NOT make new KnowledgeBase instances, by using the
"drools.agent.newInstance" configuration property, which the documentation
says is "hard coded to true" even though in fact that is not true in Drools
5.1.
If I do that, are there any concurrency issues to be aware of? After all,
the KnowledgeAgent is going to be scanning some files in a separate thread,
and periodically (presumably) updating the KnowledgeBase with their
contents. What, if any, synchronization or locking do I have to perform if,
while all of that is going on, I wish to add KnowledgePackages to the
KnowledgeBase "by hand"?
Thanks,
Laird
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Adding-packages-to-a-...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 7 months
Shame on Progress and Savvion
by Mark Proctor
Progress has recently ripped off the Drools community and has offered
nothing in return, not even a curtesy nod of accreditation for our hard
work.. 30% of that 49mill USD would go a long way to helping us invest
in our tooling which would benefit all of us :) and maybe the Drools
team can have it's next team meeting in Hawaii and pay for all the
community members to come too. Cocktails anyone? :)
http://blog.athico.com/2010/09/progress-buy-bridge-in-brooklyn-savvion.html
I'm just having a little bit of fun, at their expense, which is well
deserved for such shockingly bad behaviour. So I would urge anyone else
to join in and have some fun too :) Do your own blogs, polls etc to
bring attention to this.
http://blog.athico.com/2010/09/breaking-news-have-your-vote-on-what.html
And please vote up at Digg and DZone to help raise awareness:
http://www.dzone.com/links/progress_buy_a_bridge_in_brooklyn_savvion_brms...
<http://www.dzone.com/links/progress_buy_a_bridge_in_brooklyn_savvion_brms...>
http://digg.com/news/technology/drools_progress_buy_a_bridge_in_brooklyn_...
Being slightly less tongue in check, this is just the reality of open
source, I've been doing this a long time now and I know you just have to
live with it, take the lumps with the smooth - as long as you get more
smooth than lumps, it's still worthwhile :) At it's best it brings
people together who collaborate and help each other and enrich the
open-source eco system. At it's worst you have organisations such as
Progress executing on predatory amoral tactics. The debate on whether
all corporations are ultimately operating on degrees of amorality is out
of scope for today :) As each year goes buy you start to appreciate Red
Hat more for the sterling work it does in open source. While it would be
nice if Progress got involved and contributed to Drools, the reality is
that this doesn't both me as much as you think it would. It hasn't
lestened the Drools community and technology, we still go from strength
to strength, and I've always been more concerned about what we are doing
and achieving than what someone else may or may not be doing with
regards to taking advantage of our work.
Ultimately this is actually quite flattering and re-affirms the strength
of our technology and the directions we are going. I'd rather have an
organisation using Drools and moving it one step closing to being a
defacto standard, than they partner with someone else or develop yet
another rule engine splintering the market and confusing users. "Drools
Everywhere" has alwas been my moto :)
However that said, anyone who knows me, knows I have a mischievous sense
of humour and if Progress and Savvion aren't even going to at the very
least accredit us then they are fair game and surely myself and the
Drools community deserve a little fun at their expense :)
Mark - The Mischievous Lead
15 years, 7 months
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.
15 years, 7 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
15 years, 7 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.
15 years, 7 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.
15 years, 7 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
15 years, 7 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?
15 years, 7 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.
15 years, 7 months