URGENT - using lock-on-active or not
by Yaniv Itzhaki
Hi All,
I have an urgent problem which I hope someone can explain it to me and how
it can be solved.
I created 2 rules "Update 1" and "Update 2", basically the rules are the
same, get all the CaseLog objects according to "Category" and "Value" and
update the Case, which holds a list of CaseLogs, with a new object.
Note that in the update method I am updating the working memory by
retracting the old log and inserting the new one.
Now for the problem:
The problem is that on one hand, when I insert a new log line all rules
without lock-on-active re-fire. On the other hand, rules with lock-on-active
seem to disregard the addition of the new object and fire only on the lines
that were present when their group was activated.
Please see the rules below
Thanks
Yaniv
* *
*rule* "Update 1"
*salience* 4
*ruleflow-group* "group1"
*lock-on-active*
*when*
$case : Case()
$myLog : CaseLog( myClass == "Category",
myValue == "1" )
*then*
System.out.println("Logic: Update 1");
$case.update($myLog,40.0,*null*);
*end*
*rule* "Update 2"
*salience* 0
*ruleflow-group* "group1"
*lock-on-active*
*when*
$case : Case()
$myLog : CaseLog( myClass == "Category",
myValue == "1", $score : myScore )
*then*
System.out.println("Logic: Update 2 " + $score + 5.0);
$case.update($myLog,$score + 5,*null*);
*end*
15 years, 9 months
On Entry On Exit actions question
by Gustavo Tenrreiro
Hi,
When using an "Email" node for example, where On Entry, and On Exit
actions are available. If I create an object within the On Entry
action ( Let's say a list of recipients for the email ), how do I
access that data from the body of the email ? What is the best
strategy to access data that was created on the On Entry action, from
the node itself ?
Thanks
15 years, 10 months
Guvnor InvalidClassException
by Robert Morse
I have a Seam 2.2 application that works perfectly with Drools when it references the drl file directly. Using Guvnor 5.1.0.M1 and the same drl, I'm getting the exception listed below.
I've used earlier releases of Guvnor without any issues, but was curious why this would occur. I've stayed away from the latest release of Guvnor because my cursory evaluation leads me to believe
it's unstable. Clicking on the "verify" button for a particular rule locks JBoss 5.0.
Thanks for your help.
14:13:55,777 ERROR [STDERR] java.io.InvalidClassException: org.drools.base.ClassFieldAccessorStore; local class incompatible: stream classdesc serialVersionUID = 400, local class serialVersionUID = 487535245723988666
The human mind is an iterative processor, it never does anything right the first time. What it does well is to make improvements on every iteration (deMarco)
15 years, 10 months
How to remove a persisted session from the database ?
by Gustavo Tenrreiro
Hi,
I am using persistence, and since the sessions don't seem to have a
standard way of getting removed from the database when they are not
needed anymore, I am wondering how to do that.
I am using JPA but if I call :
em.remove(someSessionInfo);
where em is the JPA EntityManager, that does not remove the entry from
the database.
if I try to use a Query returned by the em.createQuery("delete from
SessionInfo where id = 1") it complains that it needs a transaction,
and since I don't know how to get around the issue I am stuck.
Any help would be appreciated.
Thanks
15 years, 10 months
Drools dependencies
by Evert Penninckx
Hello
I'm using ant to compile and deploy a project which uses drools. I ran in
some jar dependency problems and have a hard time understanding which
packages are required for what and which dependent libs are really needed.
I read the README_DEPENDENCIES file, but it's rather outdated by now. Is it
possible to update this file?
Tnx
Evert
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-dependencies-t...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 10 months
simultaneous forEach
by Carlos Villegas
Hi,
I'm testing Drools Flow functionality and it seems that the foreach node
iterates over the collection one value at a time, the embedded flow is
executed sequentially for each value. I'm looking for some construct
that invokes each embedded flow simultaneously for each collection
value. Like a AND split/AND join of multiple instances.
Is this possible with forEach, am I missing some configuration? or any
other way to achieve it.
Thanks,
Carlos
15 years, 10 months
using forall to validate same field value from a list
by tushmish
Hi,
My requirement is to check for same field value from a list of items. in the
test case mentioned below, I want to verify that all the applicants are of
same age.
I am running the rule as mentioned below. The 'then' part does not execute.
Please suggest.
Thanks for your time.
public class Applicant {
private String name;
private int age;
private BigDecimal amount;
// getter and setters
}
rule "age"
when
$list : List();
forall( $app : Applicant( $age : age) from $list
Applicant( this == $app, age == $age ) );
then
System.out.println("success" );
end
// setting data in working memory
Applicant applicant1 = new Applicant("aaaa", 20, new BigDecimal(16.50));
Applicant applicant2 = new Applicant("aaaa", 20, new BigDecimal(16.50));
Applicant applicant3 = new Applicant("aaaa", 20, new BigDecimal(16.50));
List<Applicant> list = Arrays.asList(new Applicant[] { applicant1,
applicant2, applicant3 });
ksession.insert(list);
Regards,
Tushar
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/using-forall-to-valid...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 10 months
Waiting in the Join node (AND)
by Ji Oh Yoo
Hi,
I am a new to Drools and I have a question.
I set up the Join (AND) node having two incoming edges,
one from some other node and one from some Event node.
I thought the Join (AND) node should wait until the Event node is triggered
(triggered by separate user input)
but the process actually stops when the process is in that Join node.
Should I use ksession.fireUtilHalt() instead of ksession.fireAllRules(),
or should I use something else?
Thanks
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Waiting-in-the-Join-n...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 10 months
Drools reflection problem.
by tom ska
Hi,
in my package definition I have two kinds of facts. I use stateFullSession
and I send to ksession facts of two different types. For each type I have
one rule using only this type. So what I am doing is processing two
different fact's types in one session. I start fireAllRules, and I know it
fires good rules, and all is working fine. But problem appears later - when
I want to get my fact's back using Drools reflection API.
With first type (facts of first type) all is working fine, but when I change
factType object to "point" into another type (the second one), I get
problems:
[ERROR] package.Type2 cannot be cast to package.Type2
java.lang.reflect.InvocationTargetException
It is thrown when I call
kbase.getFactType(package, Type2).get(factObject , "filed1_name");
I know that factObject is good, because when I use syso (factObject) I get
what I want.
What surprises me is when I call it for Type1 it works. Also, if I process
in ksession only one fact type using my code, I don't get this error (for
first and second fact type).
Thanks,
tom.
15 years, 10 months