Re: Inserting Facts within "Action nodes" (RuleFlow)
by Massi Gmail
Thank you very much Kris.
I will define such a rule.
thanks again.
Now I am experiencing something different...
I would like to introduce if\while statements into the action node
"code part".
Is that possible?
Every time i introduce such a statement into
the "textual editor "I get back a Mvel exception.
In case It were not possible, I think I would use
another rule like the one you suggested me.
Grazie.
Massi
----- Original Message -----
From: Kris Verlaenen
To: Rules Users …
[View More]List
Sent: Thursday, January 03, 2008 3:41 PM
Subject: Re: [rules-users] Inserting Facts within "Action nodes" (RuleFlow)
The ruleflow action node can be used to specify some action (as a piece of code) that should be executed. Currently, it only has access to global variables. It might indeed be a good idea to also allow access to some kind of workingMemory variable. We will try to add support for that when we add support for process variables. If you want, you could open a JIRA for this to track the issue.
Your solution, defining wm as a global, seems a possible workaround (and I don't see any problems that might arise by doing this). Another one would be using a ruleset node instead of an actionNode, and specifying a rule that does not have any conditions, something like:
rule "MyRule"
ruleflow-group "MyAction"
when
then
insert(new Object());
end
Kris
----- Original Message -----
From: mmquelo massi
To: Rules Users List
Sent: Wednesday, January 02, 2008 7:55 PM
Subject: [rules-users] Inserting Facts within "Action nodes" (RuleFlow)
Hi guys,
Is it possible to insert a new fact in the ruleflow action nodes?
I tried it simply adding an "insert(new Object())" instruction
in the action-node "textual editor" but I got back the following
exception:
org.mvel.PropertyAccessException
: unable to resolve property: insert(new Object())
Is it a simple dialect issue ? How to do it correctly?
Thank You!
Massi
----------------------------------------------------------------------------
_______________________________________________
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
[View Less]
17 years, 3 months
Custom EvaluatorFactory
by Andy Mei
Hi,
Is there a way I could register my own custom EvaluatorFactory?
Drools ships with DateFactory what compares only dates, but no time is
included. I would like to compare time as well.
I see that it would be very helpful to include capability to register
custom EvaluatorFactory.
Thanks.
Andy
17 years, 3 months
Re: JUnit and classpath
by J Michael Dean
I noticed the absence of asm and tried to manually add version 3.1 and
this had no effect on the trace.
The MinimalDrools plugin is just my plugin to contain what I thought
was the minimal amount of Drools stuff; I have the exact same error
when I put everything that is in the Drools distribution in the
classpath.
- Mike
On Jan 2, 2008, at 10:00 AM, rules-users-request(a)lists.jboss.org wrote:
>
>
> Mike,
>
> So it seems you are missing the ASM jar in your …
[View More]classpath... did
> you tried
> adding it?
> BTW, what is this MinimalDroolCore_1.0.0.jar that you are adding to
> your
> classpath? Drools also includes an inlined ASM version inside it for
> its own
> use... are you stripping that?
>
> []s
> Edson
>
> 2008/1/2, J Michael Dean <mdean77(a)comcast.net>:
>>
>> Thanks. When I do that, there is no reference to org.objectweb.asm,
>> nor is there even any reference to any asm library. The information
>> is
>> about 800 lines long and it clearly shows classes loading from my
>> "minimal core Drools" plugin; when I add the entire Drools
>> distribution to the classpath I get a similar dump with loading from
>> the complete Drools distribution. I am attaching a text file with
>> this information but I am guessing it will get stripped away by the
>> server. I very much appreciate your help with this.
>>
>> I
>>
>> On Jan 2, 2008, at 5:04 AM, rules-users-request(a)lists.jboss.org
>> wrote:
>>>
>>> Message: 8
>>> Date: Wed, 2 Jan 2008 10:00:46 -0200
>>> From: "Edson Tirelli" <tirelli(a)post.com>
>>> Subject: Re: [rules-users] Re: rules-users Digest, Vol 13, Issue 48
>>> To: "Rules Users List" <rules-users(a)lists.jboss.org>
>>> Message-ID:
>>> <e6dd5ba30801020400h2f0a16eyec3ba476c1b36f66(a)mail.gmail.com>
>>> Content-Type: text/plain; charset="iso-8859-1"
>>>
>>> Mike,
>>>
>>> I don't remember right now the exact flag to dump classpath, but
>>> adding
>>> "-verbose:class" as a VM parameter on your launch configuration
>>> shall do the
>>> trick. Just look for "org.objectweb.asm" package's Classes being
>>> loaded and
>>> you will know where they are being loaded from. You will easily be
>>> able to
>>> see if there is any other asm library clashing with the mvel
>>> required ones.
>>>
>>> []s
>>> Edson
>>>
>>> 2007/12/31, J Michael Dean <mdean77(a)comcast.net>:
>>>>
>>>> Sorry - am using Eclipse in OSX and have no clue how to ask it to
>>>> dump its
>>>> classpath.I can print out the .classpath file but this is clearly
>>>> not
>>>> really relevant.
>>>>
>>>> Mike,
>>>>
>>>> This looks like a classpath problem indeed. Did you tried asking
>>>> the JVM
>>>> to dump its classpath so that you can know for sure what jars are
>>>> included
>>>> and if any of them embeds a non-compatible ASM version ?
>>>>
>>>> []s
>>>> Edson
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>
>>
>>
>
>
> --
> Edson Tirelli
> JBoss Drools Core Development
> Office: +55 11 3529-6000
> Mobile: +55 11 9287-5646
> JBoss, a division of Red Hat @ www.jboss.com
>
[View Less]
17 years, 3 months
Inserting Facts within "Action nodes" (RuleFlow)
by mmquelo massi
Hi guys,
Is it possible to insert a new fact in the ruleflow action nodes?
I tried it simply adding an "insert(new Object())" instruction
in the action-node "textual editor" but I got back the following
exception:
*
org.mvel.PropertyAccessException*: unable to resolve property: insert(new
Object())
Is it a simple dialect issue ? How to do it correctly?
Thank You!
Massi
17 years, 3 months
Re: Inserting Facts within "Action nodes" (RuleFlow)
by Massi Gmail
I think i worked it around.
Before I fired the rules, I put the following instruction in the "main" code:
workingMemory.setGlobal("wm", workingMemory);
Ofcourse in this way I can access the working memory within
the ruleflow action nodes and I can use them in order
to assert new facts into the "wm" global.
Does it sound a bit tricky?
Does it imply horrible integrity\security issues?
Please, I need a feed back from the "drools" guys to know whether
what I did is correct or not.
Thank You …
[View More]everyone.
Massi
----- Original Message -----
From: mmquelo massi
Newsgroups: gmane.comp.java.drools.user
To: Rules Users List
Sent: Wednesday, January 02, 2008 7:55 PM
Subject: Inserting Facts within "Action nodes" (RuleFlow)
Hi guys,
Is it possible to insert a new fact in the ruleflow action nodes?
I tried it simply adding an "insert(new Object())" instruction
in the action-node "textual editor" but I got back the following
exception:
org.mvel.PropertyAccessException
: unable to resolve property: insert(new Object())
Is it a simple dialect issue ? How to do it correctly?
Thank You!
Massi
------------------------------------------------------------------------------
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
[View Less]
17 years, 3 months
Re: Inserting Facts within "Action nodes" (RuleFlow)
by mmquelo massi
Does Anyone can help me?
Massi
----- Original Message -----
*From:* mmquelo
massi<mhtml:{0087CD0D-F0D1-42F3-AEDE-0C39AEB6B8C7}mid://00000910/!x-usc:mailto:mmquelo@gmail.com>
*Newsgroups:* gmane.comp.java.drools.user
*To:* Rules Users
List<mhtml:{0087CD0D-F0D1-42F3-AEDE-0C39AEB6B8C7}mid://00000910/!x-usc:mailto:rules-users@lists.jboss.org>
*Sent:* Wednesday, January 02, 2008 7:55 PM
*Subject:* Inserting Facts within "Action nodes" (RuleFlow)
Hi guys,
Is it possible to insert a …
[View More]new fact in the ruleflow action nodes?
I tried it simply adding an "insert(new Object())" instruction
in the action-node "textual editor" but I got back the following
exception:
*
org.mvel.PropertyAccessException
*: unable to resolve property: insert(new Object())
Is it a simple dialect issue ? How to do it correctly?
Thank You!
Massi
------------------------------
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
[View Less]
17 years, 3 months
Qualifing objects on LHS
by kissro@lidp.com
Hello,
I have the following rules with the corresponding code in the LHS of
each in a single .drl file. These were not written by me but by someone
just as new to drools as I am. At the moment I'm not concerned with the
RHS of the rule.
rule "L_Quest_Q1_Add"
salience 20
when
not FormResponse(questionNumber == "Q1")
l_Quest : L_Quest(questionNumber =="Q1")
rule "L_Quest_Q3_Add"
salience 20
when
not FormResponse(…
[View More]questionNumber == "Q3")
l_Quest : L_Quest(questionNumber =="Q3")
rule "L_Quest_Q2_Add"
salience 10
when
formResponse1 : FormResponse(questionNumber == "Q1",
responseData == "Yes")
not FormResponse(questionNumber == "Q2")
l_Quest : L_Quest(questionNumber =="Q2")
rule "L_Quest_Q4_Add"
salience 10
when
formResponse3 : FormResponse(questionNumber == "Q3",
responseData == "Yes")
not formResponse4 : FormResponse(questionNumber == "Q4")
l_Quest : L_Quest(questionNumber =="Q4")
I want to rewrite these rules in a .dsl file making them as generic as
possible. Something like
when question {q} is not answered=not FormResponse(questionNumber == {q}
My question is regarding how to reference the 'formResponse' object.
For rule Q2_Add, do I really need to create 'formResponse1' and for rule
Q4_Add, do I have to create 'formResponse3' and 'formResponse4'? I
don't really want to have specific rules in my .dsl file like
when question 1 is answered=FormResponse1(questionNumber == 1, etc.
when question 3 is answered=FormResponse3(questionNumber == 3, etc.
when question 4 is not answered=not FormResponse4(questionNumber == 4)
Since I may have lots of questions, I don't want to have to have the
numbers hard-coded in the .dsl syntax if I don't have to. That's why
I'm wanting to know if I have to qualify 'FormResponse' so the rule
engine knows which 'FormResponse' I mean.
Thanks,
Rod
[View Less]
17 years, 3 months
Re: JUnit and classpath
by J Michael Dean
Thanks. When I do that, there is no reference to org.objectweb.asm,
nor is there even any reference to any asm library. The information is
about 800 lines long and it clearly shows classes loading from my
"minimal core Drools" plugin; when I add the entire Drools
distribution to the classpath I get a similar dump with loading from
the complete Drools distribution. I am attaching a text file with
this information but I am guessing it will get stripped away by the
server. I very …
[View More]much appreciate your help with this.
I
On Jan 2, 2008, at 5:04 AM, rules-users-request(a)lists.jboss.org wrote:
>
> Message: 8
> Date: Wed, 2 Jan 2008 10:00:46 -0200
> From: "Edson Tirelli" <tirelli(a)post.com>
> Subject: Re: [rules-users] Re: rules-users Digest, Vol 13, Issue 48
> To: "Rules Users List" <rules-users(a)lists.jboss.org>
> Message-ID:
> <e6dd5ba30801020400h2f0a16eyec3ba476c1b36f66(a)mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Mike,
>
> I don't remember right now the exact flag to dump classpath, but
> adding
> "-verbose:class" as a VM parameter on your launch configuration
> shall do the
> trick. Just look for "org.objectweb.asm" package's Classes being
> loaded and
> you will know where they are being loaded from. You will easily be
> able to
> see if there is any other asm library clashing with the mvel
> required ones.
>
> []s
> Edson
>
> 2007/12/31, J Michael Dean <mdean77(a)comcast.net>:
>>
>> Sorry - am using Eclipse in OSX and have no clue how to ask it to
>> dump its
>> classpath.I can print out the .classpath file but this is clearly not
>> really relevant.
>>
>> Mike,
>>
>> This looks like a classpath problem indeed. Did you tried asking
>> the JVM
>> to dump its classpath so that you can know for sure what jars are
>> included
>> and if any of them embeds a non-compatible ASM version ?
>>
>> []s
>> Edson
>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users(a)lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
>
[View Less]
17 years, 3 months