Re: [rules-users] Guvnor - archival option

2011-01-10 Thread Tihomir Surdilovic
You can try to add the following in your repository.xml 
(Workspace's PersistenceManager section):
param name=consistencyCheck value=true/

and if you want to do both a check and repair:
param name=consistencyCheck value=true/
param name=consistencyFix value=true/

..and restart Guvnor.

Another thing you can try is to check and fix possibly corrupted search 
indexes, for this in the SearchIndex class=... element of your 
repository.xml you can add parameters:
param name=enableConsistencyCheck value=true/
param name=forceConsistencyCheck value=true/

to do a repair as well, add:
param name=autoRepair value=true/

...and restart Guvnor.

I would strongly recommend backing up you repository before trying this.
Hope it helps.

Thanks.
Tihomir

On 1/9/11 11:03 PM, Jervis Liu wrote:
 On 2011/1/6 22:39, Rob Fisher wrote:
 I'm using version 5.1.1

 I can't find any reference to the rule anywhere in the package, yet it
 seems to be seeing it when trying to create a rule with the same name.

 Hi, I verified guvnor 5.1.1, still can not reproduce the problem you
 reported. If you believe you still have this problem, you can send me a
 repository dump with detailed instruction on how to reproduce so that I
 can take a further look. Thanks.

 Cheers,
 Jervis

 Rob Fisher
 Systems Analyst, Agency Awards
 Desk 309-735-4136
 Cell  309-660-4957


 -Original Message-
 From: rules-users-boun...@lists.jboss.org
 [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Jervis Liu
 Sent: Thursday, January 06, 2011 1:58 AM
 To: Rules Users List
 Subject: Re: [rules-users] Guvnor - archival option

 What version of Guvnor are you using? I am not able to reproduce this
 problem on trunk.

 Thanks,
 Jervis

 Rob Fisher wrote:
 I archived a rule, then deleted it within Administration\Archive
 (using the Delete selected asset option). However, when trying to
 create a rule with the same name, I receive the following message: An
 asset with that name already exists in the chosen package. Please use
 another name. I do not see the rule under Archive any longer (since
 it was deleted). It seems, however, to still be recognized within the
 repository.

 Anyone know how to solve this?

 Thanks

 Rob Fisher**

 --
 --

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

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

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


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


[rules-users] Why won't this work? (Conjunction + Disjunction over a set)

2011-01-10 Thread OlliSee

Hello there and a happy new year to everyone reading :) 

Why am I here again? Yep, got a problem. Don't know why it doesn't work. I'm
using the latest snapshot version.
So here it goes.

A simple rule with conjunction and disjunction but over a set of events.

when
$ldes : Set(size == 2) from collect(LoopDetectorEvent() over
window:length(2))
(or LoopDetectorEvent($t1 : transportation == LKW, $id1 : 
eventID) from
$ldes
LoopDetectorEvent($t2 : transportation == PKW, $id2 : 
eventID) from
$ldes) 
LoopDetectorEvent($t3 : transportation == BUS, $id3 : 
eventID) from
$ldes

So, what the rule says: fire when there's a BUS event plus either a LKW or
PKW event in the set.

But, instead I get a big exception. It's posted at the end.

Interestingly, it works if I don't use the Set, like this... 

when
(or $e1 : LoopDetectorEvent($t1 : transportation == PKW, $id1 
: eventID)
over window:length(1)
$e2 : LoopDetectorEvent($t2 : transportation == LKW, $id2 : 
eventID)
over window:length(1))
LoopDetectorEvent($t3 : transportation == BUS, $id3 : 
eventID) over
window:length(1)

but that rule does not have the same meaning. So it's useless for me.
Besides, it DOES work with the set if I just cut the third event out (the
BUS event).

What is wrong here?

Thanks in advance.
Kind regards!
Oliver


Exception in thread Thread-2 java.lang.ClassCastException:
org.drools.reteoo.InitialFactImpl cannot be cast to
trafficsys.domain.events.LoopDetectorEvent
at
org.drools.base.trafficsys.domain.events.LoopDetectorEvent446196$getTransportation.getValue(Unknown
Source)
at org.drools.base.ClassFieldReader.getValue(ClassFieldReader.java:91)
at
org.drools.base.evaluators.EqualityEvaluatorsDefinition$StringEqualEvaluator.evaluate(EqualityEvaluatorsDefinition.java:1961)
at 
org.drools.rule.LiteralRestriction.isAllowed(LiteralRestriction.java:92)
at 
org.drools.rule.LiteralConstraint.isAllowed(LiteralConstraint.java:109)
at
org.drools.reteoo.FromNode.checkConstraintsAndPropagate(FromNode.java:264)
at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:138)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:64)
at
org.drools.reteoo.FromNode.checkConstraintsAndPropagate(FromNode.java:279)
at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:138)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:64)
at
org.drools.reteoo.AccumulateNode.evaluateResultConstraints(AccumulateNode.java:662)
at 
org.drools.reteoo.AccumulateNode.assertObject(AccumulateNode.java:270)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at 
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:190)
at 
org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:145)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1187)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1089)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:893)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:238)
at trafficsys.SessionInterface.insertAndFire(SessionInterface.java:133)
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Why-won-t-this-work-Conjunction-Disjunction-over-a-set-tp2227002p2227002.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] Need help with Decision Table Conditions

