[rules-users] Problem with CEP/Fusion rules in Guvnor and RuleAgent: unable to determine operator for symbol [after]

2010-07-15 Thread Michael Legart
Hello Drools users

Given the following simple test rule:

rule test rule 1
when
$e : Event();
not( Event(id == $e.id  this after[0s,10s] $e ) )
then
System.out.println(Hello);
end

placed in Guvnor and the following simple test project:

ruleagent.properties:
url=http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/defaultPackage/LATEST

TestRuleAgent.java:

RuleAgent agent = 
RuleAgent.newRuleAgent(/ruleagent.properties);
RuleBase rb = agent.getRuleBase();

throws the following exception:

Exception in thread main org.drools.RuntimeDroolsException: unable to 
determine operator for symbol [after]
at 
org.drools.base.evaluators.Operator.determineOperator(Operator.java:71)
at org.drools.base.evaluators.Operator.readResolve(Operator.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at 
java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1061)
at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
[cut objectinputstream lines]
at 
org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:189)
at 
org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:158)
at org.drools.agent.HttpClientImpl.fetchPackage(HttpClientImpl.java:50)
at org.drools.agent.URLScanner.readPackage(URLScanner.java:148)
at org.drools.agent.URLScanner.getChangeSet(URLScanner.java:120)
at org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:96)
at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:410)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:362)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:347)
at org.drools.agent.RuleAgent.init(RuleAgent.java:247)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:187)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:147)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:256)
at ruleagent.RuleAgentTest.main(RuleAgentTest.java:16)

any ideas to what I am doing wrong here?

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


Re: [rules-users] Implementing Timers With Drools Persistence Enabled

2010-07-15 Thread Tan Hui Onn
I just found out that this is a (fixed) known issue:
https://jira.jboss.org/browse/JBRULES-2552
Deadlock when using fireUntilHalt on SingleSessionCommandService


On Tue, Jul 13, 2010 at 7:49 PM, Tan Hui Onn hui...@gmail.com wrote:
 Hi Nick,

 You are absolutely right that the timer is not triggered in
 CommandBasedStatefulKnowledgeSession (which is used for JPA
 persistence). I have spent some time to troubleshoot it. There is some
 finding regarding to this problem. Maybe other experts are willing to
 solve it.

 In org.drools.persistence.processinstance.JPASignalManager, when the
 signal is triggered in method
 signalEvent(long processInstanceId,
                            String type,
                            Object event),
 the thread is blocked in
     commandService.execute(command);

 I used debugger to trace it, and found that
 SingleSessionCommandService.execute(GenericCommandT) is
 synchronized.


 I think the cause of untriggered timer is due to blocked
 commandService.execute(command) in JPASignalManager.

 (I am using drools-5.1.0.M2)
 On Tue, Jul 13, 2010 at 6:09 AM, nanic23 nani...@hotmail.com wrote:

 Hi cafebabe,

 Thanks for your comment. I agree with you that work item ids are database
 primary keys but in this simple (very simple) case I just decided to
 harcoded as I know for a fact that the work item id is 1 because that is the
 only work item and each time I run the test the tables are dropped and
 recreated. So, there is never more than one row in the workItemInfo table
 and the only row always has 1 as its id.
 I could have stored the work item id or a work item object as a variable
 (like you mentioned) but in this case wouldn't make a difference for the
 timers.

 Are timers working for you when you use persistence? I do complete work
 items by workItem.getId() in all my code (other than this simple example
 :)). My problem is NOT completing the work item, my problem is triggering
 timers when persistence is enabled. The timers don't even trigger, thing
 that should happen before even trying to complete the work item.

 Thanks,

 Nick.


 --
 View this message in context: 
 http://drools-java-rules-engine.46999.n3.nabble.com/Implementing-Timers-With-Drools-Persistence-Enabled-tp923142p961658.html
 Sent from the Drools - User mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users



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


Re: [rules-users] Debug as within Eclipse

2010-07-15 Thread Evert Penninckx


chris richmond-2 wrote:
 
 I used the upate site to update my Eclipse Galileo IDE with the drools
 tools, created a new drools project, had it add the hello/goodbye test
 class
 and pointed my workspace to the 5.1M binaries.  
 

