Re: [rules-users] Flow and Rules Together - Best practice question

2010-02-18 Thread Gerret Hansper
Hi Mike,

I have been working with Drools for only a few months now and am still rather
new to it, but we've have made the same experience, switching from rules only to
rules with flow, and I'm certain it's the right way to go.

The performance implications you mention depend mainly on the way the rules are
set up, I guess. 
That is, if you have expensive RHS expressions like eval() you might indeed
profit from keeping your glucose-level condition at the beginning of the rules
which would prevent those expressions from being reevaluted, as far as I
understand. 
If you don't I can hardly imagine that activating the rules makes up a
noticeable fraction of the overall time of your process.

We here have a scenario where some rules may be activated only if the user
starting the session has got corresponding privileges. 
Since determining the priviliges is not always trivial we definitely wanted to
have that logic in one place. The first thing to do was to use inference
(http://docs.codehaus.org/display/LOGICABYSS/Policy+Encapsulation) but still
already with a few dozen rules and including other constraints the rule RHsides
became rather cluttered. Moreover it was getting increasingly complex to 
control the order in which the rules fired, maintanance being another issue. 

Using a rule flow we have achieved really good separation of concerns: A rule's
RHS mostly contains exactly those conditions that apply to its intent, none of
the cross-concerns or technicalities. (Hey, what about an AspectDrools
implementation? ;-) )
I am confident that OO lessons apply here, too: If you have a clean design and
performance problems start to show up you are much more likely to solve them
than if you have a tangled web of dependencies.

Greetings,
Gerret


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


Re: [rules-users] rules-users Digest, Vol 39, Issue 45

2010-02-18 Thread Nilima R
Hi 

In drools in deployment we get the below link.
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/xxx/LATEST.drl
 

We need to include this in properties file in application wherein this URL 
is mentioned.
How can one protect unauthorized access to this URL as the whole set of 
rules can be viewed for this .


Nilima 

Experience certainty.   IT Services
Business Solutions
Outsourcing




From:
rules-users-requ...@lists.jboss.org
To:
rules-users@lists.jboss.org
Date:
02/17/2010 10:14 PM
Subject:
rules-users Digest, Vol 39, Issue 45
Sent by:
rules-users-boun...@lists.jboss.org



Send rules-users mailing list submissions to
 rules-users@lists.jboss.org

To subscribe or unsubscribe via the World Wide Web, visit
 https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
 rules-users-requ...@lists.jboss.org

You can reach the person managing the list at
 rules-users-ow...@lists.jboss.org

When replying, please edit your Subject line so it is more specific
than Re: Contents of rules-users digest...


Today's Topics:

   1. Re: Negating a result (Wolfgang Laun)
   2. Re: Negating a result (djb)
   3. Re: Negating a result (Wolfgang Laun)
   4. Re: guvnor - dsl rule editor - using : in text box
  (Toni Rikkola)
   5. Re: getWorkingMemoryEntryPoint returns NULL (Wolfgang Laun)
   6. Insert new facts from RHS (Malinda Kaushalye)
   7. Re: Insert new facts from RHS (Mauricio Salatino)
   8. Re: Insert new facts from RHS (Enda J Diggins)


--

Message: 1
Date: Wed, 17 Feb 2010 09:48:50 +0100
From: Wolfgang Laun wolfgang.l...@gmail.com
Subject: Re: [rules-users] Negating a result
To: Rules Users List rules-users@lists.jboss.org
Message-ID:
 17de7ee81002170048j6898203br6a73e2e2962cb...@mail.gmail.com
Content-Type: text/plain; charset=iso-8859-1

Please be more specfic. If your field is called foo, then
should have a method in the class representing
your fact, such as:

   boolean getFoo(){
   return condition ? ! (expression) : expression;
   }

Basically, condition could be a global parameter (public static final)
or a static or regular method call. expression could depend on other
attribute values, and so on.

You can then write your CEs with a test such as
  foo == true

But I think this is closely related with that other question you
have posted.

-W


On Wed, Feb 17, 2010 at 9:32 AM, djb dbrownel...@hotmail.com wrote:


 Hi Wolfgang,

 Sure, I know de Morgan's laws, but I'm not asking how one can negate a
 condition...

 I'm asking how one can either negate or not negate, based on a test... 
and
 whether I'm going to have to split my spreadsheet/rule-template into 2,
 (i.e. 1 for may not be rules, 1 for must be rules).

 My spreadsheet has a field that in Java would be expressed as field ?
 !finalResult : finalResult

 But in DRL, it seems the lack of a ternary operator means I have to 
split
 my
 rule-set, and I'm just checking if this is the case.

 -Daniel

 --
 View this message in context:
 http://n3.nabble.com/Negating-a-result-tp212559p212656.html
 Sent from the Drools - User mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.jboss.org/pipermail/rules-users/attachments/20100217/18c19147/attachment-0001.html
 


