Re: [rules-users] Guvnor Building pkg error

2009-06-17 Thread Toni Rikkola

Hi,

Just noticed that you asked this same thing in the drools-dev list ( and 
I even replied to it :) ).


Please try to only ask on one list. This list, drools-users is the one 
for this type of questions.


Thanks
Toni

Yan Liu wrote:
When trying to build a package (even using the sample pkg from drools 
Guvnor) I got this - Sorry, a technical error occurred. Please 
contact a system administrator.
 
This is indeed very frustrating as I need to build binary pkgs for my 
remote rule agents to access. I found the post here saying it is 
fixed. https://jira.jboss.org/jira/browse/GUVNOR-327 No details though.
 
Can anyone shed some light on this problem if you know how to fix it?
 
Thanks in advance for your reply.
 
Yan



___
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


[rules-users] Where is the log4j configuration file kept?

2009-06-17 Thread Lukas, Ray
This is such a simple thing I would think.. But I don't have it working.
Con someone please help out. 
I am running a standalone Drools application in Eclipse, I have it all
working and all my rules fire and everything works great, but I can not
get log4J working with it. I have climbed mountains only top stumble on
a pebble.. ...
Log.error(x) sends to console. So I know that a log4j configuration is
in play. I don't see a log4j properties file, or xml file to add my
stuff into. That is the problem.. where is that located... 
Creating my own, and adding it to the class path, of course, as you
would expect, just gets ignored.. 
Where is the one that Drools uses??

This is what I am looking to add.. I am pretty sure this is correct, but
I could be wrong, long hours and... I could be wrong...

  appender name=myProject
class=org.jboss.logging.appender.RollingFileAppender
  errorHandler
class=org.jboss.logging.util.OnlyOnceErrorHandler/
  !-- param name=File
value=${jboss.server.log.dir}/server.log/ --
  param name=File value= myProject.log/
  param name=Append value=true/
 param name=MaxFileSize value=10MB/
 param name=MaxBackupIndex value=20/
  layout class=org.apache.log4j.PatternLayout
 param name=ConversionPattern value=%d %-5p [%c] %m%n/
  /layout
   /appender
   category name=com.model
 priority value=Trace /
 appender-ref ref= myProject/
   /category
   category name=com.request
 priority value=Trace /
 appender-ref ref= myProject/
   /category
   category name=com.response
 priority value=Trace /
 appender-ref ref= myProject/
   /category
   category name=com.sample
 priority value=Trace /
 appender-ref ref= myProject/
   /category


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


Re: [rules-users] Guvnor Building pkg error

2009-06-17 Thread Yan Liu
Toni,

Thanks for your reply. Seems you guys use a different version of mvel2.jar
for Guvnor 5 and my glassfish picked up the older version. Had it fixed and
it builds fine now.

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


[rules-users] Creating drools rules porgramatically?

2009-06-17 Thread Malay Shah

Hi,

I am looking to create the drools Rule objects programatically, and I
believe there is API to do that in 4.0.7. But, the API looks complex and the
documentation is not sufficient. Could anyone please point me to some
examples of doing this? I basically don't want to write rules in .drl files,
but have a database store the rules and make them strongly typed (by
generating Rule Objects directly from DB). Any help is much appreciated.

Thanks
Malay

-- 
View this message in context: 
http://www.nabble.com/Creating-drools-rules-porgramatically--tp24077426p24077426.html
Sent from the drools - user mailing list archive at Nabble.com.

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


Re: [rules-users] Creating drools rules porgramatically?

2009-06-17 Thread Dave Cracauer
Malay,
We've been doing something similar to what you are asking for, but using the 
rule syntax as an intermediate step.  We have a datamodel that users can use to
express the rules, and we have a templating engine that turns that into the 
drools syntax.  This then gets compiled into packages and built into a rule 
base.  This has worked rather well for us, as it allows us to make updates to 
logic on the fly by changing the templates.

--
Dave

-Original Message-
From: Malay Shah malay.s...@morganstanley.com
Sent: Jun 17, 2009 12:36 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] Creating drools rules porgramatically?