If you use the update site, I'd say your eclipse plugin is at version 5.0.
Maybe a manual download and extract of the 5.1M2 plugin from the download
site might fix things?


Evert

-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Debug-as-within-Eclipse-tp66651p969092.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] Help Needed in Drools Flow

2010-07-15 Thread santosh mukherjee
Hi,

I have inserted some objects into the process session through
ksession.insert(Object arg0) method call in the class file that starts the
process.Now I want to access those objects in my workItem on entry action
code. Can I do it? If yes please let me know how??

Thanks
Santosh Mukherjee.

On Wed, Jul 14, 2010 at 4:37 PM, Chris Raschl 
c.raschl-mailingli...@dyless.com wrote:

 Am 14.07.2010 12:05, schrieb santosh mukherjee:
  Hi,
 
  I want to add some of my own customized components to Drools Flow
 components pannel. How can this be done. Is there some API available to do
 so ??

 Hi,
 i guess you want to add domain specific work items to use them in the
 process designer
 in eclispe. There is no API, to do that you just have to add a
 drools.rulebase.conf file
 and your own work item definition to your META-INF directory.

 There is an example in the drools flow manual:


 http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-flow/html_single/index.html#d4e1033

 Remind: You'll have to re-open the process to make the work items appear.

 Hope this helps,
 chris
 ___
 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] Help Needed in Drools Flow

2010-07-15 Thread santosh mukherjee
This is the code that I am using in the OnEntryActions part of my workItem.

System.out.println(context.getProcessInstance().getWorkingMemory());
FactHandle fac=context.getProcessInstance().getWorkingMemory().insert(new
Name(santosh));
System.out.println(fac);
org.drools.runtime.rule.WorkingMemory
wrk=context.getProcessInstance().getWorkingMemory();
System.out.println(wrk);
System.out.println(wrk.getObject(fac));


But it gives this error:

Process Compilation error : org.drools.lang.descr.processde...@1ecfe07
com/sample/Process_com_sample_0.java (20:933) : Type mismatch: cannot
convert from org.drools.WorkingMemory to
org.drools.runtime.rule.WorkingMemory

Process Compilation error : org.drools.lang.descr.processde...@1ecfe07
com/sample/Process_com_sample_0.java (20:933) : Type mismatch: cannot
convert from org.drools.WorkingMemory to
org.drools.runtime.rule.WorkingMemory

Process Compilation error : org.drools.lang.descr.processde...@1ecfe07
com/sample/Process_com_sample_0.java (20:933) : Type mismatch: cannot
convert from org.drools.WorkingMemory to
org.drools.runtime.rule.WorkingMemory

java.lang.IllegalArgumentException: Could not parse knowledge.
at com.sample.ProcessTest.readKnowledgeBase(ProcessTest.java:47)
at com.sample.ProcessTest.main(ProcessTest.java:24)

Can anyone help how to get around this error???

Thank You.
Santosh Mukherjee


On Thu, Jul 15, 2010 at 5:33 PM, santosh mukherjee
sam.sensat...@gmail.comwrote:

 Hi,

 I have inserted some objects into the process session through
 ksession.insert(Object arg0) method call in the class file that starts the
 process.Now I want to access those objects in my workItem on entry action
 code. Can I do it? If yes please let me know how??

 Thanks
 Santosh Mukherjee.


 On Wed, Jul 14, 2010 at 4:37 PM, Chris Raschl 
 c.raschl-mailingli...@dyless.com wrote:

 Am 14.07.2010 12:05, schrieb santosh mukherjee:
  Hi,
 
  I want to add some of my own customized components to Drools Flow
 components pannel. How can this be done. Is there some API available to do
 so ??

 Hi,
 i guess you want to add domain specific work items to use them in the
 process designer
 in eclispe. There is no API, to do that you just have to add a
 drools.rulebase.conf file
 and your own work item definition to your META-INF directory.

 There is an example in the drools flow manual:


 http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-flow/html_single/index.html#d4e1033

 Remind: You'll have to re-open the process to make the work items appear.

 Hope this helps,
 chris
 ___
 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] Avoiding loops

2010-07-15 Thread Leonardo Gomes
Thanks for the feedback, guys.

Leonardo.

