Re: [rules-users] functions

2009-06-18 Thread Edson Tirelli
The only requirement in this case is that when you create the
KnowledgeBuilder and starting adding the resources to it (DRL, flows, dsls,
etc), a given resource can only reference an asset that was previously
loaded. So, you must make sure the DRL with your functions is the first
resource to be added. Other than this, everything else should work just
fine.

[]s
Edson



2009/6/18 Chris Richmond 

>  Yes….for the most part, a non developer wouln’t be able to write the
> rules anyway….you need someone with domain knowledge of the objects being
> injected, so I don’t see a non developer writing rules.I was trying to
> take the approach that if, from the application code perspective, I only
> worrry about injecting objects I wish to reason on, and not try to think of
> new functions, new stats/bookkeeping classe I might need..if I can
> demonstrate doing that all within the rule, it seems to show it’s
> flexibility more than having to modify your codebase(beyond simple
> session/api calls) to analyze those objects you are injecting.
>
>
>
> One think to keep in mind is that I am utilizing mainly Fusion…since I am
> dealing with sensor type data simply being fed into the system
> contintuously, so It’s very fluid as to the types of calculations/rules I
> might have to implement compared perhaps with a standard business object
> type of data.   I want to become a guru and munging, creating, and using all
> sorts of constructs within Fusion for being able to accomplish almost any
> rule withought having to do anything besides simply injecting my sensor data
> ojbects into the memory stream…in my mind, that will lead me to the greatest
> flexibility and demostration of the power of being able to add the rules
> engine onto an already fully functioning and robust application that was
> written without planning for rules automation.
>
>
>
> I should mention I do not use the eclipse plugin or eclipse at all for my
> rules testing/development, so I don’t have any issues with eclipse plugin
> not breaking.
>
>
>
> So….assuming I **did** want to put a simple function in my .drl
> file….*where* do I have to put it?  My oringal question about how to make a
> simple function declaration is still a mystery to me.
>
>
>
> Thanks
>
>
>
> Chris
>  --
>
> *From:* rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] *On Behalf Of *Edson Tirelli
> *Sent:* Thursday, June 18, 2009 2:25 PM
>
> *To:* Rules Users List
> *Subject:* Re: [rules-users] functions
>
>
>
>
>Chris,
>
>I understand. Although functions in DRL files where conceived to be very
> simple things to reside with the rules. So, although you can have a DRL file
> with all your functions and, as long as this file is the first you load into
> your knowledge builder, use the functions on other files, we did not
> implement any king of specific multifile import... meaning that the eclipse
> plugin, for instance, will raise errors when accessing functions from one
> file into another... but your application will run fine...
>
>Regarding recompiling the application, I think you just said that
> meaning recompiling the java file with the functions right? since the java
> file can be anywhere, including your domain model jar or even in a jar by
> himself... in any case, be it a function or a java static method, it is code
> and you will need a developer to do it, right?
>
>[]s
>Edson
>
> 2009/6/18 Chris Richmond 
>
> Edson,
>
>
>
> Thanks…and I am considering that option as well…but the nice thing about
> the functions in the drl file is the system remains much more fluid..in
> other words, if I can focus on doing what I want to do all within the DRL
> file, it proves the flexibility of the system more to me than having to
> have  developer recompile the application itself with new classes.  Does
> that make sense?   Also, I would just like to know that I can actually make
> functions work for future reference.
>
>
>
> Thanks,
>
>
>
> Chris
>
>
>  --
>
> *From:* rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] *On Behalf Of *Edson Tirelli
> *Sent:* Thursday, June 18, 2009 1:15 PM
> *To:* Rules Users List
> *Subject:* Re: [rules-users] functions
>
>
>
>
>Chris,
>
>If you are creating a function library, why don't you create it as
> static methods in a java class? easier to develop, to unit test and you can
> use "import function" in the DRL to import all of them.
>
>[]s
>Edson
>
> 2009/6/18 Chris Richmond 
>
> Ok…I am trying to build a function library in my .drl file and I added this
> one test function
>
>
>
> function String outputString(String sData){
>
> return sData;
>
> }
>
>
>
> And no matter where I place this in my .drl file, I get an exception one
> way or the other with compiling when I try instaniate and fire my rules.
>  The .drl file works exactly as expected if I remove this function
> de

RE: [rules-users] functions

2009-06-18 Thread Chris Richmond
Yes..for the most part, a non developer wouln't be able to write the rules
anyway..you need someone with domain knowledge of the objects being
injected, so I don't see a non developer writing rules.I was trying to
take the approach that if, from the application code perspective, I only
worrry about injecting objects I wish to reason on, and not try to think of
new functions, new stats/bookkeeping classe I might need..if I can
demonstrate doing that all within the rule, it seems to show it's
flexibility more than having to modify your codebase(beyond simple
session/api calls) to analyze those objects you are injecting.  

 

