Re: [rules-users] RE: Is the future avail in 4.0

2007-10-06 Thread Mark Proctor

Sikkandar Nawabjan wrote:

Hi,
I have couple of questions
 
1) I want to validate a Object and based upon certain condition set the flag and that flag available in my working memory context so that all the rules will execute based on the value of this flag. Is there any way to set the Global variable in working memory environment and use it in predicate logic.

I beleive passing Global variable using setGLobal() is possible but we can't 
use it in predicate logic.
  
globals can be used in evals, however they should be considered 
immutable if you do that and should be set before you assert any working 
memory data.
 
2) my second quetion is i have 2 classes say
 
Public class B extends Class A{
 
private boolean  flag;
 
 
}
 
 
am validating my rule using of type B.

 But i want to assert object of class A. in normal java we do downcasting  B b 
= (B)obj;
if i don't do that will downcast will happen at the working memory side 
automatically??
  

If you assert A and there is a pattern on B, A will be matched against it.
 
 
Basha
 
 
  



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
  


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] RE: Is the future avail in 4.0

2007-10-06 Thread Michael Anstis
(1) Theres nothing stopping you using a singleton to hold state, so this
provides what you want:-

rule 1
when
$o : AnObject( someField == someCriteria )
then
boolean someFlag = true;
insert(new State( someFlag ) );
end

rule 2
when
State (someFlag == true )
$o : AnotherObject ( )
then
//something else
end

You could also have the first check activate another AgendaGroup, for
example:-

rule 1
when
$o : AnObject( someField == someCriteria )
then
drools.setFocus(SomeOtherGroup);
end

rule 2
agenda-group SomeOtherGroup
when
$o : AnotherObject ( )
then
 //something else
end

(2) I believe the ObjectTypeNode filters based on Class.isInstance() and
therefore you should be able to code rules based upon the sub-class and
insert super-classes.

With kind regards,

Mike


On 06/10/2007, Sikkandar Nawabjan [EMAIL PROTECTED] wrote:

 Hi,
 I have couple of questions

 1) I want to validate a Object and based upon certain condition set the
 flag and that flag available in my working memory context so that all the
 rules will execute based on the value of this flag. Is there any way to set
 the Global variable in working memory environment and use it in predicate
 logic.
 I beleive passing Global variable using setGLobal() is possible but we
 can't use it in predicate logic.

 2) my second quetion is i have 2 classes say

 Public class B extends Class A{

 private boolean  flag;


 }


 am validating my rule using of type B.
 But i want to assert object of class A. in normal java we do
 downcasting  B b = (B)obj;
 if i don't do that will downcast will happen at the working memory side
 automatically??


 Basha



 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] DRL doubts

2007-10-06 Thread Thiago H. Pojda
Oh yes I have, but I'd like to see something different. There are no
examples with brl files (well, I didn't find any).

:)

On 10/5/07, Anstis, Michael (M.)  [EMAIL PROTECTED] wrote:

  Have you downloaded the examples?

  --
 *From:* [EMAIL PROTECTED] [mailto:
 [EMAIL PROTECTED] *On Behalf Of *Thiago H. Pojda
 *Sent:* 05 October 2007 02:28
 *To:* rules-users@lists.jboss.org
 *Subject:* [rules-users] DRL doubts

 Hello,

 I'm building a rule structure (drl) from scratch. My first idea was to
 make a drl with it's corresponding dsl like: Geral.drl - Geral.dsl. But I
 saw some other kind of structures, like brl files and now I'm not sure
 what to use.

 If you guys could send me some some examples of working structures it
 would be great. I'm trying to make something organized, and looking at rules
 from more experienced people would help a lot.

 I'd like to have a general idea of things so I can make a better choice.

 Any help would be appreciated.

 Thank you,

 --
 Thiago Henrique Pojda
 Curitiba - PR - Brasil
 +55 41 99239019


 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users





-- 
Thiago Henrique Pojda
Curitiba - PR - Brasil
+55 41 99239019
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Red Hat Developer Studio (Beta 1) and Drools Plugin - Error creating the Agenda view.

2007-10-06 Thread Paul Browne

Folks,

I'm Using RHDS Beta 1 - clean install and the only plugin is 
Drools-Eclipse (snapshot of Thurs 3rd Oct). OS is Vista, using Java 
1.6.0_02 .


When I switch to Drools Perspective and try to open the Agenda View I 
get the following error : Error creating the view.

org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextListener

Global Data View , Working Memory View also have the same error. 
Strangely , Audit View works ok.


Any suggestions?

Paul




___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Red Hat Developer Studio (Beta 1) and Drools Plugin - Error creating the Agenda view.

2007-10-06 Thread Kris Verlaenen

Paul,

Correct me if I'm wrong, but I think RHDS is on top of Eclipse Europe (3.3), 
and the current version of the Drools plugin is still targeted to Eclipse 
3.2.  Most of it will work, but debug is one of the areas where there have 
been some changes in the internal eclipse APIs.  We'll be upgrading to 
Eclipse 3.3 after Drools 4.0.2 has been released (any day now), so once 
that's done, builds will be available for Eclipse 3.3 as well.


Kris

- Original Message - 
From: Paul Browne [EMAIL PROTECTED]

To: Rules Users List rules-users@lists.jboss.org
Sent: Saturday, October 06, 2007 11:40 PM
Subject: [rules-users] Red Hat Developer Studio (Beta 1) and Drools Plugin - 
Error creating the Agenda view.




Folks,

I'm Using RHDS Beta 1 - clean install and the only plugin is 
Drools-Eclipse (snapshot of Thurs 3rd Oct). OS is Vista, using Java 
1.6.0_02 .


When I switch to Drools Perspective and try to open the Agenda View I get 
the following error : Error creating the view.

org/eclipse/debug/internal/ui/contexts/provisional/IDebugContextListener

Global Data View , Working Memory View also have the same error. Strangely 
, Audit View works ok.


Any suggestions?

Paul




___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users 


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] BRMS - how to use variables on Action part?

2007-10-06 Thread Michael Neale
On the RHS, if you put = it will allow you to type in that calculation.

I guess that is not as intuitive as it shoudl be (on the LHS it makes you
tell it what you want to do), I am open to considering changing that so it
is more obvious.

Yes, you can only access setters this way (at the moment). Everything is
based around fields and facts, (not so much objects). The balancing act is
to not put too much power into the GUI (as if you want more, that is what
DRL is for).

On 10/4/07, Felipe Piccolini [EMAIL PROTECTED] wrote:

 Ok, so to fit on the not ignored emails from the list Mark posted, I
 changed the title. However I following in the list
 anyways beacuse Im resending this email in less than 3 days.

 Note: Im not desperate, nor this is for today. This just came out today
 yesterday and well... its important to me, but I
 think I can get a work around for now.

 So here is the real on-topic question.
 -
 Anyone knows how to use variables (from fields) setted on LHS, to modify a
 field on the RHS using the GUI editor
 from BRMS?

 What I need is to write this rule on BRMS.

 rule Set approvedMount for a women
 no-loop true
 when
  $p: Person($sex: sex == F, $income: incomeMount)
 then
  $p.setApprovedMount($income * 1.2);
  update($p);
 end

 I know I can use formulas, but I only know how to set those on LHS, I dont
 know how to put a formula on RHS (setter of the field to modify).

 Thanks.

 
 *Felipe
 Piccolini M.*
 [EMAIL PROTECTED]





 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users