2011-01-10 Thread Tihomir Surdilovic

Hi Jason,
for fact types and attributes you should be able to reuse the Functions 
keyword in the RuleSet section of your sheet, for example:


---
| Functions | declare Person @author( Bob ) . end |
---

For rule attributes you can reuse the I keyword as the cell header and 
add the attributes, for example:


-
|RuleTable Sample|   
|   |

-
| Condition   |I  | 
Action|

-
| $p : Person|   | 
  |

-
| name==$param|   ||
-
|   SomeName   | @author( Bob )   |  System.out.|
-

Neither are optimal, but just workarounds. If you raise a Jira, I can 
put on todo list.

Hope this helps.

Thanks.
Tihomir

On 1/7/11 9:35 PM, Jason Mihalick wrote:
Tihomir, Do you know if decision tables support metadata 
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html_single/index.html#d0e3368? 



View this message in context: Re: Need help with Decision Table 
Conditions 
http://drools-java-rules-engine.46999.n3.nabble.com/Need-help-with-Decision-Table-Conditions-tp2195003p2215160.html
Sent from the Drools - User mailing list archive 
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.html 
at Nabble.com.



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


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


Re: [rules-users] Drools Human Task Service Persistence

2011-01-10 Thread ramram

Hi Man,

Thanks for the reply. I have noticed it and I think that it is like u r
stating some bug related to Hibernate. I will try other version of Hibernate
and check its result. 

Thnx for the tip and for the help :D
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Human-Task-Service-Persistence-tp1868778p2227215.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] Why won't this work? (Conjunction + Disjunction over a set)

2011-01-10 Thread Edson Tirelli
   Looks like a bug on the offset calculation of the last from
pattern. Can you please open a JIRA with the information from your
e-mail?

   Meanwhile, as a workaround, try to use the or as the last CE in
your rule, i.e.:

when
$ldes : Set(size == 2) from collect(LoopDetectorEvent() over
window:length(2))
LoopDetectorEvent($t3 : transportation == BUS, $id3 : eventID) from $ldes
(or LoopDetectorEvent($t1 : transportation == LKW, $id1 :
eventID) from $ldes
 LoopDetectorEvent($t2 : transportation == PKW, $id2 :
eventID) from $ldes)


Edson