One think to keep in mind is that I am utilizing mainly Fusion.since I am
dealing with sensor type data simply being fed into the system
contintuously, so It's very fluid as to the types of calculations/rules I
might have to implement compared perhaps with a standard business object
type of data.   I want to become a guru and munging, creating, and using all
sorts of constructs within Fusion for being able to accomplish almost any
rule withought having to do anything besides simply injecting my sensor data
ojbects into the memory stream.in my mind, that will lead me to the greatest
flexibility and demostration of the power of being able to add the rules
engine onto an already fully functioning and robust application that was
written without planning for rules automation.  

 

I should mention I do not use the eclipse plugin or eclipse at all for my
rules testing/development, so I don't have any issues with eclipse plugin
not breaking. 

 

So..assuming I *did* want to put a simple function in my .drl file..*where*
do I have to put it?  My oringal question about how to make a simple
function declaration is still a mystery to me.  

 

Thanks

 

Chris

  _  

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Thursday, June 18, 2009 2:25 PM
To: Rules Users List
Subject: Re: [rules-users] functions

 


   Chris,

   I understand. Although functions in DRL files where conceived to be very
simple things to reside with the rules. So, although you can have a DRL file
with all your functions and, as long as this file is the first you load into
your knowledge builder, use the functions on other files, we did not
implement any king of specific multifile import... meaning that the eclipse
plugin, for instance, will raise errors when accessing functions from one
file into another... but your application will run fine...

   Regarding recompiling the application, I think you just said that meaning
recompiling the java file with the functions right? since the java file can
be anywhere, including your domain model jar or even in a jar by himself...
in any case, be it a function or a java static method, it is code and you
will need a developer to do it, right?

   []s
   Edson

2009/6/18 Chris Richmond 

Edson,

 

Thanks.and I am considering that option as well.but the nice thing about the
functions in the drl file is the system remains much more fluid..in other
words, if I can focus on doing what I want to do all within the DRL file, it
proves the flexibility of the system more to me than having to have
developer recompile the application itself with new classes.  Does that make
sense?   Also, I would just like to know that I can actually make functions
work for future reference.

 

Thanks,

 

Chris

 

  _  

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Thursday, June 18, 2009 1:15 PM
To: Rules Users List
Subject: Re: [rules-users] functions

 


   Chris,

   If you are creating a function library, why don't you create it as static
methods in a java class? easier to develop, to unit test and you can use
"import function" in the DRL to import all of them.

   []s
   Edson

2009/6/18 Chris Richmond 

Ok.I am trying to build a function library in my .drl file and I added this
one test function

 

function String outputString(String sData){

return sData;

}

 

And no matter where I place this in my .drl file, I get an exception one way
or the other with compiling when I try instaniate and fire my rules.  The
.drl file works exactly as expected if I remove this function declaration,
and when I *do* try to add it, I do not actually call it anywhere.but get
those errors.  

 

So my question is, where exactly do I need to place function declarations..

 

 

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
 JB

Re: [rules-users] functions

2009-06-18 Thread Edson Tirelli
   Chris,

   I understand. Although functions in DRL files where conceived to be very
simple things to reside with the rules. So, although you can have a DRL file
with all your functions and, as long as this file is the first you load into
your knowledge builder, use the functions on other files, we did not
implement any king of specific multifile import... meaning that the eclipse
plugin, for instance, will raise errors when accessing functions from one
file into another... but your application will run fine...

   Regarding recompiling the application, I think you just said that meaning
recompiling the java file with the functions right? since the java file can
be anywhere, including your domain model jar or even in a jar by himself...
in any case, be it a function or a java static method, it is code and you
will need a developer to do it, right?

   []s
   Edson

2009/6/18 Chris Richmond 

>  Edson,
>
>
>
> Thanks…and I am considering that option as well…but the nice thing about
> the functions in the drl file is the system remains much more fluid..in
> other words, if I can focus on doing what I want to do all within the DRL
> file, it proves the flexibility of the system more to me than having to
> have  developer recompile the application itself with new classes.  Does
> that make sense?   Also, I would just like to know that I can actually make
> functions work for future reference.
>
>
>
> Thanks,
>
>
>
> Chris
>
>
>  --
>
> *From:* rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] *On Behalf Of *Edson Tirelli
> *Sent:* Thursday, June 18, 2009 1:15 PM
> *To:* Rules Users List
> *Subject:* Re: [rules-users] functions
>
>
>
>
>Chris,
>
>If you are creating a function library, why don't you create it as
> static methods in a java class? easier to develop, to unit test and you can
> use "import function" in the DRL to import all of them.
>
>[]s
>Edson
>
> 2009/6/18 Chris Richmond 
>
> Ok…I am trying to build a function library in my .drl file and I added this
> one test function
>
>
>
> function String outputString(String sData){
>
> return sData;
>
> }
>
>
>
> And no matter where I place this in my .drl file, I get an exception one
> way or the other with compiling when I try instaniate and fire my rules.
>  The .drl file works exactly as expected if I remove this function
> declaration, and when I **do** try to add it, I do not actually call it
> anywhere…but get those errors.
>
>
>
> So my question is, where exactly do I need to place function declarations..
>
>
>
>
>
> 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] functions