On Wed, Jul 14, 2010 at 8:41 AM, Wolfgang Laun wolfgang.l...@gmail.comwrote:

 Another option would be the addition of a single Trigger fact, inserted
 along
 with your regular facts, added as an additional pattern to all rules,
 and retracted
 in each RHS.

 You might also consider using Event processing to terminate the Engine's
 run after the first AfterActivationFiredEvent.

 -W


 2010/7/14 Mauricio Salatino sala...@gmail.com:
  you can also add an extra property to your facts to check and add
 condition
  to check that property. (like a processed flag)
  Greetings
 
 
  2010/7/13 Leonardo Gomes leonardo.f.go...@gmail.com
 
  Hi Droolers,
 
  I'm trying to avoid loops and looking at different possibilities
 (no-loop,
  activation-group, lock-on-active, etc.).
 
  Scenario I want to avoid:
 
  For example, the initial facts trigger *rule 1*, which inserts new facts
  that will trigger *rule 2*, which will then insert facts that would
  re-trigger *rule 1*.
 
  Possibilities I tried:
 
  no-loop - just prevents the re-activation of the same rule
  lock-on-active - I can't know which rules should have lock-on-active
 set
  to true, since I don't know what will be the initial facts.
 
  What I'm trying to achieve:
 
  All rules in my rule set should execute only once. So, a rule inserts
 new
  facts only rules that haven't executed so far, should be activated.
 
  Is there a way to do that, let's say 'out-of-the-box', with DRL?
 
  Thank you,
  Leo.
 
 
 
 
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 
 
  --
   - CTO @ http://www.plugtree.com
   - MyJourney @ http://salaboy.wordpress.com
   - 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

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


[rules-users] Retrieve rule names fired from StatefulknowledgeSession

2010-07-15 Thread G3

Hi

I have retrieved the package from guvnor url and fired the rules using 
statefulsession.fireallrules()
I can get the number of rules fired, all the rule names from the guvnor for
the model 
but how can I get the names of the rules that is fired.Is there any way to
get it from the session? As my requirement needs that many users may run the
application (not the guvnor application )at the same time so each set of
rules will vary depending on the user who has logged in.
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Retrieve-rule-names-fired-from-StatefulknowledgeSession-tp969508p969508.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] Retrieve rule names fired from StatefulknowledgeSession

2010-07-15 Thread Swindells, Thomas
You probably want to read up on agenda listeners - this will let you get the 
information you want.

Thomas

 -Original Message-
 From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
 boun...@lists.jboss.org] On Behalf Of G3
 Sent: 15 July 2010 14:16
 To: rules-users@lists.jboss.org
 Subject: [rules-users] Retrieve rule names fired from StatefulknowledgeSession


 Hi

 I have retrieved the package from guvnor url and fired the rules using
 statefulsession.fireallrules()
 I can get the number of rules fired, all the rule names from the guvnor for
 the model
 but how can I get the names of the rules that is fired.Is there any way to
 get it from the session? As my requirement needs that many users may run the
 application (not the guvnor application )at the same time so each set of
 rules will vary depending on the user who has logged in.
 --
 View this message in context: http://drools-java-rules-
 engine.46999.n3.nabble.com/Retrieve-rule-names-fired-from-
 StatefulknowledgeSession-tp969508p969508.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


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


[rules-users] Error while executing business Rule

2010-07-15 Thread Puneet duggal
Hi friends,

Some times i gets the error while executing rules so after that
Rules accross entire screen stops working ..
So can anyone tell me what can be the cause
why it becomes unstable after that.

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


Re: [rules-users] Error while executing business Rule

2010-07-15 Thread Swindells, Thomas
Your rules are probably written wrong, or your application, or you have a dodgy 
computer, or you have a race condition, or it is doing exactly what it should 
be doing and your expectations are wrong.
There's also possibly a small chance that there is a bug in drools but with 
absolutely no information about what the problem is or what you are doing I'd 
be inclined to check all the other options first.

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Puneet duggal
Sent: 15 July 2010 14:42
To: Rules Users List
Subject: [rules-users] Error while executing business Rule

Hi friends,

Some times i gets the error while executing rules so after that
Rules accross entire screen stops working ..
So can anyone tell me what can be the cause
why it becomes unstable after that.

Thanks
 Puneet



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


Re: [rules-users] Error while executing business Rule

2010-07-15 Thread Puneet duggal
but after that error my rules on none of the screens work why so