Hi,

I am looking to create the drools Rule objects programatically, and I
believe there is API to do that in 4.0.7. But, the API looks complex and the
documentation is not sufficient. Could anyone please point me to some
examples of doing this? I basically don't want to write rules in .drl files,
but have a database store the rules and make them strongly typed (by
generating Rule Objects directly from DB). Any help is much appreciated.

Thanks
Malay

-- 
View this message in context: 
http://www.nabble.com/Creating-drools-rules-porgramatically--tp24077426p24077426.html
Sent from the drools - user mailing list archive at Nabble.com.

___
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] Creating drools rules porgramatically?

2009-06-17 Thread Malay Shah

Thanks for the response Dave. I see that a template engine like
XSLT/FreeMarker would surely help in this case, but am still interested in
knowing about the API to understand how I could model the rules in DB and
make sure that I don't loose any flexibility by storing rules in DB.

Regards,
Malay


David Cracauer wrote:
 
 Malay,
 We've been doing something similar to what you are asking for, but using
 the rule syntax as an intermediate step.  We have a datamodel that users
 can use to
 express the rules, and we have a templating engine that turns that into
 the drools syntax.  This then gets compiled into packages and built into a
 rule base.  This has worked rather well for us, as it allows us to make
 updates to logic on the fly by changing the templates.
 
 --
 Dave
 
 -Original Message-
From: Malay Shah malay.s...@morganstanley.com
Sent: Jun 17, 2009 12:36 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] Creating drools rules porgramatically?


Hi,

I am looking to create the drools Rule objects programatically, and I
believe there is API to do that in 4.0.7. But, the API looks complex and
the
documentation is not sufficient. Could anyone please point me to some
examples of doing this? I basically don't want to write rules in .drl
files,
but have a database store the rules and make them strongly typed (by
generating Rule Objects directly from DB). Any help is much appreciated.

Thanks
Malay

-- 
View this message in context:
http://www.nabble.com/Creating-drools-rules-porgramatically--tp24077426p24077426.html
Sent from the drools - user mailing list archive at Nabble.com.

___
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
 
 

-- 
View this message in context: 
http://www.nabble.com/Creating-drools-rules-porgramatically--tp24077426p24078773.html
Sent from the drools - user mailing list archive at Nabble.com.

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


[rules-users] Is work item configuration needed at run time? Can it be built programmatically?

2009-06-17 Thread msully

Hi folks,

I'm trying to use Drools Flow in a Spring DM environment.  I've OSGified its
jars and things look promising.  The thing is, I want to use Work Items for
my domain interface, and I want WorkItemHandler's to come from the service
broker.  I can see how most of this would work, except for reading in the
workDefinitions.conf for a new work item.  I've down a quick browse through
the source code and I think it might be that I don't need the work item
configuration file during run time, just for visual rule building.  Anyone
know if that is true?

If it is needed, is there an API that I can introduce it into while building
the session, the way I can introduce KnowledgePackages/rules files?

Thanks,
mike
-- 
View this message in context: 
http://www.nabble.com/Is-work-item-configuration-needed-at-run-time---Can-it-be-built-programmatically--tp24079237p24079237.html
Sent from the drools - user mailing list archive at Nabble.com.

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


Re: [rules-users] Creating drools rules porgramatically?

2009-06-17 Thread Mark Proctor

Malay Shah wrote:

Thanks for the response Dave. I see that a template engine like
XSLT/FreeMarker would surely help in this case, but am still interested in
knowing about the API to understand how I could model the rules in DB and
make sure that I don't loose any flexibility by storing rules in DB.
  
There is the Desr api, that is built by antlr. We have no plans to 
document that though, and it's not a stable api and thus subject to 
change. It is however straight forward and easy to reverse engineer as 
you can just parse stuff yourself and check the Descr tree that it 
builds. There is a lower level api, around rule/spi, which is after the 
build stage, which I've heard a few people are targetting - but that 
really is just for crazy people :)


My recomendation is by all means build and persist your own object 
structures but use a templating approach to render that structures to 
DRL. I would use the MVEL templating engine as it's both faster and more 
powerful than FreeMarker or Velocity and you already have MVEL as a 
dependency of Drools.