2009-06-18 Thread Andrew Waterman
That's a great idea Edson. I just found Mark's posting on this from 2006:

http://markmail.org/message/pbs73eainajilmjm

Very helpful.

best wishes,

Andrew

2009/6/18 Chris Richmond 

>  Edson,
>
>
>
> Thanks…and I am considering that option as well…but the nice thing about
> the functions in the drl file is the system remains much more fluid..in
> other words, if I can focus on doing what I want to do all within the DRL
> file, it proves the flexibility of the system more to me than having to
> have  developer recompile the application itself with new classes.  Does
> that make sense?   Also, I would just like to know that I can actually make
> functions work for future reference.
>
>
>
> Thanks,
>
>
>
> Chris
>
>
>  --
>
> *From:* rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] *On Behalf Of *Edson Tirelli
> *Sent:* Thursday, June 18, 2009 1:15 PM
> *To:* Rules Users List
> *Subject:* Re: [rules-users] functions
>
>
>
>
>Chris,
>
>If you are creating a function library, why don't you create it as
> static methods in a java class? easier to develop, to unit test and you can
> use "import function" in the DRL to import all of them.
>
>[]s
>Edson
>
> 2009/6/18 Chris Richmond 
>
> Ok…I am trying to build a function library in my .drl file and I added this
> one test function
>
>
>
> function String outputString(String sData){
>
> return sData;
>
> }
>
>
>
> And no matter where I place this in my .drl file, I get an exception one
> way or the other with compiling when I try instaniate and fire my rules.
>  The .drl file works exactly as expected if I remove this function
> declaration, and when I **do** try to add it, I do not actually call it
> anywhere…but get those errors.
>
>
>
> So my question is, where exactly do I need to place function declarations..
>
>
>
>
>
> 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
>
>


-- 
+1 510 342 5693

PO Box 7775 #8750
San Francisco, California   94120-7775

"Warning:  following standard input indefinitely is ineffective"
- /bin/tail error message

"Against logic there is no armor like ignorance."
 - Laurence J. Pete
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] functions

2009-06-18 Thread Chris Richmond
Edson,

 

Thanks.and I am considering that option as well.but the nice thing about the
functions in the drl file is the system remains much more fluid..in other
words, if I can focus on doing what I want to do all within the DRL file, it
proves the flexibility of the system more to me than having to have
developer recompile the application itself with new classes.  Does that make
sense?   Also, I would just like to know that I can actually make functions
work for future reference.

 

Thanks,

 

Chris

 

  _  

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Thursday, June 18, 2009 1:15 PM
To: Rules Users List
Subject: Re: [rules-users] functions

 


   Chris,

   If you are creating a function library, why don't you create it as static
methods in a java class? easier to develop, to unit test and you can use
"import function" in the DRL to import all of them.

   []s
   Edson

2009/6/18 Chris Richmond 

Ok.I am trying to build a function library in my .drl file and I added this
one test function

 

function String outputString(String sData){

return sData;

}

 

And no matter where I place this in my .drl file, I get an exception one way
or the other with compiling when I try instaniate and fire my rules.  The
.drl file works exactly as expected if I remove this function declaration,
and when I *do* try to add it, I do not actually call it anywhere.but get
those errors.  

 

So my question is, where exactly do I need to place function declarations..

 

 

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] functions

2009-06-18 Thread Edson Tirelli
   Chris,

   If you are creating a function library, why don't you create it as static
methods in a java class? easier to develop, to unit test and you can use
"import function" in the DRL to import all of them.

   []s
   Edson

2009/6/18 Chris Richmond 

>  Ok…I am trying to build a function library in my .drl file and I added
> this one test function
>
>
>
> function String outputString(String sData){
>
> return sData;
>
> }
>
>
>
> And no matter where I place this in my .drl file, I get an exception one
> way or the other with compiling when I try instaniate and fire my rules.
>  The .drl file works exactly as expected if I remove this function
> declaration, and when I **do** try to add it, I do not actually call it
> anywhere…but get those errors.
>
>
>
> So my question is, where exactly do I need to place function declarations..
>
>
>
>
>
> 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] OSGI, classloading, and imports in KnowledgeBuilder

