Re: [rules-users] Drools Timers

2014-09-24 Thread Mauricio Salatino
Hi Demian,
As far as I remember you can use a CRON like expression in the timer
definition which will allow you to do that exactly.


On Wed, Sep 24, 2014 at 4:59 AM, Demian Calcaprina 
wrote:

> Hey Guys, I am trying to use to use the timer in the rule, but I don't
> fully understand it.
> I have a simple rule which says
>
> rule "Test"
>
> timer(int: 1s)
> when
>Something()
> then
>System.out.println("Something Happens");
> end
>
> And I insert 100 Someting() object, after 1 second I see 100 activations.
> - Can I do with the timer something like "run this rule once per minute"
> for example?
> - When does the timer start to run?
>
> Thanks in advance,
>
> Demian
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Anyone? Re: Drools bpmn gateway constraints questions

2014-08-13 Thread Mauricio Salatino
Hi Matt

so:

"1. How do I refer to the current fact?
- Can I do something like this?
*$cancerRecord : CancerRecord ()"*


*The current record where??? If you have multiple CancerRecord(s) each of
them will match with that conditional element. If you have a business
process with a process variable you should point to that variable instead
of using the rules language to filter it. If the CancerRecord is a fact
that's the right way to go.  *
"2. How do I invoke external functions?
Can I do something like

*inlist* ($cancerRecord.PRIMARY_SITE,  "C500, C501, C502, C503, C504, C505,
C506, C508, C509")
*containsAny* (kcontext, $cancerRecord,
"505101,505102,505103,505104,505105,505106,505107,505108") "

Did you try this:
eval(inlist(.)) in the RHS?




"I not able to locate any documentation in this. Can some one point me to
the right documentation. I have been stuck on this for couple of days. "

All of this is explained in the drools.org documentation site, I'm pretty
sure that the eval is there.



On Wed, Aug 13, 2014 at 4:33 PM, mattmadhavan  wrote:

> Anyone out there please?
>
> Thanks
> Matt
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-bpmn-gateway-constraints-questions-tp4030640p4030646.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Including repository in a WAR file

2014-07-23 Thread Mauricio Salatino
You can build the PKGs in guvnor and then just move the PKGs to a accesible
server by the app that will load the rules in those packages. That will do
the work IMO.

Regards


On Wed, Jul 23, 2014 at 2:39 PM, ilguapo  wrote:

> Thank you for replying Toni and Salaboy.
>
> This is the reason why we want to do that:
>
> -We already have an application that uses Guvnor in production.  The
> problem
> is Guvnor is hosted on a different machine which we are losing therefore we
> thought about an idea of completely eliminating Guvnor by including the
> repository in the WAR so that we could read it the first time the
> application starts.  As you know, this is being done by pointing to the
> Guvnor URL at this time.
>
> -We actually wanted to leave Guvnor in the dev environment so that
> developers could add more rules to the application whenever necessary by
> providing an Import feature to read the repository_export.zip file into the
> application to replace the old repository.
>
> -If we do this, we will only need Guvnor in the dev environment which is
> controlled by us and will be eliminated from all other environments. (Will
> reduce a lot of paper work at a government site)
>
> I like Toni's idea of building the repository using Guvnor in the dev
> environment but how do you read the repository the first time the app
> starts?  This is done now by getting the package from Guvnor thru a URL.
> That was the only reason to store the repository inside the WAR file so
> that
> the rules could be read at initialization time.
>
> Any pointers would be really appreciated especially how to update the
> package which according to Toni is easy :-)
>
> Regards,
> Ilguapo
>
>
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Including-repository-in-a-WAR-file-tp4030450p4030458.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Including repository in a WAR file

2014-07-23 Thread Mauricio Salatino
Hi,
I don't think that it will be possible the repository is a JCR repository
in 5.3, so there is no point in storing all the meta information from the
repository if the only thing you need are the rules. You can always ship
the rules inside the web application, provide a way to upload new rules
when needed and regenerate the sessions using the new rules.
Why do you want to have all the repo?


On Wed, Jul 23, 2014 at 1:55 AM, ilguapo  wrote:

> I'm using Drools 5.3.0
>
>
> I'd like to find out if the following scenario is possible:
>
> - Include the repository_export.zip file inside my application WAR file.
> This way, Guvnor won't be necessary.
> - Provide a special upload page just like Guvnor's Import/Export to upload
> a
> completely new repository_export.zip file when rules have changed.
>
> I haven't been able to find a way to read a repository_export.zip file with
> the current API.  They only talk about drl, pkg, etc..etc but no zip files.
> I could potentially take the zip file, unzip it to an XML and maybe read
> this file??
>
> Any ideas would be really helpful.
>
> Regards,
> Ilguapo
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Including-repository-in-a-WAR-file-tp4030450.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] How do I access objects in a top level or condition?

2014-05-28 Thread Mauricio Salatino
Hi, you can't because you don't know which is true.
You can create two rules one for each condition
and then you can access by binding the Conditaional Element to a variable:
Like for example:

when
$c: Customer( age == 50 )
  then
$c.setAge( "40" );


On Wed, May 28, 2014 at 3:39 PM, Chidambaran Subramanian
wrote:

> rule "Test"
>   dialect "mvel"
>   when
> ( Customer( age == 50 ) or Deal( amount == 30 ) )
>   then
> Customer.setAge( "40" );
> update( Customer );
> Customer.setPlace( "Test" );
> update( Customer );
> end
>
>
>
> Appreciate any help in this regard.
>
> Regards
> Chiddu
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Distributed Drools

2014-04-24 Thread Mauricio Salatino
Daniel, that sounds as a really good project, as Esteban and Davide mention
we should work together to at least share experiences and cons and pros
over the two different implementations (drools only vs jade + drools).
Keep us posted about your progress!


On Thu, Apr 24, 2014 at 8:07 AM, Esteban Aliverti <
esteban.alive...@gmail.com> wrote:

> Matthew, regarding drools-mas, I would use this other repo:
>  
> https://github.com/SocraticGrid/drools-mas.
>  I did some changes there that are not present in droolsjbpm's one (I have
> to merge them back).
> I do think, though, that drools-mas is (currently) more suitable for a
> multi-agent scenario where each of the agents has a private and local
> working memory that is not shared among the others. drools-mas uses FIPA
> messages to handle the communication between the agents, but no real shared
> working memory is never used. Previous implementation of drools-mas used
> drools-grid to try to do something like this (distributed working
> memories), but this implementation was discarded after drools-grid was
> discontinued (it actually never passed the incubation period).
>
> Regards,
>
>
> 
>
> Esteban Aliverti
> - Blog @ http://ilesteban.wordpress.com
>
>
> On Thu, Apr 24, 2014 at 4:39 AM, Daniel Souza wrote:
>
>> Hi Matt,
>>
>> This is the paper url available free from google:  Rule-based Distributed
>> and Agent Systems
>> <
>> http://vsis-www.informatik.uni-hamburg.de/getDoc.php/publications/431/intro.pdf
>> >
>> It's around 27 pages.
>>
>> Daniel
>>
>>
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Distributed-Drools-tp4029338p4029342.html
>> Sent from the Drools: User forum 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
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Want to post to this list

2014-03-21 Thread Mauricio Salatino
Hmm.. you are already posting to this list.. just send the questions :)


On Fri, Mar 21, 2014 at 10:01 AM, Ankit Jain  wrote:

> Hi,
>
> I am Ankit Jain, a newbie to Drools. In order to get my queries answered I
> would like to post to this mailing list.
>
> Regards
> Ankit
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Drools UI inside JSF

2014-03-21 Thread Mauricio Salatino
Hi, as far as I know there is nothing, but it shouldn't be that difficult
to create.
You will need to build a bridge between JSF and GWT and try to embed some
bits of guvnor into your JSF app.
I strongly recommend you to take a look at the new version of the tooling
which will allow you to be more granular selecting the panels that you want
to include.


On Fri, Mar 21, 2014 at 9:22 AM, gigu979 wrote:

> Hi All,
>
> I've a web application developed in JSF.
> I need that my customers (the users) can define rules through this web
> interface.
>
> Is there any tag library or some way to translate the input data in the drl
> script???
>
> There is a way to use guvnor modules within a facelet??
>
> Thanks
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-UI-inside-JSF-tp4028870.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] (no subject)

2014-03-10 Thread Mauricio Salatino
If the list inside  Event has never being initialised it will throw a null
point exception.. so you need to make sure that the list
is initialised properly.

Regards


On Mon, Mar 10, 2014 at 1:43 PM, Sandhya Sree wrote:

> Exception in thread "pool-2-thread-1" Exception executing consequence for
> rule "size" in com.net: java.lang.NullPointerException
>  at
> org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
>  at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1297)
> at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1221)
>  at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1456)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:710)
>  at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:674)
> at
> org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:230)
>  at com.net.RuleExecutor.execute(RuleExecutor.java:18)
> at com.net.DirectoryMonitor.run(DirectoryMonitor.java:39)
>  at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>  at java.lang.Thread.run(Thread.java:744)
> Caused by: java.lang.NullPointerException
> at
> com.net.Rule_size_dc2a47e2812648e69eb9581eda931496.defaultConsequence(Rule_size_dc2a47e2812648e69eb9581eda931496.java:9)
>  at
> com.net.Rule_size_dc2a47e2812648e69eb9581eda931496DefaultConsequenceInvokerGenerated.evaluate(Unknown
> Source)
> at
> com.net.Rule_size_dc2a47e2812648e69eb9581eda931496DefaultConsequenceInvoker.evaluate(Unknown
> Source)
>  at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1287)
>
>
> On Mon, Mar 10, 2014 at 7:08 PM, Mauricio Salatino wrote:
>
>> Please copy the entire stack trace.. what you have copied doesn't mean
>> anything besides that there is something wrong.
>>
>>
>> On Mon, Mar 10, 2014 at 1:29 PM, Sandhya Sree > > wrote:
>>
>>> im getting the following error on doing that
>>>
>>> Exception in thread "pool-2-thread-1" Exception executing consequence
>>> for rule "size" in com.net: java.lang.NullPointerException
>>>
>>> what might be the problem?
>>>
>>>
>>>
>>> On Mon, Mar 10, 2014 at 4:16 PM, Wolfgang Laun 
>>> wrote:
>>>
>>>> Seeing that the list is static you can use the usual way for accessing
>>>> a static class member:
>>>>
>>>> Event.listOfEvent.add( ... );
>>>>
>>>> @Mauricio: It's not unusual to maintain a static collection (even
>>>> though there may be better ways, esp. with Drools).
>>>>
>>>>
>>>>
>>>> On 10/03/2014, Mauricio Salatino  wrote:
>>>> > Can you please elaborate about why do you want to do that? what's the
>>>> point
>>>> > of having a list inside of the Event class that will contain the same
>>>> > event?
>>>> >
>>>> > The "Then" side of the rule is pure java.. so you just do
>>>> > event.getEvents().add(event);
>>>> >
>>>> > but I don't see the point of doing that.
>>>> >
>>>> > Regards
>>>> >
>>>> >
>>>> > On Mon, Mar 10, 2014 at 10:31 AM, Sandhya Sree
>>>> > wrote:
>>>> >
>>>> >> hi ,
>>>> >>
>>>> >> i have a class called Event which is as follows:
>>>> >>
>>>> >> public class Event {
>>>> >>  private  String name;
>>>> >>  private  File source;
>>>> >>  private  Date timeStamp;
>>>> >> public static List listOfEvents;
>>>> >>
>>>> >> public Event(String name, File source, Date timeStamp) {
>>>> >>  this.name = name;
>>>> >> this.source = source;
>>>> >> this.timeStamp = timeStamp;
>>>> >>  }
>>>> >>  public String getName() {
>>>> >>  return name;
>>>> >> }
>>>> >> public void setName(String name) {
>>>> >>  this.name = name;
>>>> >> }
>>>> >> public File getSource() {
>>>> >>  return source;
>>>> >> }
>>>> >> public void se

Re: [rules-users] (no subject)

2014-03-10 Thread Mauricio Salatino
Please copy the entire stack trace.. what you have copied doesn't mean
anything besides that there is something wrong.


On Mon, Mar 10, 2014 at 1:29 PM, Sandhya Sree wrote:

> im getting the following error on doing that
>
> Exception in thread "pool-2-thread-1" Exception executing consequence for
> rule "size" in com.net: java.lang.NullPointerException
>
> what might be the problem?
>
>
>
> On Mon, Mar 10, 2014 at 4:16 PM, Wolfgang Laun wrote:
>
>> Seeing that the list is static you can use the usual way for accessing
>> a static class member:
>>
>> Event.listOfEvent.add( ... );
>>
>> @Mauricio: It's not unusual to maintain a static collection (even
>> though there may be better ways, esp. with Drools).
>>
>>
>>
>> On 10/03/2014, Mauricio Salatino  wrote:
>> > Can you please elaborate about why do you want to do that? what's the
>> point
>> > of having a list inside of the Event class that will contain the same
>> > event?
>> >
>> > The "Then" side of the rule is pure java.. so you just do
>> > event.getEvents().add(event);
>> >
>> > but I don't see the point of doing that.
>> >
>> > Regards
>> >
>> >
>> > On Mon, Mar 10, 2014 at 10:31 AM, Sandhya Sree
>> > wrote:
>> >
>> >> hi ,
>> >>
>> >> i have a class called Event which is as follows:
>> >>
>> >> public class Event {
>> >>  private  String name;
>> >>  private  File source;
>> >>  private  Date timeStamp;
>> >> public static List listOfEvents;
>> >>
>> >> public Event(String name, File source, Date timeStamp) {
>> >>  this.name = name;
>> >> this.source = source;
>> >> this.timeStamp = timeStamp;
>> >>  }
>> >>  public String getName() {
>> >>  return name;
>> >> }
>> >> public void setName(String name) {
>> >>  this.name = name;
>> >> }
>> >> public File getSource() {
>> >>  return source;
>> >> }
>> >> public void setSource(File source) {
>> >>  this.source = source;
>> >> }
>> >> public Date getTimeStamp() {
>> >>  return timeStamp;
>> >> }
>> >> public void setTimeStamp(Date timeStamp) {
>> >>  this.timeStamp = timeStamp;
>> >> }
>> >>
>> >>
>> >>  public void display()
>> >>  {
>> >>  System.out.println(name +" " + "in folder: " + source + " on " +
>> >> timeStamp );
>> >>   }
>> >>
>> >>
>> >>
>> >> there are also some other classes associated with my project.. i have a
>> >> rules file which computes the size of a folder and creates an object of
>> >> Event class. every time this object of Event class is created i wwant
>> to
>> >> put it in a List.. how can i do this..
>> >>
>> >> my rules is as follows:
>> >>
>> >> rule "size"
>> >> when
>> >>   $p:  RuleContext($size: getOldContext().getParent().getUsableSpace()
>> >
>> >> (30*1024*1024))
>> >>
>> >> then
>> >>Event event = new Event("folder almost full",
>> >> $p.getOldContext().getParent(), new Date());
>> >>event.display();
>> >>..here i want to put this event into the List declared in
>> >> Event Class.
>> >>
>> >>   end
>> >>
>> >>
>> >>
>> >> thanks,
>> >> Sandhya
>> >>
>> >> ___
>> >> rules-users mailing list
>> >> rules-users@lists.jboss.org
>> >> https://lists.jboss.org/mailman/listinfo/rules-users
>> >>
>> >
>> >
>> >
>> > --
>> >  - MyJourney @ http://salaboy.com <http://salaboy.wordpress.com>
>> >  - Co-Founder @ http://www.jugargentina.org
>> >  - Co-Founder @ http://www.jbug.com.ar
>> >
>> >  - Salatino "Salaboy" Mauricio -
>> >
>> ___
>> 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
>



-- 
 - MyJourney @ http://salaboy.com <http://salaboy.wordpress.com>
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] (no subject)

2014-03-10 Thread Mauricio Salatino
Can you please elaborate about why do you want to do that? what's the point
of having a list inside of the Event class that will contain the same event?

The "Then" side of the rule is pure java.. so you just do
event.getEvents().add(event);

but I don't see the point of doing that.

Regards


On Mon, Mar 10, 2014 at 10:31 AM, Sandhya Sree
wrote:

> hi ,
>
> i have a class called Event which is as follows:
>
> public class Event {
>  private  String name;
>  private  File source;
>  private  Date timeStamp;
> public static List listOfEvents;
>
> public Event(String name, File source, Date timeStamp) {
>  this.name = name;
> this.source = source;
> this.timeStamp = timeStamp;
>  }
>  public String getName() {
>  return name;
> }
> public void setName(String name) {
>  this.name = name;
> }
> public File getSource() {
>  return source;
> }
> public void setSource(File source) {
>  this.source = source;
> }
> public Date getTimeStamp() {
>  return timeStamp;
> }
> public void setTimeStamp(Date timeStamp) {
>  this.timeStamp = timeStamp;
> }
>
>
>  public void display()
>  {
>  System.out.println(name +" " + "in folder: " + source + " on " +
> timeStamp );
>   }
>
>
>
> there are also some other classes associated with my project.. i have a
> rules file which computes the size of a folder and creates an object of
> Event class. every time this object of Event class is created i wwant to
> put it in a List.. how can i do this..
>
> my rules is as follows:
>
> rule "size"
> when
>   $p:  RuleContext($size: getOldContext().getParent().getUsableSpace() >
> (30*1024*1024))
>
> then
>Event event = new Event("folder almost full",
> $p.getOldContext().getParent(), new Date());
>event.display();
>..here i want to put this event into the List declared in
> Event Class.
>
>   end
>
>
>
> thanks,
> Sandhya
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] [Drools Activation-group] / how to set many activation groups

2014-02-10 Thread Mauricio Salatino
It seems that you can define a rule to codify what you are explaining. You
can change the agenda groups using rules, so you can write a rule that know
how and when change the agenda groups for each of your codes.



On Mon, Feb 10, 2014 at 12:16 PM, jcarpene wrote:

> Hello,
>
> I am trying to implement some rules that need more that a unique
> Activation-group.
>
> My case is related to some Voucher codes for online shopping. A simple case
> works great, by defining an Activation-group to make sure 2 Voucher codes
> cannot be used at the same time.
>
> But now I need 2 Voucher codes (say Code 1, Code 2) to be compatible (no
> activation-group) and a 3rd code (Code 3) to be disabled if Code 1 or Code
> 2
> is used. If I use a XOR group name as an Activation-group, then Code 1 and
> Code 2 will have a same Activation-group and will be exclusive (which I do
> not want).
>
> Do you know a way of setting multiple Activation-Groups for example, or any
> workaround for that case ?
>
>
> Regards,
>
> Jerome
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-Activation-group-how-to-set-many-activation-groups-tp4028033.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Driving License application

2013-12-24 Thread Mauricio Salatino
Yeah, that will do the work.



On Tue, Dec 24, 2013 at 10:34 AM, seyfullah wrote:

> Ok, I changed my drl file and main method as follows, and it works. Thank
> you.
>
> package MyPackage
>
> import MyPackage.Applicant;
>
> rule "Is of not valid age"
> when
> $a : Applicant( age < 18 )
> then
> $a.setValid ( false );
> end
>
> rule "Is of valid age"
> when
> $a : Applicant( age > 17 )
> then
> $a.setValid ( true );
> end
>
>
> KieServices kieServices = KieServices.Factory.get();
> KieContainer kContainer =
> kieServices.getKieClasspathContainer();
> StatelessKieSession kSession =
> kContainer.newStatelessKieSession();
>
> Applicant applicant = new Applicant("Mr John Smith", 16);
> assertFalse( applicant.isValid() );
> kSession.execute( applicant ) ;
> assertFalse ( applicant.isValid() );
>
> Applicant applicant2 = new Applicant("Mr Bill Wayne", 22);
> assertFalse( applicant2.isValid() );
> kSession.execute( applicant2 ) ;
> assertTrue ( applicant2.isValid() );
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Driving-License-application-tp4027403p4027407.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Driving License application

2013-12-24 Thread Mauricio Salatino
So, if you don't touch in some way the boolean valid, value in your rules
or in your java code it will be false not true.



On Tue, Dec 24, 2013 at 10:15 AM, seyfullah wrote:

> package MyPackage;
> public class Applicant {
>
> public String getName() {
> return name;
> }
> public void setName(String name) {
> this.name = name;
> }
> public int getAge() {
> return age;
> }
> public void setAge(int age) {
> this.age = age;
> }
> public boolean isValid() {
> return valid;
> }
> public void setValid(boolean valid) {
> this.valid = valid;
> }
> private String name;
> private int age;
> private boolean valid;
> public Applicant(String nameP, int ageP) {
> // TODO Auto-generated constructor stub
> this.name = nameP;
> this.age = ageP;
> }
>
> }
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Driving-License-application-tp4027403p4027405.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Driving License application

2013-12-24 Thread Mauricio Salatino
Can you share with us the Applicant class?
because if you have something like: boolean valid; it will be automatically
initialized to false, so the rule will not do anything just leave the
Applicant as it is


On Tue, Dec 24, 2013 at 10:05 AM, seyfullah wrote:

> Hello,
> I am trying to implement Driving License example application in Drools
> Documentation Versio 6.0.0.0 Final.
> My main method is as below.
> KieServices kieServices = KieServices.Factory.get();
> KieContainer kContainer =
> kieServices.getKieClasspathContainer();
> StatelessKieSession kSession =
> kContainer.newStatelessKieSession();
> Applicant applicant = new Applicant("Mr John Smith", 16);
>
> assertTrue( applicant.isValid() );
> kSession.execute( applicant ) ;
> assertFalse ( applicant.isValid() );
>
> My licenseApplication.drl file is as below:
> package MyPackage
>
> import MyPackage.Applicant;
>
> rule "Is of valid age"
> when
> $a : Applicant( age < 18 )
>
> then
> $a.setValid ( false );
> end
>
> Thanks to assertTrue and asserFalse methods, its output is
> It is false as not expected
> It is false as expected
>
> Bu when I change age parameter from 16 to 22 its output is same again. I
> expected that it is true.
>
> I think there is something wrong.
> Do you have any idea about this problem?
>
> Regards
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Driving-License-application-tp4027403.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Drools Roadmap - Planned Release 6.0.0.Final release date

2013-10-28 Thread Mauricio Salatino
We are working hard on get it out soon, but there is no definitive date as
far as I know.. Maybe early next week (??)


On Mon, Oct 28, 2013 at 6:53 PM, Juan Ignacio Barisich <
juan.baris...@gmail.com> wrote:

> Hi everybody.
> I need to know if is there a planned release date for Drools platform
> 6.0.0.Final.
>
> Thanks
> Regards
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Help on writing a rule

2013-10-22 Thread Mauricio Salatino
Just curious here, why do you have this -> signal : Signal( id == "1234" )
over window:length(1)?


On Tue, Oct 22, 2013 at 9:40 PM, Davide Sottara  wrote:

> Am I wrong or do you have two PriceChange events - 392 and 394 ?
> If so, you can expect two activations.. when you fire al rules, one of
> the two
> will insert the OrderCreated, which in turn will cancel the other
>
> On 10/22/2013 01:34 PM, calcacuervo wrote:
> > Hi Guys. I have one quesiton on how could I implement my rule.
> > I have this rule:
> > when
> >   t : PriceChange() over window:length(1)
> >   signal : Signal( id == "1234" ) over window:length(1)
> >   not OrderCreated( id == "1234" ) over window:time (1m)
> >   then
> > insert(new OrderCreated("1234));
> >
> > Basically, when there is some signal and some price change, create a new
> > order if  there has no been any other order in the last minute.
> > But this sometimes is being fired twice:
> > 12:31:01,121 INFO  [org.drools.audit.WorkingMemoryConsoleLogger] (Camel
> > (camel-1) thread #4 - JmsConsumer[marketDataTopic]) ACTIVATION CREATED
> > rule:ertetr activationId:ertetr [393, 392, 0] declarations: t=PriceChange
> > [](392); signal=Signal@1413ddef(393)
> > 12:31:01,160 INFO  [org.drools.audit.WorkingMemoryConsoleLogger] (Camel
> > (camel-1) thread #4 - JmsConsumer[marketDataTopic]) ACTIVATION CREATED
> > rule:ertetr activationId:ertetr [393, 394, 0] declarations: t=PriceChange
> > [](394); signal=Signal@1413ddef(393)
> >
> > I think that, when the 1m window have passed, it creates twice the
> > activations, as I have not called fire all rules yet. Does is make
> sense? Do
> > you have some idea on how could I implement this rule? "when there has
> been
> > some price change and some signal, and I did not create a new order in
> the
> > last minute, just create a new order".
> >
> > Thanks in advance!
> >
> > Demian
> >
> >
> >
> > --
> > View this message in context:
> http://drools.46999.n3.nabble.com/Help-on-writing-a-rule-tp4026461.html
> > Sent from the Drools: User forum 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
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Free Drools & jBPM Workshops in London

2013-10-22 Thread Mauricio Salatino
A community member will be trying to broadcast the workshop, so tomorrow we
will be sharing the stream URL, but it's not guaranteed to work.

Cheers


On Tue, Oct 22, 2013 at 3:58 PM, Genene Geda  wrote:

>  Hi, is there any chance to attend this workshop online ? Thanks,
>
> ** **
>
> *From:* rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] *On Behalf Of *Mauricio Salatino
> *Sent:* Tuesday, October 22, 2013 8:49 AM
> *To:* Rules Users List; Rules Dev List
> *Subject:* [rules-users] Free Drools & jBPM Workshops in London
>
> ** **
>
> Hi everyone, tomorrow we (Michael Anstis)  are doing a couple of workshops
> about the new Drools and jBPM 6 platform. Here you can find more details
> about the event:
>
> ** **
>
>
> http://salaboy.com/2013/10/04/drools-and-jbpm-6-workshops-2324-october-london/
> 
>
> ** **
>
> There are very few seats available, so get in touch if you want to secure
> your place.
>
> ** **
>
>
> 
>
> ** **
>
> -- 
>
>  - MyJourney @ http://salaboy.com <http://salaboy.wordpress.com>
>
>  - Co-Founder @ http://www.jugargentina.org
>  - Co-Founder @ http://www.jbug.com.ar
>
>  - Salatino "Salaboy" Mauricio -
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com <http://salaboy.wordpress.com>
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

[rules-users] Free Drools & jBPM Workshops in London

2013-10-22 Thread Mauricio Salatino
Hi everyone, tomorrow we (Michael Anstis)  are doing a couple of workshops
about the new Drools and jBPM 6 platform. Here you can find more details
about the event:

http://salaboy.com/2013/10/04/drools-and-jbpm-6-workshops-2324-october-london/

There are very few seats available, so get in touch if you want to secure
your place.



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Drools Flow

2013-10-14 Thread Mauricio Salatino
Yeah, Drools Flow was renamed to jBPM 5 and 6


On Mon, Oct 14, 2013 at 5:44 PM, vojedav  wrote:

> What happened with that project? Is embedded in Rules Expert o where? If I
> want to develop an app with workflow, have I to get jBPM instead? Thanks in
> advance
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-Flow-tp4026363.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Indicating "used" rules

2013-09-23 Thread Mauricio Salatino
yeah you can do that, you can write rules about rules activations with the
declarative agenda feature.
Check this out:

http://planet.jboss.org/post/declarative_agenda_and_control_rules


On Mon, Sep 23, 2013 at 4:06 PM, Andrzej Grzelak wrote:

> Hello again,
>
> Im making some kind of expert system. And now i got new problem:
>
> User is asked sequentially for propetieries of object, than I modify
> object propetieries, then i call update() and fireAllRules() to check for
> any answers.
> It is repeated for every object property till we fire rule with answer.
>
> Now problem comes : When user decline answer we need to find another one.
> But first answer will fire every time now. That's not what i need
>
> Making somewhere in app list of "false answers" and then striping out them
> on return wont work. My app flow is determined by drools rule fire - if one
> of "answer rules" fires i return that answer, normally i would ask another
> question.
>
> I would need to indicate drools somehow to delete/deactivate that rule.
>
>
> Thanks for any help.
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] JBPM 6 Loop back.

2013-09-08 Thread Mauricio Salatino
Can you please elaborate a little bit more? I coudn't understand what the
problem is.

Cheers


On Sun, Sep 8, 2013 at 6:59 AM, Naman Shah  wrote:

> I got a work flow, which has a loop back.
> ?node : yes--> do x /?node:no -->repeat previous
>  yes works and n o dont
> and also i cant find entires into process instance data ,using which i can
> see the  process status.
>
> I am using jbpm beta 6.05
>
> Please find the attached BPMN for the same.
> Node name where loop back dont work : inclusiveGateway id="_49"
> and others too.
>
> -
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] temporal reasoning/drools fusion: basic question

2013-09-03 Thread Mauricio Salatino
Sure

rule "not Y after X - 5 mins"
  when
$x: X()
 not ( Y( this after[ 5m ] $x) )
  then
   // do something
end

Check the Drools fusion docs.. there are examples there..
Cheers


On Mon, Sep 2, 2013 at 5:32 PM, amarok  wrote:

> Does fusion support temporal reasoning on futur events?
>
> E.g. I want to define rules like the following:
>
> If within 5 minutes after Event X there is NOT an Event Y
> Then do [...]
>
> This rule would then be "initiated" when an Event X occurs, and would be
> "fired" when within the next 5 minutes no Event Y follows.
>
> If this does not work with fusion, what would you recommend?
> If it does, could someone post a very simple .drl example for such a rule?
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/temporal-reasoning-drools-fusion-basic-question-tp4025760.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Is drools the solution for my requirement.

2013-08-27 Thread Mauricio Salatino
It all depends on how often those rules will change and how often you will
add new ones.
It is also important to understand if the business users wants to see the
rules and understand what is going on, or everything will be hidden?

>From the maintainance point of view, the rules can help you out if the
logic chances periodically.


On Tue, Aug 27, 2013 at 1:40 PM, nitind  wrote:

> Hi,
>
>We have 200 odd rules to be configured and wanted to know if drools can
> be the optimum solutions. The rules are broadly classified into 2
> categories
>
>   example 1 :  We need to compare invoice no value in 10 documents and
> if it matches perform A if it does not match perform B
>   The catch is the 10 different document may not
> have the same Keyword i.e. Invoice no, instead it can Bill no, Invoice
> number, Bill #, Inv etc.
>
>   example 2 :  Search for Key word like Ferrari, BMW , if found need to
> check if the individual is Authorized agent.
>
> Question : Can the above be implement using Drools, second is
> it
> worth the effort or just code if else in Java and get it done.
>
>   Thanks in advance.
>
> Regards
> Nitin
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Is-drools-the-solution-for-my-requirement-tp4025693.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] drools engine freezes when idle

2013-08-26 Thread Mauricio Salatino
Can you please elaborate a little bit about what is going one?
What do you mean with freeze? the web app is dead? does it shows something
in the logs?


On Mon, Aug 26, 2013 at 2:18 PM, arcee123  wrote:

> Greetings,
>
> I am a new drools developer.  This is my first installation.
> I have followed the instructions for installation, and was able to bring up
> Govnor and my my repositories.
>
> It appears to work great.
>
> The problem is that if the service sits idle, meaning no requests of the
> Govnor repository, the resources on the machine tie up, and the service
> freezes.
>
> I am attempting to find the culprit, but I was hoping that someone here
> might have seen this before, and is able to help me on the start point to
> figuring out what's wrong.
>
> Thank you.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/drools-engine-freezes-when-idle-tp4025677.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Process Compilation Error: Drools can not be resolved

2013-08-20 Thread Mauricio Salatino
Yeah I noticed that you are trying to do that.. but my question is why are
you doing that.
Are you using the hashmap in some rules?
Why are you using a script task? You can use a workItemHandler to have more
control on the objects that you are using and also to have auto completion,
compilation time validations and most importantly you can debug it.




On Tue, Aug 20, 2013 at 12:52 PM, V Vignesh  wrote:

> Hi Mauricio
>
> Thanks for your explanation buddy.
> sure i will check on it.
>
> Target to achieve:
> ==
> I have a HashMap in my ProcessTest.java as
> -
> --
> HashMap hMap = new HashMap();
>hMap.put("Id", "10");
>hMap.put("RollNumber", "456");
>FactHandle qMapHandle = ksession.insert(hMap);
>ksession.startProcess("sample.ruleflow");
>ksession.fireAllRules();
> -
>
>
> Now i am trying to access this HashMap from ProcessTest.java for further
> calculations to proceed using its values, in my Script Task Action of
> ruleflow.rf.
>
>
>
> Viki
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Process-Compilation-Error-Drools-can-not-be-resolved-tp4025623p4025627.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Process Compilation Error: Drools can not be resolved

2013-08-20 Thread Mauricio Salatino
The kcontext is a special variable of the type RuleContext. If you take a
look at that interface and all the inheritance you will find out which
methods you can use.
You can do something like:
kcontext.getKnowledgeRuntime().getObjects() and then look for the HashMap.
I'm not sure what do you want to achieve.. but as you may notice this is
not a clean solution.. you probably can change the shape of your solution
to something better, if you share with us what are you trying to achieve,
maybe we can help.

Cheers



On Tue, Aug 20, 2013 at 12:33 PM, V Vignesh  wrote:

> Hi Mauricio
>
> Thanks a lot buddy.
> I would like to know how this syntax functions.
> If i need the HashMap from process Test.java (as i have mentioned first)
> how should i alter this line?
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Process-Compilation-Error-Drools-can-not-be-resolved-tp4025623p4025625.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Process Compilation Error: Drools can not be resolved

2013-08-20 Thread Mauricio Salatino
Yeah, that's because "drools" doesn't exist.
I think that you can use the kcontext, in order to do that..
Try something like:

kcontext.getKnowledgeRuntime().getFactHandles() instead of
drools.getWorkingMemory().getFactHandles()


On Tue, Aug 20, 2013 at 11:42 AM, V Vignesh  wrote:

> Hi guys,
>
> I am new new to Rule Flow.
> I am using eclipse for rule flow.
>
> In a new Drools-Project
> in ProcessTest.java
> I tried to insert a HashMap in a knowledge base session
> ---
> HashMap hMap = new HashMap();
> hMap.put("Id", "10");
> hMap.put("RollNumber", "456");
> FactHandle qMapHandle = ksession.insert(hMap);
> ksession.startProcess("sample.ruleflow");
> ksession.fireAllRules();
> --
>
> but in my ruleflow.rf
> I added a script Task
> when in its Action, i tried accessing this fact Handle i get an error
> "Drools cannot be resolved"
> -
> if(drools.getWorkingMemory().getFactHandles()){
> System.out.println("Inside the Script Task");
> }
> -
>
> Can you please help me to figure out the Reasons for Compilation Error
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Process-Compilation-Error-Drools-can-not-be-resolved-tp4025623.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] What are Recursion Rules. Any example

2013-08-20 Thread Mauricio Salatino
Hi, why do you want to understand that? What are you trying to solve? Help
us to help you.

Usually when the terms "Rules Recursion" is used, is when you have a rule
or a set of rules that are executed in a loop because the consequence of a
rule trigger the same rule again. This can be caused because your rule
consequence, is modifying the objects that are matched in the Condition
side of the rule, which causes the re evaluation of the condition.

Is that what are you looking for?

Cheers


On Tue, Aug 20, 2013 at 9:56 AM, ashwindrool
wrote:

> Hi All,
>
> Can anyone help me in understanding "Recursion Rules".
>
> If any example , will be of great help to me.
>
>
> Thanks
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/What-are-Recursion-Rules-Any-example-tp4025617.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] JbpmJunitTestCase - where does it live?

2013-08-12 Thread Mauricio Salatino
That class is in jbpm-tests

https://github.com/droolsjbpm/jbpm/blob/master/jbpm-test/src/main/java/org/jbpm/test/JbpmJUnitTestCase.java


On Mon, Aug 12, 2013 at 10:18 AM, droolster  wrote:

> Hello,
>
> I have imported the jbpm dependency into my project:
>
> 
>   org.jbpm
>   jbpm-bpmn2
>   5.4.0.Final
> 
>
> However, Eclipse cannot find org.jbpm.JbpmJUnitTestCase i.e.
>
> import  org.jbpm.JbpmJUnitTestCase;
>
> Please can anyone tell me where I can find this class.
>
> Thanks in advance for your help.
>
> Regards
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/JbpmJunitTestCase-where-does-it-live-tp4025466.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Snapshot of drools engine's state

2013-08-12 Thread Mauricio Salatino
IMO that's a very difficult problem to solve.. because if you want to do it
every X seconds you can be caught in the middle of an execution. If you
delay the snapshot creation for when the execution ends, you will probably
caught in the next snapshot creation.
Depending on what are you doing within your rules, you can always recreate
the session from the scratch. You can also use rules to summarize state and
persist that summaries in your external database, that can save you some
time.

HTH


On Mon, Aug 12, 2013 at 8:52 AM, IK81  wrote:

> Hi,
>
> I am looking for a solution to make the engine's state persistent in
> regular
> intervals. I do not want to persist the engine's state at every event
> insertion for performance reasons. Instead I am thinking of making a
> snapshot of the engine's state let's say every X seconds. The events I have
> are always stored to a database. In case of a crash or reboot I'd like to
> recover the engine's state from the snapshot + reinserting the events that
> happened after the timestamp of my snapshot.
>
> Are there any hints or caveats regarding this approach?
>
> Best regards,
> Ingo
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Snapshot-of-drools-engine-s-state-tp4025457.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] ruleflow-group and jBPMN

2013-08-05 Thread Mauricio Salatino
Are you calling fireAllRules after the process returns the execution to the
application?
Are you 100% sure that at least a rule is being activated?


On Mon, Aug 5, 2013 at 4:54 PM, droolster  wrote:

> Hello,
>
> Please can the community help me.
>
> I have setup a Drools JBPMN process and am using it to determine which set
> of rules to fire under different scenarios.
>
> However, when I add the ruleflow-group attribute to the rules in the DRL
> file, the rules fail to execute.
>
> Here is my setup:
>
> foo.bpmn2
> RuleFlowGroup="abc"
>
> rules.drl
> rule "number one" ruleflow-group "abc"
>
> When I initiate the process, the rule do not fire. If I take out the
> ruleflow-group attribute in the DRL file, the rules fire. Any idea what I
> am
> not doing or doing wrong?
>
> Regards.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/ruleflow-group-and-jBPMN-tp4025347.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Integrating custom UI with drools rule engine

2013-08-05 Thread Mauricio Salatino
if you are using Guvnor 5.5 the rules are being stored in both: DRL and BRL
format.
I would recommend you to go with a simple DRL format, which is plain text
with valid rules in it.

HTH


On Mon, Aug 5, 2013 at 10:20 AM, ashish6276 wrote:

> Hi,
> I am creating UI which will take input for condition and Action. That input
> shoule be indesatndable by guvnor so that we can add one rule in it.
> My question is which format the inputof Ui should be converted so that
> Guvnor can understand and rules can be added
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Integrating-custom-UI-with-drools-rule-engine-tp4025316p4025321.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Integrating custom UI with drools rule engine

2013-08-05 Thread Mauricio Salatino
Ok, so you will need to elaborate a little bit more, so we can help you.
The Drools Engine is not Guvnor. The Drools Engine is Drools Expert and
Guvnor is a Rules/Knowledge Assets Repository.
I'm guessing that you have your own rules authoring environment and you
want to "deploy" the rule to the Knowledge Repository (Guvnor) is that
right? I guess that you can use the REST APIs for doing that. Guvnor Team,
please correct me if I'm wrong.

Best regards


On Mon, Aug 5, 2013 at 9:49 AM, ashish6276 wrote:

> I need to integrate the Custom Ui with Drools engine(Guvnor).we need to
> create rules input from UI (jsp) and integrate into Guvnor so that click of
> event rules defined in UI will add to guvnor?
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Integrating-custom-UI-with-drools-rule-engine-tp4025316.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Drools Dzone Refcard

2013-07-25 Thread Mauricio Salatino
Great Mario!
Can I publish that in my blog?


On Thu, Jul 25, 2013 at 9:01 AM, Mario Fusco  wrote:

> Hi all,
>
> Marcin Grzejszczak and myself wrote a Dzone Refcard covering Drools 5.5
> that
> is now available for download here:
> http://refcardz.dzone.com/refcardz/drools
>
> We hope this could be useful both as a starting guide for beginners and as
> cheat sheet for more experienced users.
>
> Cheers,
> Mario
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-Dzone-Refcard-tp4025135.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Pattern matching rules

2013-07-24 Thread Mauricio Salatino
yeah you can use the matches operator and write your own regular expression
there.

Cheers


On Wed, Jul 24, 2013 at 10:47 AM, rganesh84  wrote:

> I was just wondering if there is a pattern matcher available in drools.
> Below is a sample
>
> rule "Action Movies"
> dialect "java"
> when
> ui : UserInfo(likes contains "Action")
> then
> List sw = new ArrayList();
> sw.add("Die Hard");
> sw.add("The Avengers");
> ui.setRecs(sw);
> end
>
> the rule strictly checks for word "Action" but if the likes list contains
> "Action Movies" the rule won't get processed. Is there a pattern matching
> ability or a like search for a String/list containing strings?
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Pattern-matching-rules-tp4025112.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Getting deadlock-like thread state

2013-07-23 Thread Mauricio Salatino
If you run each of these sessions alone does you get the same problem? or
this only happens when you try to run multiple sessions in parallel??


On Tue, Jul 23, 2013 at 1:33 PM, Bojan Janisch <
bojan.jani...@scai.fraunhofer.de> wrote:

> Hey drools users,
>
> I'm running drools multiple times in parallel with ECJ (genetic algorithm
> framework). Also I'm running ECJ multiple times in parallel (evaluation
> purpose).
> But each time I want to run ECJ, after an unspecific time, one thread is
> running infinite long while ECJ waits for it to finish. Additionally to
> this my
> working memory is steadily growing while hanging in this deadlock-like
> state, though this might not be due to drools. This goes on until I get an
> gc out of
> memory exception.
>
> I've created a threaddump which always looks so:
>
>  java.lang.Thread.State: RUNNABLE
> at java.lang.Object.notifyAll(Native Method)
> at
> org.drools.common.DefaultAgenda.notifyHalt(DefaultAgenda.java:1478)
> - locked <0x2af5f3b0fe88> (a
> java.util.concurrent.atomic.AtomicBoolean)
> at
> org.drools.common.DefaultAgenda.addActivation(DefaultAgenda.java:466)
> at
> org.drools.common.DefaultAgenda.addActivation(DefaultAgenda.java:326)
> at
> org.drools.reteoo.RuleTerminalNode.assertLeftTuple(RuleTerminalNode.java:259)
> at
> org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:196)
> at
> org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:71)
> at org.drools.reteoo.JoinNode.propagateFromLeft(JoinNode.java:107)
> at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:95)
> at
> org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:196)
> at
> org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:71)
> at org.drools.reteoo.JoinNode.propagateFromLeft(JoinNode.java:107)
> at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:95)
> at
> org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:196)
> at
> org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:71)
> at org.drools.reteoo.JoinNode.propagateFromRight(JoinNode.java:159)
> at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:148)
> at
> org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
> at
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
> at
> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
> at
> org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
> at
> org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
> at
> org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
> at
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
> at
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
> at
> org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
> at rulevolution.RulEvolution.runDrools(RulEvolution.java:343)
> at rulevolution.RulEvolution.evaluate(RulEvolution.java:185)
> at ec.simple.SimpleEvaluator.evalPopChunk(SimpleEvaluator.java:259)
> at
> ec.simple.SimpleEvaluator$SimpleEvaluatorThreadCG.run(SimpleEvaluator.java:341)
> at ec.util.ThreadPool$PoolThread.run(ThreadPool.java:57)
>
>Locked ownable synchronizers:
> - <0x2af5f3ae95d0> (a
> java.util.concurrent.locks.ReentrantLock$NonfairSync)
>
> To my Programm:
>
> Rules are generated in parallel and for each rule, a new KnowledgeBase,
> KnowledgeBuilder and StatefulKnowledgeSession is created.
> Objects are inserted into the session and the rule is fired. The session
> will be disposed after no facts matches my rule or 1000
> conclusions are fired.
>
> I've searched the net for a similar problem, but with no success. Does
> someone know why Drools get into such a thread state and
> how to get out of it?
>
> I appreciate any help.
>
> Bojan
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] clustering

2013-05-15 Thread Mauricio Salatino
Hi Sara,
I'm not sure if this is the right mailing list for JBoss Application Server
Clustering configurations. You should try at the JBoss AS User forums.


On Wed, May 15, 2013 at 12:01 PM, sara ibrahim <
saraibrahimhas...@hotmail.com> wrote:

> hi,
>
> i need to configure Jboss clustering , i tried to apply it in the same
> server but i couldn't perform Failover
> so now i'm trying two different ips at different machines , what should i
> do exactly?!
>
> REGARDS,
>
> SARA
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Strange error using Drools + Spring + DecisionTable

2013-04-17 Thread Mauricio Salatino
If you place the xls file inside src/main/resources it should be picked up
for both, the test and the spring configuration


On Wed, Apr 17, 2013 at 7:13 PM, Mauricio Salatino wrote:

> Great! Good luck!
>
>
> On Wed, Apr 17, 2013 at 6:53 PM, Charles Moulliard wrote:
>
>> Know the reason. Maven when it copy it to the target directory modifies
>> it. Will investigate why.
>>
>>
>> On Wed, Apr 17, 2013 at 11:46 PM, Charles Moulliard wrote:
>>
>>> if i change the name (file tobe loaded) then it fails
>>>
>>> Caused by: java.io.FileNotFoundException:
>>> 'data/IntegrationExampleTesti.xls' cannot be opened because it does not
>>> exist
>>>  at
>>> org.drools.core.io.impl.ClassPathResource.getURL(ClassPathResource.java:168)
>>> at
>>> org.drools.core.io.impl.ClassPathResource.getLastModified(ClassPathResource.java:180)
>>>
>>>
>>> On Wed, Apr 17, 2013 at 11:44 PM, Mauricio Salatino 
>>> wrote:
>>>
>>>> Can you try pointing to a non existing location? to see if you get the
>>>> same error?
>>>>
>>>>
>>>>
>>>> On Wed, Apr 17, 2013 at 6:30 PM, Charles Moulliard wrote:
>>>>
>>>>> As the file exists under target/classes directory, that should be the
>>>>> case
>>>>>
>>>>> /target/classes/data/IntegrationExampleTest.xls
>>>>>
>>>>>
>>>>> On Wed, Apr 17, 2013 at 11:11 PM, Mauricio Salatino >>>> > wrote:
>>>>>
>>>>>> It could be related with the location of the file: classpath:data/
>>>>>> IntegrationExampleTest.xls
>>>>>>
>>>>>> Are you sure that the file is being picked up?
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, Apr 17, 2013 at 6:05 PM, Charles Moulliard 
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> When I try to instantiate an Excel Decision Table using Drools +
>>>>>>> Spring (kresource), I get this error :
>>>>>>>
>>>>>>> REMARK: the file is the same as we have in Drools Unit Test
>>>>>>> (decision-table)
>>>>>>>
>>>>>>> Error :
>>>>>>>
>>>>>>> Caused by: java.lang.IllegalArgumentException: Your InputStream was
>>>>>>> neither an OLE2 stream, nor an OOXML stream
>>>>>>> at
>>>>>>> org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:75)
>>>>>>>  at
>>>>>>> org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:75)
>>>>>>> at
>>>>>>> org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:93)
>>>>>>>  at
>>>>>>> org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:72)
>>>>>>> at
>>>>>>> org.drools.decisiontable.DecisionTableProviderImpl.compileStream(DecisionTableProviderImpl.java:37)
>>>>>>>  at
>>>>>>> org.drools.decisiontable.DecisionTableProviderImpl.loadFromInputStream(DecisionTableProviderImpl.java:20)
>>>>>>> at
>>>>>>> org.drools.compiler.compiler.DecisionTableFactory.loadFromInputStream(DecisionTableFactory.java:15)
>>>>>>>  at
>>>>>>> org.drools.compiler.compiler.PackageBuilder.decisionTableToPackageDescr(PackageBuilder.java:460)
>>>>>>> at
>>>>>>> org.drools.compiler.compiler.PackageBuilder.addPackageFromDecisionTable(PackageBuilder.java:454)
>>>>>>>  at
>>>>>>> org.drools.compiler.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:684)
>>>>>>> at
>>>>>>> org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:51)
>>>>>>>  at
>>>>>>> org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:40)
>>>>>>> at
>>>>>>> org.drools.container.spring.beans.KnowledgeBaseBeanFactory.afterPropertiesSet(KnowledgeBaseBeanFactory.java:110)
>>>>>>>  at
>>>>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractA

Re: [rules-users] Strange error using Drools + Spring + DecisionTable

2013-04-17 Thread Mauricio Salatino
Great! Good luck!


On Wed, Apr 17, 2013 at 6:53 PM, Charles Moulliard  wrote:

> Know the reason. Maven when it copy it to the target directory modifies
> it. Will investigate why.
>
>
> On Wed, Apr 17, 2013 at 11:46 PM, Charles Moulliard wrote:
>
>> if i change the name (file tobe loaded) then it fails
>>
>> Caused by: java.io.FileNotFoundException:
>> 'data/IntegrationExampleTesti.xls' cannot be opened because it does not
>> exist
>>  at
>> org.drools.core.io.impl.ClassPathResource.getURL(ClassPathResource.java:168)
>> at
>> org.drools.core.io.impl.ClassPathResource.getLastModified(ClassPathResource.java:180)
>>
>>
>> On Wed, Apr 17, 2013 at 11:44 PM, Mauricio Salatino wrote:
>>
>>> Can you try pointing to a non existing location? to see if you get the
>>> same error?
>>>
>>>
>>>
>>> On Wed, Apr 17, 2013 at 6:30 PM, Charles Moulliard wrote:
>>>
>>>> As the file exists under target/classes directory, that should be the
>>>> case
>>>>
>>>> /target/classes/data/IntegrationExampleTest.xls
>>>>
>>>>
>>>> On Wed, Apr 17, 2013 at 11:11 PM, Mauricio Salatino 
>>>> wrote:
>>>>
>>>>> It could be related with the location of the file: classpath:data/
>>>>> IntegrationExampleTest.xls
>>>>>
>>>>> Are you sure that the file is being picked up?
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Apr 17, 2013 at 6:05 PM, Charles Moulliard 
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> When I try to instantiate an Excel Decision Table using Drools +
>>>>>> Spring (kresource), I get this error :
>>>>>>
>>>>>> REMARK: the file is the same as we have in Drools Unit Test
>>>>>> (decision-table)
>>>>>>
>>>>>> Error :
>>>>>>
>>>>>> Caused by: java.lang.IllegalArgumentException: Your InputStream was
>>>>>> neither an OLE2 stream, nor an OOXML stream
>>>>>> at
>>>>>> org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:75)
>>>>>>  at
>>>>>> org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:75)
>>>>>> at
>>>>>> org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:93)
>>>>>>  at
>>>>>> org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:72)
>>>>>> at
>>>>>> org.drools.decisiontable.DecisionTableProviderImpl.compileStream(DecisionTableProviderImpl.java:37)
>>>>>>  at
>>>>>> org.drools.decisiontable.DecisionTableProviderImpl.loadFromInputStream(DecisionTableProviderImpl.java:20)
>>>>>> at
>>>>>> org.drools.compiler.compiler.DecisionTableFactory.loadFromInputStream(DecisionTableFactory.java:15)
>>>>>>  at
>>>>>> org.drools.compiler.compiler.PackageBuilder.decisionTableToPackageDescr(PackageBuilder.java:460)
>>>>>> at
>>>>>> org.drools.compiler.compiler.PackageBuilder.addPackageFromDecisionTable(PackageBuilder.java:454)
>>>>>>  at
>>>>>> org.drools.compiler.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:684)
>>>>>> at
>>>>>> org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:51)
>>>>>>  at
>>>>>> org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:40)
>>>>>> at
>>>>>> org.drools.container.spring.beans.KnowledgeBaseBeanFactory.afterPropertiesSet(KnowledgeBaseBeanFactory.java:110)
>>>>>>  at
>>>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
>>>>>> at
>>>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
>>>>>>
>>>>>> Config :
>>>>>>
>>>>>> 
>>>>>> http://www.springframework.org/schema/beans";
>>>>>>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>>>>>xmlns

Re: [rules-users] Strange error using Drools + Spring + DecisionTable

2013-04-17 Thread Mauricio Salatino
Can you try pointing to a non existing location? to see if you get the same
error?



On Wed, Apr 17, 2013 at 6:30 PM, Charles Moulliard  wrote:

> As the file exists under target/classes directory, that should be the case
>
> /target/classes/data/IntegrationExampleTest.xls
>
>
> On Wed, Apr 17, 2013 at 11:11 PM, Mauricio Salatino wrote:
>
>> It could be related with the location of the file: classpath:data/
>> IntegrationExampleTest.xls
>>
>> Are you sure that the file is being picked up?
>>
>>
>>
>> On Wed, Apr 17, 2013 at 6:05 PM, Charles Moulliard wrote:
>>
>>> Hi,
>>>
>>> When I try to instantiate an Excel Decision Table using Drools + Spring
>>> (kresource), I get this error :
>>>
>>> REMARK: the file is the same as we have in Drools Unit Test
>>> (decision-table)
>>>
>>> Error :
>>>
>>> Caused by: java.lang.IllegalArgumentException: Your InputStream was
>>> neither an OLE2 stream, nor an OOXML stream
>>> at
>>> org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:75)
>>>  at
>>> org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:75)
>>> at
>>> org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:93)
>>>  at
>>> org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:72)
>>> at
>>> org.drools.decisiontable.DecisionTableProviderImpl.compileStream(DecisionTableProviderImpl.java:37)
>>>  at
>>> org.drools.decisiontable.DecisionTableProviderImpl.loadFromInputStream(DecisionTableProviderImpl.java:20)
>>> at
>>> org.drools.compiler.compiler.DecisionTableFactory.loadFromInputStream(DecisionTableFactory.java:15)
>>>  at
>>> org.drools.compiler.compiler.PackageBuilder.decisionTableToPackageDescr(PackageBuilder.java:460)
>>> at
>>> org.drools.compiler.compiler.PackageBuilder.addPackageFromDecisionTable(PackageBuilder.java:454)
>>>  at
>>> org.drools.compiler.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:684)
>>> at
>>> org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:51)
>>>  at
>>> org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:40)
>>> at
>>> org.drools.container.spring.beans.KnowledgeBaseBeanFactory.afterPropertiesSet(KnowledgeBaseBeanFactory.java:110)
>>>  at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
>>> at
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
>>>
>>> Config :
>>>
>>> 
>>> http://www.springframework.org/schema/beans";
>>>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>>xmlns:drools="http://drools.org/schema/drools-spring";
>>>xsi:schemaLocation="http://www.springframework.org/schema/beans
>>> http://www.springframework.org/schema/beans/spring-beans.xsd
>>> http://drools.org/schema/drools-spring
>>> http://drools.org/schema/drools-spring.xsd";>
>>>
>>> 
>>>
>>> 
>>> 
>>> 
>>> 
>>> 
>>> >> source="classpath:data/IntegrationExampleTest.xls"/>
>>> 
>>> 
>>>
>>> >>  type="stateless"
>>>  name="ksession1"
>>>  kbase="kbase1"
>>>  node="node1"/>
>>>
>>> 
>>>
>>> Regards,
>>>
>>> --
>>> Charles Moulliard
>>> Apache Committer / Sr. Enterprise Architect (RedHat)
>>> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>>>
>>>
>>> ___
>>> rules-users mailing list
>>> rules-users@lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>
>>
>>
>>
>> --
>>  - MyJourney @ http://salaboy.com <http://salaboy.wordpress.com>
>>  - Co-Founder @ http://www.jugargentina.org
>>  - Co-Founder @ http://www.jbug.com.ar
>>
>>  - Salatino "Salaboy" Mauricio -
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com <http://salaboy.wordpress.com>
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Strange error using Drools + Spring + DecisionTable

2013-04-17 Thread Mauricio Salatino
It could be related with the location of the file: classpath:data/
IntegrationExampleTest.xls

Are you sure that the file is being picked up?



On Wed, Apr 17, 2013 at 6:05 PM, Charles Moulliard  wrote:

> Hi,
>
> When I try to instantiate an Excel Decision Table using Drools + Spring
> (kresource), I get this error :
>
> REMARK: the file is the same as we have in Drools Unit Test
> (decision-table)
>
> Error :
>
> Caused by: java.lang.IllegalArgumentException: Your InputStream was
> neither an OLE2 stream, nor an OOXML stream
> at
> org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:75)
>  at
> org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:75)
> at
> org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:93)
>  at
> org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:72)
> at
> org.drools.decisiontable.DecisionTableProviderImpl.compileStream(DecisionTableProviderImpl.java:37)
>  at
> org.drools.decisiontable.DecisionTableProviderImpl.loadFromInputStream(DecisionTableProviderImpl.java:20)
> at
> org.drools.compiler.compiler.DecisionTableFactory.loadFromInputStream(DecisionTableFactory.java:15)
>  at
> org.drools.compiler.compiler.PackageBuilder.decisionTableToPackageDescr(PackageBuilder.java:460)
> at
> org.drools.compiler.compiler.PackageBuilder.addPackageFromDecisionTable(PackageBuilder.java:454)
>  at
> org.drools.compiler.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:684)
> at
> org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:51)
>  at
> org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:40)
> at
> org.drools.container.spring.beans.KnowledgeBaseBeanFactory.afterPropertiesSet(KnowledgeBaseBeanFactory.java:110)
>  at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
>
> Config :
>
> 
> http://www.springframework.org/schema/beans";
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>xmlns:drools="http://drools.org/schema/drools-spring";
>xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://drools.org/schema/drools-spring
> http://drools.org/schema/drools-spring.xsd";>
>
> 
>
> 
> 
> 
> 
> 
>  source="classpath:data/IntegrationExampleTest.xls"/>
> 
> 
>
>   type="stateless"
>  name="ksession1"
>  kbase="kbase1"
>  node="node1"/>
>
> 
>
> Regards,
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] How to count the number of events that happened in the last X minutes and fire if is greater than Y

2013-04-15 Thread Mauricio Salatino
Hi Adrian,

nice to see you here, you can do something like:

Number(intValue > Y ) from accumulate ( $e: MyEvent() over window:time(x
m), sum($e))




On Mon, Apr 15, 2013 at 1:26 PM, Adrián Paredes <
adri...@epidataconsulting.com> wrote:

> People,
>
> I'm new at Drools Fusion and I found a problem when I'm tryin to implement
> a Rule. I need to count the number of events that happened in the last X
> minutes, and fire the rule if the count is greater than Y.
>
> When I use window:time(Xm), each event slide the window, and does not
> help.
>
> ÂżWhat should I do to solve my problem?
>
> Thx in advance.
> Regards.
>
> --
> *Epidata Consulting | Deploying Ideas
> Ing. Adrián M. Paredes | Arquitecto Desarrollador
> adri...@epidataconsulting.com | Cel: (54911) 3297 1713
>
> 
> Argentina: MaipĂş 521 Piso 7 | Buenos Aires | Of: (5411) 5031 0060
> Chile: Apoquindo 3600 Piso 7 y 9 | Las Condes - Santiago | Of: (+56) 2
> 495 8450
>
> ---
>  www.epidataconsulting.com
>  Linkedin  | 
> Facebook
>  | Twitter 
> *
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Shared Facts across nodes

2013-04-04 Thread Mauricio Salatino
Hi Mauro,
At this moment you can't share the session state between multiple nodes.
You can replicate your sessions in different nodes. Which means that two or
more nodes will contain the same set of facts.

Drools Grid was an experiment, so I don't recommend you going on that
direction.




On Thu, Apr 4, 2013 at 5:02 PM, mauro  wrote:

> Hello all,
>
> After searching the web and Drools forums for a couple of days, I couldn't
> find a solution to the problem I've got to solve. Anyway, if there's a
> thread pointing at the same problem, I apologize and please, let me know
> where it is.
>
> My current scenario involves a Drools cluster and demands high availability
> and scalability of nodes.
> I have to provide a pool of rules (Guvnor should easily handle that) and a
> set of servers to process facts against those rules.
>
> This is where I'm stuck at.
> I need to make sure all generated facts are shared across drools servers at
> the time they get into the cluster.
>
> In other words, what I need is a kind of shared (and persistent) session,
> and this session should contain unique facts, so the nodes don't waste time
> processing what has already been processed by another node. Also, session
> response time is critical.
>
> Since I'm new to the Drools world, maybe I'm missing some important aspects
> here, however, as far as I understood, Drools should be able to supply my
> requirements.
>
> Already read about Drools-Grid (Is it still alive? Being developed?
> Reliable?) and JBoss Infinispan. Both seem to help on solving this
> requirement, but I'm not sure whether they're the correct tools to attach
> to
> the arch and get to the solution.
>
> Moreover, I have to make sure an instance of Guvnor can share rules with
> other instances being queried by the Drools servers.
>
> How can I solve the problems?
>
>
> Thank you in advance,
> Mauro
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Shared-Facts-across-nodes-tp4023210.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.com 
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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

Re: [rules-users] Expert Systems and Functional programming?

2013-03-15 Thread Mauricio Salatino
I usually try to attend RuleML meet ups and Intellifest (ex October Rules
Fest) there you meet all the Expert System community.
Cheers


On Fri, Mar 15, 2013 at 5:43 PM, Grant Rettke  wrote:

> Who are the primary researchers of expert-systems today?
>
> On Tue, Mar 12, 2013 at 8:21 PM, Mark Proctor 
> wrote:
> > Actually Pamela is one of the papers I've been trying to track down,
> can't get it on the internet any more. As I first saw it referenced in
> "Production matching for large learning systems".
> >
> > You don't by chance have the paper still?
> > Barachini, F. (1991) The evolution of PAMELA. Expert Systems, 8(2):87-98
> >
> > I'm building up a collection of relevant research papers, over at
> mendelay. That is one of my missing papers, that I've been unable to track:
> > http://www.mendeley.com/groups/2918061/rule-systems/papers/
> >
> > Mark
> > On 12 Mar 2013, at 18:28, Wolfgang Laun  wrote:
> >
> >> Mark,
> >>
> >> no, the system I'm talking about is PAMELA, developed here in Vienna.
> >> You may find references to papers citing PAMELA, authored by
> >> F.Barachini and N.Theuretzbacher (one is referenced in the thesis you
> >> quoted, see [13]), but I doubt that you'l find one of the papers on
> >> the web. It was pre-internet days way back then :-)
> >>
> >> If you could produce an RBS ranking based on rules fired in
> >> production, I think that PAMELA would be in an excellent position.
> >> There's a three-digit number of installations by now, but they're
> >> running 24/7.
> >>
> >> -W
> >>
> >>
> >> On 12/03/2013, Mark Proctor  wrote:
> >>> OPS83?
> >>>
> http://repository.cmu.edu/cgi/viewcontent.cgi?article=2478&context=compsci
> >>>
> >>>
> >>> or YES/L1? (seems information on this is out of print and not online
> >>> either)
> >>> http://www.amazon.com/dp/B00070YQSU/ref=r_soa_w_d
> >>> "YES/L1: Integrating expert systems technology with traditional
> programming
> >>> languages (Research Report RC. International Business Machines Inc.
> Research
> >>> Division)"
> >>>
> >>>
> >>> I definitely find linq interesting, as it's straight out of the
> research
> >>> pages from these projects - I wonder if the linq/database propel know
> about
> >>> these... The first time I saw it was in this paper "procedural match
> augments
> >>> data-driven match"
> >>> http://www.aaai.org/Papers/AAAI/1986/AAAI86-037.pdf
> >>>
> >>> They move the "lhs" logic into the consequence block, using the actual
> >>> "when" part as a simple goal trigger - allowing the 'lhs' to be used
> >>> procedurally, like linq. This allows them to control when a rule is
> >>> evaluated and that it's evaluation is atomic, and can have cleanup work
> >>> done.
> >>>
> >>> Mark
> >>>
> >>> On 12 Mar 2013, at 06:04, Wolfgang Laun 
> wrote:
> >>>
>  Indeed, this thesis mentions a few features of the system I was
>  talking about :-)
>  ([13])
>  -W
> 
>  On 11/03/2013, Mark Proctor  wrote:
> > There were a number of research efforts that looked at combining
> > procedural
> > and rule base programming.
> > This one is quite interesting:
> > Combining Rule-Based and Procedural Programming in the XC and XE
> > Programming
> > Lanaugages
> >
> http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.9.1106&rep=rep1&type=pdf
> >
> > Mark
> >
> >
> > On 11 Mar 2013, at 18:03, Wolfgang Laun 
> wrote:
> >
> >> On 11 March 2013 16:19, Mark Proctor  wrote:
> >> So thinking really long term here. Can we build a "java layer" that
> >> provide all the rule functionality we need - but fit ontop of the
> java
> >> language neatly. We'd probably need to allow "rule" keyword and
> have it
> >> in
> >> Classes, at the method level. All class members and methods would be
> >> available to the rules in that class.
> >>
> >> There is this production rule system where you can write your rules
> >> embedded in compiling units, and alongside the legacy program
> units, of
> >> a
> >> procedural, modular, strongly type HLL, and where you use
> expressions
> >> in
> >> the language's own syntax in constraints...
> >>
> >> We've been using it ever since 1986. Rabbi Akiva was right, wasn't
> he
> >> ;-)
> >>
> >> -W
> >>
> >> ___
> >> 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@list

Re: [rules-users] Web services and Drools

2013-01-14 Thread Mauricio Salatino
You can also take advantage of the Drools and Camel integration. Apache
Camel is an integration framework that does exactly that, expose the
services via different transports.

Cheers


On Mon, Jan 14, 2013 at 3:00 PM, Stephen Masters wrote:

> Personally, I use the Spring framework to provide SOAP (and REST) web
> services to other applications. It's relatively simple to set it up and I'm
> fond of the contract-first approach which it encourages.
>
> With regards integration with Drools, it's easy enough in Spring. You just
> need to create a Spring bean to act as the interface to your knowledge
> base. That way, Spring ensures that you have only one knowledge base
> instance in play, so it is configured and compiled when the application
> starts.
>
> I'd be happy to answer any Spring/Drools integration questions (I don;t
> tend to use other web frameworks), and I can provide some code examples if
> Spring is the way you wish to go.
>
> Steve
>
>
> On 14 Jan 2013, at 13:50, riri  wrote:
>
> > Hello everyone,
> >
> > I need to develop a web application that includes Drools as its rule
> engine
> > and would like to expose its functionality as web services. I would
> > appreciate some expert opinion on which framework would be easiest to
> learn
> > and to work with. Some of the posts I have seen regarding Drools and OSGi
> > refer to it as a "nightmare". Is that still true with the current
> version?
> > If anyone has had any experience with Spring, EJB or other and would
> like to
> > share I would be very interested since I am new to this domain. If there
> is
> > a case to be made about not using a framework at all then I would also
> like
> > to hear you out.
> >
> > Best regards,
> >
> >
> >
> > --
> > View this message in context:
> http://drools.46999.n3.nabble.com/Web-services-and-Drools-tp4021509.html
> > Sent from the Drools: User forum 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
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] A basic doubt about Drools Fusion

2012-12-07 Thread Mauricio Salatino
There should be a listener for afterActivationCreated, right?


On Fri, Dec 7, 2012 at 3:16 PM, Esteban Aliverti  wrote:

> I think you have 2 main options here:
>
>- Invoke fireUnitlHalt() in an independent thread.
>- Invoke fireAllRules() after each insert() you have.
>
> Best Regards,
>
>
>
> 
>
> Esteban Aliverti
> - Blog @ http://ilesteban.wordpress.com
>
>
>
> On Fri, Dec 7, 2012 at 3:57 PM, Adrián Paredes <
> adri...@epidataconsulting.com> wrote:
>
>> Thank you, Esteban.
>>
>> You are right! If I insert two events A:
>>
>> rulesTest.addEventA("123");
>> rulesTest.addEventA("456");
>>
>> The second call of fireAllRules() activates the rule for the first object:
>>
>> Event inserted com.epidataconsulting.drools.model.EventA
>> Event A 123 at Fri Dec 07 11:54:21 ART 2012
>> Event inserted com.epidataconsulting.drools.model.EventA
>>
>> But not for the second.
>>
>> How I can do to correct this behavior?
>>
>> Thanks!
>>
>> Adrian
>>
>>
>> 2012/12/7 Esteban Aliverti 
>>
>>> It could be the case, and I'm guessing here, that the
>>> AgendaEventListener is called just before the activation is placed into the
>>> agenda. So, the call to fireAllRules() finds an empty agenda. What you
>>> could do to check if this is what is happening, is to insert 2 EvenA
>>> objects. The second call of fireAllRules() should fire the activation of
>>> the first object (and you will miss the activation of the second).
>>>
>>> Best Regards,
>>>
>>>
>>>
>>>
>>> 
>>>
>>> Esteban Aliverti
>>> - Blog @ http://ilesteban.wordpress.com
>>>
>>>
>>>
>>> On Fri, Dec 7, 2012 at 1:55 PM, Adrián Paredes <
>>> adri...@epidataconsulting.com> wrote:
>>>
 Hi all:

 I have a very basic doubt about Drools Fusion.

 I have two simple Java classes:

 EventA  {
 String id;
 Date timestamp;
 Long duration;
 }

 EventB {
 String id;
 Date timestamp;
 Long duration;
 }

 I have a DRL file, where I declare this two classes as Events:

 declare EventA
 @role(event)
 @timestamp(timestamp)
 @duration(duration)
 end

 declare EventB
 @role(event)
 @timestamp(timestamp)
 @duration(duration)
 end

 I have a simple rule:

 rule "Basic Rule"
 dialect 'mvel'
 when
 $eventA: EventA($aId: id) from entry-point "time stream"
 then
 System.out.println("Event A " + $aId + " at " + $eventA.timestamp);
 end

 Finally, I have a test that starts a StatefulKnowledgeSession in STREAM
 mode, register an eventLister in the session in order to fire the rules
 when an event arrives:

 ksession.addEventListener(new DefaultAgendaEventListener() {
 @Override
 public void activationCreated(ActivationCreatedEvent event) {
 ((StatefulKnowledgeSession)
 event.getKnowledgeRuntime()).fireAllRules();
 }
 });

 And then the test insert in the "time stream" entry-point an instance
 of EventA with duration of 10 miliseconds, as follows:

 EventA eventA = new EventA();
 eventA.setId("123");
 eventA.setTimestamp(new Date());
 eventA.setDuration(10L);
 ksession.getWorkingMemoryEntryPoint("time stream").insert(event);

 At the end of the test, I have an sleep of 2 seconds just in case.

 I don't understand why the "Basic Rule" never fires.

 But if I add another condition to the same rule, something like this:

 rule "Basic Rule"
 dialect 'mvel'
 when
 $eventA: EventA($aId: id) from entry-point "time stream"
 not EventB($aId == id, this after [0s,5s] $eventA) from entry-point
 "time stream"
 then
 System.out.println("Event A " + $aId + " at " + $eventA.timestamp);
 end

 The rules fires and I see this message in console:

 Event A 123 at Fri Dec 07 09:48:59 ART 2012

 I don't understand why the first rule, that is more open, don't fire,
 and the second rule, that is more restrictive, fires without problems.

 Thank you very much!

 Greetings,
 Adrian.

 --
 *Epidata Consulting | Deploying Ideas
 Ing. Adrián M. Paredes | Arquitecto Desarrollador
 adri...@epidataconsulting.com | Cel: (54911) 3297 1713

 
 Argentina: MaipĂş 521 Piso 1 Of. A | Buenos Aires | Of: (5411) 5031 0060
 Chile: Apoquindo 3600 Piso 7 y 9 | Las Condes - Santiago | Of: (+56) 2
 495 8450

 ---
  www.epidataconsulting.com
  Linkedin  | 
 Facebook

Re: [rules-users] Drools + Semantic Web : EulerGUI

2012-12-07 Thread Mauricio Salatino
If you do that it will be great.. so we can both attend to each others
meetup.
I'm really interested in the EulerGUI tool, I've being looking at it since
it started
Cheers


On Fri, Dec 7, 2012 at 1:40 PM, Jean-Marc Vanel wrote:

> It's too bad indeed !
> I've looked for a rules, BPMS, inference, IA, Meetup in London, but found
> none .
> I can be here longer.
> I may move my meeup to attend yours.
>
> JMV
>
> 2012/12/7 Mauricio Salatino 
>
>> Hi Jean-Marc,
>> Ouch! I will be doing a jBPM5 and Drools talk at the same time the same
>> day in the same city! I would love to go and see your talk, I guess that I
>> will miss that this time. Are you going to be around later this week? we
>> can probably arrange to meet. Is the content of the talk gonna be published
>> online somewhere?
>>
>>
>> On Fri, Dec 7, 2012 at 12:53 PM, Jean-Marc Vanel <
>> jeanmarc.va...@gmail.com> wrote:
>>
>>> Hi London Drools users !
>>>
>>> I come to London.
>>> I'm available for a talk about what I do with Drools + Semantic Web +
>>> Controlled English with EulerGUI [1].
>>> I've set a Meetup in London on dec. 12, in need of a location :
>>> http://www.meetup.com/LondonSWGroup/events/94447932/
>>>
>>> First I'll be in Oxford from today to tuesday at AGI (Artificial General
>>> Intelligence) conference [2] . The thread for me there will be "how can an
>>> agent learn from its experience?" .
>>>
>>> [1]
>>> http://eulergui.svn.sourceforge.net/viewvc/eulergui/trunk/eulergui/html/documentation.html#L5890
>>> [2] http://agi-conference.org/2012/
>>> [3] http://www.meetup.com/LondonSWGroup/events/94447932/
>>>
>>> --
>>> Jean-Marc Vanel
>>> DĂ©ductions SARL - Consulting, services, training,
>>> Rule-based programming, Semantic Web
>>> http://deductions-software.com/
>>> +33 (0)6 89 16 29 52
>>> chat :  irc://irc.freenode.net#eulergui
>>>
>>> ___
>>> rules-users mailing list
>>> rules-users@lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>
>>>
>>
>>
>> --
>>  - MyJourney @ http://salaboy.wordpress.com
>>  - Co-Founder @ http://www.jugargentina.org
>>  - Co-Founder @ http://www.jbug.com.ar
>>
>>  - Salatino "Salaboy" Mauricio -
>>
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
>
> --
> Jean-Marc Vanel
> DĂ©ductions SARL - Consulting, services, training,
> Rule-based programming, Semantic Web
> http://deductions-software.com/
> +33 (0)6 89 16 29 52
> chat :  irc://irc.freenode.net#eulergui
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Drools + Semantic Web : EulerGUI

2012-12-07 Thread Mauricio Salatino
Hi Jean-Marc,
Ouch! I will be doing a jBPM5 and Drools talk at the same time the same day
in the same city! I would love to go and see your talk, I guess that I will
miss that this time. Are you going to be around later this week? we can
probably arrange to meet. Is the content of the talk gonna be published
online somewhere?


On Fri, Dec 7, 2012 at 12:53 PM, Jean-Marc Vanel
wrote:

> Hi London Drools users !
>
> I come to London.
> I'm available for a talk about what I do with Drools + Semantic Web +
> Controlled English with EulerGUI [1].
> I've set a Meetup in London on dec. 12, in need of a location :
> http://www.meetup.com/LondonSWGroup/events/94447932/
>
> First I'll be in Oxford from today to tuesday at AGI (Artificial General
> Intelligence) conference [2] . The thread for me there will be "how can an
> agent learn from its experience?" .
>
> [1]
> http://eulergui.svn.sourceforge.net/viewvc/eulergui/trunk/eulergui/html/documentation.html#L5890
> [2] http://agi-conference.org/2012/
> [3] http://www.meetup.com/LondonSWGroup/events/94447932/
>
> --
> Jean-Marc Vanel
> DĂ©ductions SARL - Consulting, services, training,
> Rule-based programming, Semantic Web
> http://deductions-software.com/
> +33 (0)6 89 16 29 52
> chat :  irc://irc.freenode.net#eulergui
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Setting value in LHS for access in RHS

2012-11-30 Thread Mauricio Salatino
So, what's the problem with that approach? You are binding a variable in
the LHS and using it in the RHS, that should work as expected. If you make
that variable change, let's say use different strings or enums for the
"exposure
type" you should be fine.

Cheers


On Fri, Nov 30, 2012 at 3:08 PM, Stephen Masters wrote:

> Apologies for the overly brief explanation ... am at a bank where only
> internet access is on my phone. Additional apologies if I suffer from
> auto-correct errors. :)
>
> [condition][] validate "{exposureType:ENUM:exposure types}" =
> AccountExposure($exp : {exposure type});
>
> [consequence][] Create limit check = insert(new LimitCheck($exp);
>
> Now, dependent on what exposure type I select, I need to use a different
> value to perform conversions between amounts and percentages. So it would
> keep things clean if I could pass the property name selected in the LHS to
> the object inserted on the RHS.
>
> I could do it by having different DSL phrases for consequences, but my
> audience is very non technical so I'm trying to keep the language as
> minimal as possible.
>
> Hope that explains it!
>
> Steve
>
>
>
> Mauricio Salatino  wrote:
>
> Hi Steve,
> Can you please gives us an example about what are you trying to achieve?
> Setting a variable in the LHS doesn't make sense for the common use cases.
> What we usually do is to bind a variable to a field from our facts, but
> that's it.
>
> Cheers
>
>
> On Fri, Nov 30, 2012 at 2:10 PM, Stephen Masters 
> wrote:
>
>>
>>
>> Stephen Masters  wrote:
>>
>> >Hi folks,
>> >
>> >I'm trying to set up rules where the RHS is able to refer to a value set
>> in the LHS so that it can perform its logics slightly differently.
>> >
>> >I'm able to use $var to pick out fields from facts in working memory.
>> However as far as I can tell I'm not able to set a new value.
>> >
>> >I'm setting up a DSL to drive guided rules in guvnor and in the RHS I
>> need to know which value was picked from a drop down list in the LHS.
>> >
>> >Cheers
>> >
>> >Steve
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
> --
>  - MyJourney @ http://salaboy.wordpress.com
>  - Co-Founder @ http://www.jugargentina.org
>  - Co-Founder @ http://www.jbug.com.ar
>
>  - Salatino "Salaboy" Mauricio -
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Setting value in LHS for access in RHS

2012-11-30 Thread Mauricio Salatino
Hi Steve,
Can you please gives us an example about what are you trying to achieve?
Setting a variable in the LHS doesn't make sense for the common use cases.
What we usually do is to bind a variable to a field from our facts, but
that's it.

Cheers


On Fri, Nov 30, 2012 at 2:10 PM, Stephen Masters wrote:

>
>
> Stephen Masters  wrote:
>
> >Hi folks,
> >
> >I'm trying to set up rules where the RHS is able to refer to a value set
> in the LHS so that it can perform its logics slightly differently.
> >
> >I'm able to use $var to pick out fields from facts in working memory.
> However as far as I can tell I'm not able to set a new value.
> >
> >I'm setting up a DSL to drive guided rules in guvnor and in the RHS I
> need to know which value was picked from a drop down list in the LHS.
> >
> >Cheers
> >
> >Steve
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] jBPM5 Developer Guide Official Presentation in London

2012-11-29 Thread Mauricio Salatino
Hi Cedric, you were always a good community supporter. I appreciate the
support, thank you for that! Are you around London during December? that
will be a good opportunity to meet.

Cheers


On Thu, Nov 29, 2012 at 10:43 PM, Cedric Hurst  wrote:

> Spectacular! this book has been very highly anticipated by my team,
> clients and myself for a bit now and on behalf of all of us we appreciate
> all of your hard work (and that of packt and editors) in putting this out
> in the world.  It's moved straight to the top of my weekend reading list.
>
> Sent from my iPhone
>
> On Nov 29, 2012, at 3:33 PM, Mauricio Salatino  wrote:
>
> Hi everyone,
> First of all sorry for cross posting, but as you may know jBPM5 and Drools
> are two very related projects. I just want to invite you all to a talk that
> Esteban Aliverti and myself will be giving about the jBPM5 Developer Guide (
> http://www.amazon.co.uk/jBPM-Developer-Guide-Salatino-Mauricio/dp/1849516448/ref=sr_1_1?ie=UTF8&qid=1354224720&sr=8-1),
> a book about jBPM and it's relationship with Drools. The presentation will
> take place in London, so if you are around make sure to register in the
> meetup page:
>
> http://www.meetup.com/JBoss-User-Group/events/85267232/
>
> Feel free to invite your friends and drop us a line to hang around before
> or after the presentation.
>
> Cheers
>
> --
>  - MyJourney @ http://salaboy.wordpress.com
>  - Co-Founder @ http://www.jugargentina.org
>  - Co-Founder @ http://www.jbug.com.ar
>
>  - Salatino "Salaboy" Mauricio -
>
>  ___
> 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
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] persistence packages in jbpm and drools

2012-11-29 Thread Mauricio Salatino
Hi Ricardo,
Yes you can store the Drools working memory / knowledge session into a
persistence storage to restore the previous state later.
The same mechanisms are used for Processes. You will see that
jbpm-persistence-jpa contains a dependency to the drools-persistence-jpa
which contains the generic mechanisms. Inside jbpm-persistnece-jpa you will
find the entities related with the processes that will be persisted inside
the persistence storage.

Cheers


On Thu, Nov 29, 2012 at 2:19 AM, Ricardo  wrote:

> is any one interested to explain the jbpm-persistence Vs drools
> persistence?
> are we persist any thing in drools if so why?please let me knowthanks
> lot
>
> I am just started to browse those package source code:)...If I find the
> right answer I will post it...
>
>
>
>
> -
> with kind regards,
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/persistence-packages-in-jbpm-and-drools-tp4020999.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Drools response time

2012-11-27 Thread Mauricio Salatino
Hi Jesus,
Well do you want us to include the response time for your Database?
The Drools Rule engine will keep all your facts inside the main memory
(RAM) so it will be fast, but if you need to retrieve data from your
database, you will need to take that into account. Depending on how you are
doing that and how much data do you want to bring will be the response
times.

Cheers


On Tue, Nov 27, 2012 at 3:06 PM, elMateo  wrote:

> Dear all,
>
> I need to develop an Expert System for a new project and I want to use
> Drools, butI have some restrictions.
>
> The most important restriction: response time of the application must be
> less than one second. Also, the application access to one data base to
> retrieve some information and send it to the expert systetm.
>
> With this information, can anyone tell me, approximately, the response
> time of  Drools? It is very important to can use Drools in this project.
> And we like very much to use it. (We use in other projects without these
> restrictions).
>
> Thank in advance.
>
> Best regards, JesĂşs.
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] drools grid or other high availability solution?

2012-11-09 Thread Mauricio Salatino
No Problem Justin,
Let us know if you have any trouble!


On Fri, Nov 9, 2012 at 10:54 PM, Justin Case  wrote:

> D'uh how could I have missed that. You're so right, I will check with
> Camel.
> Thank you Mauricio!
> JC
>
>   --
> *From:* Mauricio Salatino 
> *To:* Justin Case ; Rules Users List <
> rules-users@lists.jboss.org>
> *Sent:* Friday, November 9, 2012 6:35 PM
> *Subject:* Re: [rules-users] drools grid or other high availability
> solution?
>
> Hi Justin,
> We are working on it, drools-grid was an experimental project to start the
> design.
> We also have the Drools Server using camel, and we will continue the
> development of the remoting APIs, probably after the next release.
> Cheers
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] drools grid or other high availability solution?

2012-11-09 Thread Mauricio Salatino
Hi Justin,
We are working on it, drools-grid was an experimental project to start the
design.
We also have the Drools Server using camel, and we will continue the
development of the remoting APIs, probably after the next release.
Cheers


On Fri, Nov 9, 2012 at 5:21 PM, Justin Case
wrote:

> Not even a single idea? :(
>
> JC
>
>
>
> - Original Message -
> > From: Justin Case 
> > To: "rules-users@lists.jboss.org" 
> > Cc:
> > Sent: Wednesday, November 7, 2012 3:33 PM
> > Subject: [rules-users] drools grid or other high availability solution?
> >
> > Hello all,
> > I noticed there's not much fuss about drools-grid (anymore?). Is there
> > something still going on there? Is it recommendable for something
> reliable?
> > Or if not, do you have any hints/links/experience on how to achieve a
> certain
> > high availability level with DRools servers?
> > Many thanks,
> > JC
> > ___
> > 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
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Is Flow / jBPM dying on the vine?

2012-11-08 Thread Mauricio Salatino
Yes, your scenario is a good scenario for Drools and JBPM.
What you can do is to describe a set of rules to handle the events and
those rules can trigger processes.
In that way your process definitions will be smaller and you will be able
to handle with rules the correlation of the events.

Cheers


On Thu, Nov 8, 2012 at 7:19 PM, dunnlow  wrote:

> Thank you for the information / update.
>
> I notice that almost all of the examples that I find are user task based
> (or
> more specifically, NOT event-based, which is my use case).  I am planning
> to
> inform a process largely (but not entirely) with events.  Short of having a
> signal and gateway for every node, I don't see a way of make a jBPM process
> event based (ie pausing at nodes until certain events/rules are satisfied).
> Is this not a good use case for jBPM?
>
>  -- salaboy, I'll be waiting anxiously for that book ;-)
>
> Thanks again.  -J
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Is-Flow-jBPM-dying-on-the-vine-tp4020738p4020764.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Is Flow / jBPM dying on the vine?

2012-11-07 Thread Mauricio Salatino
Hi J,
Yes kind the opposite, we are full speed working and the team is getting
bigger and bigger.
My book is going out in one month and as you can imagine it takes time to
write and a lot of effort. Write now it's getting reviewed by the editorial
and it will be released early December.
Feel free to ask more specific questions, but you will definitely see a
release in the next following days.

Cheers


On Wed, Nov 7, 2012 at 7:33 PM, dunnlow  wrote:

> Hi,
>
> I am considering using drools with Flow/jBPM as an integral part of a
> corporate solution.  However, it seems to me like the project is dying on
> the vine.  I understand the code is still being worked but overall interest
> seems to be waning; evidenced by things like, a (...the) jBPM 5 book due
> two
> months ago is still MIA.  No blog posts on the project for six weeks.
>
> I don't mean to bash jBPM, but am just worried about it's future.  I
> suppose
> the Flow/jBPM merge is irreversible?  Any thoughts?
>
> Is anyone using another BPM system with drools?
>
> Thanks,
> -J
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Is-Flow-jBPM-dying-on-the-vine-tp4020738.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Leveraging Drools project in JBPM workflow

2012-11-05 Thread Mauricio Salatino
I've wrote a set of articles about the subject:

http://salaboy.com/2012/07/29/processes-rules-or-rules-processes-3x/

Follow the links to the previous ones. I suggest you to read them in order.

The README file inside this repository:
https://github.com/Salaboy/jBPM5-Developer-Guide/tree/master/chapter_09
Explains the test provided.

Cheers


On Mon, Nov 5, 2012 at 10:38 AM, amit  wrote:

> Hi,
>
> Can you please provide some high level guidelines how I can use a Drools
> Rules Project created in Eclipse in jbpm workflow.
>
> Any pointers or high level guideline will be useful.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Leveraging-Drools-project-in-JBPM-workflow-tp4020691.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Task Handler blocking

2012-10-17 Thread Mauricio Salatino
Hi Alberto,
yes you can, the only thing that you need to do is deal with those I/O
blocking operations as external and Async Tasks. Instead of making your
Task sync (which will block by definition until your operations are done)
just make them async by removing the completeWorkItem() method call from
inside the workItemHandler. Then when you I/O's are done, you will need to
call the completeWorkItem using
ksession.getWorkItemManager().completeWorkItem() method.

Cheers

On Wed, Oct 17, 2012 at 1:35 PM, Alberto R. Galdo  wrote:

> Hi All,
>
>We have an application where we are using JBPM for our processes. In
> our application there's a strong requirement to maintain the same
> KnowledgeSession between restarts even though that we are not using rules
> at all, just BPMN 2.0 processes ( we are aware that JBPM needs it to
> maintain process state, workitem state and so on ...  but don't need
> neither rules nor ReteOO loops in our app ).
>
>Now we got to the tricky task handling part, were we have several
> handlers that depend on I/O which blocks the entire execution of the
> processes. And just because all our application depends on the *same*
> shared stored knowledge session, all our other parallel processes that need
> to execute processes are waiting ( like in a queue ) for the I/O to finish
> and execute themselves whenever the execution of JBPM gets blocked by I/O.
>
>We've tried to execute our handlers in different threads, but as we are
> running inside a persisted environment JBPM looses the JTA transaction as
> it is not bound to the current thread. Seems not a solution. We tried then
> to implement thread communication mechanisms, yield() and notify() and just
> made the problem worse.
>
>Any insights on the subject? How can we execute parallel non-blocking
> processes inside a shared and persisted KnowlegdeSession with JBPM?
>
> Greets,
>
> Alberto R. Galdo
> arga...@gmail.com
>
>
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] UderFire

2012-09-24 Thread Mauricio Salatino
I don't know right now the exact date, but I'm expecting to be any time
soon.
Cheers

On Mon, Sep 24, 2012 at 7:27 PM, Anton Nikulin  wrote:

> Thanks, Mauricio
>
> Can you tell me when UbetFire will be officially announced?
>
> Regards, Anton.
>
> 2012/9/25 Mauricio Salatino :
> > Hi Anton,
> > As soon as the framework gets officially announced I will publish a
> couple
> > tutorials about how to make simple hello worlds applications.
> >
> > In the mean time you can take a look at the uberfire-showcase project,
> which
> > is a sample application demonstrating how to create an application that
> uses
> > the framework.
> >
> > Cheers
> >
> >
> > On Mon, Sep 24, 2012 at 7:10 PM, Anton Nikulin 
> wrote:
> >>
> >> Hello
> >>
> >> I'm interested in your new UderFire project. Please, could you give me
> >> a brief description of its features, opportunities. I've downloaded
> >> sources from https://github.com/droolsjbpm/uberfire, could you help me
> >> how can i test it and make something like a simple example using it?
> >>
> >> Thanks, Anton.
> >> ___
> >> rules-users mailing list
> >> rules-users@lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
> >
> >
> > --
> >  - MyJourney @ http://salaboy.wordpress.com
> >  - Co-Founder @ http://www.jugargentina.org
> >  - Co-Founder @ http://www.jbug.com.ar
> >
> >  - Salatino "Salaboy" Mauricio -
> >
> >
> > ___
> > 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
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] UderFire

2012-09-24 Thread Mauricio Salatino
Hi Anton,
As soon as the framework gets officially announced I will publish a couple
tutorials about how to make simple hello worlds applications.