http://mvel.codehaus.org/MVEL+2.0+Templating+Guide

Mark

Regards,
Malay


David Cracauer wrote:
  

Malay,
We've been doing something similar to what you are asking for, but using
the rule syntax as an intermediate step.  We have a datamodel that users
can use to
express the rules, and we have a templating engine that turns that into
the drools syntax.  This then gets compiled into packages and built into a
rule base.  This has worked rather well for us, as it allows us to make
updates to logic on the fly by changing the templates.

--
Dave

-Original Message-


From: Malay Shah malay.s...@morganstanley.com
Sent: Jun 17, 2009 12:36 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] Creating drools rules porgramatically?


Hi,

I am looking to create the drools Rule objects programatically, and I
believe there is API to do that in 4.0.7. But, the API looks complex and
  

the
  

documentation is not sufficient. Could anyone please point me to some
examples of doing this? I basically don't want to write rules in .drl
  

files,
  

but have a database store the rules and make them strongly typed (by
generating Rule Objects directly from DB). Any help is much appreciated.

Thanks
Malay

--
View this message in context:
  

http://www.nabble.com/Creating-drools-rules-porgramatically--tp24077426p24077426.html
  

Sent from the drools - user mailing list archive at Nabble.com.

___
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





  


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


[rules-users] Help -- running JSR-94 TCK with drools-jsr

2009-06-17 Thread Chuck Baker

Hi,

The mvn package nicely generated the tck_res_1.xml and tck_res_2.xml 
fles.  All the implementation
instructions I've been able to find indicate that an additional file 
run_tck.xml is also needed.


Is there a way to generate this file as well?

thanks
Charles Baker


Charles Binford wrote:

Thanks Mark.  We'll give it a try.

cb


On 06/12/09 11:52, Mark Proctor wrote:

Charles Binford wrote:

We were trying to run the JSR-94 TCK with Drools 4.0.7.  With google, I
found this tutorial:

http://legacy.drools.codehaus.org/JSR-94+TCK+Tutorial
(same tutorial is also found here)
http://docs.codehaus.org/display/DROOLS/JSR-94+TCK+Tutorial

but it was written for Drools 2.0 and some of the key links are 
broken -

e.g. links in the following text:  Simply download the Drools rule
execution sets named tck_res_1.xml
http://cvs.drools.codehaus.org/%2Acheckout%2A/drools/drools-jsr94/src/test/org/drools/jsr94/tck/tck_res_1.xml 


and tck_res_2.xml
http://cvs.drools.codehaus.org/%2Acheckout%2A/drools/drools-jsr94/src/test/org/drools/jsr94/tck/tck_res_2.xml 

and copy them over the tck_res_1.xml and tck_res_2.xml files 
provided in

the JSR-94 Specification.

Is there an update tutorial or can someone point me to instructions on
how to run test kit against drools 4.0.7?
  
It runs as part of the maven build. Just cd into drools-jsr94 and 
run mvn package.


Mark

Thanks,
Charles Binford
___
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

___
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


[rules-users] averages on different data types

2009-06-17 Thread Chris Richmond
Hi guys,

 

Building from the stockticker sample, I have been running my own average
aggregates over time and window length and I have the following rule.it
simply runs a last 10 average and outputs the average(in theory). 

 

rule show averages

when

 

$n : Number( doubleValue  0 ) from accumulate (

 

 

 

$mdo : MyDataObject($tm: delayTime) over window:length(10) from
entry-point DataObject stream,

average( $tm )

 

)

 

 

then

 

System.err.println($tm);

 

End

 

I have set the limit to 0 for the average because I simply want to have it
fire every time, no matter the average(they are all positive)

 

 

However I get this error:

 

Unable to build expression for 'consequence': Failed to compile: 1
compilation error(s): 

 - (1,3) unqualified type in strict mode for: $tm '

System.err.println($tm);

' : [Rule name='show averages']

 

 

If I have the consequence 

 

System.err.println($n);

 