On 7/15/10, Swindells, Thomas tswinde...@nds.com wrote:

  Your rules are probably written wrong, or your application, or you have a
 dodgy computer, or you have a race condition, or it is doing exactly what it
 should be doing and your expectations are wrong.

 There’s also possibly a small chance that there is a bug in drools but with
 absolutely no information about what the problem is or what you are doing
 I’d be inclined to check all the other options first.



 *From:* rules-users-boun...@lists.jboss.org [mailto:
 rules-users-boun...@lists.jboss.org] *On Behalf Of *Puneet duggal
 *Sent:* 15 July 2010 14:42
 *To:* Rules Users List
 *Subject:* [rules-users] Error while executing business Rule



 Hi friends,



 Some times i gets the error while executing rules so after that

 Rules accross entire screen stops working ..

 So can anyone tell me what can be the cause

 why it becomes unstable after that.



 Thanks

  Puneet

 --


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


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


[rules-users] persistence.xml for 5.1.0.M2?

2010-07-15 Thread retoy

Can anyone give me a hint where I can find the persistence.xml that works
with version 5.1.0.M2?

Thanks!
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/persistence-xml-for-5-1-0-M2-tp969868p969868.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] Error while executing business Rule

2010-07-15 Thread Greg Barton
Yoda?  You is that?

GreG

On Jul 15, 2010, at 9:53, Puneet duggal duggalpu...@gmail.com wrote:

 but after that error my rules on none of the screens work why so
 
 On 7/15/10, Swindells, Thomas tswinde...@nds.com wrote:
 Your rules are probably written wrong, or your application, or you have a 
 dodgy computer, or you have a race condition, or it is doing exactly what it 
 should be doing and your expectations are wrong.
 
 There’s also possibly a small chance that there is a bug in drools but with 
 absolutely no information about what the problem is or what you are doing I’d 
 be inclined to check all the other options first.
 
  
 
 From: rules-users-boun...@lists.jboss.org 
 [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Puneet duggal
 Sent: 15 July 2010 14:42
 To: Rules Users List
 Subject: [rules-users] Error while executing business Rule
 
  
 
 Hi friends,
 
  
 
 Some times i gets the error while executing rules so after that
 
 Rules accross entire screen stops working ..
 
 So can anyone tell me what can be the cause
 
 why it becomes unstable after that.
 
  
 
 Thanks
 
  Puneet
 
 
 
 **
 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
 
 
 ___
 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] orm.xml for 5.1.0.M2?

2010-07-15 Thread retoy

Is the orm.xml in drools-persistence-jpa-5.1.0.M2.jar still correct?

I'm getting the exception:


Error in named query: ProcessInstancesWaitingForEvent
org.hibernate.QueryException: cannot dereference scalar collection element:
name [select processInstanceInfo.processInstanceId from
org.drools.persistence.processinstance.ProcessInstanceInfo
processInstanceInfo where :type in (processInstanceInfo.eventTypes.name)]


And the query in orm.xml in fact doesn't seem to reflect the latest changes
in ProcessInstanceInfo.java (?)


--- org.drools.persistence.processinstance.ProcessInstanceInfo.java
   
//  @OneToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
//  @JoinColumn(name = processInstanceId)
//  private SetEventType eventTypes = new HashSetEventType();

private @CollectionOfElements
@JoinTable(name = EventTypes, joinColumns = @JoinColumn(name =
InstanceId))
SetString eventTypes = new HashSetString();


--- orm.xml:

  query
select 
processInstanceInfo.processInstanceId
from 
ProcessInstanceInfo processInstanceInfo
where
:type in (processInstanceInfo.eventTypes.name)
  /query


(Removing the .name in the query didn't help...)
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/orm-xml-for-5-1-0-M2-tp969955p969955.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] Error while executing business Rule

2010-07-15 Thread PAYET, Manuel
You probably should post an examples describing your problem.
I think that the drools community don't have any clairvoyant powers :p


De : rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] De la part de Greg Barton
Envoyé : jeudi 15 juillet 2010 17:51
À : Rules Users List
Objet : Re: [rules-users] Error while executing business Rule

Yoda?  You is that?

GreG

On Jul 15, 2010, at 9:53, Puneet duggal 
duggalpu...@gmail.commailto:duggalpu...@gmail.com wrote:

but after that error my rules on none of the screens work why so

On 7/15/10, Swindells, Thomas 
mailto:tswinde...@nds.comtswinde...@nds.commailto:tswinde...@nds.com 
wrote:
Your rules are probably written wrong, or your application, or you have a dodgy 
computer, or you have a race condition, or it is doing exactly what it should 
be doing and your expectations are wrong.
There's also possibly a small chance that there is a bug in drools but with 
absolutely no information about what the problem is or what you are doing I'd 
be inclined to check all the other options first.

From: mailto:rules-users-boun...@lists.jboss.org 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:mailto:rules-users-boun...@lists.jboss.orgrules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Puneet duggal
Sent: 15 July 2010 14:42
To: Rules Users List
Subject: [rules-users] Error while executing business Rule

Hi friends,

Some times i gets the error while executing rules so after that
Rules accross entire screen stops working ..
So can anyone tell me what can be the cause
why it becomes unstable after that.

Thanks
 Puneet



**
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
mailto:postmas...@nds.com postmas...@nds.commailto: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
mailto:rules-users@lists.jboss.orgrules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-usershttps://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
/PREp style=font-family:arial;color:grey style=font-size:13pxThis 
message contains information that may be privileged or confidential and is the 
property of the Capgemini Group. It is intended only for the person to whom it 
is addressed. If you are not the intended recipient, you are not authorized to 
read, print, retain, copy, disseminate, distribute, or use this message or any 
part thereof. If you receive this message in error, please notify the sender 
immediately and delete all copies of this message./pPRE
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] FW: Drools 5.1.0.M2 - WorkItemNodeInstance --Listeners can't get hold of WorkItem object

2010-07-15 Thread Vijay K Pandey
Hi @Salaboy,

I am not sure if you received the email below.  Thanks for looking into this.

Vijay
From: Vijay K Pandey
Sent: Tuesday, July 13, 2010 8:53 AM
To: 'Mauricio Salatino'
Subject: RE: [rules-users] Drools 5.1.0.M2 - WorkItemNodeInstance --Listeners 
can't get hold of WorkItem object

Thanks for a quick response. I added the Transaction Manager piece of code but 
the problem still persists. Also it uses the attached persistence.xml file 
which is placed under META-INF directory that has the correct transaction 
manager look up class.

Thanks
Vijay


From: Mauricio Salatino [mailto:sala...@gmail.com]
Sent: Tuesday, July 13, 2010 6:40 AM
To: Vijay K Pandey
Subject: Re: [rules-users] Drools 5.1.0.M2 - WorkItemNodeInstance --Listeners 
can't get hold of WorkItem object

I've just take a quick look to your file and I notice (without running it) that 
you didn't set the TransactionManager property to your Environment:

env.set( EnvironmentName.TRANSACTION_MANAGER,












 TransactionManagerServices.getTransactionManager() );
You also need to have the reference to bitronix inside your persistence.xml 
file:

property name=hibernate.transaction.manager_lookup_class












value=org.hibernate.transaction.BTMTransactionManagerLookup/

Can you try this and let me know if it fix your problem?
Greetings
On Tue, Jul 13, 2010 at 12:43 AM, Vijay K Pandey 
vpan...@mdes.ms.govmailto:vpan...@mdes.ms.gov wrote:
Thanks Salaboy for looking into this.

Here is the Junit Test case(java file attached) I created for this problem.

Line # 129 fails.

Please do let me know if I am doing something wrong or the fix has some issues 
or maybe there is some other way out to get hold of the WorkItem object in 
the process event listener.

Thanks
Vijay
From: 
rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org]
 On Behalf Of Salaboy
Sent: Friday, July 09, 2010 11:11 AM
To: Rules Users List
Subject: Re: [rules-users] Drools 5.1.0.M2 - WorkItemNodeInstance -- Listeners 
can't get hold of WorkItem object

I would like to take a look on this issue. Can you provide me a test case that 
show the problem?
- CTO @ http://www.plugtree.com
- MyJourney @ http://salaboy.wordpress.com
- Co-Founder @ http://www.jbug.com.ar
- Mauricio Salaboy Salatino -