In the mean time you can take a look at the uberfire-showcase project,
which is a sample application demonstrating how to create an application
that uses the framework.

Cheers


On Mon, Sep 24, 2012 at 7:10 PM, Anton Nikulin  wrote:

> Hello
>
> I'm interested in your new UderFire project. Please, could you give me
> a brief description of its features, opportunities. I've downloaded
> sources from https://github.com/droolsjbpm/uberfire, could you help me
> how can i test it and make something like a simple example using it?
>
> Thanks, Anton.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Call a Process from a Rule

2012-09-03 Thread Mauricio Salatino
Hi there,
thanks for the interest in the book, it is now in technical revision phase,
there is nothing more that I can do to speed it up.

Cheers

On Mon, Sep 3, 2012 at 5:09 PM, Sadiroveski  wrote:

> Thanks Salaboy,
> You are right, but the problem is that Still Have Thousands of Questions
> and I am trying to prevent asking before reading & reading & reading.
>
> BTW, where is your book. It was supposed to be in August and now PacketHub
> mentioned that will be published in December.
>
> Anyway, good luck for that and thanks for your answers.
> More questions will be asked from now till December
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Call-a-Process-from-a-Rule-tp4019556p4019560.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Call a Process from a Rule

2012-09-03 Thread Mauricio Salatino
Hi,
A lot of questions in the same email about different subjects! :)

Yes you can start a process inside the Right Hand Side of a Rule using:

kcontext.getKnowledgeRuntime().startProcess(,
)

For running a rule every two days you will need to use timers, please refer
to the official documentation.
Cheers

On Mon, Sep 3, 2012 at 4:48 PM, Sadiroveski  wrote:

> Hello,
>
> Is there a way to initiate a process based on a rule? So if the rule is
> fired, a process will be initiated.
> If this could be happened, how about pass arguments/variables to the
> process
> from this rule? is it possible too?
>
> Also, how can we set a rule to run every 2 days?
>
> thanks in advance,
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Call-a-Process-from-a-Rule-tp4019556.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] fireUntilHalt() is halt forever

2012-08-15 Thread Mauricio Salatino
Hi,
yes if you use : drools.halt();
that will stop the session.
What exactly do you want to achieve with that?
Cheers

On Wed, Aug 15, 2012 at 5:49 PM, Rana  wrote:

> Hi my rule file is halt for ever. Can anybody tell me why. I debugged and
> saw
> that it is going into this method in DefaultAgenda.class
>
> public void fireUntilHalt(final AgendaFilter agendaFilter) {
>
> synchronized ( this.halt ) {
> if( !this.halt.get() ) this.halt.wait();   //it is
> halt here  and waiting.
> }
>
>
> this is my rule file.
>
> http://drools.46999.n3.nabble.com/file/n4019146/rule_file.txtrule_file.txt
>
>
> Please help me out.
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/fireUntilHalt-is-halt-forever-tp4019146.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Workitems doesn't get persisted when completing a task after rehydrating a knowledge session is some circumstances.

2012-06-26 Thread Mauricio Salatino
Hi Alberto,
I'm not upset, kind the opposite. I'm sorry if my comments sounds harsh. I
was making some assumptions based on my previous experience.
My main point was, let's try to be concrete and let's work on code and
failing tests. I know that is not trivial, but if we want to make the
project better for everyone I think that's the only way to go. I'm keeping
my mind open and I think that we all here are open to discussions, but lets
discuss based on concrete proposals. If we don't go that way, this
conversation will become cyclic and we will all loose time instead of being
fixing bugs and adding new features :)


On Tue, Jun 26, 2012 at 5:43 AM, Alberto R. Galdo  wrote:

> Mauricio, seems to me that you're upset. I'm really sorry, I didn't mean
> it. I didn't mean this thread to become a fud or some kind of rant.
>
> Comments inline:
>
> On Mon, Jun 25, 2012 at 1:36 PM, Mauricio Salatino wrote:
>
>> What I've noticed in the past, doing consulting is that people wants to
>> migrate from jBPM3 that is almost stateless to jBPM5 and have everything
>> inside a Stateful session with a richer context and expect that everything
>> will work in the same way.
>> If you run each of your process instances in different stateful sessions
>> (with local ht) you will have something similar to what jBPM3 does,
>> extremely reduced and isolated context. Now if you want to add Rules and
>> Events into the mix you will need to learn how Rules and Events works and
>> how they are mixed with processes inside the stateful session. You cannot
>> expect that all those features and the mix works in the same way as jBPM3
>> (just a stateless process engine) works, right?
>>
>
> That's offensive :(. You're making uninformed assumptions about our
> experiences with JBPM & Drools, both isolated and mixed, and our
> expectatives for the migration of our system from JBPM v3 to v5.
>
> We obviously were expecting some changes and some bugs. We were definetly
> not expecting such, IMHO, hard issues with the execution of long-running
> processes when persistence configured just because how the approach for
> mixing Drools & JBPM solution for persistence was done. This makes the
> system not fault tolerant, at least not without some pain and I agree in
> certain ( but not rare  ) configurations.
>
>
>>
>> I've also notice that this is a step-by-step learning process, once you
>> master BPMN2 and how process works inside the process engine you can move
>> to Rules and then to Events, learning in the middle the technical and
>> logical requirements of each of them.
>>
>>
>
>> Most of the time the "solution" is understanding how the components
>> interact and can be mixed. I know that this is difficult sometime, because
>> of the diversity of the technologies that are being mixed here.
>>
>> If you can create a test that shows the problems that you are mentioning
>> here, we can discuss why or why not this is a good or a wrong approach and
>> find bugs in case that you find one. If you are in a hurry and you think
>> that what you are trying to solve are problems, good luck with finding the
>> tricks.
>>
>>
>
> OK, let's call this a bug.
>
> We believe in open source, that's why we chose Drools & JBPM in favor of
> other privative solutions. Hey!, At least here we have the chance to hack
> the code for dirty tricks! ;-).  We also believe in an open and honest
> discussion of issues like this in this kind of projects.
>
> As you may know making a test case that reflects the situation mentioned
> in this thread takes time, is far from trivial, we really are in a hurry
> and deadlines are aproaching.
>
> I personally assigned resources in my team for making such tests and will
> create issues in Jira when available.
>
>
>
>>
>> Cheers
>>
>
> Let me finish quoting with one of your previous messages: "Keep your mind
> open, because there is no single solution for all the problems", which I
> agree.
>
>
>
>
>
>
>
>
>>
>>
>> On Mon, Jun 25, 2012 at 4:42 AM, Alberto R. Galdo wrote:
>>
>>>   We're in a hurry now to make our system work, unfortunately seems that
>>> we will be doing dirty tricks as this one for some time ... we'll open an
>>> issue whenever a test can be produced ...
>>>
>>>   We were running our system using JBPM 3 and both the integration and
>>> the persistence there were seamsly done. Our system has high availability
>>> constraints that forces us to be fault tolerant ( that i

Re: [rules-users] Workitems doesn't get persisted when completing a task after rehydrating a knowledge session is some circumstances.

2012-06-25 Thread Mauricio Salatino
What I've noticed in the past, doing consulting is that people wants to
migrate from jBPM3 that is almost stateless to jBPM5 and have everything
inside a Stateful session with a richer context and expect that everything
will work in the same way.
If you run each of your process instances in different stateful sessions
(with local ht) you will have something similar to what jBPM3 does,
extremely reduced and isolated context. Now if you want to add Rules and
Events into the mix you will need to learn how Rules and Events works and
how they are mixed with processes inside the stateful session. You cannot
expect that all those features and the mix works in the same way as jBPM3
(just a stateless process engine) works, right?

I've also notice that this is a step-by-step learning process, once you
master BPMN2 and how process works inside the process engine you can move
to Rules and then to Events, learning in the middle the technical and
logical requirements of each of them.

Most of the time the "solution" is understanding how the components
interact and can be mixed. I know that this is difficult sometime, because
of the diversity of the technologies that are being mixed here.

If you can create a test that shows the problems that you are mentioning
here, we can discuss why or why not this is a good or a wrong approach and
find bugs in case that you find one. If you are in a hurry and you think
that what you are trying to solve are problems, good luck with finding the
tricks.


Cheers

On Mon, Jun 25, 2012 at 4:42 AM, Alberto R. Galdo  wrote:

>   We're in a hurry now to make our system work, unfortunately seems that
> we will be doing dirty tricks as this one for some time ... we'll open an
> issue whenever a test can be produced ...
>
>   We were running our system using JBPM 3 and both the integration and the
> persistence there were seamsly done. Our system has high availability
> constraints that forces us to be fault tolerant ( that includes running the
> human task server and process manager in different machines ) and when
> migrating to JBPM 5 we began to face ugly race conditions and rare
> transactional problems ... we honestly thought that must be our fault,
> that's why we opened this thread, just to check if someone had this
> problems and make ourselves wrong or found another "solution".
>
>
>
> On Fri, Jun 22, 2012 at 3:03 PM, Mauricio Salatino wrote:
>
>> So, can you create an isolated test where you reproduce:
>>
>> "We are unable to complete a human task after rehydrating a Drools
>> knowledge session because in some circunstances the generated Drools'
>> workitems don't get persisted in the database after the completion of a
>> previous task"
>>
>> And I can take a look on that.. Please create Jira issue for that.
>>
> Without a concrete situation it's very difficult to analyze.. Did you
>> check your transactions not being rolledback.. That's the only situation
>> where I think that the workItem information will not be persisted.
>>
>> Cheers
>>
>> On Fri, Jun 22, 2012 at 9:55 AM, Alberto R. Galdo wrote:
>>
>>>
>>> Sure, WorkItemHandlers are never persisted. I re-register those handlers
>>> before staring the session, just because I want my tasks to be properly
>>> executed.
>>>
>>> :(
>>>
>>>
>>> Alberto R. Galdo
>>> arga...@gmail.com
>>>
>>>
>>>
>>> On Fri, Jun 22, 2012 at 2:46 PM, Mauricio Salatino wrote:
>>>
>>>> There are two concepts here:
>>>> 1) WorkItem -> Persist the state of the activity
>>>> 2) WorkItemHandlers -> Never Persisted
>>>>
>>>> Are you re-registering the WorkItemHandlers at rehydratation?
>>>> WorkItemHandlers are part of the runtime status and don't get persisted.
>>>> Cheers
>>>>
>>>> On Fri, Jun 22, 2012 at 9:39 AM, Alberto R. Galdo wrote:
>>>>
>>>>> No, I'm not registering pending workitems at rehydration. That's why
>>>>> I'm using Drools & JBPM persistence ;-). I don't want to write my own 
>>>>> state
>>>>> persistence, as I am a mere user of JBPM & Drools services.
>>>>>
>>>>> >> "They are never persisted"
>>>>>
>>>>> This several methods in
>>>>> org.drools.persitence.jpa.JPAPersistenceContext seem to say just the
>>>>> opposite:
>>>>>
>>>>> public void persist(WorkItemInfo workItemInfo)
>>>>> public void remove(W

Re: [rules-users] Drools & JBPM Persistence

2012-06-25 Thread Mauricio Salatino
Comments inline

On Mon, Jun 25, 2012 at 4:31 AM, Alberto R. Galdo  wrote:

> What I'm pointing out is that at certain circumstances, such as when a
> human task is completed in a HT Server that connects to the execution
> context in JBPM  ( we've tested this with Mina ), the execution of the JBPM
> process lives in the same thread as the one that receives the message ( a
> NIO Channel ) and this makes the persistence go wrong.
>
Can you share an isolated test case for this one?

>
> But in our experience, this is not the only case where persistence can be
> wrong, there are others, such as when using Fusion events are involved with
> process instances in an persistent environment ...
>
> What kind of problems? If your stream of events is aggressive, your
database will be the bottleneck, usually if you can use multiple sessions,
one without persistence for Fusion and one with persistence for long
running processes.
If you have an isolated test that demonstrate which kind of problems you
are having we can take a look and fix if there is a bug.


> That's why we thought that maybe another approach to persistence, now that
> Drools & JBPM are tied, is needed.
>
>
> Cheers

>
>
> Alberto R. Galdo
> arga...@gmail.com
>
>
> On Fri, Jun 22, 2012 at 3:05 PM, Mauricio Salatino wrote:
>
>> Drools and jBPM are being executed in the same thread, in your set up
>> mina is not. Is that what are you pointing out?
>> Did you really need to have mina in a separate JVM or you can use the
>> Local Implementation?
>> Cheers
>>
>>
>> On Fri, Jun 22, 2012 at 10:00 AM, Alberto R. Galdo wrote:
>>
>>>
>>> I see your point, but IMHO that doesn't mean that in certain
>>> circumstances, when the process is being executed in a thread that it is no
>>> the same thread as the one in which drools is executing leads to a
>>> situation in which the persistence mechanisms are not enough to allow a
>>> fault tolerant JBPM for long-time running processes.
>>>
>>> As mentioned, there is at least one scenario, at least when mina is
>>> involved, where things are broken.
>>>
>>> Alberto R. Galdo
>>> arga...@gmail.com
>>>
>>>
>>>
>>> On Fri, Jun 22, 2012 at 2:50 PM, Mauricio Salatino wrote:
>>>
>>>> I think that you are mixing things up.
>>>> Did you take a look at the CommandBasedStatefulKnowledgeSession?
>>>> Every command that represent an operation against the knowledge session
>>>> is being executed inside a transaction, for both rules and processes. As
>>>> soon as a safe point is found (for both processes and rules) the
>>>> persistence mechanism commits the transaction.
>>>>
>>>> "In fact, this will never dissapear unless some communication mechanism
>>>> between Drools & JBPM is developed to allow the processes to be executed
>>>> inside Drools Reteoo thread."
>>>> Take a look at the class that I mention and then try to explain me what
>>>> you mean with the previous sentence.
>>>>
>>>> Cheers
>>>>
>>>>
>>>> On Fri, Jun 22, 2012 at 9:45 AM, Alberto R. Galdo wrote:
>>>>
>>>>>
>>>>> No, I didn't. I need to be able to deploy the human task server and my
>>>>> knowledge session in separate JVM's. And Mina is on my way.
>>>>>
>>>>> The fact that I am able to do things in some other way doesn't make
>>>>> this very problem dissapear ... :(. In fact, this will never dissapear
>>>>> unless some communication mechanism between Drools & JBPM is developed to
>>>>> allow the processes to be executed  inside Drools Reteoo thread.
>>>>>
>>>>> Isn't that so?
>>>>>
>>>>>
>>>>> Alberto R. Galdo
>>>>> arga...@gmail.com
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Jun 22, 2012 at 2:17 PM, Mauricio Salatino 
>>>>> wrote:
>>>>>
>>>>>> Both persistence mechanisms are already unified.
>>>>>> the jBPM-persistence module extends the Drools one adding the
>>>>>> relevant entities by the processes.
>>>>>>
>>>>>> You can be having problems with the Mina Server, did you try the
>>>>>> local configuration? The Mina Server was designed to run in a different 
>>>>>> JVM
>>>>>> than the session, a

Re: [rules-users] Drools & JBPM Persistence

2012-06-22 Thread Mauricio Salatino
Drools and jBPM are being executed in the same thread, in your set up mina
is not. Is that what are you pointing out?
Did you really need to have mina in a separate JVM or you can use the Local
Implementation?
Cheers

On Fri, Jun 22, 2012 at 10:00 AM, Alberto R. Galdo wrote:

>
> I see your point, but IMHO that doesn't mean that in certain
> circumstances, when the process is being executed in a thread that it is no
> the same thread as the one in which drools is executing leads to a
> situation in which the persistence mechanisms are not enough to allow a
> fault tolerant JBPM for long-time running processes.
>
> As mentioned, there is at least one scenario, at least when mina is
> involved, where things are broken.
>
> Alberto R. Galdo
> arga...@gmail.com
>
>
>
> On Fri, Jun 22, 2012 at 2:50 PM, Mauricio Salatino wrote:
>
>> I think that you are mixing things up.
>> Did you take a look at the CommandBasedStatefulKnowledgeSession?
>> Every command that represent an operation against the knowledge session
>> is being executed inside a transaction, for both rules and processes. As
>> soon as a safe point is found (for both processes and rules) the
>> persistence mechanism commits the transaction.
>>
>> "In fact, this will never dissapear unless some communication mechanism
>> between Drools & JBPM is developed to allow the processes to be executed
>> inside Drools Reteoo thread."
>> Take a look at the class that I mention and then try to explain me what
>> you mean with the previous sentence.
>>
>> Cheers
>>
>>
>> On Fri, Jun 22, 2012 at 9:45 AM, Alberto R. Galdo wrote:
>>
>>>
>>> No, I didn't. I need to be able to deploy the human task server and my
>>> knowledge session in separate JVM's. And Mina is on my way.
>>>
>>> The fact that I am able to do things in some other way doesn't make this
>>> very problem dissapear ... :(. In fact, this will never dissapear unless
>>> some communication mechanism between Drools & JBPM is developed to allow
>>> the processes to be executed  inside Drools Reteoo thread.
>>>
>>> Isn't that so?
>>>
>>>
>>> Alberto R. Galdo
>>> arga...@gmail.com
>>>
>>>
>>>
>>> On Fri, Jun 22, 2012 at 2:17 PM, Mauricio Salatino wrote:
>>>
>>>> Both persistence mechanisms are already unified.
>>>> the jBPM-persistence module extends the Drools one adding the relevant
>>>> entities by the processes.
>>>>
>>>> You can be having problems with the Mina Server, did you try the local
>>>> configuration? The Mina Server was designed to run in a different JVM than
>>>> the session, as a standalone component, if you are running it in the same
>>>> JVM that can be causing some transactional problems as you mention. If you
>>>> need to run it in the same JVM you can use the local configuration, did you
>>>> try that?
>>>> Cheers
>>>>
>>>> On Fri, Jun 22, 2012 at 8:31 AM, Alberto R. Galdo wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>>I'm opening this thread in the aim of generating a debate about the
>>>>> approach to session persistence in Drools and JBPM for BPMN processes 
>>>>> which
>>>>> by definition are able to generate asynchronous human tasks.
>>>>>
>>>>>IMHO the current approach needs to be refactored in favor of
>>>>> joining the management of the different Drools and JBPM entities in an
>>>>> unique manager.
>>>>>
>>>>>The current implementation offers two managers one in Drools, one
>>>>> in JBPM. Each of this managers are wrappers of a shared JPA EntityManager
>>>>> context and manage their own entities.
>>>>>
>>>>>When the integration of JBPM into Drools was done ( leaving behind
>>>>> drools flow ), the approach seemed to be to make the entities in JBPM (
>>>>> workitems, processinstance and so on ) look like the entities in Drools. 
>>>>> As
>>>>> a result, the implementation of those entities in JBPM now implement the
>>>>> interfaces of the same entities in Drools. That looked like a good
>>>>> approach, but the experience, at least mine, seems to reveal it as not 
>>>>> that
>>>>> good.
>>>>>
>>>>>In my opinion, the first problem with that approach is 

Re: [rules-users] Workitems doesn't get persisted when completing a task after rehydrating a knowledge session is some circumstances.

2012-06-22 Thread Mauricio Salatino
So, can you create an isolated test where you reproduce:

"We are unable to complete a human task after rehydrating a Drools
knowledge session because in some circunstances the generated Drools'
workitems don't get persisted in the database after the completion of a
previous task"

And I can take a look on that.. Please create Jira issue for that.
Without a concrete situation it's very difficult to analyze.. Did you check
your transactions not being rolledback.. That's the only situation where I
think that the workItem information will not be persisted.

Cheers

On Fri, Jun 22, 2012 at 9:55 AM, Alberto R. Galdo  wrote:

>
> Sure, WorkItemHandlers are never persisted. I re-register those handlers
> before staring the session, just because I want my tasks to be properly
> executed.
>
> :(
>
>
> Alberto R. Galdo
> arga...@gmail.com
>
>
>
> On Fri, Jun 22, 2012 at 2:46 PM, Mauricio Salatino wrote:
>
>> There are two concepts here:
>> 1) WorkItem -> Persist the state of the activity
>> 2) WorkItemHandlers -> Never Persisted
>>
>> Are you re-registering the WorkItemHandlers at rehydratation?
>> WorkItemHandlers are part of the runtime status and don't get persisted.
>> Cheers
>>
>> On Fri, Jun 22, 2012 at 9:39 AM, Alberto R. Galdo wrote:
>>
>>> No, I'm not registering pending workitems at rehydration. That's why I'm
>>> using Drools & JBPM persistence ;-). I don't want to write my own state
>>> persistence, as I am a mere user of JBPM & Drools services.
>>>
>>> >> "They are never persisted"
>>>
>>> This several methods in org.drools.persitence.jpa.JPAPersistenceContext
>>> seem to say just the opposite:
>>>
>>> public void persist(WorkItemInfo workItemInfo)
>>> public void remove(WorkItemInfo workItemInfo)
>>> public WorkItemInfo merge(WorkItemInfo workItemInfo)
>>>
>>> The fact that lots of workitems get created, persisted, merged and
>>> finally removed during the life of the process doesn't hide the fact that
>>> they're in fact,  well, persisted.
>>>
>>> If you take a look at the changes in the database whenever a human task
>>> is involved in a BPMN process that is executed inside a Drools & JBPM JPA
>>> persisted environment you will realize that indeed the human task are
>>> *persisted* and like so, rehydrated when loading the session in Drools.  In
>>> fact, those human task related workitems are never removed from the
>>> database, but that's another bug ... :(
>>>
>>> Any insight?
>>>
>>> Alberto R. Galdo
>>> arga...@gmail.com
>>>
>>>
>>>
>>> On Fri, Jun 22, 2012 at 2:15 PM, Mauricio Salatino wrote:
>>>
>>>>   "We are unable to complete a human task after rehydrating a Drools
>>>> knowledge session because in some circunstances the generated Drools'
>>>> workitems don't get persisted in the database after the completion of a
>>>> previous task"
>>>>
>>>> They are never persisted, they are runtime information that you must
>>>> re-register after rehydrating the session. Are you doing that?
>>>> Cheers
>>>>
>>>> On Fri, Jun 22, 2012 at 7:34 AM, Alberto R. Galdo wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>>We have a fairly large BPMN process running inside a JPA persisted
>>>>> StatefulKnowledgeSession using Drools 5.4 & JBPM 5.3. Our process involves
>>>>> timers, automated tasks, human tasks  most of them are long-running
>>>>> processes, so a fault-tolerant scenario is a must.
>>>>>
>>>>> We've found what seems to be a weird, weird bug in JBPM-Drools
>>>>> regarding the execution of BPMN processes. This is by best to summarize 
>>>>> the
>>>>> problem:
>>>>>
>>>>>  "We are unable to complete a human task after rehydrating a
>>>>> Drools knowledge session because in some circunstances the generated
>>>>> Drools' workitems don't get persisted in the database after the completion
>>>>> of a previous task"
>>>>>
>>>>> So, as the workitem is not in the database, when a human task
>>>>> client completes a task that is related to that non-existent workitem, the
>>>>> process doesn't get restarted. And the process fa

Re: [rules-users] Drools & JBPM Persistence

2012-06-22 Thread Mauricio Salatino
I think that you are mixing things up.
Did you take a look at the CommandBasedStatefulKnowledgeSession?
Every command that represent an operation against the knowledge session is
being executed inside a transaction, for both rules and processes. As soon
as a safe point is found (for both processes and rules) the persistence
mechanism commits the transaction.

"In fact, this will never dissapear unless some communication mechanism
between Drools & JBPM is developed to allow the processes to be executed
inside Drools Reteoo thread."
Take a look at the class that I mention and then try to explain me what you
mean with the previous sentence.

Cheers

On Fri, Jun 22, 2012 at 9:45 AM, Alberto R. Galdo  wrote:

>
> No, I didn't. I need to be able to deploy the human task server and my
> knowledge session in separate JVM's. And Mina is on my way.
>
> The fact that I am able to do things in some other way doesn't make this
> very problem dissapear ... :(. In fact, this will never dissapear unless
> some communication mechanism between Drools & JBPM is developed to allow
> the processes to be executed  inside Drools Reteoo thread.
>
> Isn't that so?
>
>
> Alberto R. Galdo
> arga...@gmail.com
>
>
>
> On Fri, Jun 22, 2012 at 2:17 PM, Mauricio Salatino wrote:
>
>> Both persistence mechanisms are already unified.
>> the jBPM-persistence module extends the Drools one adding the relevant
>> entities by the processes.
>>
>> You can be having problems with the Mina Server, did you try the local
>> configuration? The Mina Server was designed to run in a different JVM than
>> the session, as a standalone component, if you are running it in the same
>> JVM that can be causing some transactional problems as you mention. If you
>> need to run it in the same JVM you can use the local configuration, did you
>> try that?
>> Cheers
>>
>> On Fri, Jun 22, 2012 at 8:31 AM, Alberto R. Galdo wrote:
>>
>>> Hi,
>>>
>>>I'm opening this thread in the aim of generating a debate about the
>>> approach to session persistence in Drools and JBPM for BPMN processes which
>>> by definition are able to generate asynchronous human tasks.
>>>
>>>IMHO the current approach needs to be refactored in favor of joining
>>> the management of the different Drools and JBPM entities in an unique
>>> manager.
>>>
>>>The current implementation offers two managers one in Drools, one in
>>> JBPM. Each of this managers are wrappers of a shared JPA EntityManager
>>> context and manage their own entities.
>>>
>>>When the integration of JBPM into Drools was done ( leaving behind
>>> drools flow ), the approach seemed to be to make the entities in JBPM (
>>> workitems, processinstance and so on ) look like the entities in Drools. As
>>> a result, the implementation of those entities in JBPM now implement the
>>> interfaces of the same entities in Drools. That looked like a good
>>> approach, but the experience, at least mine, seems to reveal it as not that
>>> good.
>>>
>>>In my opinion, the first problem with that approach is that Drools,
>>> the reteoo algorithm, runs in a single-threaded environment. Drools
>>> persistence was designed having this in mind, so for the code in Drools,
>>> there's no doubt that when in a persistent enviroment, the transaction, if
>>> any, will be bound to the same thread as the one in which the reteoo
>>> algorithm is executed. That leads to situations where whenever a class in
>>> JBPM calls drools in a JBPM's thread ( the mina handler thread, a NIO one
>>> for instance ), Drools thinks that is being executed in it's own thread (
>>> where things are expected, as the JTA transaction bound for example ) and
>>> clearly, in some situations it is not the case. Then Drools expects to find
>>> certain resources and certain environment which are not always there.
>>> Leading to failure.
>>>
>>>As Drools now is a dependency for JBPM through the Knowledge-API, I
>>> think that the management of the persistence for Drools and JBPM should be
>>> merged in one that makes no assumptions and manages the needs for
>>> persistence in a coherent way for both products.
>>>
>>>What do you think?
>>>
>>>
>>> "There can be only one" ->
>>> http://en.wikipedia.org/wiki/Highlander_%28film%29
>>>
>>>
>>> Alberto R. Galdo
>>> arga...@gmail.com
>>>
>>>
>>> _

Re: [rules-users] Workitems doesn't get persisted when completing a task after rehydrating a knowledge session is some circumstances.

2012-06-22 Thread Mauricio Salatino
There are two concepts here:
1) WorkItem -> Persist the state of the activity
2) WorkItemHandlers -> Never Persisted

