Specifying time in date-effective
by devyani.sapre@wipro.com
Hi All
I am using 4.0. I have a requirement to execute a rule only during a
specified time of a given day
While going through the documentation I found that I could use the
date-effective attribute to specify the date and time
6.5.1.8. date-effective
default value : N/A
type : String, which contains a Date/Time definition
A rule can only activate if the current date and time is after
date-effective attribute.
But while trying out the same, the engine recognizes only the day and
not the time. How do I specify the time? So far I have been using the
std format HH:MM:SS , tried both 12-hr and 24 -hr format but no luck.
Please help.
Also, I would like to know how can I make a rule run on a specified time
everyday. With date-effective specifying a date would be mandatory? Is
thr a way or I need to put that in the rule condition part.
Thanks
Devyani
Please do not print this email unless it is absolutely necessary.
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
14 years, 2 months
Drools Flow: Activities and Sequence Flows
by Simon Peter
Hi,
Although the BPMN2 specification hasn't actually been ratified as yet,
Drools 5.1.x does appear to be backing BPMN2 (obviously a good decision!).
However, according to the spec, Drools isn't doing BPMN proper - and
regardless of whether the spec has been ratified or not, it could be closer
than it is.
There are a couple of examples I've come across, but the most obvious one is
the treatment of multiple sequence flows entering and leaving activities.
Where Drools requires a Gateway for this, the spec does allow it. To quote
from the spec:
"But there are special
considerations relative to Sequence Flows when applied to Activities. An
Activity that is the target of multiple
Sequence Flows participates in 'uncontrolled flow.'"
It goes on to describe the expected behaviour; the sequence flow should
behave as an exclusive gateway.
See page 441 of the spec available @
http://www.omg.org/cgi-bin/doc?dtc/10-06-04.pdf (it's a 7.5 meg download)
I can raise a bug if that is appropriate.
- Simon
14 years, 2 months
Chained Rules
by djb
Hi all,
I know there are some basic ways to chain rules together, by setting flags
in consequences that are checked in the conditions of other rules...
but in a large system based on rule templates, where thousands of rules are
generated, it is not feasible to chain rules in this manner, especially when
they are chained in a somewhat arbitrary fashion
(eg. True if Rule 130 AND Rule 200 AND Rule 480 fire)
has anyone had this situation before? would I need to execute this as a
post-processing step? or, is there any design pattern that will allow rules
to be chained, preferably in a manageable way?
regards,
Daniel
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Chained-Rules-tp77549...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 2 months
Change drools process variables
by jawa
Hi,
I am writing a drools flow which is backed up by JPA. It get stored into db
and then reloaded etc. I've some user task nodes on which flow stops and
gets stored in db. Then i reload it from db and resume flow etc. When i
start my flow I supply it with flow parameter map. It starts with those flow
variables. Now when it reaches a user task it stops there and get stored in
db and wait for that node to complete. Then for a certain type of request I
reload my session and complete the work item and flow resumes from where it
stopped last time. What i wanted to know is can I modify the object i
inserted into flow while starting it first time? Is it possible at all?
Thanks
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Change-drools-process...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 2 months
How to integrate Guvnor GUI in a test app
by Harshit Bapna
Hi All,
I have just started learning Drools. I have gone through various Guvnor
screens.
My requirement is to integrate the Rule Mgmt functionality of guvnor into my
test app.
1. Is there any way where I can integrate Guvnor GUI in my test app ?
Are there any suggested steps to do so ?
14 years, 2 months
4.x to 5.1.0 Rule migration issue
by Kumar Pandey
Hi
I've inherited some old code running under 4.x of Drools. I'm investigating
use of 5.1.0 for newer development.
I was testing the old code base as is with drools 5.1.0 and got some
compilation issues on the DRL. Here is the sample drl snippet
package com.test.rule
import ...
rule "EmailVerificationCheck"
salience 500
when
context : RuleContext (paymentMethod == "P_EXPRESS")
eval (!context.isTrustedUser())
act : RuleAction (action == null || == "VERIFY")
then
if (act.getAction() == null) {
if(!context.isPEmailVerified()) {
act.setAction ("VERIFY");
}
}
if (act.getAction() == "VERIFY") {
if(!context.isPEmailVerified()) {
act.getRuleNames().add("PEmailVerificationCheck");
}
}
end
Compilation error is at eval (!context.isTrustedUser()) and the error
message is as follows -
org.drools.rule.InvalidRulePackage: Unable to generate rule invoker. :
org.drools.lang.descr.EvalDescr@1f8b158
com/playspan/rule/Rule_PayPal_EmailVerificationCheck_0Eval0Invoker.java
(16:48) : Redefinition of local variable "context"
at org.drools.rule.Package.checkValidity(Package.java:477)
~[drools-core-5.1.0.jar:5.1.0]
at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:479)
~[drools-core-5.1.0.jar:5.1.0]
at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:445)
~[drools-core-5.1.0.jar:5.1.0]
at org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:452)
~[drools-core-5.1.0.jar:5.1.0]
at com.playspan.rule.RuleEngine.buildRuleBase(RuleEngine.java:374)
[classes/:na]
at com.playspan.rule.RuleEngine.initializeRuleSession(RuleEngine.java:384)
[classes/:na]
It is using java dialect and JANINO compiler.
I would really appreciate if some could point me to a direction for
troubleshooting this issue.
Is this construct invalid for 5.x onwards?
Thanks
Kumar
14 years, 2 months
Re: [rules-users] Multi threaded rule engine question.
by Greg Barton
I wouldn't reuse a stateless session. You could reuse a stateful session and clean up between runs, but session creation is not that expensive. (and easily less expensive than cleanup of a stateful session, mattering on the complexity of your rules)
GreG
On Sep 27, 2010, at 8:39, Nadav Hashimshony <nadavh(a)gmail.com> wrote:
My rule engine server is multi threaded.
in the server main i build a knowledgebase:
KnowledgeBuilderConfiguration config = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(droolsConf, null);
KnowledgeBuilder builder = KnowledgeBuilderFactory.newKnowledgeBuilder(config);
builder.add(ResourceFactory.newFileResource("path to drools pkg", ResourceType.PKG);
KnowledgeBase knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();
knowledgeBase.addKnowledgePackages(builder.getKnowledgePackages());
i have 10 threads that have the following code:
thread run method:
as long as a Vector has data do:
1. StatelessKnowledgeSession droolsSession= m_droolsKagent.getKnowledgeBase().newStatelessKnowledgeSession();
2. get data object from a vector
3. create fact model from data
4. droolsSession.insert(facts);
5. droolsSession.fireAllRules();
6. do stuff with the response
7.droosSession.dispose
8.get next object from vector.
Questions:
1. should i create each time the droolsSession? or can i resuse the same one, meaning can i create it in the Thread's constractor?
Thanks
Nadav.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
14 years, 2 months
Help require for "web actor" related task
by Ashish.zokarkar
Hello,
I am newbie for Drools flow. I am trying to build work flow in which
according to condition I have to ask either person properties or user
properties.
I am trying to embed it in web project. So I created 3 jsps.
1. Ask information about User or Product.
2. According to selection shows different options.
3. Display all the properties.
What I am trying is, remove all the forwards from jsp and put them in
workflow so that its easily supportable for new object as well.
I think I should use "Human Task" where I am taking user input.
Now i have below questions:
1. I am trying to use "Human Task". But I can see it supports only Web
Service Human task. Is it true???
2. How can I use "Human Task" in this situation? In examples, I can see, I
require EntityManagerFactory, mina Task which should run on some port. Is
these steps really necessary???
3. I am trying really simple POC where I require kind of web actor which
should wait till user click on "Submit" button and then proceed to next
step. Is any similar kind of support Drools have?? If yes how can i use it??
Small code snippets or doc link will be very helpful...
Thank you very much in advance..
Ashish Zokarkar
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Help-require-for-web-...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 2 months