On Jul 9, 2010, at 12:43, Vijay K Pandey 
vpan...@mdes.ms.govmailto:vpan...@mdes.ms.gov wrote:
I guess this problem was due to a fix done in WorkItemNodeInstance? Is this the 
correct behavior? If yes how do we get hold of WorkItem instance in the 
attached listeners?

http://fisheye.jboss.org/browse/JBossRules/trunk/drools-core/src/main/java/org/drools/workflow/instance/node/WorkItemNodeInstance.java?r1=32801r2=

Thanks
Vijay
From: Vijay K Pandey
Sent: Tuesday, June 15, 2010 9:20 AM
To: 'Rules Users List'
Subject: RE: Drools 5.1.0.M2 - WorkItemNodeInstance -- Listeners can't get hold 
of WorkItem object

Any one on this issue? Any Drools Flow expert?

Appreciate your time for taking a look at it.

Thanks
Vijay
From: Vijay K Pandey
Sent: Thursday, June 10, 2010 12:03 PM
To: 'Rules Users List'
Subject: RE: Drools 5.1.0.M2 - WorkItemNodeInstance -- Listeners can't get hold 
of WorkItem object

Should I log this as a JIRA ticket.

Thanks
Vijay
From: Vijay K Pandey
Sent: Wednesday, June 09, 2010 9:57 AM
To: 'Rules Users List'
Subject: Drools 5.1.0.M2 - WorkItemNodeInstance -- Listeners can't get hold of 
WorkItem object

Hi,

There is a change done in Drools 5.1.0.M2 - 
org.drools.workflow.instance.node.WorkItemNodeInstance class in the method

public void triggerCompleted(WorkItem workItem) at line 196  which is 
setting the workItemId as -1

this.workItemId = -1;

Due to the above change the listeners which are attached to the  complete 
event of the work item - such as the method below

public void beforeNodeLeft(ProcessNodeLeftEvent event)  are not able to get 
hold of the associated workitem object as it returns null.

Is there any specific reason that workItemId is set to -1 even before the 
associated listeners get triggered or is this a bug?

If it was an intended change then how do I get hold of the WorkItem object in 
the attached listeners.

Thanks
Vijay
p.s This change was not there in the snapshot of 18th April 2010 which I was 
earlier working on. Above is the only change in this class from the snapshot of 
18th April and 5.1.0.M2
___
rules-users mailing list
rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino Salaboy Mauricio -


persistence.xml
Description: persistence.xml


TestProcessEvent.java
Description: TestProcessEvent.java
___
rules-users mailing 

[rules-users] Gunvor Rule Editor problem?

2010-07-15 Thread Han Ming Low
I have downloaded Guvnor build 4122 from
http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/

I'm using this version because of the BPMN editor provided.
However, the Guvnor Rule Editor is not behaving the same.
In the When condition, the action is greyed out and I cannot change the
properties of the action I have added.

A screenshot is upload to
http://img693.imageshack.us/img693/2567/guvnorq.jpg

I can't remember the all build number I have tried but 2 of them are build
4083 and 4097.
In some cases, the Rule Editor is working as I previously used it but upon
opening a model, it shows the screen same as 5.0 where a upload option is
available.
But, in some other build when the designer is loaded up nicely, the Rule
Editor did not behave the same way as it previously did.

If the Rule Editor has changed the way it works, please let me know how to
go about edition the Set value of XXX option.

Thanks.


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


Re: [rules-users] Improving Drools Memory Performance

2010-07-15 Thread Jevon Wright
Hi again,

By removing all of the simple eval()s from my rules, I have cut heap usage
by at least an order of magnitude. However this still isn't enough.

Since I am trying to reduce the cross-product size (as in SQL), I recall
that most SQL implementations have a DESCRIBE SELECT query which provides
real-time information about the complexity of a given SQL query - i.e. the
size of the tables, indexes used, and so on. Is there any such tool
available for Drools? Are there any tools which can provide clues as to
which rules are using the most memory?

Alternatively, I am wondering what kind of benefit I could expect from using
materialized views to create summary tables; that is, deriving and inserting
additional facts. This would allow Drools to rewrite queries that currently
use eval(), but would increase the size of working memory, so would this
actually save heap size?

To what extent does Drools rewrite queries? Is there any documentation
describing the approaches used?

Any other ideas on how to reduce heap memory usage? I'd appreciate any ideas
:)

Thanks
Jevon