--

Message: 2
Date: Wed, 17 Feb 2010 02:02:08 -0800 (PST)
From: djb dbrownel...@hotmail.com
Subject: Re: [rules-users] Negating a result
To: rules-users@lists.jboss.org
Message-ID: 1266400928420-212797.p...@n3.nabble.com
Content-Type: text/plain; charset=us-ascii


Well the thing is, it's not just one condition - it's the combination of 
all
my rule's conditions. 
And my rules have about 7 conditions, none of which are mandatory. 

And that is actually the source of all my problems: that the conditions 
are
optional.

If I set up a few logical relationships, there is nothing specific I am
testing on, which gives a single expression I can test in a function.  In
procedural programming, I check each of the 7 conditions optionally, and
then I apply my ternary operator to the final result.  But here I can't do
that, because the condition is made up of all the little conditions that 
may
or may not be applicable.



PS. 
Ok, so I see from the other thread that a rule template is meant to place
whatever text you give it, like a text pre-processor.  I'll see if that is
correct, thanks.  I thought it might not be, because if you provide a 
blank
cell, it deletes your entire condition, instead 

[rules-users] MarshallerReaderContext.resolveClass() unhandled null pionter exception

2010-02-18 Thread KiranP

Is was going through the source code of Drools 5.1 M1 and found out that it
may happen
(as i have checked with my test cases) that the resolveClass method can also
throw a 
null pointer exception which is not handeled in this function and because of
which the 
completeWorkItem() also fails..

need some suggestions for work around.if already in trunk..  

thanks in advance

Please consider if said something wrong or so...b'coz newbie
here.
-- 
View this message in context: 
http://n3.nabble.com/MarshallerReaderContext-resolveClass-unhandled-null-pionter-exception-tp215025p215025.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] MarshallerReaderContext.resolveClass() unhandled null pionter exception

2010-02-18 Thread KiranP

sorry i missed something

the null pointer is caused by the ruleBase variable which can b null when
calling the constructor from
WorkItemInfo class using getWorkItem();

thanks once again
-- 
View this message in context: 
http://n3.nabble.com/MarshallerReaderContext-resolveClass-unhandled-null-pionter-exception-tp215025p215028.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Flow and Rules Together - Best practice question

2010-02-18 Thread Pete Carapetyan
Nice post, Gerret. Cean logic, nicely presented. Separation of concerns vs
tangled web of dependencies. whooo!

On Thu, Feb 18, 2010 at 3:05 AM, Gerret Hansper gerret.pub...@gmx.dewrote:

 Hi Mike,

 I have been working with Drools for only a few months now and am still
 rather
 new to it, but we've have made the same experience, switching from rules
 only to
 rules with flow, and I'm certain it's the right way to go.

 The performance implications you mention depend mainly on the way the rules
 are
 set up, I guess.
 That is, if you have expensive RHS expressions like eval() you might indeed
 profit from keeping your glucose-level condition at the beginning of the
 rules
 which would prevent those expressions from being reevaluted, as far as I
 understand.
 If you don't I can hardly imagine that activating the rules makes up a
 noticeable fraction of the overall time of your process.

 We here have a scenario where some rules may be activated only if the user
 starting the session has got corresponding privileges.
 Since determining the priviliges is not always trivial we definitely wanted
 to
 have that logic in one place. The first thing to do was to use inference
 (http://docs.codehaus.org/display/LOGICABYSS/Policy+Encapsulation) but
 still
 already with a few dozen rules and including other constraints the rule
 RHsides
 became rather cluttered. Moreover it was getting increasingly complex to
 control the order in which the rules fired, maintanance being another
 issue.

 Using a rule flow we have achieved really good separation of concerns: A
 rule's
 RHS mostly contains exactly those conditions that apply to its intent, none
 of
 the cross-concerns or technicalities. (Hey, what about an AspectDrools
 implementation? ;-) )
 I am confident that OO lessons apply here, too: If you have a clean design
 and
 performance problems start to show up you are much more likely to solve
 them
 than if you have a tangled web of dependencies.

 Greetings,
 Gerret


 ___
 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] Decision table parameter problem ?

2010-02-18 Thread mklaric

When i write this in decision table 

RuleTable example(Integer i, Integer j) i got exception : 

nvalid rule table header cell. Should be in the format of 'RuleTable
YourRuleName'. It was: 
 [RuleTable example(ParamAttribute p, Integer i)] 

why ? 


-- 
View this message in context: 
http://n3.nabble.com/Decision-table-parameter-problem-tp215178p215178.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] AGE problem