2011/1/10 OlliSee o.ro...@seeburger.de:

 Hello there and a happy new year to everyone reading :)

 Why am I here again? Yep, got a problem. Don't know why it doesn't work. I'm
 using the latest snapshot version.
 So here it goes.

 A simple rule with conjunction and disjunction but over a set of events.

        when
                $ldes : Set(size == 2) from collect(LoopDetectorEvent() over
 window:length(2))
                (or LoopDetectorEvent($t1 : transportation == LKW, $id1 : 
 eventID) from
 $ldes
                LoopDetectorEvent($t2 : transportation == PKW, $id2 : 
 eventID) from
 $ldes)
                LoopDetectorEvent($t3 : transportation == BUS, $id3 : 
 eventID) from
 $ldes

 So, what the rule says: fire when there's a BUS event plus either a LKW or
 PKW event in the set.

 But, instead I get a big exception. It's posted at the end.

 Interestingly, it works if I don't use the Set, like this...

        when
                (or $e1 : LoopDetectorEvent($t1 : transportation == PKW, 
 $id1 : eventID)
 over window:length(1)
                $e2 : LoopDetectorEvent($t2 : transportation == LKW, $id2 : 
 eventID)
 over window:length(1))
                LoopDetectorEvent($t3 : transportation == BUS, $id3 : 
 eventID) over
 window:length(1)

 but that rule does not have the same meaning. So it's useless for me.
 Besides, it DOES work with the set if I just cut the third event out (the
 BUS event).

 What is wrong here?

 Thanks in advance.
 Kind regards!
 Oliver


 Exception in thread Thread-2 java.lang.ClassCastException:
 org.drools.reteoo.InitialFactImpl cannot be cast to
 trafficsys.domain.events.LoopDetectorEvent
        at
 org.drools.base.trafficsys.domain.events.LoopDetectorEvent446196$getTransportation.getValue(Unknown
 Source)
        at org.drools.base.ClassFieldReader.getValue(ClassFieldReader.java:91)
        at
 org.drools.base.evaluators.EqualityEvaluatorsDefinition$StringEqualEvaluator.evaluate(EqualityEvaluatorsDefinition.java:1961)
        at 
 org.drools.rule.LiteralRestriction.isAllowed(LiteralRestriction.java:92)
        at 
 org.drools.rule.LiteralConstraint.isAllowed(LiteralConstraint.java:109)
        at
 org.drools.reteoo.FromNode.checkConstraintsAndPropagate(FromNode.java:264)
        at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:138)
        at
 org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
        at
 org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:64)
        at
 org.drools.reteoo.FromNode.checkConstraintsAndPropagate(FromNode.java:279)
        at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:138)
        at
 org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
        at
 org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:64)
        at
 org.drools.reteoo.AccumulateNode.evaluateResultConstraints(AccumulateNode.java:662)
        at 
 org.drools.reteoo.AccumulateNode.assertObject(AccumulateNode.java:270)
        at
 org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
        at
 org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
        at 
 org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:190)
        at 
 org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:145)
        at
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1187)
        at
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1089)
        at
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:893)
        at
 org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:238)
        at trafficsys.SessionInterface.insertAndFire(SessionInterface.java:133)
 --
 View this message in context: 
 http://drools-java-rules-engine.46999.n3.nabble.com/Why-won-t-this-work-Conjunction-Disjunction-over-a-set-tp2227002p2227002.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




-- 
  Edson Tirelli
  JBoss Drools 

[rules-users] writing correct drool rule

2011-01-10 Thread Odelya Holiday
Hi!

I am actually using jBPM5 but the rules are in drools.

I created the following DSL file:

[condition][]There is a new program request=$processInstance: 
WorkflowProcessInstance() AND $requestData: RequestData()

[consequence][]Select an officers for {requestData.genre} 
program=CollectionOfficer officers = CollectionOfficer 
officers.get(GenreType.{requestData.genre}))

[consequence][]Select an officer for {requestData.cost} program=

[consequence][]Initialize Process=$processInstance.setVariable(officers, 
officers);

Officer object looks like this:
Name
Mincost
Maxcost

So on the 1st consequence I get all the officers that their genre type is as in 
the request data
In the 2nd consequence I get all the officers that their mincost  
requestData.cost and maxcost  requestData.cost

How can I write it in drools rule?

Thanks!

Odelya Holiday



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


Re: [rules-users] Need help with Decision Table Conditions

2011-01-10 Thread Wolfgang Laun
I would not use I / DESCRIPTION for these reasons:

   - it's not parameterized, and I think you don't want to repeat the
   @Meta(...) for every rule, you just want the argument
   - you can use only one I column, since the 2nd one silently overwrites
   the 1st one, so you'll have to squeeze multiple @s into one cell
   - it is an undocumented feature, and the name would suggest that it was
   intended for providing a comment

Adding a proper metadata column type is simple, given what is available from
other column types.

-W

2011/1/10 Tihomir Surdilovic tsurd...@redhat.com

  Hi Jason,
 for fact types and attributes you should be able to reuse the Functions
 keyword in the RuleSet section of your sheet, for example:

 ---
 | Functions | declare Person @author( Bob ) . end |
 ---

 For rule attributes you can reuse the I keyword as the cell header and
 add the attributes, for example:

 -
 |RuleTable Sample|
 |   |
 -
 | Condition   |I  |
 Action|
 -
 | $p : Person|   |