On Mon, Jul 12, 2010 at 5:56 PM, Jevon Wright je...@jevon.org wrote:

 Hi Wolfgang and Mark,

 Thank you for your replies! You were correct: my eval() functions
 could generally be rewritten into Drools directly.

 I had one function connectsDetail that was constraining
 unidirectional edges, and could be rewritten from:
   detail : DetailWire ( )
  eval ( functions.connectsDetail(detail, source, target) )

 to:
  detail : DetailWire ( from == source, to == target )

 Another function, connects, was constraining bidirectional edges,
 and could be rewritten from:
  sync : SyncWire( )
  eval ( functions.connects(sync, source, target) )

 to:
  sync : SyncWire( (from == source  to == target) || (from == target
  to == source) )

 Finally, the veto function could be rewritten from:
  detail : DetailWire ( )
  eval ( handler.veto(detail) )

 to:
  detail : DetailWire ( overridden == false )

 I took each of these three changes, and evaluated them separately [1].
 I found that:

 1. Inlining 'connectsDetail' made a huge difference - 10-30% faster
 execution and 50-60% less allocated heap.
 2. Inlining 'connects' made very little difference - 10-30% faster
 execution, but 0-20% more allocated heap.
 3. Inlining 'veto' made no difference - no significant change in
 execution speed or allocated heap.

 I think I understand why inlining 'connects' would improve heap usage
 - because the rules essentially have more conditionals?

 I also understand why 'veto' made no difference - for most of my test
 models, overridden was never true, so adding this conditional was
 not making the cross product set any smaller.

 Finally, I also tested simply joining all of the rules together into
 one file. This happily made no difference at all (although made it
 more difficult to edit).

 So I think I can safely conclude that eval() should be used as little
 as possible - however, this means that the final rules are made more
 complicated and less human-readable, so a DSL may be best for my
 common rule patterns in the future.

 Thanks again!
 Jevon

 [1]: http://www.jevon.org/wiki/Improving_Drools_Memory_Performance

 On Sat, Jul 10, 2010 at 12:28 AM, Wolfgang Laun wolfgang.l...@gmail.com
 wrote:
  On 9 July 2010 14:14, Mark Proctor mproc...@codehaus.org wrote:
   You have many objects there that are not constrained;
 
  I have an inkling that the functions.*() are hiding just these
 contraints,
  It's certainly the wrong way, starting with oodles of node pairs, just to
  pick out connected ones by fishing for the connecting edge. And this
  is worsened by trying to find two such pairs which meet at some
  DomainSource
 
  Guesswork, hopefully educated ;-)
 
  -W
 
 
  if there are
  multiple versions of those objects you are going to get massive amounts
  of cross products. Think in terms of SQL, each pattern you add is like
  an SQL join.
 
  Mark
  On 09/07/2010 09:20, Jevon Wright wrote:
  Hi everyone,
 
  I am working on what appears to be a fairly complex rule base based on
  EMF. The rules aren't operating over a huge number of facts (less than
  10,000 EObjects) and there aren't too many rules (less than 300), but
  I am having a problem with running out of Java heap space (set at ~400
  MB).
 
  Through investigation, I came to the conclusion that this is due to
  the design of the rules, rather than the number of facts. The engine
  uses less memory inserting many facts that use simple rules, compared
  with inserting few facts that use many rules.
 
  Can anybody suggest some tips for reducing heap memory usage in
  Drools? I don't have a time constraint, only a heap/memory constraint.
  A sample rule in my project looks like this:
 
 rule Create QueryParameter for target container of DetailWire
   when
 container : Frame( )
 schema : DomainSchema ( )
 domainSource : DomainSource ( )
 instance : DomainIterator( )
 

Re: [rules-users] Improving Drools Memory Performance

2010-07-15 Thread Mark Proctor

 On 16/07/2010 04:16, Jevon Wright wrote:

Hi again,

By removing all of the simple eval()s from my rules, I have cut heap 
usage by at least an order of magnitude. However this still isn't enough.


Since I am trying to reduce the cross-product size (as in SQL), I 
recall that most SQL implementations have a DESCRIBE SELECT query 
which provides real-time information about the complexity of a given 
SQL query - i.e. the size of the tables, indexes used, and so on. Is 
there any such tool available for Drools? Are there any tools which 
can provide clues as to which rules are using the most memory?