Then it outputs the average no problem, but I am trying to simply output
that indifidual value, delayTime which I have stored in $tm is an integer,
so I cannot figure out why I cannot output this value.Similarly if I
simply try as a consequence:

 

System.err.println($ mdo.delayTime);

 

I get a similar error.

 

What am I doing wrong?

 

Thanks,


Chris

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


RE: [rules-users] averages on different data types

2009-06-17 Thread Chris Richmond
So how can I access variables that I have populated from within that scope
delimiter(accumulate)?  For instance if I did want to access the delayTime,
what strategy should be used?

 

Thanks,


Chris

  _  

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Wednesday, June 17, 2009 11:49 AM
To: Rules Users List
Subject: Re: [rules-users] averages on different data types

 


   Chris,

   Remember that accumulate is a scope delimiter, meaning variables bound
inside accumulate are not visible outside of it. The error message you see
is the MVEL way of saying: non-existing variable (I guess you are using mvel
as the dialect for the consequence).

   If you want to know what data objects are being inserted/expired from the
working memory, use a working memory listener.

   []s
   Edson

2009/6/17 Chris Richmond crichm...@referentia.com

Hi guys,

 

Building from the stockticker sample, I have been running my own average
aggregates over time and window length and I have the following rule.it
simply runs a last 10 average and outputs the average(in theory). 

 

rule show averages

when

 

$n : Number( doubleValue  0 ) from accumulate (

 

 

 

$mdo : MyDataObject($tm: delayTime) over window:length(10) from
entry-point DataObject stream,

average( $tm )

 

)

 

 

then

 

System.err.println($tm);

 

End

 

I have set the limit to 0 for the average because I simply want to have it
fire every time, no matter the average(they are all positive)

 

 

However I get this error:

 

Unable to build expression for 'consequence': Failed to compile: 1
compilation error(s): 

 - (1,3) unqualified type in strict mode for: $tm '

System.err.println($tm);

' : [Rule name='show averages']

 

 

If I have the consequence 

 

System.err.println($n);

 

Then it outputs the average no problem, but I am trying to simply output
that indifidual value, delayTime which I have stored in $tm is an integer,
so I cannot figure out why I cannot output this value.Similarly if I
simply try as a consequence:

 

System.err.println($ mdo.delayTime);

 

I get a similar error.

 

What am I doing wrong?

 

Thanks,


Chris


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




-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com

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


Re: [rules-users] averages on different data types

2009-06-17 Thread Edson Tirelli
   Chris,

   Not sure what you mean. If you want to know what is in there for debug
purposes, I guess the best way is to implement your own average() accumulate
function that prints out (or do whatever you want) with the bound
variables/facts.

   For regular use, it does not makes sense to allow access to such variable
because it is bound to multiple values. For instance:

$tot : Number() from accumulate(
Order( $value : value ),
sum( $value ) )

This pattern will sum all the values from all the Order facts in the
working memory. Lets imagine that it would be possible to access the $value
variable outside the accumulate, what Order would it be bound to? So, it
makes no sense...

 []s
 Edson

2009/6/17 Chris Richmond crichm...@referentia.com

  So how can I access variables that I have populated from within that
 scope delimiter(accumulate)?  For instance if I did want to access the
 delayTime, what strategy should be used?



 Thanks,


 Chris
  --

 *From:* rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] *On Behalf Of *Edson Tirelli
 *Sent:* Wednesday, June 17, 2009 11:49 AM
 *To:* Rules Users List
 *Subject:* Re: [rules-users] averages on different data types




Chris,

Remember that accumulate is a scope delimiter, meaning variables bound
 inside accumulate are not visible outside of it. The error message you see
 is the MVEL way of saying: non-existing variable (I guess you are using mvel
 as the dialect for the consequence).

If you want to know what data objects are being inserted/expired from
 the working memory, use a working memory listener.