Are you re-registering the WorkItemHandlers at rehydratation?
WorkItemHandlers are part of the runtime status and don't get persisted.
Cheers

On Fri, Jun 22, 2012 at 9:39 AM, Alberto R. Galdo  wrote:

> No, I'm not registering pending workitems at rehydration. That's why I'm
> using Drools & JBPM persistence ;-). I don't want to write my own state
> persistence, as I am a mere user of JBPM & Drools services.
>
> >> "They are never persisted"
>
> This several methods in org.drools.persitence.jpa.JPAPersistenceContext
> seem to say just the opposite:
>
> public void persist(WorkItemInfo workItemInfo)
> public void remove(WorkItemInfo workItemInfo)
> public WorkItemInfo merge(WorkItemInfo workItemInfo)
>
> The fact that lots of workitems get created, persisted, merged and finally
> removed during the life of the process doesn't hide the fact that they're
> in fact,  well, persisted.
>
> If you take a look at the changes in the database whenever a human task is
> involved in a BPMN process that is executed inside a Drools & JBPM JPA
> persisted environment you will realize that indeed the human task are
> *persisted* and like so, rehydrated when loading the session in Drools.  In
> fact, those human task related workitems are never removed from the
> database, but that's another bug ... :(
>
> Any insight?
>
> Alberto R. Galdo
> arga...@gmail.com
>
>
>
> On Fri, Jun 22, 2012 at 2:15 PM, Mauricio Salatino wrote:
>
>>   "We are unable to complete a human task after rehydrating a Drools
>> knowledge session because in some circunstances the generated Drools'
>> workitems don't get persisted in the database after the completion of a
>> previous task"
>>
>> They are never persisted, they are runtime information that you must
>> re-register after rehydrating the session. Are you doing that?
>> Cheers
>>
>> On Fri, Jun 22, 2012 at 7:34 AM, Alberto R. Galdo wrote:
>>
>>> Hi,
>>>
>>>We have a fairly large BPMN process running inside a JPA persisted
>>> StatefulKnowledgeSession using Drools 5.4 & JBPM 5.3. Our process involves
>>> timers, automated tasks, human tasks  most of them are long-running
>>> processes, so a fault-tolerant scenario is a must.
>>>
>>> We've found what seems to be a weird, weird bug in JBPM-Drools
>>> regarding the execution of BPMN processes. This is by best to summarize the
>>> problem:
>>>
>>>  "We are unable to complete a human task after rehydrating a Drools
>>> knowledge session because in some circunstances the generated Drools'
>>> workitems don't get persisted in the database after the completion of a
>>> previous task"
>>>
>>> So, as the workitem is not in the database, when a human task client
>>> completes a task that is related to that non-existent workitem, the process
>>> doesn't get restarted. And the process fails.
>>>
>>> ÂżWhy does this happens? Lets see:
>>>
>>>  When the processs is executed, different workitems get created,
>>> updated and eventually deleted during the execution of a process up until a
>>> human task is created ( in our process ). When living in a persistet
>>> knowledge session, the transaction that is associated to Drools' thread is
>>> commited right after the human task is created in the human task server ...
>>> as it is a "safe point". Nothing here. Everithing is consistent, if you
>>> look at the database you will see your session instance, your process
>>> instance, and the final human task workitem as it is the only workitem
>>> survivor after the execution ( whatever hadler-managed automated task that
>>> were executed before the human task are deleted and the human task workitem
>>> needs to survive as it's completion depends on asyncronous client
>>> interaction ).
>>>
>>>  Now, if you connect to the human task server and complete that
>>> human task, a message is sent to the Drools session to update the state of
>>> the work item. The workitem gets updated, the process get restarted and the
>>> flow continues ... maybe generating a new human task ( which is our case ).
>>> At this very moment, if you take a look at the database, there are no
>>> automated-handled-task workitems ( as expected ) but there isn

Re: [rules-users] Drools & JBPM Persistence

2012-06-22 Thread Mauricio Salatino
Both persistence mechanisms are already unified.
the jBPM-persistence module extends the Drools one adding the relevant
entities by the processes.

You can be having problems with the Mina Server, did you try the local
configuration? The Mina Server was designed to run in a different JVM than
the session, as a standalone component, if you are running it in the same
JVM that can be causing some transactional problems as you mention. If you
need to run it in the same JVM you can use the local configuration, did you
try that?
Cheers

On Fri, Jun 22, 2012 at 8:31 AM, Alberto R. Galdo  wrote:

> Hi,
>
>I'm opening this thread in the aim of generating a debate about the
> approach to session persistence in Drools and JBPM for BPMN processes which
> by definition are able to generate asynchronous human tasks.
>
>IMHO the current approach needs to be refactored in favor of joining
> the management of the different Drools and JBPM entities in an unique
> manager.
>
>The current implementation offers two managers one in Drools, one in
> JBPM. Each of this managers are wrappers of a shared JPA EntityManager
> context and manage their own entities.
>
>When the integration of JBPM into Drools was done ( leaving behind
> drools flow ), the approach seemed to be to make the entities in JBPM (
> workitems, processinstance and so on ) look like the entities in Drools. As
> a result, the implementation of those entities in JBPM now implement the
> interfaces of the same entities in Drools. That looked like a good
> approach, but the experience, at least mine, seems to reveal it as not that
> good.
>
>In my opinion, the first problem with that approach is that Drools, the
> reteoo algorithm, runs in a single-threaded environment. Drools persistence
> was designed having this in mind, so for the code in Drools, there's no
> doubt that when in a persistent enviroment, the transaction, if any, will
> be bound to the same thread as the one in which the reteoo algorithm is
> executed. That leads to situations where whenever a class in JBPM calls
> drools in a JBPM's thread ( the mina handler thread, a NIO one for instance
> ), Drools thinks that is being executed in it's own thread ( where things
> are expected, as the JTA transaction bound for example ) and clearly, in
> some situations it is not the case. Then Drools expects to find certain
> resources and certain environment which are not always there. Leading to
> failure.
>
>As Drools now is a dependency for JBPM through the Knowledge-API, I
> think that the management of the persistence for Drools and JBPM should be
> merged in one that makes no assumptions and manages the needs for
> persistence in a coherent way for both products.
>
>What do you think?
>
>
> "There can be only one" ->
> http://en.wikipedia.org/wiki/Highlander_%28film%29
>
>
> Alberto R. Galdo
> arga...@gmail.com
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Workitems doesn't get persisted when completing a task after rehydrating a knowledge session is some circumstances.

2012-06-22 Thread Mauricio Salatino
  "We are unable to complete a human task after rehydrating a Drools
knowledge session because in some circunstances the generated Drools'
workitems don't get persisted in the database after the completion of a
previous task"

They are never persisted, they are runtime information that you must
re-register after rehydrating the session. Are you doing that?
Cheers

On Fri, Jun 22, 2012 at 7:34 AM, Alberto R. Galdo  wrote:

> Hi,
>
>We have a fairly large BPMN process running inside a JPA persisted
> StatefulKnowledgeSession using Drools 5.4 & JBPM 5.3. Our process involves
> timers, automated tasks, human tasks  most of them are long-running
> processes, so a fault-tolerant scenario is a must.
>
> We've found what seems to be a weird, weird bug in JBPM-Drools
> regarding the execution of BPMN processes. This is by best to summarize the
> problem:
>
>  "We are unable to complete a human task after rehydrating a Drools
> knowledge session because in some circunstances the generated Drools'
> workitems don't get persisted in the database after the completion of a
> previous task"
>
> So, as the workitem is not in the database, when a human task client
> completes a task that is related to that non-existent workitem, the process
> doesn't get restarted. And the process fails.
>
> ÂżWhy does this happens? Lets see:
>
>  When the processs is executed, different workitems get created,
> updated and eventually deleted during the execution of a process up until a
> human task is created ( in our process ). When living in a persistet
> knowledge session, the transaction that is associated to Drools' thread is
> commited right after the human task is created in the human task server ...
> as it is a "safe point". Nothing here. Everithing is consistent, if you
> look at the database you will see your session instance, your process
> instance, and the final human task workitem as it is the only workitem
> survivor after the execution ( whatever hadler-managed automated task that
> were executed before the human task are deleted and the human task workitem
> needs to survive as it's completion depends on asyncronous client
> interaction ).
>
>  Now, if you connect to the human task server and complete that human
> task, a message is sent to the Drools session to update the state of the
> work item. The workitem gets updated, the process get restarted and the
> flow continues ... maybe generating a new human task ( which is our case ).
> At this very moment, if you take a look at the database, there are no
> automated-handled-task workitems ( as expected ) but there isn't any human
> task related work item, even worse, the task at the human task server is
> created, persisted and has a reference to the non-existant workitem.
>
> Days of debugging led us to what we think is the source of the
> problem:
>
> We found that the execution of the process after completing a task is
> being executed in the same thread as the one that receives the mina message
> that the human task server sends whenever a task is completed. This thread
> is not the same thread that executes the knowledgesession ( where the
> reteoo lives ) and so it doesn't have a transaction. By the way, we found
> that for  workitem persistence the JPAWorkitemManager never joins an active
> transaction. :(
>
> That's why invoking the persistence of a workitem as a consequence of
> restarting the execution of a process inside the thread that receives the
> mina messages makes the database inconsistent, and so invalidating all
> means to make JBPM fault tolerant by making Drools session persistent.
>
> We found a way to circunvent this problem, making all our human task
> nodes be followed by a event timer. That way, when the timer gets completed
> we force the execution of the process to live in the same thread that the
> reteoo session lives where a transaction is available and things get back
> to normal. But this is really dirty and wrong.
>
> Any thoughts?
>
> We are really eager to be wrong whith this. :'(
>
> Greets,
>
>
>
> Alberto R. Galdo
> arga...@gmail.com
>
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Is a single StatefulKnowledgeSession with Distributed Memory cache possible?

2012-06-14 Thread Mauricio Salatino
Yes, that's another option too.. it really depends on how you can
accumulate data or split your data to be analyzed.
Cheers

On Thu, Jun 14, 2012 at 1:22 PM, Vincent LEGENDRE <
vincent.legen...@eurodecision.com> wrote:

> May be you can think differently : Instead of keeping all objects for 90
> days, keep only the accumulate results for each previous day.
>
> - Mail original -
> De: "chrisLi" 
> À: rules-users@lists.jboss.org
> Envoyé: Jeudi 14 Juin 2012 18:06:50
> Objet: [rules-users] Is a single StatefulKnowledgeSession with Distributed
> Memory cache possible?
>
> Hi All,
>
> I am working on a banking fraud detection project with Drools Fusion,
> which will match a transaction against hunreds of rules to check whether
> the
> transaction is suspicious.
>
> In some rules, I use time-based sliding window to calculate the average
> transaction amount of an account in the past 3 or 6 months. One possible
> rule will be as below:
>
>rule "Single Large Amount Transaction"
>dialect "mvel"
>when
>$account : Account($number : number)
>$averageAmount : BigDecimal() from accumulate(
>TransactionCompletedEvent(fromAccountNumber == $account.number,
> $amount : amount)
>over window:time(90d)
>from entry-point TransactionStream,
>bigDecimalAverage($amount))
>$t1 : TransactionCreatedEvent(fromAccountNumber == $account.number,
>amount > $account.creditAmount * 0.5, amount > $averageAmount *
> 3.0)
>   from entry-point TransactionStream
>then
>end
>
>In such cases, the Fusion Engine will hold TransactionCompletedEvent in
> its memory for 90 days. And we have about 1 billion Accounts in total, so
> the TransactionCompletedEvent will be huge, we will very soon run out of
> memory.
>
>I have been blocked here for a long time! Is it possible to distribute a
> single StatefulKnowledgeSession in multiple JVMs or machines using
> Distributed Memory cache such as Hazelcast? If yes, could you give me some
> opinion on the solution? Or is this the problem the Drools Grid project try
> to handle? Or there are other techonology to handle large numbers of facts
> or events problem?
>
>As far as I know, Drools Grid distribute multilple ksessions on multiple
> machines in the Grid, each or several kseesions on one node? Is my
> understandings right?
>
>Any response or opinion from you will be appriciated! Thank you very
> much!
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Is-a-single-StatefulKnowledgeSession-with-Distributed-Memory-cache-possible-tp4017968.html
> Sent from the Drools: User forum 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
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Is a single StatefulKnowledgeSession with Distributed Memory cache possible?

2012-06-14 Thread Mauricio Salatino
Yes, you get it right.
Drools Grid (or at least what is there in the source code right now) was
about session virtualization. It allows you to access to a session hosted
in a different JVM.
What you are looking for, I'm afraid is not possible right now, because in
order to distribute one session into multiple JVMs the RETE algorithm needs
to be split. There are some experimental works around this, but nothing has
being released yet. Probably Mark can give you more details about that.
Cheers

On Thu, Jun 14, 2012 at 1:06 PM, chrisLi  wrote:

> Hi All,
>
> I am working on a banking fraud detection project with Drools Fusion,
> which will match a transaction against hunreds of rules to check whether
> the
> transaction is suspicious.
>
> In some rules, I use time-based sliding window to calculate the average
> transaction amount of an account in the past 3 or 6 months. One possible
> rule will be as below:
>
>rule "Single Large Amount Transaction"
>dialect "mvel"
>when
>$account : Account($number : number)
>$averageAmount : BigDecimal() from accumulate(
>TransactionCompletedEvent(fromAccountNumber == $account.number,
> $amount : amount)
>over window:time(90d)
>from entry-point TransactionStream,
>bigDecimalAverage($amount))
>$t1 : TransactionCreatedEvent(fromAccountNumber == $account.number,
>amount > $account.creditAmount * 0.5, amount > $averageAmount *
> 3.0)
>   from entry-point TransactionStream
>then
>end
>
>In such cases, the Fusion Engine will hold TransactionCompletedEvent in
> its memory for 90 days. And we have about 1 billion Accounts in total, so
> the TransactionCompletedEvent will be huge, we will very soon run out of
> memory.
>
>I have been blocked here for a long time! Is it possible to distribute a
> single StatefulKnowledgeSession in multiple JVMs or machines using
> Distributed Memory cache such as Hazelcast? If yes, could you give me some
> opinion on the solution? Or is this the problem the Drools Grid project try
> to handle? Or there are other techonology to handle large numbers of facts
> or events problem?
>
>As far as I know, Drools Grid distribute multilple ksessions on multiple
> machines in the Grid, each or several kseesions on one node? Is my
> understandings right?
>
>Any response or opinion from you will be appriciated! Thank you very
> much!
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Is-a-single-StatefulKnowledgeSession-with-Distributed-Memory-cache-possible-tp4017968.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Looking for Drools audit tool

2012-05-30 Thread Mauricio Salatino
What kind of things do you want to audit?
Most of the information generated by the engine can be exposed to be
consumed by external tools.
Edson write a great post about how to monitor the engine using JMX and
Visual VM:

http://blog.athico.com/2009/10/drools-monitoring-with-jmx.html

On Wed, May 30, 2012 at 12:29 PM, paco  wrote:

> Hi everybody,
> I am looking for an audit tool for Drools technology.
> Can someone tell me if there is one?
> If so where can I find it?
> thank you
> Paco
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Looking-for-Drools-audit-tool-tp4017686.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Possibly race condition in a persisted Drools + JBPM during a StatefulKnowledgeSession

2012-05-29 Thread Mauricio Salatino
:)
Keep your mind open, because there is no single solution for all the
problems.

On Tue, May 29, 2012 at 1:15 PM, Alberto R. Galdo  wrote:

> Thank you very much Mauricio. You've been of great help. Now is time for
> us to cook all this valuable information and go for a solution. xD
>
> Alberto R. Galdo
> arga...@gmail.com
>
>
>
> On Tue, May 29, 2012 at 5:59 PM, Mauricio Salatino wrote:
>
>> Comments inline,
>>
>> On Tue, May 29, 2012 at 12:24 PM, Alberto R. Galdo wrote:
>>
>>>Sure!. I didn't mention that we're running in a OSGi environment and
>>> we're getting the session from JPAKnowledgeService like that:
>>>
>>>
>>>
>>> EntityManagerFactory emf =
>>> Persistence.createEntityManagerFactory("com.package");
>>>
>>> Environment env = KnowledgeBaseFactory.newEnvironment();
>>>
>>> env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
>>>
>>> env.set(EnvironmentName.TRANSACTION_MANAGER,(TransactionManager)
>>> bundleContext.getService(this.tmServiceRef));
>>>
>>> env.set(EnvironmentName.TRANSACTION, (UserTransaction)
>>> bundleContext.getService(this.userTransactionServiceRef));
>>>
>>> env.set(EnvironmentName.GLOBALS, new MapGlobalResolver());
>>>
>>> env.set(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES, new
>>> ObjectMarshallingStrategy[] {
>>> MarshallerFactory.newSerializeMarshallingStrategy() });
>>>
>>> final StatefulKnowledgeSession ksession =
>>> JPAKnowledgeService.newStatefulKnowledgeSession(kbase, sessionConfig, env);
>>>
>>>
>>>We are just following the manual ( and some acquired knowledge
>>> through the days ... )  I understand that inserting an event and
>>> starting a process at the same time would lead to the current situation,
>>> but Isn't this the reason why we are using drools with drools fusion + jbpm
>>> to build a CEP?
>>>
>> I'm not sure about your reasons :)
>>
>>>
>>>We chose Drools and a statefulsession in a fireUntilHalt loop just
>>> because we would be able to have our rules and processes reacting to events
>>> that enter the system at their own pace ... and found ourselves in this
>>> nightmare when trying to make the system fault-tolerant through
>>> persistence... :(
>>>
>>> FireUntilHalt and Persistence will cause "conflicts", because
>> fireUntilHalts by default creates a different thread == race conditions.
>>
>>
>>>Do you think we should change our fault-tolerance strategy by
>>> reconstructing the knowledge session, process and tasks state by our own
>>> means leaving Drools and JBPM JPA persistence appart?
>>>
>>>  A common problem is to think that a session will do everything for you.
>> I'm not saying that you need to separate your processes from your rules,
>> I'm just saying that probably decoupling responsibilities will help you to
>> tackle down some of the problems that you are having. If you have in memory
>> processes and fusion entry points, you can keep those together and in a
>> separate persistence session handle all the human task interactions and
>> long running processes. If you are getting events in real time and you want
>> to process them, you cannot expect to persist all the session state and
>> have no performance impacts.
>>
>>>
>>> Alberto R. Galdo
>>> arga...@gmail.com
>>>
>>>
>>> Cheers
>>
>>>
>>> On Tue, May 29, 2012 at 4:43 PM, Mauricio Salatino wrote:
>>>
>>>> Ok, so probably I'm not understanding your scenario, but are you using
>>>> the JPAKnowledgeService to create persistent sessions?
>>>> If you use that everything is aware of everything :) Drools and jBPM5
>>>> will run using the same persistence resources. For each interaction:
>>>> startProcess, insert, update, fireAllRules a transaction will be created.
>>>> If you are starting a process and at the same time inserting a Fusion event
>>>> you will be generating two transaction that will fight for the resources
>>>> (the same resources because you have only one session).
>>>> Obviously if you take the persistence mechanisms outside of the
>>>> discussion everything will work perfectly fine, because you don't have any
>>>> transactional resource to fight for :)
>>>>
>>>> Hope it helps.
>>>>