|
 -
 | name==$param|   |
 |
 -
 |   SomeName   | @author( Bob )   |  System.out.|
 -

 Neither are optimal, but just workarounds. If you raise a Jira, I can put
 on todo list.
 Hope this helps.

 Thanks.
 Tihomir

 On 1/7/11 9:35 PM, Jason Mihalick wrote:

 Tihomir, Do you know if decision tables support 
 metadatahttp://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html_single/index.html#d0e3368?

 --
 View this message in context: Re: Need help with Decision Table 
 Conditionshttp://drools-java-rules-engine.46999.n3.nabble.com/Need-help-with-Decision-Table-Conditions-tp2195003p2215160.html
 Sent from the Drools - User mailing list 
 archivehttp://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.htmlat
  Nabble.com.


 ___
 rules-users mailing 
 listrules-us...@lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-users



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


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


Re: [rules-users] Need help with Decision Table Conditions

2011-01-10 Thread Tihomir Surdilovic
Hi Wolfgang, good points, thus I asked for a Jira so we can add proper 
support for it.
If you know of a better workaround with whats currently available let us 
know.


Thanks.

On 1/10/11 10:13 AM, Wolfgang Laun wrote:

I would not use I / DESCRIPTION for these reasons:

* it's not parameterized, and I think you don't want to repeat the
  @Meta(...) for every rule, you just want the argument
* you can use only one I column, since the 2nd one silently
  overwrites the 1st one, so you'll have to squeeze multiple @s
  into one cell
* it is an undocumented feature, and the name would suggest that
  it was intended for providing a comment

Adding a proper metadata column type is simple, given what is 
available from other column types.


-W

2011/1/10 Tihomir Surdilovic tsurd...@redhat.com 
mailto:tsurd...@redhat.com


Hi Jason,
for fact types and attributes you should be able to reuse the
Functions keyword in the RuleSet section of your sheet, for example:

---
| Functions | declare Person @author( Bob ) . end |
---

For rule attributes you can reuse the I keyword as the cell
header and add the attributes, for example:

-
|RuleTable Sample|  
|   |

-
| Condition   |I  |
Action|

-
| $p : Person|   |
  |

-
| name==$param|  
||

-
|   SomeName   | @author( Bob )   |  System.out.|
-

Neither are optimal, but just workarounds. If you raise a Jira, I
can put on todo list.
Hope this helps.

Thanks.
Tihomir

On 1/7/11 9:35 PM, Jason Mihalick wrote:

Tihomir, Do you know if decision tables support metadata

http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html_single/index.html#d0e3368?


View this message in context: Re: Need help with Decision Table
Conditions

http://drools-java-rules-engine.46999.n3.nabble.com/Need-help-with-Decision-Table-Conditions-tp2195003p2215160.html
Sent from the Drools - User mailing list archive

http://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.html
at Nabble.com.


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



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



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


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


Re: [rules-users] Need help with Decision Table Conditions

2011-01-10 Thread Jason Mihalick

Thanks Tihomir.  I will submit a JIRA ticket for this, as I definitely could
use this feature.
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Need-help-with-Decision-Table-Conditions-tp2195003p2227739.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] Grouping and Aggregation in Drools

2011-01-10 Thread Manav
Thanks for the quick response Wolfgang. Appreciate it. 

I have a question about this line in the rule you specified below
  not Category( $sup == name, cart == $cart )
What should this name be ? How will this be determined at runtime ? 

Also would you mind how these rules work . I tried to implement it but could 
not 
make much progress. 


On the other hand i tried with a slightly different approach. My use-case is 
the 
Customer will have 

an actual cart and a suggested cart when they are made available in the working 
memory. Here's the rule : -

rule Test 1
when
 Customer ($actual_cart : actual_cart, $reference_cart : reference_cart)
 $item : CartItem () from $actual_cart
 $category_limit : Category (category == $item.category, $limit : 
categoryLimit) 
from $reference_cart
 
 // This will accumulate as many times as the category exists in the actual_cart
 $total : Double() 
    from accumulate ( CartItem (category == $item.category, $value : 
actual_value) from $actual_cart,
     sum ($value)
     )
 //if there's no row in the reference_Cart for specified category then $limit 
should be set to zero. 

 eval ($total   $limit)      
then
 //record the category where the excess items has been purchased
end

There are some obvious issues with the approach that i have outlined above. 
Wonder if there's some way to get around them.

Regards,
Manav