[]s
Edson

 2009/6/17 Chris Richmond crichm...@referentia.com

 Hi guys,



 Building from the stockticker sample, I have been running my own average
 aggregates over time and window length and I have the following rule…it
 simply runs a last 10 average and outputs the average(in theory).



 rule show averages

 when



 $n : Number( doubleValue  0 ) from accumulate (







 $mdo : MyDataObject($tm: delayTime) over window:length(10) from
 entry-point DataObject stream,

 average( $tm )



 )





 then



 System.err.println($tm);



 End



 I have set the limit to 0 for the average because I simply want to have it
 fire every time, no matter the average(they are all positive)





 However I get this error:



 Unable to build expression for 'consequence': Failed to compile: 1
 compilation error(s):

  - (1,3) unqualified type in strict mode for: $tm '

 System.err.println($tm);

 ' : [Rule name='show averages']





 If I have the consequence



 System.err.println($n);



 Then it outputs the average no problem, but I am trying to simply output
 that indifidual value, delayTime which I have stored in $tm is an integer,
 so I cannot figure out why I cannot output this value.Similarly if I
 simply try as a consequence:



 System.err.println($ mdo.delayTime);



 I get a similar error.



 What am I doing wrong?



 Thanks,


 Chris


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




 --
  Edson Tirelli
  JBoss Drools Core Development
  JBoss, a division of Red Hat @ www.jboss.com

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




-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] averages on different data types

2009-06-17 Thread Chris Richmond
Ok..I was under the impression that the rule would fire for each Order
object that was injected, and in that case variables apply to each Order,
hence accessing them from the consequences(right side) would be from an
indfividual Order.  I guess I am misundertanding how it works.

 

Thanks for the clarification.

 

Chris

 

  _  

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Wednesday, June 17, 2009 1:37 PM
To: Rules Users List
Subject: Re: [rules-users] averages on different data types

 


   Chris,

   Not sure what you mean. If you want to know what is in there for debug
purposes, I guess the best way is to implement your own average() accumulate
function that prints out (or do whatever you want) with the bound
variables/facts.

   For regular use, it does not makes sense to allow access to such variable
because it is bound to multiple values. For instance:

$tot : Number() from accumulate( 
Order( $value : value ),
sum( $value ) )

This pattern will sum all the values from all the Order facts in the
working memory. Lets imagine that it would be possible to access the $value
variable outside the accumulate, what Order would it be bound to? So, it
makes no sense...

 []s
 Edson

2009/6/17 Chris Richmond crichm...@referentia.com

So how can I access variables that I have populated from within that scope
delimiter(accumulate)?  For instance if I did want to access the delayTime,
what strategy should be used?

 

Thanks,


Chris

  _  

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Wednesday, June 17, 2009 11:49 AM
To: Rules Users List
Subject: Re: [rules-users] averages on different data types

 


   Chris,

   Remember that accumulate is a scope delimiter, meaning variables bound
inside accumulate are not visible outside of it. The error message you see
is the MVEL way of saying: non-existing variable (I guess you are using mvel
as the dialect for the consequence).

   If you want to know what data objects are being inserted/expired from the
working memory, use a working memory listener.

   []s
   Edson

2009/6/17 Chris Richmond crichm...@referentia.com

Hi guys,

 

Building from the stockticker sample, I have been running my own average
aggregates over time and window length and I have the following rule.it
simply runs a last 10 average and outputs the average(in theory). 

 

rule show averages

when

 

$n : Number( doubleValue  0 ) from accumulate (

 

 

 

$mdo : MyDataObject($tm: delayTime) over window:length(10) from
entry-point DataObject stream,

average( $tm )

 

)

 

 

then

 

System.err.println($tm);

 

End

 

I have set the limit to 0 for the average because I simply want to have it
fire every time, no matter the average(they are all positive)

 

 

However I get this error:

 

Unable to build expression for 'consequence': Failed to compile: 1
compilation error(s): 

 - (1,3) unqualified type in strict mode for: $tm '

System.err.println($tm);

' : [Rule name='show averages']

 

 

If I have the consequence 

 

System.err.println($n);

 

Then it outputs the average no problem, but I am trying to simply output
that indifidual value, delayTime which I have stored in $tm is an integer,
so I cannot figure out why I cannot output this value.Similarly if I
simply try as a consequence:

 