2009-06-18 Thread msully

Here's the ClassLoader that let's the import work:
org.springframework.osgi.util.BundleDelegatingClassLoader

OK, I realize this is starting to seem like a question for another board,
but I figured I'd put all the info here since I started here.

If I find the solution elsewhere, I'll share here.
-- 
View this message in context: 
http://www.nabble.com/OSGI%2C-classloading%2C-and-imports-in-KnowledgeBuilder-tp24099671p24099687.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] OSGI, classloading, and imports in KnowledgeBuilder

2009-06-18 Thread msully

Update: The plot thickens.

Sometimes when I'm importing my domain class in the rulesflow, it works, and
sometimes it does not.

This seems to be tied to the class loader that happens to be in the current
thread context.  Sometimes it is
org.eclipse.core.runtime.internal.adaptor.ContextFinder and sometimes it is
another type.  I don't know what class the 'other type' is because it
overrides Object's toString()and I was just doing
getClassLoader().toString(). I've changed it to
getClassLoader().getClass().getName() so I can see what the real object is
if it happens again




msully wrote:
> 
> So I'm playing with Drools in Equinox OSGi, and so far it's behaving quite
> nicely - one bit of weirdness though.
> 
> What I'm trying to do:
> I have a bundle with a 'flow manager' that listens for instances of
> WorkItemHandler in the service broker (well, really my own subinterface
> that has a getName method).  It also listens for new bundles with a
> META-INF/drools directory with *.rf files in them, and parses the .rf
> files it finds there.
> 
> The Flow Manager is itself published as an OSGI Service with a 'perform'
> method.  It encapsulates all of its Drools calls within the perform method
> though - they aren't exposed to clients.
> 
> My test involves a simple start->work item->end workflow.
> 
> I pass in an instance of a class "Tablex" that can be saved to hibernate.
> I also pass in a String that has the table name, and an empty List to get
> the results.
> 
> My .rf file tries to import Tablex.  It declares the three values I
> mention above, and maps them to the work item in the work item definition.
> 
> 
>  
>   
> 
> ...
>   
>  name="org.drools.process.core.datatype.impl.type.ObjectDataType"
> className="my.pkg.Tablex"/>
> 
> ...
>  height="40" >
>   
>   
>   
>   
>   
>  
> 
> 
> 
> In my manifest for my .rf file and for the flow manager (where the parsing
> occurs) I Import-Package Tablex's package.
> 
> When my flow manager tries parsing the rule, it gives an error saying the
> the import failed. BUT, everything still works, and my WorkItemHandler
> works correctly (the WorkItemHandler imports Tablex itself, since it needs
> to manipulate it).
> 
> If I declare my Tablex variable as a java.util.Object in the ruleflow then
> I don't get the error and things also still work.
> 
> If I declare my Tablex as Tablex in the rule flow AND import it in the
> class that does the parsing (it's already 'OSGI' imported to the parsing
> bundle, but now I'm doing a plain old Java import on it) then everything
> works fine with no error message.
> 
> Kind of a hybrid question but I figured I'd start with the Drools folks.
> 
> Any ideas would be appreciated.
> 
> Thanks,
> Mike
> 

-- 
View this message in context: 
http://www.nabble.com/OSGI%2C-classloading%2C-and-imports-in-KnowledgeBuilder-tp24099671p24099685.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] functions

2009-06-18 Thread Chris Richmond
Ok.I am trying to build a function library in my .drl file and I added this
one test function

 

function String outputString(String sData){

return sData;

}

 

And no matter where I place this in my .drl file, I get an exception one way
or the other with compiling when I try instaniate and fire my rules.  The
.drl file works exactly as expected if I remove this function declaration,
and when I *do* try to add it, I do not actually call it anywhere.but get
those errors.  

 

So my question is, where exactly do I need to place function declarations..

 

 

Thanks,


Chris

 

 

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


[rules-users] OSGI, classloading, and imports in KnowledgeBuilder

2009-06-18 Thread msully

So I'm playing with Drools in Equinox OSGi, and so far it's behaving quite
nicely - one bit of weirdness though.

What I'm trying to do:
I have a bundle with a 'flow manager' that listens for instances of
WorkItemHandler in the service broker (well, really my own subinterface that
has a getName method).  It also listens for new bundles with a
META-INF/drools directory with *.rf files in them, and parses the .rf files
it finds there.

The Flow Manager is itself published as an OSGI Service with a 'perform'
method.  It encapsulates all of its Drools calls within the perform method
though - they aren't exposed to clients.

My test involves a simple start->work item->end workflow.

I pass in an instance of a class "Tablex" that can be saved to hibernate. I
also pass in a String that has the table name, and an empty List to get the
results.

My .rf file tries to import Tablex.  It declares the three values I mention
above, and maps them to the work item in the work item definition.


 
  

...
  


...

  
  
  
  
  
 



In my manifest for my .rf file and for the flow manager (where the parsing
occurs) I Import-Package Tablex's package.

When my flow manager tries parsing the rule, it gives an error saying the
the import failed. BUT, everything still works, and my WorkItemHandler works
correctly (the WorkItemHandler imports Tablex itself, since it needs to
manipulate it).

If I declare my Tablex variable as a java.util.Object in the ruleflow then I
don't get the error and things also still work.

If I declare my Tablex as Tablex in the rule flow AND import it in the class
that does the parsing (it's already 'OSGI' imported to the parsing bundle,
but now I'm doing a plain old Java import on it) then everything works fine
with no error message.

Kind of a hybrid question but I figured I'd start with the Drools folks.

Any ideas would be appreciated.

Thanks,
Mike
-- 
View this message in context: 
http://www.nabble.com/OSGI%2C-classloading%2C-and-imports-in-KnowledgeBuilder-tp24099671p24099671.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] Is work item configuration needed at run time? Can it be built programmatically?

2009-06-18 Thread msully

Thanks Kris - it did work as you described. Got another issue, which I'll
make another post on.

Thanks again,
Mike 

Kris Verlaenen wrote:
> 
> Mike,
> 
> The work item definitions file is only used in the graphical editor, to
> add custom nodes to the palette.  It is not used at compile or runtime,
> as the variable definitions etc. are all part of the work item itself. 
> So you probably don't need it in your environment.
> 
> Kris
> 
> Quoting 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
>> 
> 
> 
> 
> 
> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
> ___
> 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/Is-work-item-configuration-needed-at-run-time---Can-it-be-built-programmatically--tp24079237p24099663.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] functions .drl file

2009-06-18 Thread Chris Richmond
Is it possible to create a .drl file of nothing but functions then import
those into another .drl file to make it easy to maintain one file of API
style functions and then beable to call them from any additional .drl files?

 

Thanks,


Chris

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


Re: [rules-users] Compatibility of Drools for High Traffic events

2009-06-18 Thread Thilina Anjitha
Thanks for the quick response.

Yes, the events will be collected from the CDR(caller details records)
files. We will decode the CDR files and store in a database. So the Rule
Engine should be able to process these events to identify who are the
candidate winners. This winner selection criteria can be defined as a
Rule. (Pls check the examples Rules specified in the mail). Rules need
to fire with a scheduler basis not real time and winners will be
notified at the end of the promotion period.

So I would like to know the feasibility of Drools for this kind of an
application.

Thanks,
Thilina


On Thu, 2009-06-18 at 15:35 +0200, Wolfgang Laun wrote:
> I've been doing similar things in an ESME (direct SMSC connection) but
> without rules, as the conditions were much simpler, and just handling
> SMS messages themselves.
>  
> I guess you'll base your decision on billing records, possibly in
> connection with subscriber data. Billing records might be a bit bulky;
> and the class(es) representing them s.b. well structured (bean style).
> But I have seen telecommunication provider solutions where the data
> (from the subscriber DB) hat to be accessed using property keys, which
> would not be so nice for writing rules (with any such system,
> probably).
>  
> Also, do you need to distribute your goodies in real time (so that a
> caller is informed right away - marketing will love that for obvious
> reasons) or can you do it after time 'Y'? The former is a little more
> intricate, especially distributing on a fractional rate (and not by
> "every n-th").
>  
> -W
> 
> 
>  
> On 6/18/09, Thilina Anjitha  wrote: 
> 
> Hi,
> 
> I'm planning to use drools to define rules and execute
> promotions for telecommunication events such as voice call,
> SMS, MMS, etc.. events. So we can expect very large amount of
> events per day.
> 
> We need to define different business rules to provide
> promotions, bonuses to the subscribers. Some of the example
> promotions are listed here.
> 
> 1. During the period of X-Y, every 10th MMS sender gets $ 2.00
> worth of free SMS. And the winners will be notified via SMS.
> 2. During the period of X-Y, random 100 calls to Japan of the
> CHAT tariff plan get free movie tickets. And the winners will
> be notified via SMS. The same subscriber will not be selected
> as winner again and again.
> 3. During the period of X-Y, any subscribers have usage for
> voice call or SMS get bonuses as follows :
> $ 10 - 20 : get 20% as bonus of free SMS
> $ 20 - 50 : get 50% as bonus of free air time
> $ 50 - 70 : get 70% as bonus of free IDD
> 
> I'm in the evaluation period of the Drools for the system. If
> anybody give recommendations or flexibilities/limitations of
> the drools for our application.
> 
> Thanks,
> Thilina
> 
> 
> 
> ___
> 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] Updating the knowledge base manually...