2010-02-18 Thread Pavel Tavoda
Hello,
I would like to calculate AGE of object based on Date inside object, I
can use eval but I hope it's so basic functionality that Drools should
have it. It's also performance problem if I need to use EVAL in many
rules (let's say 100 in XLS). I'm playing with some FUSION features
like:
 $now : Now()  $order : SecurityOrder(this before[400d, 0d] $now)
should work but I can't specify YEARS as constant. That's a problem
for long time because 30*365d isn't same as 30 years if you consider
leap years. Is it possible some easy way to calculate AGE of something
with correct time handling and compare to years? Something like:
SecurityOrder( age(createdDate)  20y, age(createdDate)  25y)
or by FUSION:
 $now : Now()  $order : SecurityOrder(this before[25y, 20y] $now)

For now I'm using following function in eval() but it's becoming
performance problem:
function boolean between(Calendar currentDate, Date oldDate, int from, int to) {
Calendar fromCal = Calendar.getInstance();
fromCal.setTime(oldDate);
fromCal.add(Calendar.YEAR, from);

Calendar toCal = Calendar.getInstance();
toCal.setTime(oldDate);
toCal.add(Calendar.YEAR, to);
return currentDate.after(fromCal)  currentDate.before(toCal);
}

Thank you

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


Re: [rules-users] Drools Flow: Variable Persistence Strategies

2010-02-18 Thread Dale Wyttenbach
My pleasure.

Within ProcessInstanceInfo, I've got a similar observation about the
eventTypes member.  'private SetEventType' is currently commented out in
favor of 'private SetString'.  When using an Oracle hibernate dialect,
this results in the DDL 'create table ProcessInstanceInfo_eventTypes' which
yields the error 'ORA-00972: identifier is too long'.  I imagine this will
be resolved when the String is promoted to EventType but I thought you might
want to know.

2010/2/13 Mauricio Salatino sala...@gmail.com

 done.. I will apply the patch into the trunk.. it seems to be correct.
 Thanks a lot!

 2010/2/13 Dale Wyttenbach dale.wyttenb...@gmail.com

 Please see attached.


 2010/2/12 Mauricio Salatino sala...@gmail.com

 I just want to make sure before apply the patch that the change will not
 impact in other places.
 Thanks


 On Fri, Feb 12, 2010 at 5:38 PM, Mauricio Salatino sala...@gmail.comwrote:

 can you post both, previous and new, sql schema generated for the
 VariableInstanceInfo and ProcessInstanceInfo tables?



 2010/2/12 Dale Wyttenbach dale.wyttenb...@gmail.com

 If you try to write a query that
 requires VariableInstanceInfo.processId, it won't work because that class
 has no processId member.
 I guessed that processInstanceId would be a better join column, and
 that worked (patch attached)

 Thanks for the reply.

 2010/2/12 Mauricio Salatino sala...@gmail.com

 Hmm..
 I'm looking at the source and I see the following mapping:

 @OneToMany(cascade = CascadeType.ALL)
 @JoinColumn(name = processId)
 @MapKey(name = name)
 private MapString, VariableInstanceInfo variables  = new
 HashMapString, VariableInstanceInfo();

 That makes me think that there is a join column called processId
 between VariableInstanceInfo and ProcessInstanceInfo.


 2010/2/12 Dale Wyttenbach dale.wyttenb...@gmail.com

 I have a patch for drools-persistence-jpa should anyone agree with me
 that ProcessInstanceInfo and VariableInstanceInfo should be joined by
 processInstanceId.


 On Fri, Feb 12, 2010 at 10:52 AM, Dale Wyttenbach 
 dale.wyttenb...@gmail.com wrote:

 I'm trying to adapt the StringVariablePersister presented in
 http://blog.athico.com/2009/09/drools-flow-variable-persistence.html

 http://blog.athico.com/2009/09/drools-flow-variable-persistence.htmlI
 can create process instances with variable color:

   private static WorkflowProcessInstance
 startProcess(StatefulKnowledgeSession ksession, String color) {
 MapString, Object vars = new HashMapString, Object();
 vars.put(color, color);
 WorkflowProcessInstance p1 = (WorkflowProcessInstance)
 ksession.startProcess(com.sample.ruleflow, vars);
 return p1;
   }

 I can count them:

 select
 count(*)
 from
 ProcessInstanceInfo

 However I'm stymied as to counting process instances with a given
 color, as there appears to be no join column between 
 ProcessInstanceInfo and
 VariableInstanceInfo.
 Can such a query be written?

 Thanks.





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




 --
 - http://salaboy.wordpress.com
 - 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




 --
 - http://salaboy.wordpress.com
 - http://www.jbug.com.ar
 - Salatino Salaboy Mauricio -




 --
 - http://salaboy.wordpress.com
 - 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




 --
 - http://salaboy.wordpress.com
 - 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


Re: [rules-users] Drools Flow: Variable Persistence Strategies

2010-02-18 Thread Mauricio Salatino
Let me take a look at that too.. probably it's an oracle problem right? I
mean, probably it just happen with oracle.. we can create a fix for that too


2010/2/18 Dale Wyttenbach dale.wyttenb...@gmail.com

 My pleasure.

 Within ProcessInstanceInfo, I've got a similar observation about the
 eventTypes member.  'private SetEventType' is currently commented out in
 favor of 'private SetString'.  When using an Oracle hibernate dialect,
 this results in the DDL 'create table ProcessInstanceInfo_eventTypes' which
 yields the error 'ORA-00972: identifier is too long'.  I imagine this will
 be resolved when the String is promoted to EventType but I thought you might
 want to know.

 2010/2/13 Mauricio Salatino sala...@gmail.com

 done.. I will apply the patch into the trunk.. it seems to be correct.
 Thanks a lot!

 2010/2/13 Dale Wyttenbach dale.wyttenb...@gmail.com

 Please see attached.


 2010/2/12 Mauricio Salatino sala...@gmail.com

 I just want to make sure before apply the patch that the change will not
 impact in other places.
 Thanks


 On Fri, Feb 12, 2010 at 5:38 PM, Mauricio Salatino 
 sala...@gmail.comwrote:

 can you post both, previous and new, sql schema generated for the
 VariableInstanceInfo and ProcessInstanceInfo tables?



 2010/2/12 Dale Wyttenbach dale.wyttenb...@gmail.com

 If you try to write a query that
 requires VariableInstanceInfo.processId, it won't work because that class
 has no processId member.
 I guessed that processInstanceId would be a better join column, and
 that worked (patch attached)

 Thanks for the reply.

 2010/2/12 Mauricio Salatino sala...@gmail.com

 Hmm..
 I'm looking at the source and I see the following mapping:

 @OneToMany(cascade = CascadeType.ALL)
 @JoinColumn(name = processId)
 @MapKey(name = name)
 private MapString, VariableInstanceInfo variables  =
 new HashMapString, VariableInstanceInfo();

 That makes me think that there is a join column called processId
 between VariableInstanceInfo and ProcessInstanceInfo.


 2010/2/12 Dale Wyttenbach dale.wyttenb...@gmail.com

 I have a patch for drools-persistence-jpa should anyone agree with
 me that ProcessInstanceInfo and VariableInstanceInfo should be joined 
 by
 processInstanceId.


 On Fri, Feb 12, 2010 at 10:52 AM, Dale Wyttenbach 
 dale.wyttenb...@gmail.com wrote:

 I'm trying to adapt the StringVariablePersister presented in
 http://blog.athico.com/2009/09/drools-flow-variable-persistence.html

 http://blog.athico.com/2009/09/drools-flow-variable-persistence.htmlI
 can create process instances with variable color:

   private static WorkflowProcessInstance
 startProcess(StatefulKnowledgeSession ksession, String color) {
 MapString, Object vars = new HashMapString, Object();
 vars.put(color, color);
 WorkflowProcessInstance p1 = (WorkflowProcessInstance)
 ksession.startProcess(com.sample.ruleflow, vars);
 return p1;
   }

 I can count them:

 select
 count(*)
 from
 ProcessInstanceInfo

 However I'm stymied as to counting process instances with a given
 color, as there appears to be no join column between 
 ProcessInstanceInfo and
 VariableInstanceInfo.
 Can such a query be written?

 Thanks.





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




 --
 - http://salaboy.wordpress.com
 - 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




 --
 - http://salaboy.wordpress.com
 - http://www.jbug.com.ar
 - Salatino Salaboy Mauricio -




 --
 - http://salaboy.wordpress.com
 - 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




 --
 - http://salaboy.wordpress.com
 - 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




-- 
- http://salaboy.wordpress.com
- 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: Variable Persistence Strategies

2010-02-18 Thread Dale Wyttenbach
That's correct, it works fine using h2.  Thanks.

2010/2/18 Mauricio Salatino sala...@gmail.com

 Let me take a look at that too.. probably it's an oracle problem right? I
 mean, probably it just happen with oracle.. we can create a fix for that too


 2010/2/18 Dale Wyttenbach dale.wyttenb...@gmail.com

 My pleasure.

 Within ProcessInstanceInfo, I've got a similar observation about the
 eventTypes member.  'private SetEventType' is currently commented out in
 favor of 'private SetString'.  When using an Oracle hibernate dialect,
 this results in the DDL 'create table ProcessInstanceInfo_eventTypes' which
 yields the error 'ORA-00972: identifier is too long'.  I imagine this will
 be resolved when the String is promoted to EventType but I thought you might
 want to know.

 2010/2/13 Mauricio Salatino sala...@gmail.com

 done.. I will apply the patch into the trunk.. it seems to be correct.
 Thanks a lot!

 2010/2/13 Dale Wyttenbach dale.wyttenb...@gmail.com

 Please see attached.


 2010/2/12 Mauricio Salatino sala...@gmail.com

 I just want to make sure before apply the patch that the change will
 not impact in other places.
 Thanks


 On Fri, Feb 12, 2010 at 5:38 PM, Mauricio Salatino 
 sala...@gmail.comwrote:

 can you post both, previous and new, sql schema generated for the
 VariableInstanceInfo and ProcessInstanceInfo tables?



 2010/2/12 Dale Wyttenbach dale.wyttenb...@gmail.com

 If you try to write a query that
 requires VariableInstanceInfo.processId, it won't work because that 
 class
 has no processId member.
 I guessed that processInstanceId would be a better join column, and
 that worked (patch attached)

 Thanks for the reply.

 2010/2/12 Mauricio Salatino sala...@gmail.com

 Hmm..
 I'm looking at the source and I see the following mapping:

 @OneToMany(cascade = CascadeType.ALL)
 @JoinColumn(name = processId)
 @MapKey(name = name)
 private MapString, VariableInstanceInfo variables  =
 new HashMapString, VariableInstanceInfo();

 That makes me think that there is a join column called processId
 between VariableInstanceInfo and ProcessInstanceInfo.


 2010/2/12 Dale Wyttenbach dale.wyttenb...@gmail.com

 I have a patch for drools-persistence-jpa should anyone agree with
 me that ProcessInstanceInfo and VariableInstanceInfo should be joined 
 by
 processInstanceId.


 On Fri, Feb 12, 2010 at 10:52 AM, Dale Wyttenbach 
 dale.wyttenb...@gmail.com wrote:

 I'm trying to adapt the StringVariablePersister presented in
 http://blog.athico.com/2009/09/drools-flow-variable-persistence.html

 http://blog.athico.com/2009/09/drools-flow-variable-persistence.htmlI
 can create process instances with variable color:

   private static WorkflowProcessInstance
 startProcess(StatefulKnowledgeSession ksession, String color) {
 MapString, Object vars = new HashMapString, Object();
 vars.put(color, color);
 WorkflowProcessInstance p1 = (WorkflowProcessInstance)
 ksession.startProcess(com.sample.ruleflow, vars);
 return p1;
   }

 I can count them:

 select
 count(*)
 from
 ProcessInstanceInfo

 However I'm stymied as to counting process instances with a given
 color, as there appears to be no join column between 
 ProcessInstanceInfo and
 VariableInstanceInfo.
 Can such a query be written?

 Thanks.





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




 --
 - http://salaboy.wordpress.com
 - 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




 --
 - http://salaboy.wordpress.com
 - http://www.jbug.com.ar
 - Salatino Salaboy Mauricio -




 --
 - http://salaboy.wordpress.com
 - 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




 --
 - http://salaboy.wordpress.com
 - 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




 --
 - http://salaboy.wordpress.com
 - http://www.jbug.com.ar
 - Salatino Salaboy Mauricio -

 ___
 rules-users mailing list
 

Re: [rules-users] Drools Flow: Variable Persistence Strategies

2010-02-18 Thread Mauricio Salatino
The first patch is already in the trunk.
About the second problem, we are trying to remove the
@CollectionOfElements annotation, (because it's hibernate specific) that's
why you see the other one commented out. I will try fix it asap, to be able
to use toplink as persistence provider as well. Probably that will fix your
problem too.


2010/2/18 Dale Wyttenbach dale.wyttenb...@gmail.com

 That's correct, it works fine using h2.  Thanks.

 2010/2/18 Mauricio Salatino sala...@gmail.com

 Let me take a look at that too.. probably it's an oracle problem right? I
 mean, probably it just happen with oracle.. we can create a fix for that too


 2010/2/18 Dale Wyttenbach dale.wyttenb...@gmail.com

 My pleasure.

 Within ProcessInstanceInfo, I've got a similar observation about the
 eventTypes member.  'private SetEventType' is currently commented out in
 favor of 'private SetString'.  When using an Oracle hibernate dialect,
 this results in the DDL 'create table ProcessInstanceInfo_eventTypes' which
 yields the error 'ORA-00972: identifier is too long'.  I imagine this will
 be resolved when the String is promoted to EventType but I thought you might
 want to know.

 2010/2/13 Mauricio Salatino sala...@gmail.com

 done.. I will apply the patch into the trunk.. it seems to be correct.
 Thanks a lot!

 2010/2/13 Dale Wyttenbach dale.wyttenb...@gmail.com

 Please see attached.


 2010/2/12 Mauricio Salatino sala...@gmail.com

 I just want to make sure before apply the patch that the change will
 not impact in other places.
 Thanks


 On Fri, Feb 12, 2010 at 5:38 PM, Mauricio Salatino sala...@gmail.com
  wrote:

 can you post both, previous and new, sql schema generated for the
 VariableInstanceInfo and ProcessInstanceInfo tables?



 2010/2/12 Dale Wyttenbach dale.wyttenb...@gmail.com

 If you try to write a query that
 requires VariableInstanceInfo.processId, it won't work because that 
 class
 has no processId member.
 I guessed that processInstanceId would be a better join column, and
 that worked (patch attached)

 Thanks for the reply.

 2010/2/12 Mauricio Salatino sala...@gmail.com

 Hmm..
 I'm looking at the source and I see the following mapping:

 @OneToMany(cascade = CascadeType.ALL)
 @JoinColumn(name = processId)
 @MapKey(name = name)
 private MapString, VariableInstanceInfo variables  =
 new HashMapString, VariableInstanceInfo();

 That makes me think that there is a join column called processId
 between VariableInstanceInfo and ProcessInstanceInfo.


 2010/2/12 Dale Wyttenbach dale.wyttenb...@gmail.com

 I have a patch for drools-persistence-jpa should anyone agree with
 me that ProcessInstanceInfo and VariableInstanceInfo should be 
 joined by
 processInstanceId.


 On Fri, Feb 12, 2010 at 10:52 AM, Dale Wyttenbach 
 dale.wyttenb...@gmail.com wrote:

 I'm trying to adapt the StringVariablePersister presented in
 http://blog.athico.com/2009/09/drools-flow-variable-persistence.html

 http://blog.athico.com/2009/09/drools-flow-variable-persistence.htmlI
 can create process instances with variable color:

   private static WorkflowProcessInstance
 startProcess(StatefulKnowledgeSession ksession, String color) {
 MapString, Object vars = new HashMapString, Object();
 vars.put(color, color);
 WorkflowProcessInstance p1 = (WorkflowProcessInstance)
 ksession.startProcess(com.sample.ruleflow, vars);
 return p1;
   }

 I can count them:

 select
 count(*)
 from
 ProcessInstanceInfo

 However I'm stymied as to counting process instances with a given
 color, as there appears to be no join column between 
 ProcessInstanceInfo and
 VariableInstanceInfo.
 Can such a query be written?

 Thanks.





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




 --
 - http://salaboy.wordpress.com
 - 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




 --
 - http://salaboy.wordpress.com
 - http://www.jbug.com.ar
 - Salatino Salaboy Mauricio -




 --
 - http://salaboy.wordpress.com
 - 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




 --
 - http://salaboy.wordpress.com
 - http://www.jbug.com.ar
 - Salatino Salaboy Mauricio -

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 

[rules-users] Question on use of Timer node in rule flow

2010-02-18 Thread Alan . Gairey
I'm currently experimenting with including a Timer node within a rule 
flow.

My question is: what (if any) runtime state information is persisted by 
Drools Flow for a Timer node? I can recreate a session via a call to 
JPAKnowledgeService.loadStatefulKnowledgeSession, but if a process 
instance was previously on a Timer node, will it start from where it left 
off, or will the Timer delay start from the beginning again? For example, 
if I have a Timer node with a delay of 7 days, but the application is 
stopped / crashes after 6 days, then when I recreate my session, will the 
Timer node just wait 1 more day, or will the delay of 7 days start from 
scratch?

Thanks in advance for any help,

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


Re: [rules-users] Decision table list problem ?

2010-02-18 Thread Tihomir Surdilovic
On 2/18/10 2:51 AM, mklaric wrote:
 I have written this in my decision table, and i wan't to iterate over
 SubParamAttribute values, but it doesn't work, why ? The program runs
 normaly, but no action is fired.


 http://n3.nabble.com/file/n214823/ScreenShot020.jpg

Not sure how much your LHS pattern makes sense:

subList : SubParamAttribute(zs : value == $param) from subList

Did you mean instead something like:

subList : SubParamAttribute(value in ($1, $2, $3, $4))

(you would have to change the cell underneith Param Attribute Names to 
1,2,3,4 instead of having each on its separate row cell)





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


[rules-users] How to avoid clearing the rulebase in case of bad version of package found or no package found

2010-02-18 Thread Sartaj Shaik
HiWhile integrating the drools with my application, i have used the RuleAgent configuration properties as Rule Agent configuration file##newInstance = falsepoll = 30name = MyRuleAgentdir = C : /package_binariesI have put the binary file in the specified directory ( C : /package_binaries ). So it will scan the directory every 30 sec and update the ruleBase accordingly.My problem is, if i remove the binary package from the specified directory, it is scanning the directory and clearing the ruleBase (deleting).If we use the URL, even though the site is not up, or if there is no good version of package it won't effect the rulebase which is in the application. But in case of dir it is effecting the rulebase irrespective of binary package (whether it is good version/ bad or it is deleted).How can we avoid clearing the rulebase?ThanksSartaj ShaikTata Consultancy Services
=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



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


Re: [rules-users] Drools Flow: Variable Persistence Strategies

2010-02-18 Thread Dale Wyttenbach
Excellent, I have attached a unit test that demonstrates a query made
possible by the first patch, in case you are interested.  The unit test is
designed to run in your example DroolsFlowVPS project,
since StringVariablePersister is not part of drools-persistence-jpa.
 (Could StringVariablePersister be contributed to drools?)

2010/2/18 Mauricio Salatino sala...@gmail.com

 The first patch is already in the trunk.
 About the second problem, we are trying to remove the
 @CollectionOfElements annotation, (because it's hibernate specific) that's
 why you see the other one commented out. I will try fix it asap, to be able
 to use toplink as persistence provider as well. Probably that will fix your
 problem too.



 2010/2/18 Dale Wyttenbach dale.wyttenb...@gmail.com

 That's correct, it works fine using h2.  Thanks.

 2010/2/18 Mauricio Salatino sala...@gmail.com

 Let me take a look at that too.. probably it's an oracle problem right? I
 mean, probably it just happen with oracle.. we can create a fix for that too


 2010/2/18 Dale Wyttenbach dale.wyttenb...@gmail.com

 My pleasure.

 Within ProcessInstanceInfo, I've got a similar observation about the
 eventTypes member.  'private SetEventType' is currently commented out in
 favor of 'private SetString'.  When using an Oracle hibernate dialect,
 this results in the DDL 'create table ProcessInstanceInfo_eventTypes' which
 yields the error 'ORA-00972: identifier is too long'.  I imagine this will
 be resolved when the String is promoted to EventType but I thought you 
 might
 want to know.

 2010/2/13 Mauricio Salatino sala...@gmail.com

 done.. I will apply the patch into the trunk.. it seems to be correct.
 Thanks a lot!

 2010/2/13 Dale Wyttenbach dale.wyttenb...@gmail.com

 Please see attached.


 2010/2/12 Mauricio Salatino sala...@gmail.com

 I just want to make sure before apply the patch that the change will
 not impact in other places.
 Thanks


 On Fri, Feb 12, 2010 at 5:38 PM, Mauricio Salatino 
 sala...@gmail.com wrote:

 can you post both, previous and new, sql schema generated for the
 VariableInstanceInfo and ProcessInstanceInfo tables?



 2010/2/12 Dale Wyttenbach dale.wyttenb...@gmail.com

 If you try to write a query that
 requires VariableInstanceInfo.processId, it won't work because that 
 class
 has no processId member.
 I guessed that processInstanceId would be a better join column, and
 that worked (patch attached)

 Thanks for the reply.

 2010/2/12 Mauricio Salatino sala...@gmail.com

 Hmm..
 I'm looking at the source and I see the following mapping:

 @OneToMany(cascade = CascadeType.ALL)
 @JoinColumn(name = processId)
 @MapKey(name = name)
 private MapString, VariableInstanceInfo variables  =
 new HashMapString, VariableInstanceInfo();

 That makes me think that there is a join column called processId
 between VariableInstanceInfo and ProcessInstanceInfo.


 2010/2/12 Dale Wyttenbach dale.wyttenb...@gmail.com

 I have a patch for drools-persistence-jpa should anyone agree
 with me that ProcessInstanceInfo and VariableInstanceInfo should be 
 joined
 by processInstanceId.


 On Fri, Feb 12, 2010 at 10:52 AM, Dale Wyttenbach 
 dale.wyttenb...@gmail.com wrote:

 I'm trying to adapt the StringVariablePersister presented in
 http://blog.athico.com/2009/09/drools-flow-variable-persistence.html

 http://blog.athico.com/2009/09/drools-flow-variable-persistence.htmlI
 can create process instances with variable color:

   private static WorkflowProcessInstance
 startProcess(StatefulKnowledgeSession ksession, String color) {
 MapString, Object vars = new HashMapString, Object();
 vars.put(color, color);
 WorkflowProcessInstance p1 = (WorkflowProcessInstance)
 ksession.startProcess(com.sample.ruleflow, vars);
 return p1;
   }

 I can count them:

 select
 count(*)
 from
 ProcessInstanceInfo

 However I'm stymied as to counting process instances with a
 given color, as there appears to be no join column between
 ProcessInstanceInfo and VariableInstanceInfo.
 Can such a query be written?

 Thanks.





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




 --
 - http://salaboy.wordpress.com
 - 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




 --
 - http://salaboy.wordpress.com
 - http://www.jbug.com.ar
 - Salatino Salaboy Mauricio -




 --
 - http://salaboy.wordpress.com
 - http://www.jbug.com.ar
 - Salatino Salaboy Mauricio -

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 

Re: [rules-users] Drools Flow: Variable Persistence Strategies

2010-02-18 Thread Mauricio Salatino
Yes, of course, I add the VPS feature into drools so, I'm glad to see that
it's useful, I will add that persister, and if you are interested in do some
contributions with JCR will be nice too!
Thanks a lot for your contributions!

2010/2/18 Dale Wyttenbach dale.wyttenb...@gmail.com

 Excellent, I have attached a unit test that demonstrates a query made
 possible by the first patch, in case you are interested.  The unit test is
 designed to run in your example DroolsFlowVPS project,
 since StringVariablePersister is not part of drools-persistence-jpa.
  (Could StringVariablePersister be contributed to drools?)

 2010/2/18 Mauricio Salatino sala...@gmail.com

 The first patch is already in the trunk.
 About the second problem, we are trying to remove the
 @CollectionOfElements annotation, (because it's hibernate specific) that's
 why you see the other one commented out. I will try fix it asap, to be able
 to use toplink as persistence provider as well. Probably that will fix your
 problem too.



 2010/2/18 Dale Wyttenbach dale.wyttenb...@gmail.com

 That's correct, it works fine using h2.  Thanks.

 2010/2/18 Mauricio Salatino sala...@gmail.com

 Let me take a look at that too.. probably it's an oracle problem right? I
 mean, probably it just happen with oracle.. we can create a fix for that 
 too


 2010/2/18 Dale Wyttenbach dale.wyttenb...@gmail.com

 My pleasure.

 Within ProcessInstanceInfo, I've got a similar observation about the
 eventTypes member.  'private SetEventType' is currently commented out in
 favor of 'private SetString'.  When using an Oracle hibernate dialect,
 this results in the DDL 'create table ProcessInstanceInfo_eventTypes' 
 which
 yields the error 'ORA-00972: identifier is too long'.  I imagine this will
 be resolved when the String is promoted to EventType but I thought you 
 might
 want to know.

 2010/2/13 Mauricio Salatino sala...@gmail.com

 done.. I will apply the patch into the trunk.. it seems to be correct.
 Thanks a lot!

 2010/2/13 Dale Wyttenbach dale.wyttenb...@gmail.com

 Please see attached.


 2010/2/12 Mauricio Salatino sala...@gmail.com

 I just want to make sure before apply the patch that the change will
 not impact in other places.
 Thanks


 On Fri, Feb 12, 2010 at 5:38 PM, Mauricio Salatino 
 sala...@gmail.com wrote:

 can you post both, previous and new, sql schema generated for the
 VariableInstanceInfo and ProcessInstanceInfo tables?



 2010/2/12 Dale Wyttenbach dale.wyttenb...@gmail.com

 If you try to write a query that
 requires VariableInstanceInfo.processId, it won't work because that 
 class
 has no processId member.
 I guessed that processInstanceId would be a better join column,
 and that worked (patch attached)

 Thanks for the reply.

 2010/2/12 Mauricio Salatino sala...@gmail.com

 Hmm..
 I'm looking at the source and I see the following mapping:

 @OneToMany(cascade = CascadeType.ALL)
 @JoinColumn(name = processId)
 @MapKey(name = name)
 private MapString, VariableInstanceInfo variables
 = new HashMapString, VariableInstanceInfo();

 That makes me think that there is a join column called processId
 between VariableInstanceInfo and ProcessInstanceInfo.


 2010/2/12 Dale Wyttenbach dale.wyttenb...@gmail.com

 I have a patch for drools-persistence-jpa should anyone agree
 with me that ProcessInstanceInfo and VariableInstanceInfo should 
 be joined
 by processInstanceId.


 On Fri, Feb 12, 2010 at 10:52 AM, Dale Wyttenbach 
 dale.wyttenb...@gmail.com wrote:

 I'm trying to adapt the StringVariablePersister presented in
 http://blog.athico.com/2009/09/drools-flow-variable-persistence.html

 http://blog.athico.com/2009/09/drools-flow-variable-persistence.htmlI
 can create process instances with variable color:

   private static WorkflowProcessInstance
 startProcess(StatefulKnowledgeSession ksession, String color) {
 MapString, Object vars = new HashMapString, Object();
 vars.put(color, color);
 WorkflowProcessInstance p1 = (WorkflowProcessInstance)
 ksession.startProcess(com.sample.ruleflow, vars);
 return p1;
   }

 I can count them:

 select
 count(*)
 from
 ProcessInstanceInfo

 However I'm stymied as to counting process instances with a
 given color, as there appears to be no join column between
 ProcessInstanceInfo and VariableInstanceInfo.
 Can such a query be written?

 Thanks.





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




 --
 - http://salaboy.wordpress.com
 - 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




 --
 - http://salaboy.wordpress.com
 - 

Re: [rules-users] Decision table list problem ?

2010-02-18 Thread mklaric

So there is no way of iterating throught list with values put vertically in a
column ?
But doesn't your solution gives me just if element in iteration is in some
group of values let's say (1,2,3)?
Le't say i have a list of 2 SubParamAttribute. One having value==1, and
another value==2.I wan't my list
to iterate in the first column and when value 1 in cell is equal to value==1
from SubParamAttribute to catch in column one that SubParamAttribute with
has value=1, so I can send that SubParamAttribute to the next column because
my SubParamAttribute has another list of other values to iterate ? Is it
possible ?


-- 
View this message in context: 
http://n3.nabble.com/Decision-table-list-problem-tp214823p216823.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users