Exception: rule 'end_key' failed predicate
by Tina Vießmann
Hi,
I'm receiving a exception when trying to run my application:
[ERR 103] Line 44:24 rule 'end_key' failed predicate:
{(validateIdentifierKey(DroolsSoftKeywords.END))}? in Watcher[55,0]:
[ERR 101] Line 55:0 no viable alternative at input 'global' in rule end
The relevant code is:
declare Watcher
@role ( event )
triggeringValue : Value
numberOfContainedValues : int
valueSet : Set<Value>
end
global Logger LOG; # Line 55
I know the problem lies in the Watcher declaration, but I don't know
what it is.
Thanks for any help! :)
Tina
15 years, 8 months
Drools Expert scalability
by Dieter D'haeyere
I have a question regarding the scalability of Drools Expert.
Situation is as follows:
- Individual cases have to be evaluated by the rule engine (result is a
tarrif that could be refunded).
- the application receives the cases in flat files with 50K cases each. The
app parses them and sends them one by one to the rule engine
- the application receives multiple batch files per day.
- seperate cases can be dependant on each other. Eg. if max 1 refund can be
done to an actor, two cases about the same actor can not run in parallel.
- loads will be huge, scalability is an issue
So, what I see now
- Drools Server can be run as a server
- It is possible to have multiple instances of drools server, this would
allow to evaluate cases in parallel. But ... this can cause problems (as
stated before): you can't run any two cases in parallel. Preprocessing
could be done by the application (eg. determining the order in which to
present the cases to the rule engine) but over time extra constraints can
appear so preprocessing would have to be maintained continuously.
So, this is an issue :)
My questions are:
- is it eg possible to organise rules such that different rules can run on
different rule engines. Like that you could have some kind of pipeline.
Maybe this could be defined with ruleflow ? Compare to the pipelines in
CPU's (for executing machine code). Could you eg. relate one server
instance to one set of rules and another server instance to the sequential
next set of rules ? How would you configure that (performance is of course
important).
- Or, is it possible to split rules but not as a pipeline but in parallel...
like a 'fork .. join' . Again, this could be configured with ruleflow?
- What do you see as the best way to solve this issue ?
Any help is welcome,
Dieter D'haeyere.
15 years, 8 months
How to do validation of facts in a Stateful Session?
by Stephen Mcgruer
Hi there,
My project uses Drools to (among other things) validate new
facts/updates to old facts, according to a set of rules. (For example,
we might have a rule that says "No two people can be named the same
thing".) Our method of validation and error reporting was originally
chosen for a stateless session (before we had the requirement of doing
checks like the above), and I feel I've had to hack it a bit much to
get it working with stateful sessions. The current methodology is:
1. (Website) The user inserts/updates a fact.
2. (Java) If the fact is new, an object is created for it. If it is an
update, the pre-existing object is fetched from the object repository
(the interface to the database) and a backup copy of the object is
taken.
3. (Java) This fact is either inserted into the KnowledgeBase (KB) or
a pre-existing fact in the KB is updated depending.
4. (Rules) If the new/updated object fails a validation rule, it will
be retracted and a ValidationError object will be inserted into the KB.
5. (Java) The code then searches for ValidationError objects that
match the just inserted/updated object. If it finds any it records
them and then retracts them from the KB.
6. (Java) If there are no errors, then that's it - a success report is
generated and passed back to the website.
7. (Java) If there were errors, then if the user was updating a fact
the backup of it (before the changes) is inserted back into the KB.
The website is then passed a failure report.
It just feels very hacky to do so much manual insertion/retracting
from the Java side of the code.
So, is there a 'correct' way to do stateful validation? And does our
current way even work, or are there hidden problems that we've not
spotted?
Cheers,
Stephen
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
15 years, 8 months
Drools Guvnor
by Rajesh R.V - ESA
I am working with OTA model, and I have around 2800 classes in my model.
When I open the technical editor, looks like it introspects all classes
to show the fact types.
It is taking a long time. I want to switch off this and I don't want to
see the fact types at all. Which class I need to change.
Regards
RV
15 years, 8 months
Fwd: Retrieve values from a Map
by Wolfgang Laun
Since this was sent to me only, I feel I ought to forward it to the list.
I do like "f*u*ntastic" :-)
-W
---------- Forwarded message ----------
From: Manav <manav7574(a)yahoo.com>
Date: 12 August 2010 05:41
Subject: Re: [rules-users] Retrieve values from a Map
To: Wolfgang Laun <wolfgang.laun(a)gmail.com>
[snip]
Really appreciate it . I must the Drools is just funtastic and the Drools
Team
even better :)
Regards,
Manav
15 years, 8 months
Retrieve values from a Map
by Manav
I am new to drools and currently using version 5.1 for my testing.
I am facing an issue with retrieving a value from Map if a key is present
In my drl if i do this
$c : Client (language contains "Japanese" , lang : language ->
(language.get("Japanese").equals("Expert")))
it works ...but if i want to retrieve the value of the key i am not sure how to
go about it . I tried various approaches but none of them worked
i would like to do something like
$c : Client (language contains "Japanese", $langValue :
language.get("Japanese"))
Can some one please guide me how to go about it .
Regards,
Manav
15 years, 8 months
Drools 5.1 Update Site
by Georg Maier
Hi,
is there any reason why 5.1. final Eclipse Workbench is not put into an
Update Site? Sure it is possible just to drop in the content of the zip, but
I think Update Sites are far more comfortable :-)
Furthermore, there actually is an Update Site - but it's kind of empty...? On
purpose?
Any information would be appreciated :-)
Thanks in advance!
Cheers
Georg
15 years, 8 months
JpaManager - SingleSessionCommandService
by drooRam
Hi,
I am using bitronix transaction manager for oracle through tomcat... i
have set the transaction manager as follows :
<bean id="BitronixTransactionManager"
factory-method="getTransactionManager"
class="bitronix.tm.TransactionManagerServices"
destroy-method="shutdown" />
<bean id="transactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager" ref="BitronixTransactionManager" />
<property name="userTransaction" ref="BitronixTransactionManager" />
</bean>
and finally passing this wrapped JtaTransactionManager to drools:ksession
tag, the following code has been invoked on SingleSessionCommandService for
the transactionManager ...
method initTransactionManager() on SingleSessionCommandService.java line #
218.
this tm class starts with "org.springframework", so it enters this block of
code..but it doesn't contains "jpa"
hence JPAManager (jpm) is not being initialized...i cud see the else block
is hanging in this code....
Result : NullPointerException on calling the reference this.jpm.....
Question is that how should i configure JpaTransactionManager or
JtaTransactionManager for Drools ?
i think that i followed a correct approach and there is a bug in
SingleSessionCommandService.java code?
Please advice. Thanks
-drooRam
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/JpaManager-SingleSess...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 8 months
Can't see process in gwt-console after changing guvnor to authenticator
by Han Ming Low
Hi,
I'm having problems with seeing the process in gwt-console. :p
This time the difference is I change the guvnor components.xml authenticator
to "other" and role based authorization as "true" and set the
login-config.xml authentication to a users.properties
The steps and difference in setup I have made is as follows
1) change guvnor and flow persistence to mysql instead of h2
2) Build defaultPackage, ABLE to see process in Drools Flow console
3) Shutdown both human task and jboss
4) Configure role-base authorization and users.properties file
authentication
5) Start human.task and jboss
6) Not able to see process in Drools Flow console
7) Rebuild defaultPackage
8) Not able to see process in Drools Flow console
9) Restart both human task and jboss
10) Not able to see process in Drools Flow console
11) Delete process in guvnor and delete archive
12) Copy process from local file system to guvnor through WebDAV
13) Build defaultPackage
14) Not able to see process in Drools Flow console
15) Shutdown both human task and jboss
16) Change login back to defaultAuthenticator.authenticate
17) Start human.task and jboss
18) ABLE to see process again
What should I do to allow the process to be seen when other authenticator is
used?
Any advice is greatly appreciated.
Thanks.
Han Ming
15 years, 8 months