2009-06-18 Thread pnavais

Hi,

I'm very new to Drools and don't know if this is possible, but i'm trying to
manually update the knowledge base with the following steps :

1. Retrieve a knowledge builder from KnowledgeBuilderFactory
2. Load a drl rules file into builder
3. Create a knowledge base with the knowledge packages from the builder
4. Create a session from the kbase
4. Insert objects into the working memory => Activations are created
5. Fire all rules => Rules are launched , objects are created by rules and
asserted into the WM
6. Retract objects generated by rules from the WM
7. Remove knowledge packages from the kbase
8. Generate another builder, load a different drl rules file and add the
knowledge pacakges to the kbase => Activations are created automatically
just after adding new packages but objects are created by rules and asserted
into the WM.
9. Fire all rules -> Te agenda is empty , no rules are launched.

Are the 8th and 9th steps the expected behaviour or i'm just doing something
wrong ?

Thanks in advance.
Pablo.
-- 
View this message in context: 
http://www.nabble.com/Updating-the-knowledge-base-manually...-tp24089673p24089673.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] Updating the knowledge base manually...

2009-06-18 Thread Edson Tirelli
   First of all, your approach does not sound like a good approach. If you
are removing all rules and adding new ones, why not simply create a new
knowledge base?

   Anyway, by default, drools fires all rules right after a rulebase is
