uot;1");
> objectList.add("2");
> drools.getWorkingMemory().setGlobal("objectList", objectList);
> end
>
> Kris
>
> - Original Message -
> From: "drools_user" <[EMAIL PROTECTED]>
> To:
> Sent: Wednesday, October 24
LHS of the rule.
>
> This should provide the condition you request and prevent the rule from
> firing after the global has been initialised.
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of java_user_
> Sent: 30 October 20
rom: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of java_user_
Sent: 30 October 2007 16:06
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Initialize Global
Hi Kris,
I am using a JSR94 stateful session. My design is to initialize the global
list once and reuse it within the s
Hi Kris,
I am using a JSR94 stateful session. My design is to initialize the global
list once and reuse it within the same session.
The init-global rule is being executed each execution because there is no
conditional statement. Can I disable the rule for future executions?
Thanks
Kris V
d
rule "end"
salience 97
when
$g : MyGlobalObject( list != null )
then
System.out.println("End objectList: " + $g.getList());
end
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Waruzjan
Shahbazian
Sent: 3
>> $g : MyGlobalObject( list != null )
>> then
>> System.out.println("End objectList: " + $g.getList());
>> end
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Waruzjan
Shahbazian
Sent: 30 October 2
Thanks, that sounds logical to me. I guess I just have to "trust" that
the rule where the array gets initialised activates earlier than the
rule where I need the array. That shouldn't be a problem since I use
salience and to avoid nullpoint exceptions I can use the if(objectList
!= null) in th
It's normal.
Globally, the rule engine works in two steps :
- first : the activation (the "when" statement)
- second : the execution (the "then" statement) with salience, ruleflow ...
In your test, you have in the first step objectList = null and in the second
step objectList = [1, 2].
If you
;, objectList);
>> end
>>
>> Kris
>>
>> - Original Message -
>> From: "drools_user" <[EMAIL PROTECTED]>
>> To:
>> Sent: Wednesday, October 24, 2007 7:35 PM
>> Subject: [rules-users] Initialize Global
>>
&g
I have the same "problem", but eval(objectList == null) doesn't work. If
I don't execute "drools.getWorkingMemory().setGlobal()" it "works fine",
as if the rule activates and the object is null.
global List objectList;
rule "Start"
salience 101
when
#conditions
then
obje
That initialized my global but the rule still runs every execution. Can I
disable the rule after the first execution?
What do you mean by "every execution". A rule should only be executed once,
unless it gets reactivated (which should not be the case in this situation).
I would like to use (i
t.add("2");
> drools.getWorkingMemory().setGlobal("objectList", objectList);
> end
>
> Kris
>
> - Original Message -
> From: "drools_user" <[EMAIL PROTECTED]>
> To:
> Sent: Wednesday, October 24, 2007 7:35 PM
> Subjec
Beware,
2.5.4.5. Globals
"If you use a global on the LHS of a rule, make sure it is immutable."
regards,
V.
java_user_ wrote:
>
> How do I initialize a global fact in the drl file? I want use the JSR94
> API and avoid using the Drools API inside the Java code. I would like to
> access the
s.getWorkingMemory().setGlobal("objectList", objectList);
end
Kris
- Original Message -
From: "drools_user" <[EMAIL PROTECTED]>
To:
Sent: Wednesday, October 24, 2007 7:35 PM
Subject: [rules-users] Initialize Global
How do I initialize a global fact in the
When
$f : MyFact()
Then
$f.doSomethingToInitialiseIt();
End
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of drools_user
Sent: 24 October 2007 18:35
To: rules-users@lists.jboss.org
Subject: [rules-users] Initialize Global
How
How do I initialize a global fact in the drl file? I want use the JSR94 API
and avoid using the Drools API inside the Java code. I would like to access
the same variable every execution of a stateful session without having to
reinstantiate the variable after each execution?
Basically I want to
16 matches
Mail list logo