Drools 5.1 Javadoc link broken
by Chrystall, Greg
Does the link work for anyone else?
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/apidocs/index.html
________________________________
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
14 years, 4 months
A drools flow persistence example that behaves strangely
by Chrystall, Greg
I have written a test based as much as possible on the Drools Flow 5.1 Persistence Documentation. You can see the code here:
http://pastebin.com/33QXK4iU
And I have attached my eclipse project but without the jars as its too big, if anyone wants a zip of the whole project ready to run, I can put it on an http server for you.
My question is why when I change the code from running without persistence to running with persistence does it become "single threaded"? You can see by toggling the persistence variable in the top of the test file that when persistence is enabled each flow will complete before the next one begins yet without persistence they run in parallel.
Any advice on what I am doing wrong or whether persistence simply does not support what I want to do is much appreciated.
Greg
________________________________
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
14 years, 4 months
A dazzling feature - not in Drools!
by Wolfgang Laun
Just FYI, but who knows ;-)
Our proprietary vintage RBS has a feature is (admittedly) rarely used
but could come in handy, every now and then.
Given this class
class Element {
int rank; // rank > 0
}
and to fire a rule in ascending rank order, you can write (using
modified Drools syntax)
rule "fire in rank order 1,2,..."
when
Element( $rank : rank,... )
// ...
salience -$rank ### <=
then
// ...
end
The dynamically set salience does all the work. (Of course, you can
achieve the same order
in Drools easily enough.)
This is possible since salience is a value that must be carried over
into the activation.
There is at least one other rule attribute that shares this property,
but I'm not sure
whether anything useful can be done with dynamic agenda groups.
Cheers
-W
14 years, 4 months
Contributer Agreement
by Mark Proctor
To anyone who has signed the previous contributor agreement, it has
just been updated so you will receive an email requesting you re-sign
it. Don't panic, just re-sign it and carry on as normal :)
Thanks
Mark
14 years, 4 months
Querying long running human tasks by mapping variables
by watters.john@gmail.com
I’m using drools in order to make a decision on whether to purchase certain
stock items or dispose of stock items. Our system takes a stock import and
feeds the values into drools by inserting an object into the knowledge
session; this object is mapped to the human task as a variable. If a rule
passes it will create a human task to purchase stock for that item. The
user then purchases more stock and completes the human task.
Our system may import the same stock file and feed the values into drools
again, I want to ensure that a task isn’t created to purchase that stock
item again, is there any way of searching previously completed tasks by the
object mapped as a variable to the human task.
Thanks,
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Querying-long-running...
Sent from the Drools - Dev mailing list archive at Nabble.com.
14 years, 4 months
Drools Flow Persistence
by Chrystall, Greg
Hello,
I have a workflow project up and running using Drools Persistence. My workflows will have a number of "long running processes" which I will implement with WorkItemHandlers. I have created a dummy WorkItemHandler that just sleeps for a number of seconds before calling manager.completeWorkItem(workItem.getId(), null);
My problem is that in a unit test I am creating a StatefulKnowledgeSession in one thread then calling start process on it in other threads to start multiple processes. I take it this is not supported because it tries to do persistence things without a transaction. How should I be doing this?
Also how can I get my long running process to execute outside of a database transaction?
Thanks,
Greg
________________________________
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
14 years, 4 months
Drools JCA project
by Laird Nelson
I've cleaned up (somewhat) my source and dumped it at
https://code.google.com/p/drools-jca/source/checkout.
This is a project that attempts (successfully as far as I can tell but who
knows) to make Drools a Java EE citizen by way of the JCA specification.
The way that I've implemented the resource adapter relies (at the moment) on
several make-a-private-method-
accessible hacks in Drools 5.1.0.
Among other things I've brutally hacked out the sections of Drools that rely
on Threads and have subclassed and whatnot so that they now use the
JCA-mandated WorkManager and BootstrapContext#getTimer().
The resource adapter sets up a KnowledgeAgent which consults a changeset and
monitors it. When a new KnowledgeBase is detected, the agent rebuilds it.
Client calls are blissfully unaware of all of this.
The general gist of the project is that you should, from an EJB, be able to
do this, provided your container is set up properly:
@Resource
private KnowledgeBase kb;
...and that KnowledgeBase will be a "front" for the "real" KnowledgeBase
managed by the resource adapter.
I've declared the resource adapter as not supporting transactions, because
it's unclear to me what it would mean for it to do so. One area that is
unexplored is what happens if you are in a transaction in your EJB, and you
stuff your EJB's copy of, say, an EntityManager into the rules as a global.
Does "not supporting transactions" mean that the transaction of which the
EntityManager was most recently a part will be suspended? Or is this
sleight-of-hand possible?
As confirmed on the rules-user list, no further synchronization or anything
like that is (apparently) necessary from a caller's point of view.
The project is built in two parts: the raw jars part (drools-jca) and the
RAR wrapper around it (drools-rar). This allows the drools-jca part to be
tested by an embedded instance of OpenEJB, which is a Java EE 6 compliant
(mostly) application server. It also allows the consumer to decide whether
to build his own "skinny" rar or to use the drools-rar project as is.
Please please please give me feedback on this in case I've done something
horribly wrong.
Best,
Laird
14 years, 4 months
Why are fundamental API functions not part of "stable"?
by Wolfgang Laun
Trying to provide some debugging functions, I find that
org.drools.runtime.rule.WorkingMemory (a "stable" interface) lets you retrieve
org.drools.runtime.rule.Agenda (another "stable" interface). But this
one does not provide access to the current set of Activation objects.
In contrast to this, org.drools.Agenda, which is part of the
"unstable" Core API, does provide Activation[] getActivations().
Since there is org.drools.runtime.rule.Activation in the "stable"
part, why is it not possible to retrieve the current activations by
just using the "stable" API? I would think that concepts such as
"agenda" and its current set of activations are here to stay. What
should one do when one wants to implement support functions for Drools
applications that should have long term stability??
Best
Wolfgang
14 years, 4 months
drools-persistence-jpa ProcessInstanceInfo processInstanceId
by Chrystall, Greg
Hi,
Is there some magic going on in ProcessInstanceInfo? As far as I can tell there is no way that the processInstanceId can ever have a non-null value. This causes a null pointer exception when called from JPAProcessInstanceManager line 37 because it will try and unbox null to a long.
Can anyone explain what is supposed to happen?
Thanks,
Greg
________________________________
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
14 years, 4 months
Setting Configuration Option in KnowledgeBase
by Nicolás Sanchez
Hi, I am a Newbie with Drools5.1.0 and I was trying to set a
KnowledgeBaseConfiguration Option using Drools Fusion.
I tried the code that was in the Documentation part of Drools Fusion:
*KnowledgeBaseConfiguration config =
KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
config.setOption(EventProcessingMode.STREAM);*
And the next Error appears, and I can`t know why:
*
Bound mismatch: The generic method setOption(T) of type
KnowledgeBaseOptionsConfiguration is not applicable for the arguments
(RuleBaseConfiguration.EventProcessingMode). The inferred type
RuleBaseConfiguration.EventProcessingMode is not a valid substitute
for the bounded parameter <T extends KnowledgeBaseOption>*
Regards,
Nicolas
14 years, 4 months