- Original Message 
From: Wolfgang Laun wolfgang.l...@gmail.com
To: Manav manav7...@yahoo.com; Rules Users List rules-users@lists.jboss.org
Sent: Sat, January 8, 2011 3:09:12 PM
Subject: Re: [rules-users] Grouping and Aggregation in Drools

A Category combines a name, a reference to the cart, a sum of article
values and a percentage.

Any change in the cart triggers an update of all associated Category
facts. The rules are quite simple. The update of the cart (not shown
here) must be run with higher salience.

rule first super
  $cart. Cart( $tot: total )
  $art: Article( $cart: cart, $val: value, $sup. super, $sub: sub )
  not Category( $sup == name, cart == $cart )
then
  insert( new Category( $sup, $car, $val, $val/$tot ) );
end

rule next super
  $cart. Cart( $tot: total )
  $art: Article( $cart: cart, $val: value, $sup. super, $sub: sub )
  $cat: Category( $sup == name, cart == $cart )
then
  Double newVal =$cat.getValue() + $val;
  modify( $cat ){
    setValue( newVal ),
    setPercent( newVal / tot )
  }
end

Almost identical rules handle sub-categories.

For removal from the cart, you can use the same rule if the article
value is negative.

Make sure to avoid division by 0 if the last item is removed from the cart.

The reference cart is similar in structure, and the comparison rule is
generic for all categories.

-W



On 08/01/2011, Manav manav7...@yahoo.com wrote:
 Hi,
 I have a slightly tricky problem on my hand that i am trying to solve using
 rules.

 I am using version 5.1 of Drools.Appreciate if there are any suggestions /
 pointers .


 I have a customer who will have a shopping cart with various products. For
 example

 the shopping cart will be a list of products that belong to a certain
 sub-category and

 super category like

 product-id= 'Noodles', sub-category='PackagedFood',
 super-category='FMCG-Food',
 %value of total=3%
 product-id= 'Cookies',
 sub-category='PackagedFood',super-category='FMCG-Food',
 %value of total=6%
 product-id= 'Pizza', sub-category='ReadyToEat',super-category='FMCG-Food',
 %value of total=5%
 product-id= 'Burgers', sub-category='ReadyToEat',super-category='FMCG-Food',
 %value of total=7%
 product-id= 'Shampoo',
 sub-category='Toiletaries',super-category='FMCG-NonFood',
 %value of total=4%
 product-id= 'Conditioner',
 sub-category='Toiletaries',super-category='FMCG-NonFood', %value of total=8%

 The customer will also have a suggested cart that serves as a reference at
 the
 sub-category and supercategory level. The reference will tell what level of
 his
 total purchase he can spend on the sub-category and super-category. The
 reference will look something like


 super-category='FMCG-Food', %value-suggested=20%
 super-category='FMCG-NonFood', %value-suggested=15%
 sub-category='PackagedFood',%value-suggested=10%
 sub-category='ReadyToEat',%value-suggested=10%
 sub-category='Toiletaries',%value-suggested=6%

 Looking at this example the customer is going overboard in the FMCG-Food
 super
 category as the suggested

 limit is 20% and the actual grouped at the supsercategory is 21% . Also he
 is
 crossing the limit at the

 sub-category level for ReadyToEat (suggested is 10% vs actual is 12%) and
 Toiletaries (suggested is 6% vs actual 12%)

 My problem is how do i  group the actual data at various supercategory
 level,
 sum the %value and then compare it with the suggested in the when clause.


 If they cross the limit i will then have some action taken in the then
 clause.
 Similarly i will have to do the same at the sub-category level as well.
 Regards,
 Manav





 

Re: [rules-users] Need help with Decision Table Conditions

2011-01-10 Thread Jason Mihalick

JIRA Issue added here:  https://issues.jboss.org/browse/JBRULES-2866
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Need-help-with-Decision-Table-Conditions-tp2195003p2227963.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] Using GlobalArea in Guvnor

2011-01-10 Thread Dean Whisnant
The specific error message I was getting is:

Unable to save this asset, as it has been recently updated by [admin]

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Dean Whisnant
Sent: Monday, January 10, 2011 3:36 PM
To: Rules Users List
Subject: Re: [rules-users] Using GlobalArea in Guvnor

As a follow-on to this question, will anything need to be done with the current 
repository if I grabbed a more current drools-guvnor.war file from the snapshot?