no, but sounds like a nice side project :)


Alternatively, I am wondering what kind of benefit I could expect from 
using materialized views to create summary tables; that is, deriving 
and inserting additional facts. This would allow Drools to rewrite 
queries that currently use eval(), but would increase the size of 
working memory, so would this actually save heap size?


To what extent does Drools rewrite queries? Is there any documentation 
describing the approaches used?
The only rewriting we do is on literal constraints, moving == ones to 
the front, that's it. Also make sure you are using trunk, which is more 
memory efficient for modifies:

https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/

Mark


Any other ideas on how to reduce heap memory usage? I'd appreciate any 
ideas :)


Thanks
Jevon


On Mon, Jul 12, 2010 at 5:56 PM, Jevon Wright je...@jevon.org 
mailto:je...@jevon.org wrote:


Hi Wolfgang and Mark,

Thank you for your replies! You were correct: my eval() functions
could generally be rewritten into Drools directly.

I had one function connectsDetail that was constraining
unidirectional edges, and could be rewritten from:
 detail : DetailWire ( )
 eval ( functions.connectsDetail(detail, source, target) )

to:
 detail : DetailWire ( from == source, to == target )

Another function, connects, was constraining bidirectional edges,
and could be rewritten from:
 sync : SyncWire( )
 eval ( functions.connects(sync, source, target) )

to:
 sync : SyncWire( (from == source  to == target) || (from == target
 to == source) )

Finally, the veto function could be rewritten from:
 detail : DetailWire ( )
 eval ( handler.veto(detail) )

to:
 detail : DetailWire ( overridden == false )

I took each of these three changes, and evaluated them separately [1].
I found that:

1. Inlining 'connectsDetail' made a huge difference - 10-30% faster
execution and 50-60% less allocated heap.
2. Inlining 'connects' made very little difference - 10-30% faster
execution, but 0-20% more allocated heap.
3. Inlining 'veto' made no difference - no significant change in
execution speed or allocated heap.

I think I understand why inlining 'connects' would improve heap usage
- because the rules essentially have more conditionals?

I also understand why 'veto' made no difference - for most of my test
models, overridden was never true, so adding this conditional was
not making the cross product set any smaller.

Finally, I also tested simply joining all of the rules together into
one file. This happily made no difference at all (although made it
more difficult to edit).

So I think I can safely conclude that eval() should be used as little
as possible - however, this means that the final rules are made more
complicated and less human-readable, so a DSL may be best for my
common rule patterns in the future.

Thanks again!
Jevon

[1]: http://www.jevon.org/wiki/Improving_Drools_Memory_Performance

On Sat, Jul 10, 2010 at 12:28 AM, Wolfgang Laun
wolfgang.l...@gmail.com mailto:wolfgang.l...@gmail.com wrote:
 On 9 July 2010 14:14, Mark Proctor mproc...@codehaus.org
mailto:mproc...@codehaus.org wrote:
  You have many objects there that are not constrained;

 I have an inkling that the functions.*() are hiding just these
contraints,
 It's certainly the wrong way, starting with oodles of node
pairs, just to
 pick out connected ones by fishing for the connecting edge. And this
 is worsened by trying to find two such pairs which meet at some
 DomainSource

 Guesswork, hopefully educated ;-)

 -W


 if there are
 multiple versions of those objects you are going to get massive
amounts
 of cross products. Think in terms of SQL, each pattern you add
is like
 an SQL join.

 Mark
 On 09/07/2010 09:20, Jevon Wright wrote:
 Hi everyone,

 I am working on what appears to be a fairly complex rule base
based on
 EMF. The rules aren't operating over a huge number of facts
(less than
 10,000 EObjects) and there aren't too many rules (less than
300), but
 I am having a problem with running out of Java 

[rules-users] JMS Fusion entry point

2010-07-15 Thread Maurizio Dosso
Hi,
we'd like to use Drools Fusion for processing RFID messages coming from 
vehicles to be remotely monitored.
I'm quite new to Drools and I'm looking for an example/sample code showing how 
to define and use a JMS topic as an event entry point for Drools Fusion rules.  
Can anybody point me to or provide a working code sample ? 
Any help would be greatly appreciated.

Thanks a lot for helping.
Maurizio___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users