updated. To disable this behavior, you need to set a knowledge base
configuration. Unfortunately setting this property now requires a down cast:

KnowledgeBaseConfiguration conf = ...
((RuleBaseConfiguration)conf).setRuleBaseUpdateHandler( null );

   I will add an option API to allow the configuration without the cast.

   []s
   Edson



2009/6/18 Pablo Navais 

> Hi,
>
> I'm very new to Drools and don't know if this is possible, but i'm trying
> to
> manually update the knowledge base with the following steps :
>
> 1. Retrieve a knowledge builder from KnowledgeBuilderFactory
> 2. Load a drl rules file into builder
> 3. Create a knowledge base with the knowledge packages from the builder
> 4. Create a session from the kbase
> 4. Insert objects into the working memory => Activations are created
> 5. Fire all rules => Rules are launched , objects are created by rules and
> asserted into the WM
> 6. Retract objects generated by rules from the WM
> 7. Remove knowledge packages from the kbase
> 8. Generate another builder, load a different drl rules file and add the
> knowledge pacakges to the kbase => Activations are created automatically
> just after adding new packages but objects are created by rules and
> asserted
> into the WM.
> 9. Fire all rules -> Te agenda is empty , no rules are launched.
>
> Are the 8th and 9th steps the expected behaviour or i'm just doing
> something
> wrong ? The same seems to happen when
>
> Thanks in advance.
> Pablo.
> ___
> 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] Updating the knowledge base manually...

2009-06-18 Thread Pablo Navais
Hi,

I'm very new to Drools and don't know if this is possible, but i'm trying to

manually update the knowledge base with the following steps :

1. Retrieve a knowledge builder from KnowledgeBuilderFactory
2. Load a drl rules file into builder
3. Create a knowledge base with the knowledge packages from the builder
4. Create a session from the kbase
4. Insert objects into the working memory => Activations are created
5. Fire all rules => Rules are launched , objects are created by rules and
asserted into the WM
6. Retract objects generated by rules from the WM
7. Remove knowledge packages from the kbase
8. Generate another builder, load a different drl rules file and add the
knowledge pacakges to the kbase => Activations are created automatically
just after adding new packages but objects are created by rules and asserted

into the WM.
9. Fire all rules -> Te agenda is empty , no rules are launched.

Are the 8th and 9th steps the expected behaviour or i'm just doing something

wrong ? The same seems to happen when

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


Re: [rules-users] Compatibility of Drools for High Traffic events

2009-06-18 Thread Wolfgang Laun
I've been doing similar things in an ESME (direct SMSC connection) but
without rules, as the conditions were much simpler, and just handling SMS
messages themselves.

I guess you'll base your decision on billing records, possibly in connection
with subscriber data. Billing records might be a bit bulky; and the
class(es) representing them s.b. well structured (bean style). But I have
seen telecommunication provider solutions where the data (from the
subscriber DB) hat to be accessed using property keys, which would not be so
nice for writing rules (with any such system, probably).

Also, do you need to distribute your goodies in real time (so that a caller
is informed right away - marketing will love that for obvious reasons) or
can you do it after time 'Y'? The former is a little more intricate,
especially distributing on a fractional rate (and not by "every n-th").

-W