Re: [rules-users] Possibly race condition in a persisted Drools + JBPM during a StatefulKnowledgeSession

2012-05-29 Thread Mauricio Salatino
Comments inline,

On Tue, May 29, 2012 at 12:24 PM, Alberto R. Galdo wrote:

>Sure!. I didn't mention that we're running in a OSGi environment and
> we're getting the session from JPAKnowledgeService like that:
>
>
>
> EntityManagerFactory emf =
> Persistence.createEntityManagerFactory("com.package");
>
> Environment env = KnowledgeBaseFactory.newEnvironment();
>
> env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
>
> env.set(EnvironmentName.TRANSACTION_MANAGER,(TransactionManager)
> bundleContext.getService(this.tmServiceRef));
>
> env.set(EnvironmentName.TRANSACTION, (UserTransaction)
> bundleContext.getService(this.userTransactionServiceRef));
>
> env.set(EnvironmentName.GLOBALS, new MapGlobalResolver());
>
> env.set(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES, new
> ObjectMarshallingStrategy[] {
> MarshallerFactory.newSerializeMarshallingStrategy() });
>
> final StatefulKnowledgeSession ksession =
> JPAKnowledgeService.newStatefulKnowledgeSession(kbase, sessionConfig, env);
>
>
>We are just following the manual ( and some acquired knowledge through
> the days ... )  I understand that inserting an event and starting a
> process at the same time would lead to the current situation, but Isn't
> this the reason why we are using drools with drools fusion + jbpm to build
> a CEP?
>
I'm not sure about your reasons :)

>
>We chose Drools and a statefulsession in a fireUntilHalt loop just
> because we would be able to have our rules and processes reacting to events
> that enter the system at their own pace ... and found ourselves in this
> nightmare when trying to make the system fault-tolerant through
> persistence... :(
>
> FireUntilHalt and Persistence will cause "conflicts", because
fireUntilHalts by default creates a different thread == race conditions.


>Do you think we should change our fault-tolerance strategy by
> reconstructing the knowledge session, process and tasks state by our own
> means leaving Drools and JBPM JPA persistence appart?
>
>  A common problem is to think that a session will do everything for you.
I'm not saying that you need to separate your processes from your rules,
I'm just saying that probably decoupling responsibilities will help you to
tackle down some of the problems that you are having. If you have in memory
processes and fusion entry points, you can keep those together and in a
separate persistence session handle all the human task interactions and
long running processes. If you are getting events in real time and you want
to process them, you cannot expect to persist all the session state and
have no performance impacts.

>
> Alberto R. Galdo
> arga...@gmail.com
>
>
> Cheers

>
> On Tue, May 29, 2012 at 4:43 PM, Mauricio Salatino wrote:
>
>> Ok, so probably I'm not understanding your scenario, but are you using
>> the JPAKnowledgeService to create persistent sessions?
>> If you use that everything is aware of everything :) Drools and jBPM5
>> will run using the same persistence resources. For each interaction:
>> startProcess, insert, update, fireAllRules a transaction will be created.
>> If you are starting a process and at the same time inserting a Fusion event
>> you will be generating two transaction that will fight for the resources
>> (the same resources because you have only one session).
>> Obviously if you take the persistence mechanisms outside of the
>> discussion everything will work perfectly fine, because you don't have any
>> transactional resource to fight for :)
>>
>> Hope it helps.
>> Cheers
>>
>>
>> On Tue, May 29, 2012 at 11:36 AM, Alberto R. Galdo wrote:
>>
>>>Your answer is confusing me, I think I'm not getting it right.
>>>
>>>It seems that we you're saying that will have to modify JBPM or
>>> Drools behaviour to get our architecture done ... but I don't think we are
>>> doing nothing special than what Drools & JBPM are able to do in a
>>> non-persisting enviroment ( at least without JBPM persisted ).
>>>
>>>Maybe deeping a bit more the architecture will lead to a better
>>> understanding of the problem:
>>>
>>>We have a Drools StatefulKnowledgeSession wich is populated with
>>> packages of rules and different BPMN 2.0 process definitions. That session
>>> in Drools is persisted using JPA and our JTA provider. Our solution is a
>>> CEP that uses events that get into the session using Drools Fusion. There,
>>> several rules fire and then several consequences start processes wich
>>> contain both Tasks and

Re: [rules-users] Possibly race condition in a persisted Drools + JBPM during a StatefulKnowledgeSession

2012-05-29 Thread Mauricio Salatino
Ok, so probably I'm not understanding your scenario, but are you using the
JPAKnowledgeService to create persistent sessions?
If you use that everything is aware of everything :) Drools and jBPM5 will
run using the same persistence resources. For each interaction:
startProcess, insert, update, fireAllRules a transaction will be created.
If you are starting a process and at the same time inserting a Fusion event
you will be generating two transaction that will fight for the resources
(the same resources because you have only one session).
Obviously if you take the persistence mechanisms outside of the discussion
everything will work perfectly fine, because you don't have any
transactional resource to fight for :)

Hope it helps.
Cheers

On Tue, May 29, 2012 at 11:36 AM, Alberto R. Galdo wrote:

>Your answer is confusing me, I think I'm not getting it right.
>
>It seems that we you're saying that will have to modify JBPM or Drools
> behaviour to get our architecture done ... but I don't think we are doing
> nothing special than what Drools & JBPM are able to do in a non-persisting
> enviroment ( at least without JBPM persisted ).
>
>Maybe deeping a bit more the architecture will lead to a better
> understanding of the problem:
>
>We have a Drools StatefulKnowledgeSession wich is populated with
> packages of rules and different BPMN 2.0 process definitions. That session
> in Drools is persisted using JPA and our JTA provider. Our solution is a
> CEP that uses events that get into the session using Drools Fusion. There,
> several rules fire and then several consequences start processes wich
> contain both Tasks and HumanTasks. Those rule activations are already in a
> queue, the Agenda. Given that JBPM acts as the processmanager provider for
> Drools, our processes get started in JBPM, and it is persisted using it's
> own JPA manager.  Just rules, that start processes in response to events in
> a fireUntilHalt loop in a persistent enviroment, both for Drools & JBPM.
> Then some processes interact with the knowledge session using BussinessTask
> nodes( which make other rules fire and maybe launch a different set of
> processes ) and other simply get to the Stop node. I see nothing wrong
> here, in fact, taking the persistence appart from the equation, everything
> runs as beautifuly as expected. We've tested that.
>
>I'm just trying to undersand the problem, I'm pretty 90% sure I'm
> wrong, but what I think is happening here is that Drools isn't aware that
> JBPM may be using the same resources and vice-versa, Isn't it?
>
>Shouldn't the solution be to make Drools & JBPM aware of each other in
> what is related to the syncronization of the transaction management to
> avoid race conditions?
>
>
>
>
> Alberto R. Galdo
> arga...@gmail.com
>
>
> On Tue, May 29, 2012 at 3:58 PM, Mauricio Salatino wrote:
>
>> I'm in no way saying this:
>> "  Let me see if I'm getting this right, What you mean is that there is
>> no way for the JPA persistence of Drools & JBPM to coexist in the same
>> knowledge session because of race conditions between them competing for
>> their shared resources? I'm afraid so.. :(
>>
>> They can coexist. As you can see they are working together. If you take a
>> look at the underlying layers you will see that each operation that you run
>> against the session is wrapped in a transaction. That leads to your
>> architecture, If you have a single entry point for your session everything
>> will work correctly. You can achieve this by receiving all the operations
>> in a queue and then execute one after the other.
>> If you have multiple threads interacting with the session, you can
>> implement a retrying mechanism if the transaction gets rolled back and as
>> soon as the transaction win the right to commit it will work. It really
>> depends on the problem that you are trying to solve.
>>
>> Cheers
>>
>> On Tue, May 29, 2012 at 10:42 AM, Alberto R. Galdo wrote:
>>
>>>Thanks Mauricio for your kind response, and kick, as usual ;-)
>>>
>>>Sure, we see lots of rolled back transactions ... Everywhere!
>>>
>>>Let me see if I'm getting this right, What you mean is that there is
>>> no way for the JPA persistence of Drools & JBPM to coexist in the same
>>> knowledge session because of race conditions between them competing for
>>> their shared resources? I'm afraid so.. :(
>>>
>>>If it is so, Are there any plans for the integration of a shared JPA
>>> persistence management of both Drools & JBPM, wich

Re: [rules-users] Possibly race condition in a persisted Drools + JBPM during a StatefulKnowledgeSession

2012-05-29 Thread Mauricio Salatino
I'm in no way saying this:
"  Let me see if I'm getting this right, What you mean is that there is no
way for the JPA persistence of Drools & JBPM to coexist in the same
knowledge session because of race conditions between them competing for
their shared resources? I'm afraid so.. :(

They can coexist. As you can see they are working together. If you take a
look at the underlying layers you will see that each operation that you run
against the session is wrapped in a transaction. That leads to your
architecture, If you have a single entry point for your session everything
will work correctly. You can achieve this by receiving all the operations
in a queue and then execute one after the other.
If you have multiple threads interacting with the session, you can
implement a retrying mechanism if the transaction gets rolled back and as
soon as the transaction win the right to commit it will work. It really
depends on the problem that you are trying to solve.

Cheers

On Tue, May 29, 2012 at 10:42 AM, Alberto R. Galdo wrote:

>Thanks Mauricio for your kind response, and kick, as usual ;-)
>
>Sure, we see lots of rolled back transactions ... Everywhere!
>
>Let me see if I'm getting this right, What you mean is that there is no
> way for the JPA persistence of Drools & JBPM to coexist in the same
> knowledge session because of race conditions between them competing for
> their shared resources? I'm afraid so.. :(
>
>If it is so, Are there any plans for the integration of a shared JPA
> persistence management of both Drools & JBPM, wich may be the solution for
> this problem? ... Will we be better thinking to change our architecture
> ASAP?
>
> Greets,
>
> Alberto R. Galdo
> arga...@gmail.com
>
>
>
> On Tue, May 29, 2012 at 1:54 PM, Mauricio Salatino wrote:
>
>> Ok, so what is happening is that two or more threads are fighting for the
>> resources, causing that two or more transactions wants to be completed, but
>> just one can win. All the other must be retried. Are you seeing rolled back
>> exceptions in your stack trace?
>> My question to you is if you really need to handle everything in just one
>> big persistent session. I've solved similar issues in the past using more
>> than one session, for example one session to run business
>> processes(persistent) and one or more for receiving and reacting to events.
>> If you have an async way to communicate both sessions there should be no
>> problem.
>> Hope it helps!
>> Cheers
>>
>> On Tue, May 29, 2012 at 7:30 AM, Alberto R. Galdo wrote:
>>
>>> Hi all,
>>>
>>>We've been for long time now developing a complex event processing
>>> system that ( simplified version ahead !! ) involves a set of rules that in
>>> turn activates a set processes that fulfill human tasks and other kind of
>>> tasks.. This all is running in a StatefulKnowledgeSession with JPA
>>> persistence configured both for Drools and JBPM. We are running an stack of
>>> Drools, JBPM, Drools Integration, Drools fussion, etc..
>>>
>>>We've been able to persist Drools sessions & JBPM processes in the
>>> same Persistence Context  ( not without pain :( ) using different JTA
>>> implementations including ( but not limited to ) Bitronix & Atomikos.
>>>
>>> What we are observing here is what seems to be some kind of race
>>> condition between Drools and JBPM when running the knowledge session when
>>> JPA&JTA persistence is configured. Very often, as soon as after 2-3
>>> processes get created as rule's consequences are fired in response of
>>> events inside the session we see how JBPM finds its instance nullified by
>>> Drools when it tries to end a process and persist it.
>>>
>>>We've been able to find where Drools decides to delete an instance of
>>> the process ... at a given time Drools executes
>>> JPAProcessInstanceManager.clearProcessInstances() [1] when it finalizes a
>>> SingleSessionCommand wich in turn calls disconnect() for *all* the
>>> local-stored processinstances ( wich gets populated with instances of
>>> processes every time a process is started in the knowledge session ):
>>>
>>> public void clearProcessInstances() {
>>>
>>>
>>> for (ProcessInstance processInstance: new 
>>> ArrayList(processInstances.values())) {
>>>
>>>
>>>
>>>
>>>
>>>
>>> ((ProcessInstanceImpl) processInstance).disconnect();
>>>
>>> }
>>> }
>>

Re: [rules-users] Possibly race condition in a persisted Drools + JBPM during a StatefulKnowledgeSession

2012-05-29 Thread Mauricio Salatino
Ok, so what is happening is that two or more threads are fighting for the
resources, causing that two or more transactions wants to be completed, but
just one can win. All the other must be retried. Are you seeing rolled back
exceptions in your stack trace?
My question to you is if you really need to handle everything in just one
big persistent session. I've solved similar issues in the past using more
than one session, for example one session to run business
processes(persistent) and one or more for receiving and reacting to events.
If you have an async way to communicate both sessions there should be no
problem.
Hope it helps!
Cheers

On Tue, May 29, 2012 at 7:30 AM, Alberto R. Galdo  wrote:

> Hi all,
>
>We've been for long time now developing a complex event processing
> system that ( simplified version ahead !! ) involves a set of rules that in
> turn activates a set processes that fulfill human tasks and other kind of
> tasks.. This all is running in a StatefulKnowledgeSession with JPA
> persistence configured both for Drools and JBPM. We are running an stack of
> Drools, JBPM, Drools Integration, Drools fussion, etc..
>
>We've been able to persist Drools sessions & JBPM processes in the same
> Persistence Context  ( not without pain :( ) using different JTA
> implementations including ( but not limited to ) Bitronix & Atomikos.
>
> What we are observing here is what seems to be some kind of race
> condition between Drools and JBPM when running the knowledge session when
> JPA&JTA persistence is configured. Very often, as soon as after 2-3
> processes get created as rule's consequences are fired in response of
> events inside the session we see how JBPM finds its instance nullified by
> Drools when it tries to end a process and persist it.
>
>We've been able to find where Drools decides to delete an instance of
> the process ... at a given time Drools executes
> JPAProcessInstanceManager.clearProcessInstances() [1] when it finalizes a
> SingleSessionCommand wich in turn calls disconnect() for *all* the
> local-stored processinstances ( wich gets populated with instances of
> processes every time a process is started in the knowledge session ):
>
> public void clearProcessInstances() {
>
>
> for (ProcessInstance processInstance: new 
> ArrayList(processInstances.values())) {
>
>
> ((ProcessInstanceImpl) processInstance).disconnect();
>
> }
> }
>
>
> So, Drools decides to disconnect all process instances in it's JPA
> context without taking in account the state the process is in, and when an
> processinstance that is not stopped gets removed then JBPM finds it's
> NullPointerException...
>
> We've modified the code to make Drools aware of the state of the
> process before wiping it from the context   ( no problem here, there will
> be no leak as a running processinstance will be removed in future calls of
> "clearProcessInstances" given the process is closed ). But unfortunatelly
> this seems to resolve this problem, but lots of other problems ( wich seems
> also race conditions arise :  for instance: Drools closes connections to
> the database and JBPM finds the connection closed,
>
>
> So, we are really worried about using Drools & JBPM in a persisted
> environment. Maybe our asumptions are wrong...  Is it possible to have an
> scenario like ours given the current Drools & JBPM integration status for a
> persistent statefulKnowledge Session?  Did anyone build a complex event
> processing system like ours in a unaltered persistence environment such as
> provided in Drools and JBPM by default?
>
>
> Greets,
>
> [1]
> https://github.com/droolsjbpm/jbpm/blob/master/jbpm-persistence-jpa/src/main/java/org/jbpm/persistence/processinstance/JPAProcessInstanceManager.java
>
>
>
>
>
>
> Alberto R. Galdo
> arga...@gmail.co 
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Persist JPA Entity fact in session

2012-05-24 Thread Mauricio Salatino
You can use the Variable Persistency Strategies, that will store your facts
in the database for you.
You need to configure in the environment the strategies for example:
https://github.com/droolsjbpm/jbpm/blob/master/jbpm-human-task/jbpm-human-task-core/src/test/java/org/jbpm/task/service/persistence/variable/VariablePersistenceStrategiesSyncHTTest.java

Notice that you will need to provide your domain specific entityManager to
the JPAPlaceholderResolverStrategy

Cheers

On Thu, May 24, 2012 at 1:30 PM, Alberto R. Galdo  wrote:

> Hi,
>
>We are in a fireUntilHalt during a persistent StatefulKnowledgeSession
> using JTA & JPA with Hibernate ... Our session consists in a series of
> facts ( well, we are not different of anyone else for that matter ... xD )
> but some of our facts are also JPA @Entity . What we want is to persist
> those entities on their own database tables as well as the SessionInfo each
> time Drools considers the knowledge session needs to be persisted.
>
>We are aware that Drools uses
> org.drools.persistence.jpa.persist(SessionInfo)  What would be the best
> approach to get certain facts that are JPA Entities persisted along with
> the Session taking advantage of the Drool's SessionInfo persistence loop?
>
> Best regards,
>
>
> Alberto R. Galdo
> arga...@gmail.com
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] ProcessInstance from StartProcessCommand

2012-05-18 Thread Mauricio Salatino
Did you take a look at the documentation?
http://docs.jboss.org/drools/release/5.4.0.Final/droolsjbpm-integration-docs/html_single/index.html#d0e1070

Cheers

On Fri, May 18, 2012 at 12:11 AM, Hrumph  wrote:

> What would one call with the outIdentifier to get a result?
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/ProcessInstance-from-StartProcessCommand-tp383p4000166.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] ProcessInstance from StartProcessCommand

2012-05-17 Thread Mauricio Salatino
Hi Herm,
You can use the out identifier to get some result..


On Thu, May 17, 2012 at 8:25 PM, Hrumph  wrote:

> I am using the StartProcessCommand through the BatchExecution interface,
> and
> it works fine, but I don't see any return information in the
> ExecutionResults, such as a ProcessInstanceId or ProcessState?   Is there
> some way to acquire this information.  I see a number of other Commands in
> the process package but it's not clear how to use them or where the
> ProcessState would come from.
>
> Thanks,
>
> Herm
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/ProcessInstance-from-StartProcessCommand-tp383.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Is there a faster way of doing this in Drools ?

2012-05-09 Thread Mauricio Salatino
Can you explain a little bit more about your context? having completely
dynamic rules is not an usual use case, rules tends to be static because
they define the business logic that you want to apply. So please elaborate
on the context.

On Wed, May 9, 2012 at 1:07 PM, soumya_sd  wrote:

>
> salaboy wrote
> >
> > You can do that step once and then reload the compiled rules from the
> > disk,
> > or use guvnor which will compile the rules for you.
> > Cheers
> >
> >
> >
>
> Thanks for responding so quickly. I tried using Guvnor. Do you think it
> will
> be faster than this ? In the worse case, the rules that I need to apply can
> change with every iteration i.e., they are completely dynamic and defined
> at
> runtime. So, storing the rules is not an options.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Is-there-a-faster-way-of-doing-this-in-Drools-tp3973888p3973915.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Is there a faster way of doing this in Drools ?

2012-05-09 Thread Mauricio Salatino
You can do that step once and then reload the compiled rules from the disk,
or use guvnor which will compile the rules for you.
Cheers

On Wed, May 9, 2012 at 12:55 PM, soumya_sd  wrote:

> I've a use case where I need to create a rule dynamically every time the
> user
> sends a request.
> My current understanding of Drools is that you need to create a
> KnowledgeBuilder and then add the rules
>
> I'm creating the KnowledgeBase as follows.
>
>private static KnowledgeBase readKnowledgeBase() throws Exception {
>long t1 = System.currentTimeMillis();
>KnowledgeBuilder kbuilder =
> KnowledgeBuilderFactory.newKnowledgeBuilder();
>long t11 = System.currentTimeMillis();
>
>
>kbuilder.add(
> org.drools.io.ResourceFactory.newByteArrayResource(getRule()),
> ResourceType.DRL);
>
>long t2 = System.currentTimeMillis();
>
>KnowledgeBuilderErrors errors = kbuilder.getErrors();
>if (errors.size() > 0) {
>for (KnowledgeBuilderError error: errors) {
>System.err.println(error);
>}
>throw new IllegalArgumentException("Could not parse
> knowledge.");
>}
>long t3 = System.currentTimeMillis();
>
>KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
>long t4 = System.currentTimeMillis();
>
>kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
>long t5 = System.currentTimeMillis();
>
>
>Collection kpackages =
> kbase.getKnowledgePackages();
>for (KnowledgePackage knowledgePackage : kpackages) {
>System.out.println("Package  " +
> knowledgePackage.getName());
>Collection rules =
> knowledgePackage.getRules();
>for (Rule rule : rules) {
>System.out.println("" + rule.getName());
>}
>}
>long t6 = System.currentTimeMillis();
>
>System.out.println( (t11-t1) + " " + (t2-t11) + " " + ( t3-t2) + "
> " +
> ( t4-t3) + " " + ( t5-t4) + " " + ( t6-t5)+ " " );
>
>return kbase;
>}
>
> Based on the timing logs the code take majority (more than 80%) of time in
> only these two operations. Is there a way to make it faster ?
>
> KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
> kbuilder.add(
> org.drools.io.ResourceFactory.newByteArrayResource(getRule()),
> ResourceType.DRL);
>
> thanks.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Is-there-a-faster-way-of-doing-this-in-Drools-tp3973888.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] drools 5.0's RuleFlow & drools 5.2's jbpm5

2012-05-05 Thread Mauricio Salatino
Yes, jbpm5 is focused on the BPMN2 modeling language, I suggest you to read
about that specification in order to start working with jBPM5. From the
technical point of view most of the things that you will read about Drools
Flow are still valid for jBPM5 (except the modeling language - RuleFlow).
Cheers

On Sat, May 5, 2012 at 11:28 AM, Ahmed Feki wrote:

> the jbpm5 runs with .bpmn process files not with .rf as in the 5.0, i
> still dont know if it is the only difference but i think these standards re
> not compatibles.
>
>
> 2012/5/5 bardelman 
>
>> Hi,
>> i m planning to learn jbpm5 and i ve 2 books :
>> -Drools-JBoss-Rules-5.0-Developers-Guide :which is about the version 5.0
>> of
>> drools. in this book, there is a chapter about the Drools flow.
>>
>> -The second book is the Drools Developper Cookbook(2012), here there is a
>> chapter about the jbpm5 in which it s said :<> of
>> the Drools process engine that was previously known as
>> Drools Flow.>>
>>
>> As i want to optimize my learning curve for this framework(i mean for
>> jbpm5)
>> i want to know if it is useful to read from the first book ? is it still
>> useful  the Drools flow of the version 5.0 ? sorry for my bad english ..!!
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/drools-5-0-s-RuleFlow-drools-5-2-s-jbpm5-tp3964263.html
>> Sent from the Drools: User forum 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
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] ontologies

