Re: [rules-users] Doubt regarding the Email WorkItem in Drool Flow
by Pardeep.Ruhil@lntinfotech.com
Hi Mauricio
No I haven't seen that. Thanks for telling me this.
Now I am able to send Email through the Email WorkItem Handler.
Thanks & Regards
Pardeep Ruhil
> did you see
>
>trunk/drools-process/drools-workitems/src/test/java/org/drools/process/workitem/email/EmailWorkItemHandlerTest.java
> ?
2009/8/24 <Pardeep.Ruhil(a)lntinfotech.com>
>
> Hi,
> I have a question regarding the email workItem that is present in the
Drool
> Flow.
> I want to know, does Drool Flow support for sending the emails or we
have
> to externally provide
> the functionality for sending the emails in the WorkItemHandler for
email.
>
> If Drool provides the in-built functionality of email sending through
the
> Email workitem, so where
> I have to provide the configuration for SMTP server for sending of
Emails
> and
> other related setting that are required for using the Drools in-built
email
> functionality.
>
> Thanks & Regards
>
> Pardeep Ruhil
>
______________________________________________________________________
15 years, 4 months
drools-[slidingTimeCount]
by Francesco Chiarelli
Hi!
I'm trying to use a sliding time fro count a facts with a condition.
I'have set a stream mode.
In test, with pseudo clock active, set this to current Time (it's correct?),
declare a fact type in drl with
declare MyFact (i've a javabean)
@role(event)
@timestamp(myTimestamp)
end
attribute type of myTimestamp must be long or Date? I've tried with both but
nothing, engine count all fact
ex: n fact in x days ago from now, the statement over window:time(1s) result
always n fact. why?
in when:
// $o : Order(<condition>)
$nRic : Number(intValue<maxRic) from accumulate($n: Order(this==$o) over
window:time(1s),count($n))
ps. if i set a real clock altough a pseudo, in runTime i've a ClassCastExc.
to JdkTimerService
Thanks in advance.
*Francesco*
15 years, 4 months
drools-[SplitConstraint]
by Francesco Chiarelli
Hi!
In a split constraint i've:
$bool:Boolean(booleanValue==true) from hbnSession.createQuery("select active
from Euristic where name=:name").setString("name","C").uniqueResult()
eval($bool)
but the result is:
XOR split could not find at least one valid outgoing connection for split
C_isActive?
hbnSession is an active hibernateSession
In a simple drl rule, this works fine.
unfortunately, the previous post (slidingTime) is yet unresolved. :(
Thanks in advance.
*Francesco*
15 years, 4 months
DROOLS 4.0.7 Regular expression
by Romain Van der Keilen
Hi there,
I'm looking how to use regular expression with Drools 4.
I've already found some things but they don't work.
Here is an example I want to do, considering all getters and setters are properly written:
Class House
+ private Window myWindow
+ private Phone myPhone
Class Door
+ private String name
Class Phone
+ private String phoneNumber
Let's say in my country phone numbers are the following type: xx/xxx.xx.xx
If I give my house to the session, how can I check if the phone is correct? I've tryied this but that's not working:
rule "Check phone"
when
h : House ( phone: phone );
eval ( phone != null );
Phone ( phoneNumber matches "^ -regex- $");
then
System.out.println("my phone is correct");
End
Thanks for help,
Romain Van der Keilen
15 years, 4 months
Using constants in drools flow
by kothvandir kothvandir
Hello,
How can I define a constant in en jboss flow process so I can use it in a
flow-group rules?
I have defined it in the .drl that contains the ruleflow-group but when i
try to set the constant with my service object using:
ksession.setGlobal("myService", serviceObject);
an Exception is thrown
java.lang.RuntimeException: Unexpected global
[myService]
Is there any way to define globals in the .rf file within <head> tag? anyone
knows where can i find the xsd description for .tf files?
Thanks
15 years, 4 months
Re: [rules-users] populating global variable in Condition Section?
by Greg Barton
Of course, I had to test that assertion. :)
$ java -Xmx128M -server -jar target/DroolsExistence-1.0.jar not.drl 50000
25000
2395ms
$ java -Xmx1024M -server -jar target/DroolsExistence-1.0.jar not_exists.drl 50000
25000
121378ms
You ain't kiddin'! 50x slower requiring 9x the memory.
--- On Fri, 8/21/09, Wolfgang Laun <wolfgang.laun(a)gmail.com> wrote:
> From: Wolfgang Laun <wolfgang.laun(a)gmail.com>
> Subject: Re: [rules-users] populating global variable in Condition Section?
> To: "Rules Users List" <rules-users(a)lists.jboss.org>
> Date: Friday, August 21, 2009, 4:54 PM
> <quote>
> It is rather common for people to
> write something like "(not (exists
> (A)))," but this is just a
> very inefficient way to write (not
> (A)).
> </quote>
>
> Kudos to Ernest Friedman-Hill to put this sentence into the
> Jess documentation.
>
> Maybe I should quote hiom in the Drools Expert doc ;-)
>
>
> -W
>
>
> On Fri, Aug 21, 2009 at 11:11 PM,
> Shah, Malay <Malay.Shah(a)morganstanley.com>
> wrote:
>
> May be I have not put the question right. We have a drool
> rule that is running extremely slow for large sets of data.
> The rule is something like:
>
>
>
> For every object A, perform action if there does not exist
> an object B such that A.id = B.id.
>
> And the corresponding drool rule is as follows:
>
>
>
> when
>
> A()
>
> not(exists B(A.id = id))
>
> then
>
> action......
>
>
>
> The performance is bad because of not exists clause here.
> We have got OOM exceptions with relatively large amounts of
> data for this rule. To improve performance, we basically
> hacked the rule/code into something like this:
>
>
>
>
> Create a global variable x that is a HashSet of all ids of
> object A, and the drool rule now is:
>
>
>
> global java.util.HashSet x;
>
> when
>
> B()
>
> eval
>
> (
>
> ! (x.contains(b.id) )
>
> )
>
> then
>
> action.....
>
>
>
> This obviously is performing much better with hashes
> involved. But, I don't like the fact that we have to
> write the logic of this rule at two places. I would rather
> create this variable x (don't care whether it is global
> or temporarily bound) in the rule itself and use it in the
> condition to help performance and have all logic for the
> rule at one place.
>
>
>
>
> Is there a way to generate this hashset x in the condition
> part of the rule itself? Yes, I understand that I am trying
> to mix up the procedural part of code with drool code. But,
> I was just wondering if this is possible to keep the java
> code clean and have the intelligence of information that the
> rule needs to be evaluated in the rule itself.
>
>
>
>
> Hope this clears some doubts.
>
>
>
> Thanks
>
>
>
> Malay Shah
>
>
>
> -----Original Message-----
>
> From: rules-users-bounces(a)lists.jboss.org
> [mailto:rules-users-bounces@lists.jboss.org]
> On Behalf Of Greg Barton
>
>
> Sent: Friday, August 21, 2009 4:44 PM
>
> To: Rules Users List
>
> Subject: Re: [rules-users] populating global variable in
> Condition Section?
>
>
>
> This is a galactically bad idea. Using a global in this
> way is inherently unsafe as there's no guarantee that
> ebtween the time you set the var and when it's used
> later in the condition that the value is the same. What is
> your reason for wanting to use a global in this way? You
> should use a temporary bound variable instead.
>
>
>
>
> --- On Fri, 8/21/09, Shah, Malay <Malay.Shah(a)morganstanley.com>
> wrote:
>
>
>
> > From: Shah, Malay <Malay.Shah(a)morganstanley.com>
>
> > Subject: [rules-users] populating global variable in
> Condition Section?
>
> > To: rules-users(a)lists.jboss.org
>
> > Date: Friday, August 21, 2009, 3:19 PM
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > Hi,
>
> >
>
> > Is it possible
>
> > to populate a global variable in
>
> > the condition section of the
>
> > drool rule, and use it later in the condition itself?
>
> > I currently have a
>
> > global HashSet variable that I construct before firing
> the rule, but I
>
> > would like this code of constructing this global
> variable to be with
>
> > the drool rule itself. Any help on this would be much
> appreciated.
>
> >
>
> > Thanks
>
> >
>
> > Malay
>
> >
>
> >
>
> >
>
> > NOTICE: If received in error, please
>
> > destroy, and notify sender. Sender does not intend to
> waive
>
> > confidentiality or privilege. Use of this email is
>
> > prohibited when received in error. We may monitor and
> store emails to the extent
>
> > permitted by applicable law.
>
> >
>
> >
>
> > -----Inline Attachment Follows-----
>
> >
>
> > _______________________________________________
>
> > rules-users mailing list
>
> > rules-users(a)lists.jboss.org
>
> > https://lists.jboss.org/mailman/listinfo/rules-users
>
> >
>
>
>
>
>
>
>
>
>
> _______________________________________________
>
> rules-users mailing list
>
> rules-users(a)lists.jboss.org
>
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
> --------------------------------------------------------------------------
>
> NOTICE: If received in error, please
> destroy, and notify sender. Sender does not intend to waive
> confidentiality or privilege. Use of this email is
> prohibited when received in error. We may monitor and store
> emails to the extent permitted by applicable law.
>
>
>
>
> _______________________________________________
>
> rules-users mailing list
>
> rules-users(a)lists.jboss.org
>
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
15 years, 4 months
BRMS configuration changes to support Oracle
by David Godfrey
Hi,
Is anyone able to supply an example repository.xml used to configure Drools
BRMS to work with an Oracle database rather than flat-file based repository?
I have tried following examples I found on the internet, including the
Jackrabbit site, but it is very non-obvious and there seems to be no example
showing a full working xml file, just small snippets.
With the configuration I have, I can see that tables are being created in my
database, but I get many different errors, e.g. complaining that the
repository ".lock" file is locked by another process, even though I thought
it shouldn't be using that file any longer in favour of Oracle.
Many thanks,
Dave
--
Ted Turner <http://www.brainyquote.com/quotes/authors/t/ted_turner.html> -
"Sports is like a war without the killing."
15 years, 4 months