I downloaded 
https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/target/drools-5.2.0-SNAPSHOT-guvnor.war
 and replaced my old war file (5.1).  Everything comes up, but when I tried to 
import a new POJO into a new package it wouldn't allow me to save.  

Could this be an artifact that I need to reset (convert) the repository?  Or is 
it because I didn't unpack the war file and reset the security to what I had it 
as before?

Thanks

Dean

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Jervis Liu
Sent: Thursday, December 16, 2010 9:29 PM
To: Rules Users List
Subject: Re: [rules-users] Using GlobalArea in Guvnor

On 2010/12/17 0:41, Dean Whisnant wrote:
 Jervis,

 I see that it looks like you worked on and resolved this in drools-5.2.M1 
 this morning.

 This is a noob question, but when or how can I get my hands on this fix?  
 It's funny because I ran into this same issue today while trying to do 
 something similar to John.

You can grab the latest snapshot from this place: 
https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/

Or you can wait for Drools 5.2.M1. It should come out next week if things go 
well.

Cheers,
Jervis

 Thanks

 Dean

 -Original Message-
 From: rules-users-boun...@lists.jboss.org
 [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Jervis Liu
 Sent: Wednesday, December 15, 2010 8:30 AM
 To: rules-users@lists.jboss.org
 Subject: Re: [rules-users] Using GlobalArea in Guvnor

 This is a bug. I've filed jira
 https://issues.jboss.org/browse/GUVNOR-1124. I will take a look into this 
 jira next week.

 Thanks,
 Jervis

 On 2010/12/15 2:24, John Peterson wrote:
 I'm working with Guvnor 5.1.1 and I'm having an issue accessing
 Declarative Models defined in the Global Area in the Packages.  Is 
 it possible to create a shared model in the Global Area and then 
 write rules against them in other packages?  It would seem to me 
 that the answer would be yes (why else have a Global area), but, 
 for some reason, it doesn't seem to recognize them.

 Here's a scenario:

 I declare a DeclarativeModel in GlobalArea:

 GenericFact
 id: Integer
 valueOne: Integer
 label: String
 end

 I have a package called com.experiment.  I'd like to write Business
 Rule
 in it using that GenericFact.  However, when I click the + sign 
 to
 add
 a Fact, I see a yellow background over Note: No model has been 
 defined.  Is there something that needs to be done to make the 
 GlobalArea stuff viewable from the individual packages?

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

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

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

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

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


Re: [rules-users] Integrating Guvnor with Oracle 11g

2011-01-10 Thread Tihomir Surdilovic
Hi David, see the attached repository.xml template for Oracle11 that you 
can use. You will need to replace all occurrences of @DRIVER, @URL, 
@USERNAME, and @PASSWORD

with your concrete values.

Not sure what Guvnor version is used but if your using trunk, the 
Administration tab has a Repository Configuration section which can 
help you create this repository.xml, and also help if you want to use JNDI.


Thanks.
Tihomir

On 1/10/11 3:34 PM, ergh99 wrote:
Has anyone tried this? I'm trying to configure Guvnor to store its 
repository in an Oracle 11g database, but having no luck. Wanted to 
know if anyone has had experience with this combination.


--
David Stern
Blaze  J2EE specialist
mobile: 904.874.2685


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


?xml version=1.0?
!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the License); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an AS IS BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
--
!DOCTYPE Repository PUBLIC -//The Apache Software Foundation//DTD Jackrabbit 1.4//EN
http://jackrabbit.apache.org/dtd/repository-1.4.dtd;
!-- Example Repository Configuration File --
Repository
!--
virtual file system where the repository stores global state
(e.g. registered namespaces, custom node types, etc.)
--
!--
FileSystem class=org.apache.jackrabbit.core.fs.local.LocalFileSystem
param name=path value=${rep.home}/repository/
/FileSystem
--
FileSystem class=org.apache.jackrabbit.core.fs.db.OracleFileSystem
	param name=driver value=@DRIVER/
	param name=url value=@URL /
	param name=schema value=oracle/
	param name=user value=@USERNAME/
	param name=password value=@PASSWORD/
	param name=schemaObjectPrefix value=FS_/
/FileSystem
!--
security configuration
--
Security appName=Jackrabbit
!--
access manager:
class: FQN of class implementing the AccessManager interface
--
AccessManager class=org.apache.jackrabbit.core.security.SimpleAccessManager
!-- param name=config value=${rep.home}/access.xml/ --
/AccessManager