System.err.println($ mdo.delayTime);

 

I get a similar error.

 

What am I doing wrong?

 

Thanks,


Chris


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




-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com


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




-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com

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


Re: [rules-users] averages on different data types

2009-06-17 Thread Edson Tirelli
   Oh, ok. Well, if you remove the accumulate and write only the pattern,
then it will fire for each instance. :)

   Edson

2009/6/17 Chris Richmond crichm...@referentia.com

  Ok..I was under the impression that the rule would fire for each Order
 object that was injected, and in that case variables apply to each Order,
 hence accessing them from the consequences(right side) would be from an
 indfividual Order.  I guess I am misundertanding how it works.



 Thanks for the clarification.



 Chris


  --

 *From:* rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] *On Behalf Of *Edson Tirelli
 *Sent:* Wednesday, June 17, 2009 1:37 PM

 *To:* Rules Users List
 *Subject:* Re: [rules-users] averages on different data types




Chris,

Not sure what you mean. If you want to know what is in there for debug
 purposes, I guess the best way is to implement your own average() accumulate
 function that prints out (or do whatever you want) with the bound
 variables/facts.

For regular use, it does not makes sense to allow access to such
 variable because it is bound to multiple values. For instance:

 $tot : Number() from accumulate(
 Order( $value : value ),
 sum( $value ) )

 This pattern will sum all the values from all the Order facts in the
 working memory. Lets imagine that it would be possible to access the $value
 variable outside the accumulate, what Order would it be bound to? So, it
 makes no sense...

  []s
  Edson

 2009/6/17 Chris Richmond crichm...@referentia.com

 So how can I access variables that I have populated from within that scope
 delimiter(accumulate)?  For instance if I did want to access the delayTime,
 what strategy should be used?



 Thanks,


 Chris
  --

 *From:* rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] *On Behalf Of *Edson Tirelli
 *Sent:* Wednesday, June 17, 2009 11:49 AM
 *To:* Rules Users List
 *Subject:* Re: [rules-users] averages on different data types




Chris,

Remember that accumulate is a scope delimiter, meaning variables bound
 inside accumulate are not visible outside of it. The error message you see
 is the MVEL way of saying: non-existing variable (I guess you are using mvel
 as the dialect for the consequence).

If you want to know what data objects are being inserted/expired from
 the working memory, use a working memory listener.

[]s
Edson

 2009/6/17 Chris Richmond crichm...@referentia.com

 Hi guys,



 Building from the stockticker sample, I have been running my own average
 aggregates over time and window length and I have the following rule…it
 simply runs a last 10 average and outputs the average(in theory).



 rule show averages

 when



 $n : Number( doubleValue  0 ) from accumulate (







 $mdo : MyDataObject($tm: delayTime) over window:length(10) from
 entry-point DataObject stream,

 average( $tm )



 )





 then



 System.err.println($tm);



 End



 I have set the limit to 0 for the average because I simply want to have it
 fire every time, no matter the average(they are all positive)





 However I get this error:



 Unable to build expression for 'consequence': Failed to compile: 1
 compilation error(s):

  - (1,3) unqualified type in strict mode for: $tm '

 System.err.println($tm);

 ' : [Rule name='show averages']





 If I have the consequence



 System.err.println($n);



 Then it outputs the average no problem, but I am trying to simply output
 that indifidual value, delayTime which I have stored in $tm is an integer,
 so I cannot figure out why I cannot output this value.Similarly if I
 simply try as a consequence:



 System.err.println($ mdo.delayTime);



 I get a similar error.



 What am I doing wrong?



 Thanks,


 Chris


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




 --
  Edson Tirelli
  JBoss Drools Core Development
  JBoss, a division of Red Hat @ www.jboss.com


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




 --
  Edson Tirelli
  JBoss Drools Core Development
  JBoss, a division of Red Hat @ www.jboss.com

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




-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Pre-installed Drools development environment for VirtualBox

2009-06-17 Thread Mark Proctor

http://blog.athico.com/2009/06/pre-installed-drools-development.html

Enjoy

Mark

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