On 6/18/09, Thilina Anjitha  wrote:
>
> Hi,
>
> I'm planning to use drools to define rules and execute promotions for
> telecommunication events such as voice call, SMS, MMS, etc.. events. So we
> can expect very large amount of events per day.
>
> We need to define different business rules to provide promotions, bonuses
> to the subscribers. Some of the example promotions are listed here.
>
> 1. During the period of X-Y, every 10th MMS sender gets $ 2.00 worth of
> free SMS. And the winners will be notified via SMS.
> 2. During the period of X-Y, random 100 calls to Japan of the CHAT tariff
> plan get free movie tickets. And the winners will be notified via SMS. The
> same subscriber will not be selected as winner again and again.
> 3. During the period of X-Y, any subscribers have usage for voice call or
> SMS get bonuses as follows :
> $ 10 - 20 : get 20% as bonus of free SMS
> $ 20 - 50 : get 50% as bonus of free air time
> $ 50 - 70 : get 70% as bonus of free IDD
>
> I'm in the evaluation period of the Drools for the system. If anybody give
> recommendations or flexibilities/limitations of the drools for our
> application.
>
> Thanks,
> Thilina
>
>
>
>
> ___
> 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] Traversing the Rete Network

2009-06-18 Thread Edson Tirelli
   LeftTupleSource.getSinkPropagator().getSinks()

   ObjectSource.getSinkPropagator().getSinks()



2009/6/18 Peter Wong 

> Hello,
>
> I am trying to find out if and why a rule is not activated/fired when
> asserting a piece of data. At the moment I am using JBoss AOP to pointcut
> the method EntryPointNode.assertObject(), and from there I run an algorithm
> to walk to "every" node in the rete network. My question is how can I be
> sure that I have indeed accessed every node in the network? Thanks for your
> help.
>
> Regards,
>
> Peter
>
> ___
> 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] Exposing the rule engine as a web service to be accessed by the client

2009-06-18 Thread Mark Proctor

tanzu wrote:

My requirement is to expose drools rules as a web service ,which can be
accessed by any kind of client including .net .I have built a struts based
web application.When the user submits the struts client should be able to
submit the data ,to the web service ,which will execute the rule engine ,and
fire all rules ,and send a response back to the client.You said it correctly
the drools execution server can suffice my need.


My doubts are
1.Is it possible that I dont use guvnor ,and instead use just the drools
expert with drl files with the execution server.
2.The data from the struts client should be converted into xml ,fact object
and sent to the server to be used in the rules.Am I thinking right.

A sample code showing how the client ,sends xml data to server ,and the
response sent back to the client ,will be very helpful to me.