2012-03-30 Thread Mauricio Salatino
You usually create ontologies with other tools like Protege, right?

2012/3/30 Olfa h 

> hello,
> how I can create ontologies with Drools ?
>
> thx
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] NullPointerException when load file rules

2012-03-26 Thread Mauricio Salatino
So, probably there is something related on how those resources are loaded
or how the jar files are scanned when they are loaded.
This doesn't means that drools doesn't work.. probably is a bug and you
should report it if you can create an isolated test with the error inside
Jira.
Cheers

2012/3/26 elMateo 

> With Java 7, when I run a bundle with Drools (in Apache Felix), I get this
> exception:
>
> *org.drools.RuntimeDroolsException: Unable to load dialect*
> *
> 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java:org.drools.rule.builder.dialect.java.JavaDialectConfiguration'
> *
>
> I had this problem before because I need to add inside my project that is
> loading the rules the file META-INF/drools.packagebuilder.conf. I did it
> when you helped me. A few days ago I installed Java 7, but I don't run my
> project with Drools. Until this morning. I uninstall it and my project work
> ok again :)
>
>
>
> On Mon, Mar 26, 2012 at 5:41 PM, Mauricio Salatino wrote:
>
>> What do you mean with "doesn't work well"? which problem are you
>> experiencing?
>>
>> 2012/3/26 elMateo 
>>
>>> Hi all,
>>>
>>> the problem is that Drools doesn't work well with Java 1.7.0
>>>
>>> On Mon, Mar 26, 2012 at 2:21 PM, jjmartinez wrote:
>>>
>>>> Hello all,
>>>>
>>>> I have, again, this exception:
>>>>
>>>> org.drools.RuntimeDroolsException: Unable to load dialect
>>>> 'org.drools.rule.build
>>>>
>>>> er.dialect.java.JavaDialectConfiguration:java:org.drools.rule.builder.dialect.ja
>>>> va.JavaDialectConfiguration'
>>>>
>>>> but I have a file in META-INFcalled drools.packagebuilder.conf, with the
>>>> information above.
>>>>
>>>> Of course, I have all drools bundles in my Apache Felix running. And I'm
>>>> using Drools 5.4.0-SNAPSHOT version.
>>>>
>>>> Could anybody help me??
>>>>
>>>> Thanks in advance, Jesus.
>>>>
>>>> --
>>>> View this message in context:
>>>> http://drools.46999.n3.nabble.com/NullPointerException-when-load-file-rules-tp3645021p3857996.html
>>>> Sent from the Drools: User forum 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
>>>
>>>
>>
>>
>> --
>>  - MyJourney @ http://salaboy.wordpress.com
>>  - Co-Founder @ http://www.jugargentina.org
>>  - Co-Founder @ http://www.jbug.com.ar
>>
>>  - Salatino "Salaboy" Mauricio -
>>
>>
>> ___
>> 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
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] NullPointerException when load file rules

2012-03-26 Thread Mauricio Salatino
What do you mean with "doesn't work well"? which problem are you
experiencing?

2012/3/26 elMateo 

> Hi all,
>
> the problem is that Drools doesn't work well with Java 1.7.0
>
> On Mon, Mar 26, 2012 at 2:21 PM, jjmartinez  wrote:
>
>> Hello all,
>>
>> I have, again, this exception:
>>
>> org.drools.RuntimeDroolsException: Unable to load dialect
>> 'org.drools.rule.build
>>
>> er.dialect.java.JavaDialectConfiguration:java:org.drools.rule.builder.dialect.ja
>> va.JavaDialectConfiguration'
>>
>> but I have a file in META-INFcalled drools.packagebuilder.conf, with the
>> information above.
>>
>> Of course, I have all drools bundles in my Apache Felix running. And I'm
>> using Drools 5.4.0-SNAPSHOT version.
>>
>> Could anybody help me??
>>
>> Thanks in advance, Jesus.
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/NullPointerException-when-load-file-rules-tp3645021p3857996.html
>> Sent from the Drools: User forum 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
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] The rule language. More about the agenda-group and ruleflow-group attributes

2012-03-24 Thread Mauricio Salatino
If you want to use rule flow groups you will need to define a process using
jbpm5 and then bind each rule flow group to a businessRuleTask. You can
find some examples about this here:
https://github.com/Salaboy/jBPM5-Developer-Guide

here:
https://github.com/Salaboy/Drools_jBPM5-Training-Examples

and here:
https://github.com/esteban-aliverti/JBPM-Samples

Cheers

2012/3/24 Maxim Kolchin 

> Hi Mauricio,
>
> I'm not sure, are they suitable for me, but I want to do the following:
> I'm using Guvnor and I have rules packed in a one package.
>
> These rules must be partition to several groups which must fire in a
> certain order: at first rules from group-A, then rules from group-B etc.
>
> I don't know, how should I use agenda-group and ruleflow-group. And how to
> specify the order of the groups firing.
>
> Thanks for your help,
> Max
>
>
> 2012/3/24 Mauricio Salatino 
>
>> As far as I remember Ruleflow Groups are documented inside the jBPM5
>> documentation and agenda group inside the Drools docs.
>> What do you want to achieve with them?
>> Cheers
>>
>> 2012/3/24 Maxim Kolchin 
>>
>>> Hi,
>>>
>>> I've only been working with drools about couple of months. I've read the
>>> documentation and some articles about drools.
>>> But, I've not found the detail information about the agenda-group and
>>> ruleflow-group attributes, or examples showing how to work with them.
>>>
>>> Have I missed something? Will be grateful for any useful information.
>>>
>>> Regards,
>>> Maxim Kolchin,
>>>
>>> Laboratory of Intellectual Systems,
>>> National Research University ITMO,
>>> Saint-Petersburg.
>>> http://ailab.ifmo.ru/
>>>
>>> Email: kolchin...@gmail.com
>>>
>>> ___
>>> rules-users mailing list
>>> rules-users@lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>
>>>
>>
>>
>> --
>>  - MyJourney @ http://salaboy.wordpress.com
>>  - Co-Founder @ http://www.jugargentina.org
>>  - Co-Founder @ http://www.jbug.com.ar
>>
>>  - Salatino "Salaboy" Mauricio -
>>
>>
>> ___
>> 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
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] The rule language. More about the agenda-group and ruleflow-group attributes

2012-03-24 Thread Mauricio Salatino
As far as I remember Ruleflow Groups are documented inside the jBPM5
documentation and agenda group inside the Drools docs.
What do you want to achieve with them?
Cheers

2012/3/24 Maxim Kolchin 

> Hi,
>
> I've only been working with drools about couple of months. I've read the
> documentation and some articles about drools.
> But, I've not found the detail information about the agenda-group and
> ruleflow-group attributes, or examples showing how to work with them.
>
> Have I missed something? Will be grateful for any useful information.
>
> Regards,
> Maxim Kolchin,
>
> Laboratory of Intellectual Systems,
> National Research University ITMO,
> Saint-Petersburg.
> http://ailab.ifmo.ru/
>
> Email: kolchin...@gmail.com
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Drools and Jersey

2012-03-14 Thread Mauricio Salatino
If you create an isolated test you can also create a new Jira issue, so
it's easier for every one to reproduce, test and fix the problem.
Cheers

2012/3/14 mike 

> Wolfgang,
>
> I am using
>
> 
>  org.drools
>  drools-core
> 5.3.1.Final
>  jar
> 
>
> Mauricio:
>
> It is something related to loading classes inside Jersey that brakes if I
> am using mvel. I use mvel always, because java syntax hurts me.
>
> Drools Team:
>
> I think the easier way would be to try this scenario yourself. This is a
> pom for Jersey.
>
> 
> com.sun.jersey
>  jersey-client
> 1.12
>  
>
> Thank you very much
> Cheers
> Mike
>
> 2012/3/14 Mauricio Salatino 
>
>> Sure.. we are interested in finding out what is happening. So, you find
>> that when you are using mvel something inside Jersey fails?
>> Did you find what exactly is happening inside Jersey? Probably it's
>> something related with the class loaders, but I never seen an error like
>> that when you specify the mvel dialect.
>> By the way, what exactly are you trying to do with mvel? did you try
>> using the mvel syntax without explicitly specifying the dialect?
>>
>> Cheers
>>
>>
>>
>> 2012/3/14 mike 
>>
>>> Wait ... I haven't solved the problem ... I mean, as of now I cannot use
>>> mvel if I want to use Jersey ... and I don't think it's Jersey's fault
>>> because it works in any condition except when using mvel. I thought that
>>> the Drools team follows this list and might be interested in that bug.
>>>
>>> Thank you very much
>>> Mike
>>>
>>> 2012/3/14 Mauricio Salatino 
>>>
>>>> Cool that you find that :)
>>>> Cheers
>>>>
>>>>
>>>> 2012/3/14 mike 
>>>>
>>>>> Hi Mauricio,
>>>>>
>>>>> I spent like 2 days debugging, before realizing that mvel was the
>>>>> culprit. The error is a Null Exception when resolving some service inside
>>>>> Jersey. I have to check my browser history at home for more details but 
>>>>> the
>>>>> exception was happening inside Jersey.
>>>>>
>>>>> Please notice I reduced the code to the minimum. I had 'real' code
>>>>> doing more reasonable things with new Client. Client c = new Client() 
>>>>> fails
>>>>> too.
>>>>>
>>>>> Thank you very much
>>>>>  Mike
>>>>>
>>>>>
>>>>> 2012/3/14 Mauricio Salatino 
>>>>>
>>>>>> Hi Mike, I've never tried that before (a rule without the when
>>>>>> part..) is good to know that it works :)
>>>>>> Humm that's sounds weird.. why the dialect is affecting your Client
>>>>>> creation.
>>>>>> It could be that there is something wrong with the expression
>>>>>> evaluation.
>>>>>> It looks like MVEL cannot compile the new Client(); expression -> at
>>>>>> java.lang.String.(Unknown Source)
>>>>>> Did you try with something like:
>>>>>> then \n
>>>>>> Client c = new Client();
>>>>>>
>>>>>> I'm just guessing here, because it looks strange
>>>>>>
>>>>>>
>>>>>> 2012/3/14 mike 
>>>>>>
>>>>>>> Hi Mauricio,
>>>>>>>
>>>>>>> Thank you for the speedy reply. Ia m making rest call to web
>>>>>>> services using jersey. I simplified the rule to the max. The 'when' is 
>>>>>>> not
>>>>>>> really needed. I get the exception on the call to "new Client()". Please
>>>>>>> keep in mind it works without dialect "mvel".
>>>>>>>
>>>>>>> Thank you very much
>>>>>>> Mike
>>>>>>>
>>>>>>> Here's the stack trace .
>>>>>>> java.lang.StringIndexOutOfBoundsException: String index out of
>>>>>>> range: -1
>>>>>>> at java.lang.String.(Unknown Source)
>>>>>>>  at
>>>>>>> org.mvel2.CompileException.showCodeNearError(CompileException.java:149)
>>>>>>> at
>>>>>>> org.mvel2.CompileException.generateErrorMessage(CompileException.java:219)
&g

Re: [rules-users] Drools and Jersey

2012-03-14 Thread Mauricio Salatino
Sure.. we are interested in finding out what is happening. So, you find
that when you are using mvel something inside Jersey fails?
Did you find what exactly is happening inside Jersey? Probably it's
something related with the class loaders, but I never seen an error like
that when you specify the mvel dialect.
By the way, what exactly are you trying to do with mvel? did you try using
the mvel syntax without explicitly specifying the dialect?

Cheers


2012/3/14 mike 

> Wait ... I haven't solved the problem ... I mean, as of now I cannot use
> mvel if I want to use Jersey ... and I don't think it's Jersey's fault
> because it works in any condition except when using mvel. I thought that
> the Drools team follows this list and might be interested in that bug.
>
> Thank you very much
> Mike
>
> 2012/3/14 Mauricio Salatino 
>
>> Cool that you find that :)
>> Cheers
>>
>>
>> 2012/3/14 mike 
>>
>>> Hi Mauricio,
>>>
>>> I spent like 2 days debugging, before realizing that mvel was the
>>> culprit. The error is a Null Exception when resolving some service inside
>>> Jersey. I have to check my browser history at home for more details but the
>>> exception was happening inside Jersey.
>>>
>>> Please notice I reduced the code to the minimum. I had 'real' code doing
>>> more reasonable things with new Client. Client c = new Client() fails too.
>>>
>>> Thank you very much
>>>  Mike
>>>
>>>
>>> 2012/3/14 Mauricio Salatino 
>>>
>>>> Hi Mike, I've never tried that before (a rule without the when part..)
>>>> is good to know that it works :)
>>>> Humm that's sounds weird.. why the dialect is affecting your Client
>>>> creation.
>>>> It could be that there is something wrong with the expression
>>>> evaluation.
>>>> It looks like MVEL cannot compile the new Client(); expression -> at
>>>> java.lang.String.(Unknown Source)
>>>> Did you try with something like:
>>>> then \n
>>>> Client c = new Client();
>>>>
>>>> I'm just guessing here, because it looks strange
>>>>
>>>>
>>>> 2012/3/14 mike 
>>>>
>>>>> Hi Mauricio,
>>>>>
>>>>> Thank you for the speedy reply. Ia m making rest call to web services
>>>>> using jersey. I simplified the rule to the max. The 'when' is not really
>>>>> needed. I get the exception on the call to "new Client()". Please keep in
>>>>> mind it works without dialect "mvel".
>>>>>
>>>>> Thank you very much
>>>>> Mike
>>>>>
>>>>> Here's the stack trace .
>>>>> java.lang.StringIndexOutOfBoundsException: String index out of range:
>>>>> -1
>>>>> at java.lang.String.(Unknown Source)
>>>>>  at
>>>>> org.mvel2.CompileException.showCodeNearError(CompileException.java:149)
>>>>> at
>>>>> org.mvel2.CompileException.generateErrorMessage(CompileException.java:219)
>>>>>  at org.mvel2.CompileException.toString(CompileException.java:62)
>>>>> at java.lang.Throwable.(Throwable.java:242)
>>>>>  at java.lang.Exception.(Unknown Source)
>>>>> at java.lang.RuntimeException.(Unknown Source)
>>>>>  at
>>>>> org.drools.runtime.rule.ConsequenceException.(ConsequenceException.java:31)
>>>>> at
>>>>> org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
>>>>>  at
>>>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1101)
>>>>> at
>>>>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
>>>>>  at
>>>>> org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1251)
>>>>> at
>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:709)
>>>>>  at
>>>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:673)
>>>>> at
>>>>> org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
>>>>>  at
>>>>> com.ultimatesoftware.engine.tests.Wip.drools_new_client(Wip.java:32)
>>>>> at sun.reflect.NativeMethodAccessorI

Re: [rules-users] Drools and Jersey

2012-03-14 Thread Mauricio Salatino
Cool that you find that :)
Cheers

2012/3/14 mike 

> Hi Mauricio,
>
> I spent like 2 days debugging, before realizing that mvel was the culprit.
> The error is a Null Exception when resolving some service inside Jersey. I
> have to check my browser history at home for more details but the exception
> was happening inside Jersey.
>
> Please notice I reduced the code to the minimum. I had 'real' code doing
> more reasonable things with new Client. Client c = new Client() fails too.
>
> Thank you very much
>  Mike
>
>
> 2012/3/14 Mauricio Salatino 
>
>> Hi Mike, I've never tried that before (a rule without the when part..) is
>> good to know that it works :)
>> Humm that's sounds weird.. why the dialect is affecting your Client
>> creation.
>> It could be that there is something wrong with the expression evaluation.
>> It looks like MVEL cannot compile the new Client(); expression -> at
>> java.lang.String.(Unknown Source)
>> Did you try with something like:
>> then \n
>> Client c = new Client();
>>
>> I'm just guessing here, because it looks strange
>>
>>
>> 2012/3/14 mike 
>>
>>> Hi Mauricio,
>>>
>>> Thank you for the speedy reply. Ia m making rest call to web services
>>> using jersey. I simplified the rule to the max. The 'when' is not really
>>> needed. I get the exception on the call to "new Client()". Please keep in
>>> mind it works without dialect "mvel".
>>>
>>> Thank you very much
>>> Mike
>>>
>>> Here's the stack trace .
>>> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
>>> at java.lang.String.(Unknown Source)
>>>  at
>>> org.mvel2.CompileException.showCodeNearError(CompileException.java:149)
>>> at
>>> org.mvel2.CompileException.generateErrorMessage(CompileException.java:219)
>>>  at org.mvel2.CompileException.toString(CompileException.java:62)
>>> at java.lang.Throwable.(Throwable.java:242)
>>>  at java.lang.Exception.(Unknown Source)
>>> at java.lang.RuntimeException.(Unknown Source)
>>>  at
>>> org.drools.runtime.rule.ConsequenceException.(ConsequenceException.java:31)
>>> at
>>> org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
>>>  at
>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1101)
>>> at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
>>>  at
>>> org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1251)
>>> at
>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:709)
>>>  at
>>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:673)
>>> at
>>> org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
>>>  at com.ultimatesoftware.engine.tests.Wip.drools_new_client(Wip.java:32)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>  at java.lang.reflect.Method.invoke(Unknown Source)
>>> at
>>> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>>>  at
>>> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>>> at
>>> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>>>  at
>>> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
>>> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
>>>  at
>>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
>>> at
>>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
>>>  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
>>> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
>>>  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
>>> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
>>>  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
>>> at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
>>>  at
>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.ja

Re: [rules-users] Drools and Jersey

2012-03-14 Thread Mauricio Salatino
Hi Mike, I've never tried that before (a rule without the when part..) is
good to know that it works :)
Humm that's sounds weird.. why the dialect is affecting your Client
creation.
It could be that there is something wrong with the expression evaluation.
It looks like MVEL cannot compile the new Client(); expression -> at
java.lang.String.(Unknown Source)
Did you try with something like:
then \n
Client c = new Client();

I'm just guessing here, because it looks strange

2012/3/14 mike 

> Hi Mauricio,
>
> Thank you for the speedy reply. Ia m making rest call to web services
> using jersey. I simplified the rule to the max. The 'when' is not really
> needed. I get the exception on the call to "new Client()". Please keep in
> mind it works without dialect "mvel".
>
> Thank you very much
> Mike
>
> Here's the stack trace .
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> at java.lang.String.(Unknown Source)
>  at
> org.mvel2.CompileException.showCodeNearError(CompileException.java:149)
> at
> org.mvel2.CompileException.generateErrorMessage(CompileException.java:219)
>  at org.mvel2.CompileException.toString(CompileException.java:62)
> at java.lang.Throwable.(Throwable.java:242)
>  at java.lang.Exception.(Unknown Source)
> at java.lang.RuntimeException.(Unknown Source)
>  at
> org.drools.runtime.rule.ConsequenceException.(ConsequenceException.java:31)
> at
> org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
>  at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1101)
> at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
>  at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1251)
> at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:709)
>  at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:673)
> at
> org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
>  at com.ultimatesoftware.engine.tests.Wip.drools_new_client(Wip.java:32)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>  at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>  at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>  at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
>  at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
>  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
>  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
>  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
>  at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>  at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>  at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>
>
>
> 2012/3/14 Mauricio Salatino 
>
>> what are you trying to do?
>> what's the error?
>>
>> the rule should look like
>>
>> rule "create Rest Client"
>> when
>> then new Client();
>> end
>>
>> 2012/3/14 mike 
>>
>>>  Hi there,
>>>
>>> I am trying to make rest calls from Drools. For that I am using Jersey
>>> http://jersey.java.net/. I cannot no get it to work if I use mvel,
>>> otherwise it works fine.
>>>
>>> Here is a sample rule:
>>> --
>>> import com.sun.jersey.a

Re: [rules-users] Raising event signal from work item handler

2012-03-08 Thread Mauricio Salatino
Do you mean a ksession.signalEvent()??
Usually the work item is considered an execution outside the process
context, so are not supposed to access the process context from there. Can
you explains us a little bit about your use case?

2012/3/8 Swindells, Thomas 

>  Within a work item, if you need to signal an event how would you do it?**
> **
>
> From a rules task you have access to the kcontext but generically this
> isn’t available.
>
> ** **
>
> Thanks,
>
> ** **
>
> Thomas
>
> --
>
>
> **
> This message is confidential and intended only for the addressee. If you
> have received this message in error, please immediately notify the
> postmas...@nds.com and delete it from your system as well as any copies.
> The content of e-mails as well as traffic data may be monitored by NDS for
> employment and security purposes. To protect the environment please do not
> print this e-mail unless necessary.
>
> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18
> 4EX, United Kingdom. A company registered in England and Wales. Registered
> no. 3080780. VAT no. GB 603 8808 40-00
>
> **
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Simple question about String comparison in Drool

2012-03-07 Thread Mauricio Salatino
you can just use String( this == key)

On Wed, Mar 7, 2012 at 11:32 PM, shawn  wrote:

> I insert several strings into working memory to make a comparison. But how
> to
> compare a anonymous string to another string. code like:
>
> List  s = ArrayList 
> String key
>
> function void insertValue( s, KnowledgeHelper kh ) {
>
>for( String string : s ) {
>kh.insert( string );
>}
>
> }
> ...
> When
>not $string : String( toString() == key)
> Then
> Obviously, toString() can not do this task.
> How to get the string's value ?
> Cheers.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Simple-question-about-String-comparison-in-Drool-tp3808352p3808352.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Drools 5.3 partitioned rule base

2012-03-02 Thread Mauricio Salatino
But are the facts related with each other? do you need to analyze them all
together inside the same session?
Can you share a little bit more about your use cases? What do you mean with
"Execution" execution of what? What do you mean with "evaluation"?

Cheers

On Fri, Mar 2, 2012 at 4:12 PM, gboro54  wrote:

> Executions need to happen in an order based on a data and a message id(at
> least at one part of the evaluation). Because of this my plan was to use
> dynamic salience and insert as many of the facts as I can at a time
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-5-3-partitioned-rule-base-tp3793558p3793941.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


  1   2   3   4   5   6   7   >