LoginModule class=org.apache.jackrabbit.core.security.SimpleLoginModule
   !-- anonymous user name ('anonymous' is the default value) --
   !-- param name=anonymousId value=anonymous/ --
   !--
  default user name to be used instead of the anonymous user
  when no login credentials are provided (unset by default)
   --
   !-- param name=defaultUserId value=superuser/ --
/LoginModule
/Security

!--
location of workspaces root directory and name of default workspace
--
Workspaces rootPath=${rep.home}/workspaces defaultWorkspace=default/
!--
workspace configuration template:
used to create the initial workspace if there's no workspace yet
--
Workspace name=${wsp.name}
!--
virtual file system of the workspace:
class: FQN of class implementing the FileSystem interface
--

!--
FileSystem class=org.apache.jackrabbit.core.fs.local.LocalFileSystem
param name=path value=${wsp.home}/
/FileSystem
--
		
		FileSystem class=org.apache.jackrabbit.core.fs.db.OracleFileSystem
			param name=driver value=@DRIVER/
			param name=url value=@URL /
			param name=schema value=oracle/
			param name=user value=@USERNAME /
			param name=password value=@PASSWORD /
			param name=schemaObjectPrefix value=FS_WS_${wsp.name}_/
		/FileSystem
!--
persistence manager of the workspace:
class: FQN of class implementing the PersistenceManager interface
--
		PersistenceManager class=org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager
			param name=driver value=@DRIVER/
			param name=url value=@URL /
			param name=schema value=oracle/
			param name=user value=@USERNAME /
			param name=password value=@PASSWORD /
			param name=schemaObjectPrefix value=PM_WS_${wsp.name}_ /
		/PersistenceManager

!--
Search index and the file system it uses.
class: FQN of class implementing the QueryHandler interface
--
SearchIndex 

Re: [rules-users] Drools 5.1 JMX Monitoring.

2011-01-10 Thread plugtreelabs

Benson, I think you'll find the next post very useful

http://lucazamador.wordpress.com/2011/01/07/drools-metrics-persistence/

Hope it helps.


-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-5-1-JMX-Monitoring-tp2196951p2230790.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] Mythic Game Project Addition Artificial Intelligence and Quest System Components

2011-01-10 Thread Mark Proctor
http://blog.athico.com/2011/01/mythic-game-project-addition-artificial.html

In this project, we describe the design decisions and principles behind 
the arti cial intelligence (AI) for a multiplayer online role playing 
game, and our use of an expert system to implement it. We explain how we 
organize AI rules into les, how those rules are assembled from a 
database, how AI is assigned to entities, the di erent types of AI, the 
di erent phases of AI, and how we manage facts used by AI. We also 
review some of the history behind the Mythic project, where it is 
headed, what an expert system is and why we chose to use one for our 
project. The result of our project is a design that allows us to have 
diverse AI behavior and exibility to reuse code to create new behaviors, 
but may prove to be ineffcient if implemented on systems with many 
players or many instances of AI running.

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


[rules-users] Guvnor and dynamic classes...

2011-01-10 Thread bob.breitling

Hello all,

We have a situation where we need the Guvnor to extend a classes getters and
setters dynamically using Reflection, so the list of fields in the
Constraints GUI will show many fields that are not part of the concrete
class. 

Is there an API to modify the Guvnor in this way? or do we need to just get
the sources and start hacking?  Is this something that could be done easily? 
I already have the code to dynamically add the getters and setters to a
class on the fly.  I just need to add it to the Guvnor.

Thanks in advance.

Bob
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-dynamic-classes-tp2231415p2231415.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] Guvnor and dynamic classes...

2011-01-10 Thread Tihomir Surdilovic
What comes to mind is AOP and load-time-weaving with weaving agent(s). 
This should avoid hacking on Guvnor code altogether.

Thanks.
Tihomir
On 1/10/11 6:25 PM, bob.breitling wrote:
 Hello all,

 We have a situation where we need the Guvnor to extend a classes getters and
 setters dynamically using Reflection, so the list of fields in the
 Constraints GUI will show many fields that are not part of the concrete
 class.

 Is there an API to modify the Guvnor in this way? or do we need to just get
 the sources and start hacking?  Is this something that could be done easily?
 I already have the code to dynamically add the getters and setters to a
 class on the fly.  I just need to add it to the Guvnor.

 Thanks in advance.

 Bob

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