Please help.I have a deadline.:-(
  
If you are using Drools 5.0, we have the new Command and Pipeline api 
with built in XML marshalling. This was all designed to allow it to be 
easily hooked up to any service.


This unit test shows a large set of examples of working with the XML, 
via the pipeline:

http://fisheye.jboss.org/browse/JBossRules/trunk/drools-pipeline/drools-transformer-xstream/src/test/java/org/drools/runtime/pipeline/impl/XStreamBatchExecutionTest.java?r=HEAD

Mark

tanzu



pkpkpkpk wrote:
  

Using the Drools execution server, the rules engine can be exposed as a
web
service.

In
http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-guvnor/html_single/index.html,
check out section 1.4.7.2

The web service can be invoked using JSON or XML, so, it is possible to
invoke it from any client.

Regards,
Prem


On Sun, Jun 14, 2009 at 6:45 AM, tanzu  wrote:



Can the drools rule engine ,be exposed as a web service or do we need to
write a web service and make an explicit call to rule engine ,using the
working memory.
Is it possible for a .net application to invoke drools rule engine.


Please help as I am a newbie


Thanks
tanzu
--
View this message in context:
http://www.nabble.com/Exposing-the-rule-engine-as-a-web-service-to-be-accessed-by-the-client-tp23961020p23961020.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


Re: [rules-users] Exposing the rule engine as a web service to be accessed by the client

2009-06-18 Thread tanzu

My requirement is to expose drools rules as a web service ,which can be
accessed by any kind of client including .net .I have built a struts based
web application.When the user submits the struts client should be able to
submit the data ,to the web service ,which will execute the rule engine ,and
fire all rules ,and send a response back to the client.You said it correctly
the drools execution server can suffice my need.


My doubts are
1.Is it possible that I dont use guvnor ,and instead use just the drools
expert with drl files with the execution server.
2.The data from the struts client should be converted into xml ,fact object
and sent to the server to be used in the rules.Am I thinking right.

A sample code showing how the client ,sends xml data to server ,and the
response sent back to the client ,will be very helpful to me.

Please help.I have a deadline.:-(

tanzu



pkpkpkpk wrote:
> 
> Using the Drools execution server, the rules engine can be exposed as a
> web
> service.
> 
> In
> http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-guvnor/html_single/index.html,
> check out section 1.4.7.2
> 
> The web service can be invoked using JSON or XML, so, it is possible to
> invoke it from any client.
> 
> Regards,
> Prem
> 
> 
> On Sun, Jun 14, 2009 at 6:45 AM, tanzu  wrote:
> 
>>
>> Can the drools rule engine ,be exposed as a web service or do we need to
>> write a web service and make an explicit call to rule engine ,using the
>> working memory.
>> Is it possible for a .net application to invoke drools rule engine.
>>
>>
>> Please help as I am a newbie
>>
>>
>> Thanks
>> tanzu
>> --
>> View this message in context:
>> http://www.nabble.com/Exposing-the-rule-engine-as-a-web-service-to-be-accessed-by-the-client-tp23961020p23961020.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/Exposing-the-rule-engine-as-a-web-service-to-be-accessed-by-the-client-tp23961020p24092604.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] Drools Guvnor documentation issue

2009-06-18 Thread Toni Rikkola

Hi,

Thanks for reporting this. You can see the latest and fixed documents 
here: 
https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/index.html


Toni

Alexander Golubev wrote:

Hi,

I downloaded standalone Guvnor:
http://download.jboss.org/drools/release/5.0.1.26597.FINAL/drools-5.0-guvnor-standalone.zip

and then began reading the documentation to get idea how to start with it:
http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-guvnor/html_single/index.html 


The issue which I noticed is that the documentation says:

"1.2.1. Installation

Once the drools-guvnor.war has been placed in the deployment 
directory, and the application server started, you should navigate to 
*http://localhost/drools-jbrms* and check that Guvnor appears. 
(Obviously substitute the URL for what your application server is 
configured to).

"

, whereas the guvnor application is accessible from 
*http://localhost/drools-guvnor.*


Of course, this info can be found out from the jboss(tomcat) log, but 
i believe it's better to 
have correct link right in the docs.


Regards,
Alexander


___
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] Compatibility of Drools for High Traffic events

2009-06-18 Thread Thilina Anjitha
Hi,

I'm planning to use drools to define rules and execute promotions for
telecommunication events such as voice call, SMS, MMS, etc.. events. So
we can expect very large amount of events per day.

We need to define different business rules to provide promotions,
bonuses to the subscribers. Some of the example promotions are listed
here.

1. During the period of X-Y, every 10th MMS sender gets $ 2.00 worth of
free SMS. And the winners will be notified via SMS.
2. During the period of X-Y, random 100 calls to Japan of the CHAT
tariff plan get free movie tickets. And the winners will be notified via
SMS. The same subscriber will not be selected as winner again and again.
3. During the period of X-Y, any subscribers have usage for voice call
or SMS get bonuses as follows :
$ 10 - 20 : get 20% as bonus of free SMS
$ 20 - 50 : get 50% as bonus of free air time
$ 50 - 70 : get 70% as bonus of free IDD

I'm in the evaluation period of the Drools for the system. If anybody
give recommendations or flexibilities/limitations of the drools for our
application.

Thanks,
Thilina


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


[rules-users] Drools Guvnor documentation issue

2009-06-18 Thread Alexander Golubev
Hi,
I downloaded standalone Guvnor:
http://download.jboss.org/drools/release/5.0.1.26597.FINAL/drools-5.0-guvnor-standalone.zip

and then began reading the documentation to get idea how to start with it:
http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-guvnor/html_single/index.html


The issue which I noticed is that the documentation says:

"1.2.1. Installation

Once the drools-guvnor.war has been placed in the deployment directory, and
the application server started, you should navigate to *
http://localhost/drools-jbrms* and check that Guvnor appears. (Obviously
substitute the URL for what your application server is configured to).
"
, whereas the guvnor application is accessible from *
http://localhost/drools-guvnor.*

Of course, this info can be found out from the jboss(tomcat) log, but i
believe it's better to
have correct link right in the docs.

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


[rules-users] Traversing the Rete Network

2009-06-18 Thread Peter Wong
Hello,

I am trying to find out if and why a rule is not activated/fired when
asserting a piece of data. At the moment I am using JBoss AOP to pointcut
the method EntryPointNode.assertObject(), and from there I run an algorithm
to walk to "every" node in the rete network. My question is how can I be
sure that I have indeed accessed every node in the network? Thanks for your
help.

Regards,

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


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

2009-06-18 Thread Kris Verlaenen
Mike,

The work item definitions file is only used in the graphical editor, to
add custom nodes to the palette.  It is not used at compile or runtime,
as the variable definitions etc. are all part of the work item itself. 
So you probably don't need it in your environment.

Kris

Quoting 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
> 




Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users