configuring drools timers (and persistence)
by Jordi Alvarez
Hello, I am involved in a project in which we are using Drools Flow 5.1.1.
as the underlying BPM.
We have drools integration with Spring. We are using JPA+Spring+Drools
integration, and have setup the knowledge base and stateful session as
indicated in the drools spring integration documentation. Our BPM has
external clients that call adaptor methods for Drools. That is, drools is
never used in a direct way from an external client. We use this strategy in
order to provide some additional behaviour and also in order to provide
transactional behaviour as it is usually made with Spring.
We needed to partially apply the patch reported at the end of:
http://drools.46999.n3.nabble.com/5-1-0-CR1-Drools-Spring-Configuration-C...
"3. Interesting thing is that I have to recreate "Environment" now every
time before reloading the Session, otherwise the entityManager is closed,
and it does not respond to a simple Spring AOP TM wrapping... But that is
another issue.. "
We still have some persistence problems when using drools Timers. The
problems arise when drools creates the transaction itself (the timers
execution is the only situation in our scenario where this happens). We do
have some listeners which persist some information in our own tables. These
listeners are not prepared to use drools-created transaction (a different
entity manager is used). For this reason and also some others (as reported
in
http://drools.46999.n3.nabble.com/Drools-5-1-Flow-in-a-quot-Clustered-quo...),
we would like to configure the timer service used
internally by Drools.
Looking at drools source code, it seems that it should be possible, since a
defult implementation is provided by drools (
JDKTimerService and JpaJDKTimerService if persistence is used). For example,
class KnowledgeStoreServiceImpl seems to define a set of default services
(which could pressumably be overriden someway). Nevertheless, after looking
to that for a while we have found no specific documentation and no clear way
to do that for our Spring integration.
Is there a way to change the TimerService implementation provided by Drools?
Any help is appreciated.
Thanks very much in advance!
Jordi Alvarez
13 years, 7 months
How do I validate my DRL file
by Vijeth Raj
Hi ,
I am working on a Grails project where I have a web UI where the user
can define rules with all the conditions and the .DRL file will be
generated. Finally when the user clicks on a validate button ,my
application should validate the defined rules (which is in .DRL file) to
check for errors.
So now my question is :How do I validate my DRL file?
Can any one please guide me how can I achieve this?
Thanks in advance.
Vijeth Raj K
vijethrajk(a)gmail.com
13 years, 7 months
5.2.0.M2 issue using import functions
by wendy
Hi,
I've been using Drools 5.1 and I'm in the process of switching over to
5.2.0.M2. I have a file containing many custom public static functions that
our rules use. With 5.1 I could just "import function MyRuleFunction.*;"
and then use them in the 'when' part of the rule:
$example: ArrayList(size>3) from collect ($p: Person( eval (
exampleImportedFunction( name, "Bob")))
but with 5.2.0.M2 I'm getting an "unable to resolve method using
strict-mode: Person.exampleImportedFunction(java.lang.String,
java.lang.String)
which makes it look like it is only searching for functions on Person but
not in the 'import functions'.
If I add "import function MyRuleFunction.exampleImportedFunction;" it works
fine but I don't want to have to do that for every function in my file.
Functions used in the consequent don't seem to need to be imported
specifically (* works fine).
Has something changed between 5.1 and 5.2.0.M2 that effects this?
Thank you,
Wendy
--
View this message in context: http://drools.46999.n3.nabble.com/5-2-0-M2-issue-using-import-functions-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months
Turning off mvel strict-mode evaluation in within Eclipse/Drools?
by drdaveg
A common problem in using Drools DSL is MVEL's "Unable to build
expression.....unqualified type in strict mode...." Many posts mention
error, I have looked at drools-compiler.jar, drools-core.jar, drools-api.jar
but I haven't found a real solution to the problem yet, i.e., a way to
unset strict mode compilation within the Eclipse editor/plug-in.
I have worked around this issue many times, but have an expression that
ignores my typing cues.
Can strict mode evaluation be unset via a property like one I might expect
in drools.default.rulebase.conf?
--
View this message in context: http://drools.46999.n3.nabble.com/Turning-off-mvel-strict-mode-evaluation...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months
Simple Rule Flow
by sdinoo
I am new to drools
All I want to do is create a simple rule flow with a rule task that executes
a particular Rule-flow group
Here is what my rule looks like
rule "rule1" ruleflow-group "group1"
when
eval(true)
then
System.out.println("Bingo");
end
in my Rule flow i have
Start->hello world(sysouts Helo world) ->Rule Task->End
Rule Task attributes are configured with the rf group as "group1"
my calling program ProcessTest.java does have these two lines
kbuilder.add(ResourceFactory.newClassPathResource("ruleflow.rf"),
ResourceType.DRF);
kbuilder.add(ResourceFactory.newClassPathResource("Sample.drl"),
ResourceType.DRL);
BUT
When I run the program I only to see "Hello World" I expect to see "Hello
World" followed by "Bingo"
Iam certianly doing something wrong - Can you please help?
--
View this message in context: http://drools.46999.n3.nabble.com/Simple-Rule-Flow-tp2894351p2894351.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months
Regarding Drools - Expert and Fusion
by Sumeet Karawal
Hi,
Could somebody please let me know about any link or document for Best
Practices regarding JBoss Rules(Expert) and Fusion.
Also any link or document regarding Technical Architecture of JBoss Rules
(Expert) and JBoss Fusion Stack.
Thanks & Regards,
Sumeet Karawal
Mailto: sumeet.karawal(a)tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
13 years, 7 months
Getting Started with the Standalone Version of Guvnor
by rlinan@austin.rr.com
I am an application Systems Analyst who has been tasked with researching Rules Governance tools.
I downloaded the standalone version of Guvnor, expecting that I would not need to install any other software to be able to try it. This is an important consideration for me given my limited technical skills.
The down load was successful, but when I tried to follow the installation instructions, I encountered a problem. It said to look for tge .WAR file and execute that, but a could not find a .awr file in the zipped files. What am I missing?
13 years, 7 months
Authorisation of Guvnor users on Glassfish
by Chris Selwyn
I am using Guvnor 2.1.1 on Glassfish 2.1 and mostly it seems to work
very well.
However, I am now looking to setup authentication of users to the Guvnor
server and this is where I am finding problems.
I tried writing a class with an "authenticate" method to authenticate
against a Glassfish realm using ProgrammaticLogin but (as far as I can
tell) this class is not being used by Guvnor.
Looking at the source, Guvnor appears to only use the
org.jboss.seam.security.Identity.authenticate method which uses only the
jaas-config-name value from the components.xml file.
So I then tried setting the jaas-config-name to "fileRealm" (which
exists in Glassfish's default login.conf) but now I get
"javax.security.auth.login.LoginException: No credentials." logged in my
server.log (and the user get a fail message, naturally).
Has anyone out there managed to configure Guvnor to authenticate against
a Glassfish realm or JAAS context and would be willing to help me through?
Chris Selwyn
13 years, 7 months
Dynamic updates of stateful sessions
by Mattias Avelin
We have a application in which we have both stateless & stateful sessions
running. We're using the KnowledgeAgent and ChangeSets to automatically
update our knowledge bases when the rules are changed.
This works fine for our stateless sessions for which we are creating a new
session for each request and if the rules have been updated this is
reflected in next session we create.
But for stateful sessions I'm not quite as sure on how to get it working. I
can see in the logs that the KnowledgeBase is re-built when the
KnowledgeAgent detects the updated rule files. But my "long running" session
is does not reflect these changes (which it shouldn't right?). But how do we
apply these changes to the stateful session without loosing all the facts I
accumulated?
The way I've solved it now is to keep a "last updated" timestamp for the
knowledgeBase and a "created" timestamp for the session and then compare
these before using the session. If the knowledgeBase's "update timestamp" is
later that the sessions "creation timestamp" I create a new Session and then
"manually" copy all facts from the former to the latter.
Is this the way you would do this or is there a better way?
Best Regards
Mattias Avelin
13 years, 7 months