Re: [rules-users] Drools 6 Spring JTA Persistence

2013-09-04 Thread Alexander Herwix
Hey Martin,

haven't looked at your code yet, but I have Drools 6 CR1 and 2 running in 
grails though without local HT and JTA persistence. It was pretty straight 
forward, just included the dependencies and pruned duplicate entries (check the 
dependency report).

If I get the plugin working I would be glad to share a demo project. However, I 
think that a fully fledged release of the plugin to grails central would take 
some more time.

Cheers, Alex

Am 03.09.2013 um 21:23 schrieb Martin Minka martin.mi...@gmail.com:

 Alex,
 I am sorry, I don't have solution for your problem, but maybe I will work 
 soon on same issue. 
 Are you using Drools 6.0.0.CR2 ? If yes, where you able to overcome this 
 problem 
 http://drools.46999.n3.nabble.com/rules-users-classloader-problem-in-Drools-6-0-0-CR1-and-CR2-working-in-Beta5-td4025726.html
  ?
 
 Do you mind to share your plugin code with community ?
 
 Best regards,
 Martin
 
 
 
 2013/9/3 Alexander Herwix a...@herwix.com
 Hey guys, 
 
 I'm working on a Grails plugin for Drools/Jbpm 6 and I have trouble to get 
 persistence working in a user friendly way. It would be awesome if someone 
 with a better understanding of drools and especially drools spring 
 integration could help me to figure this out :) 
 
 I have considered multiple approaches:
 
 - Use a spring LocalContainerEntityManagerFactoryBean with a local 
 JpaTransactionManager to configure a KieEnvironment via Spring.
 
 I basically got this working, but this doesn't provide real integration with 
 Grails, as there are 2 seperate local TransactionManagers involved - 
 limiting the ability to integrate drools in the grails app.
 
 - Use JTA-Transactions. 
 
 As I want the plugin to be as user friendly as possible I would like to keep 
 using the default tomcat container for development. There is the Atomikos 
 Plugin for Grails which configures Grails to work with JTA. This works 
 pretty nicely and should suffice for the development environment. 
 
 My problem is integrating the Atomikos backed JTATransactionManager with the 
 drools 6 spring environment configuration as I have not much experience with 
 JTA. I have looked at the Tests for Kie-Spring and looked at as much 
 documentation as I could find, but I can't seem to figure this out. 
 
 This is what I use to configure the environment via spring (in Grails groovy 
 syntax)
 
 jbpmGlobals(MapGlobalResolver)
 
 dacceptor(ClassObjectMarshallingStrategyAcceptor,['*.*'])
 
 kie.kstore(id:'kiestore')
 
 kie.environment(id: 'jbpmEnv'){
 kie.'entity-manager-factory'(ref:'entityManagerFactory')
 
 kie.globals(ref:'jbpmGlobals')
 
 kie.'object-marshalling-strategies'(){
 kie.'jpa-placeholder-resolver-strategy'()
 
 kie.'serializable-placeholder-resolver-strategy'('strategy-acceptor-ref':dacceptor)
 }
 }
 //Tried to wrap my JtaTransactionManager with KieSpringTransactionManager
 jbpmTransactionManager(KieSpringTransactionManager, 
 ref('transactionManager'))
 
 the environment value for transactionManager cannot be set here, because the 
 parser expects a JpaTransactionManager. I tried to add the 
 transactionManager manually to the environment and found the 
 KieSpringTransactionManager, which looked like it could help me somehow, but 
 in the end, there is always the default implementation of the 
 JtaTransactionManager used which can't find the transactionManager that I 
 configured. 
 
 Error:
 NamingException occurred when processing request: [GET] /bpm/test/testJbpm
 Cannot create resource instance. Stacktrace follows:
 javax.naming.NamingException: Cannot create resource instance
  at 
 org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:116)
  at 
 javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:154)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:831)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
  at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)
  at javax.naming.InitialContext.lookup(InitialContext.java:411)
  at 
 org.drools.persistence.jta.JtaTransactionManager.findUserTransaction(JtaTransactionManager.java:122)
  at 
 org.drools.persistence.jta.JtaTransactionManager.init(JtaTransactionManager.java:69)
  at 
 org.drools.persistence.SingleSessionCommandService.initTransactionManager(SingleSessionCommandService.java:325)
  at 
 org.drools.persistence.SingleSessionCommandService.init(SingleSessionCommandService.java:114)
  at 
 org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:129)
  at 
 org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newKieSession(KnowledgeStoreServiceImpl.java:67)
  at 
 

[rules-users] Fully qualified name for generated classes

2013-09-04 Thread Lance Leverich
What would be the fully qualified name for a generated class, that is based
upon a fact type (for example a type named Foo) that is defined inside a
declarative model?
How is the fully qualified name affected if the model resides in the Global
Area, and is imported into multiple packages?

The reason for my question is that I have the following issue:

In the Global Area, I have a declarative model (named MyModel) with a
definition like...
   declare Foo
  bar: String
  version: String
   end

In a package (com.mypkg.a), I have imported MyModel from the Global Area. I
have a rule like...

   rule myRuleA
   ruleflow-group firstGroup
   when
  not Foo( bar==bar )
   then
  Foo fact = new Foo();
  fact.setBar(bar);
  fact.setVersion(1);
  insert(fact);

In another package (com.mypkg.b), I have also imported MyModel from the
Global Area. I have a rule like

   rule myRuleB
  ruleflow-group secondGroup
  when
 Foo()
  then
 System.out.println(got at least one Foo);

Looking at logs, the rule myRuleA fires as is appropriate; however, the
rule myRuleB does not fire, even though both ruleflow groups are
represented in the ruleflow. I have verified that both of the ruleflow
groups are activated, using the logs. My best guess at this point is that
the class generated for fact type Foo is different for each package. So,
how can I make sure that I am instantiating and checking for the same type
across packages?



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

Re: [rules-users] Fully qualified name for generated classes

2013-09-04 Thread Davide Sottara
A declared class assumes the package of the drl containing the declaration.
You'll need to import it in other packages
Davide

On 09/04/2013 07:28 AM, Lance Leverich wrote:
 What would be the fully qualified name for a generated class, that is
 based upon a fact type (for example a type named Foo) that is
 defined inside a declarative model? 
 How is the fully qualified name affected if the model resides in the
 Global Area, and is imported into multiple packages?

 The reason for my question is that I have the following issue:

 In the Global Area, I have a declarative model (named MyModel) with a
 definition like...
declare Foo
   bar: String
   version: String
end

 In a package (com.mypkg.a), I have imported MyModel from the Global
 Area. I have a rule like...

rule myRuleA
ruleflow-group firstGroup
when
   not Foo( bar==bar )
then
   Foo fact = new Foo();
   fact.setBar(bar);
   fact.setVersion(1);
   insert(fact);

 In another package (com.mypkg.b), I have also imported MyModel from
 the Global Area. I have a rule like

rule myRuleB
   ruleflow-group secondGroup
   when
  Foo()
   then
  System.out.println(got at least one Foo);

 Looking at logs, the rule myRuleA fires as is appropriate; however,
 the rule myRuleB does not fire, even though both ruleflow groups are
 represented in the ruleflow. I have verified that both of the ruleflow
 groups are activated, using the logs. My best guess at this point is
 that the class generated for fact type Foo is different for each
 package. So, how can I make sure that I am instantiating and checking
 for the same type across packages?



 Lance Leverich


 ___
 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] Would like to know about a coming Workshop/Training/Seminar in Drools/Guvnor

2013-09-04 Thread marianbuenosayres
We at Plugtree are closing details for a Drools/Guvnor/jBPM training in
London by October 21-25, and are preparing another for USA but haven't
pinned all the details yet. You can see more about the one we're preparing
for London here:

http://www.plugtree.com/public-trainings-london-2013/

Cheers,



--
View this message in context: 
http://drools.46999.n3.nabble.com/Would-like-to-know-about-a-coming-Workshop-Training-Seminar-in-Drools-Guvnor-tp4025792p4025803.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Fully qualified name for generated classes

2013-09-04 Thread Lance Leverich
The issue isn't that Foo cannot be resolved, as it was imported into both
packages from the Global Area. The packages compile just fine. I believe
what might be happening, though, is that each package is creating its own
version of Foo.
For example, am I experiencing something like...
com.mypkg.a generates a class with a fully qualified name of
drools.com.mypkg.a.Foo
com.mypkg.b generates a class with a fully qualified name of
drools.com.mypkg.b.Foo
?

If this is the case, is there someway within Guvnor to refer to a
particular version? I'm beginning to think that my best option might be to
create a POJO and import it. At least that way, I can make sure I know the
fully qualified (i.e. canonical) class name.

~ Lance


Cc:
 Date: Wed, 4 Sep 2013 15:41:55 +0100
 Subject: Re: [rules-users] Fully qualified name for generated classes
 Guvnor's Global Area has no affect on fully qualified type names; it's
 just a container for things you want to share.

 If Foo could not be resolved in myRuleB the rule would fail to compile.

 What do you observations show if you don't have any rule flow?


 On 4 September 2013 15:28, Lance Leverich lance.lever...@gmail.comwrote:

 What would be the fully qualified name for a generated class, that is
 based upon a fact type (for example a type named Foo) that is defined
 inside a declarative model?
 How is the fully qualified name affected if the model resides in the
 Global Area, and is imported into multiple packages?

 The reason for my question is that I have the following issue:

 In the Global Area, I have a declarative model (named MyModel) with a
 definition like...
declare Foo
   bar: String
   version: String
end

 In a package (com.mypkg.a), I have imported MyModel from the Global Area.
 I have a rule like...

rule myRuleA
ruleflow-group firstGroup
when
   not Foo( bar==bar )
then
   Foo fact = new Foo();
   fact.setBar(bar);
   fact.setVersion(1);
   insert(fact);

 In another package (com.mypkg.b), I have also imported MyModel from the
 Global Area. I have a rule like

rule myRuleB
   ruleflow-group secondGroup
   when
  Foo()
   then
  System.out.println(got at least one Foo);

 Looking at logs, the rule myRuleA fires as is appropriate; however, the
 rule myRuleB does not fire, even though both ruleflow groups are
 represented in the ruleflow. I have verified that both of the ruleflow
 groups are activated, using the logs. My best guess at this point is that
 the class generated for fact type Foo is different for each package. So,
 how can I make sure that I am instantiating and checking for the same type
 across packages?



 Lance Leverich

 ___
 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 6 Spring JTA Persistence

2013-09-04 Thread Markus Schneider
Hi Alex,

I'm developing a Grails Drools Plugin, too. At the moment I'm working on an
ECA (Event Correlation  Analysis) solution so my current focus is on
expert  fusion. But jBPM is also an important module that I'll need in the
future.
Maybe we can come togehter and create one feature rich grails plugin.
Let me know if you're interested.

Cheers

-markus





2013/9/4 Alexander Herwix a...@herwix.com

 Hey Martin,

 haven't looked at your code yet, but I have Drools 6 CR1 and 2 running in
 grails though without local HT and JTA persistence. It was pretty straight
 forward, just included the dependencies and pruned duplicate entries (check
 the dependency report).

 If I get the plugin working I would be glad to share a demo project.
 However, I think that a fully fledged release of the plugin to grails
 central would take some more time.

 Cheers, Alex

 Am 03.09.2013 um 21:23 schrieb Martin Minka martin.mi...@gmail.com:

 Alex,
 I am sorry, I don't have solution for your problem, but maybe I will work
 soon on same issue.
 Are you using Drools 6.0.0.CR2 ? If yes, where you able to overcome this
 problem
 http://drools.46999.n3.nabble.com/rules-users-classloader-problem-in-Drools-6-0-0-CR1-and-CR2-working-in-Beta5-td4025726.html?

 Do you mind to share your plugin code with community ?

 Best regards,
 Martin



 2013/9/3 Alexander Herwix a...@herwix.com

 Hey guys,

 I'm working on a Grails plugin for Drools/Jbpm 6 and I have trouble to
 get persistence working in a user friendly way. It would be awesome if
 someone with a better understanding of drools and especially drools spring
 integration could help me to figure this out :)

 I have considered multiple approaches:

 - Use a spring LocalContainerEntityManagerFactoryBean with a local
 JpaTransactionManager to configure a KieEnvironment via Spring.

 I basically got this working, but this doesn't provide real integration
 with Grails, as there are 2 seperate local TransactionManagers involved -
 limiting the ability to integrate drools in the grails app.

 - Use JTA-Transactions.

 As I want the plugin to be as user friendly as possible I would like to
 keep using the default tomcat container for development. There is the
 Atomikos Plugin for Grails which configures Grails to work with JTA. This
 works pretty nicely and should suffice for the development environment.

 My problem is integrating the Atomikos backed JTATransactionManager with
 the drools 6 spring environment configuration as I have not much experience
 with JTA. I have looked at the Tests for Kie-Spring and looked at as much
 documentation as I could find, but I can't seem to figure this out.

 This is what I use to configure the environment via spring (in Grails
 groovy syntax)

 jbpmGlobals(MapGlobalResolver)

 dacceptor(ClassObjectMarshallingStrategyAcceptor,['*.*'])

 kie.kstore(id:'kiestore')

 kie.environment(id: 'jbpmEnv'){
 kie.'entity-manager-factory'(ref:'entityManagerFactory')

 kie.globals(ref:'jbpmGlobals')

 kie.'object-marshalling-strategies'(){
 kie.'jpa-placeholder-resolver-strategy'()

 kie.'serializable-placeholder-resolver-strategy'('strategy-acceptor-ref':dacceptor)
 }
 }
 //Tried to wrap my JtaTransactionManager with KieSpringTransactionManager
 jbpmTransactionManager(KieSpringTransactionManager,
 ref('transactionManager'))


 the environment value for transactionManager cannot be set here, because
 the parser expects a JpaTransactionManager. I tried to add the
 transactionManager manually to the environment and found the
 KieSpringTransactionManager, which looked like it could help me somehow,
 but in the end, there is always the default implementation of the
 JtaTransactionManager used which can't find the transactionManager that I
 configured.

 Error:
 NamingException occurred when processing request: [GET] /bpm/test/testJbpm
 Cannot create resource instance. Stacktrace follows:
 javax.naming.NamingException: Cannot create resource instance
  at
 org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:116)
 at
 javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
 at org.apache.naming.NamingContext.lookup(NamingContext.java:154)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:831)
 at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
  at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)
 at javax.naming.InitialContext.lookup(InitialContext.java:411)
  at
 org.drools.persistence.jta.JtaTransactionManager.findUserTransaction(JtaTransactionManager.java:122)
 at
 org.drools.persistence.jta.JtaTransactionManager.init(JtaTransactionManager.java:69)
  at
 org.drools.persistence.SingleSessionCommandService.initTransactionManager(SingleSessionCommandService.java:325)
 at
 

Re: [rules-users] Fully qualified name for generated classes

2013-09-04 Thread Davide Sottara
Interesting..  can you define a package in the global declarative model
without it
clashing with the separate rule packages?
Otherwise, I'd consider it a bug

On 09/04/2013 10:43 AM, Lance Leverich wrote:
 The issue isn't that Foo cannot be resolved, as it was imported into
 both packages from the Global Area. The packages compile just fine. I
 believe what might be happening, though, is that each package is
 creating its own version of Foo.
 For example, am I experiencing something like...
 com.mypkg.a generates a class with a fully qualified name of
 drools.com.mypkg.a.Foo
 com.mypkg.b generates a class with a fully qualified name of
 drools.com.mypkg.b.Foo
 ?

 If this is the case, is there someway within Guvnor to refer to a
 particular version? I'm beginning to think that my best option might
 be to create a POJO and import it. At least that way, I can make sure
 I know the fully qualified (i.e. canonical) class name.

 ~ Lance


 Cc: 
 Date: Wed, 4 Sep 2013 15:41:55 +0100
 Subject: Re: [rules-users] Fully qualified name for generated classes
 Guvnor's Global Area has no affect on fully qualified type names;
 it's just a container for things you want to share.

 If Foo could not be resolved in myRuleB the rule would fail to
 compile.

 What do you observations show if you don't have any rule flow?


 On 4 September 2013 15:28, Lance Leverich
 lance.lever...@gmail.com mailto:lance.lever...@gmail.com wrote:

 What would be the fully qualified name for a generated class,
 that is based upon a fact type (for example a type named
 Foo) that is defined inside a declarative model? 
 How is the fully qualified name affected if the model resides
 in the Global Area, and is imported into multiple packages?

 The reason for my question is that I have the following issue:

 In the Global Area, I have a declarative model (named MyModel)
 with a definition like...
declare Foo
   bar: String
   version: String
end

 In a package (com.mypkg.a), I have imported MyModel from the
 Global Area. I have a rule like...

rule myRuleA
ruleflow-group firstGroup
when
   not Foo( bar==bar )
then
   Foo fact = new Foo();
   fact.setBar(bar);
   fact.setVersion(1);
   insert(fact);

 In another package (com.mypkg.b), I have also imported MyModel
 from the Global Area. I have a rule like

rule myRuleB
   ruleflow-group secondGroup
   when
  Foo()
   then
  System.out.println(got at least one Foo);

 Looking at logs, the rule myRuleA fires as is appropriate;
 however, the rule myRuleB does not fire, even though both
 ruleflow groups are represented in the ruleflow. I have
 verified that both of the ruleflow groups are activated, using
 the logs. My best guess at this point is that the class
 generated for fact type Foo is different for each package. So,
 how can I make sure that I am instantiating and checking for
 the same type across packages?



 Lance Leverich

 ___
 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

[rules-users] SpringOne 2GX

2013-09-04 Thread Stephen Masters
Hi folks,

There seem to be quite a few queries on using Spring and Grails with Drools 
just recently, so I was just wondering whether anybody is heading to SpringOne 
2GX next week. If anyone is going, it might be fun to meet up and natter about 
what we're all up to.

Please do give me a shout if any of you are going to be there, and we can sort 
something out.

Hope to see some of you there!

Steve


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


Re: [rules-users] Fully qualified name for generated classes

2013-09-04 Thread Stephen Masters
It could be worth using the REST API to browse to the source of each package. 
It would be telling if the DRL included imports for com.mypkg.a.Foo and 
com.mypkg.b.Foo depending on which package it was in.

Steve


On 4 Sep 2013, at 18:43, Lance Leverich lance.lever...@gmail.com wrote:

 The issue isn't that Foo cannot be resolved, as it was imported into both 
 packages from the Global Area. The packages compile just fine. I believe what 
 might be happening, though, is that each package is creating its own version 
 of Foo.
 For example, am I experiencing something like...
 com.mypkg.a generates a class with a fully qualified name of 
 drools.com.mypkg.a.Foo
 com.mypkg.b generates a class with a fully qualified name of 
 drools.com.mypkg.b.Foo
 ?
 
 If this is the case, is there someway within Guvnor to refer to a particular 
 version? I'm beginning to think that my best option might be to create a POJO 
 and import it. At least that way, I can make sure I know the fully qualified 
 (i.e. canonical) class name.
 
 ~ Lance
 
 
 Cc: 
 Date: Wed, 4 Sep 2013 15:41:55 +0100
 Subject: Re: [rules-users] Fully qualified name for generated classes
 Guvnor's Global Area has no affect on fully qualified type names; it's just a 
 container for things you want to share.
 
 If Foo could not be resolved in myRuleB the rule would fail to compile.
 
 What do you observations show if you don't have any rule flow?
 
 
 On 4 September 2013 15:28, Lance Leverich lance.lever...@gmail.com wrote:
 What would be the fully qualified name for a generated class, that is based 
 upon a fact type (for example a type named Foo) that is defined inside a 
 declarative model? 
 How is the fully qualified name affected if the model resides in the Global 
 Area, and is imported into multiple packages?
 
 The reason for my question is that I have the following issue:
 
 In the Global Area, I have a declarative model (named MyModel) with a 
 definition like...
declare Foo
   bar: String
   version: String
end
 
 In a package (com.mypkg.a), I have imported MyModel from the Global Area. I 
 have a rule like...
 
rule myRuleA
ruleflow-group firstGroup
when
   not Foo( bar==bar )
then
   Foo fact = new Foo();
   fact.setBar(bar);
   fact.setVersion(1);
   insert(fact);
 
 In another package (com.mypkg.b), I have also imported MyModel from the 
 Global Area. I have a rule like
 
rule myRuleB
   ruleflow-group secondGroup
   when
  Foo()
   then
  System.out.println(got at least one Foo);
 
 Looking at logs, the rule myRuleA fires as is appropriate; however, the rule 
 myRuleB does not fire, even though both ruleflow groups are represented in 
 the ruleflow. I have verified that both of the ruleflow groups are activated, 
 using the logs. My best guess at this point is that the class generated for 
 fact type Foo is different for each package. So, how can I make sure that I 
 am instantiating and checking for the same type across packages?
 
 
 
 Lance Leverich
 
 ___
 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] Fully qualified name for generated classes

2013-09-04 Thread Michael Anstis
Lance is correct.

Global Area in Guvnor is package agnostic; items in it only assume a
package when an item is imported into a package.

In the case of a declarative model the resulting class can be in multiple
packages depending on which Guvnor packages the item in the Global Area was
imported.

You can configure imports on the package configuration screen.

Sent on the move
On 4 Sep 2013 19:31, Stephen Masters stephen.mast...@me.com wrote:

 It could be worth using the REST API to browse to the source of each
 package. It would be telling if the DRL included imports for
 com.mypkg.a.Foo and com.mypkg.b.Foo depending on which package it was in.

 Steve


 On 4 Sep 2013, at 18:43, Lance Leverich lance.lever...@gmail.com wrote:

 The issue isn't that Foo cannot be resolved, as it was imported into both
 packages from the Global Area. The packages compile just fine. I believe
 what might be happening, though, is that each package is creating its own
 version of Foo.
 For example, am I experiencing something like...
 com.mypkg.a generates a class with a fully qualified name of
 drools.com.mypkg.a.Foo
 com.mypkg.b generates a class with a fully qualified name of
 drools.com.mypkg.b.Foo
 ?

 If this is the case, is there someway within Guvnor to refer to a
 particular version? I'm beginning to think that my best option might be to
 create a POJO and import it. At least that way, I can make sure I know the
 fully qualified (i.e. canonical) class name.

 ~ Lance


 Cc:
 Date: Wed, 4 Sep 2013 15:41:55 +0100
 Subject: Re: [rules-users] Fully qualified name for generated classes
 Guvnor's Global Area has no affect on fully qualified type names; it's
 just a container for things you want to share.

 If Foo could not be resolved in myRuleB the rule would fail to compile.

 What do you observations show if you don't have any rule flow?


 On 4 September 2013 15:28, Lance Leverich lance.lever...@gmail.comwrote:

 What would be the fully qualified name for a generated class, that is
 based upon a fact type (for example a type named Foo) that is defined
 inside a declarative model?
 How is the fully qualified name affected if the model resides in the
 Global Area, and is imported into multiple packages?

 The reason for my question is that I have the following issue:

 In the Global Area, I have a declarative model (named MyModel) with a
 definition like...
declare Foo
   bar: String
   version: String
end

 In a package (com.mypkg.a), I have imported MyModel from the Global
 Area. I have a rule like...

rule myRuleA
ruleflow-group firstGroup
when
   not Foo( bar==bar )
then
   Foo fact = new Foo();
   fact.setBar(bar);
   fact.setVersion(1);
   insert(fact);

 In another package (com.mypkg.b), I have also imported MyModel from the
 Global Area. I have a rule like

rule myRuleB
   ruleflow-group secondGroup
   when
  Foo()
   then
  System.out.println(got at least one Foo);

 Looking at logs, the rule myRuleA fires as is appropriate; however, the
 rule myRuleB does not fire, even though both ruleflow groups are
 represented in the ruleflow. I have verified that both of the ruleflow
 groups are activated, using the logs. My best guess at this point is that
 the class generated for fact type Foo is different for each package. So,
 how can I make sure that I am instantiating and checking for the same type
 across packages?



 Lance Leverich

 ___
 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] Drools 6 Spring JTA Persistence

2013-09-04 Thread Alexander Herwix
Hey Markus, 

that sounds really interesting! I would love to know your opinion on how to 
integrate grails and drools in the best way. If we have similar ideas and goals 
for the plugin that would be really good way to proceed. Maybe we can set up a 
talk in irc or the like? I'm currently working on this full time so just hit me 
up on my mail address to set something up.

Cheers, Alex

Am 04.09.2013 um 19:44 schrieb Markus Schneider markus.schneide...@gmail.com:

 Hi Alex,
 
 I'm developing a Grails Drools Plugin, too. At the moment I'm working on an 
 ECA (Event Correlation  Analysis) solution so my current focus is on expert 
  fusion. But jBPM is also an important module that I'll need in the future.
 Maybe we can come togehter and create one feature rich grails plugin.
 Let me know if you're interested.
 
 Cheers
 
 -markus
 
 
 
 
 
 2013/9/4 Alexander Herwix a...@herwix.com
 Hey Martin,
 
 haven't looked at your code yet, but I have Drools 6 CR1 and 2 running in 
 grails though without local HT and JTA persistence. It was pretty straight 
 forward, just included the dependencies and pruned duplicate entries (check 
 the dependency report).
 
 If I get the plugin working I would be glad to share a demo project. However, 
 I think that a fully fledged release of the plugin to grails central would 
 take some more time.
 
 Cheers, Alex
 
 Am 03.09.2013 um 21:23 schrieb Martin Minka martin.mi...@gmail.com:
 
 Alex,
 I am sorry, I don't have solution for your problem, but maybe I will work 
 soon on same issue. 
 Are you using Drools 6.0.0.CR2 ? If yes, where you able to overcome this 
 problem 
 http://drools.46999.n3.nabble.com/rules-users-classloader-problem-in-Drools-6-0-0-CR1-and-CR2-working-in-Beta5-td4025726.html
  ?
 
 Do you mind to share your plugin code with community ?
 
 Best regards,
 Martin
 
 
 
 2013/9/3 Alexander Herwix a...@herwix.com
 Hey guys, 
 
 I'm working on a Grails plugin for Drools/Jbpm 6 and I have trouble to get 
 persistence working in a user friendly way. It would be awesome if someone 
 with a better understanding of drools and especially drools spring 
 integration could help me to figure this out :) 
 
 I have considered multiple approaches:
 
 - Use a spring LocalContainerEntityManagerFactoryBean with a local 
 JpaTransactionManager to configure a KieEnvironment via Spring.
 
 I basically got this working, but this doesn't provide real integration with 
 Grails, as there are 2 seperate local TransactionManagers involved - 
 limiting the ability to integrate drools in the grails app.
 
 - Use JTA-Transactions. 
 
 As I want the plugin to be as user friendly as possible I would like to keep 
 using the default tomcat container for development. There is the Atomikos 
 Plugin for Grails which configures Grails to work with JTA. This works 
 pretty nicely and should suffice for the development environment. 
 
 My problem is integrating the Atomikos backed JTATransactionManager with the 
 drools 6 spring environment configuration as I have not much experience with 
 JTA. I have looked at the Tests for Kie-Spring and looked at as much 
 documentation as I could find, but I can't seem to figure this out. 
 
 This is what I use to configure the environment via spring (in Grails groovy 
 syntax)
 
 jbpmGlobals(MapGlobalResolver)
 
 dacceptor(ClassObjectMarshallingStrategyAcceptor,['*.*'])
 
 kie.kstore(id:'kiestore')
 
 kie.environment(id: 'jbpmEnv'){
 kie.'entity-manager-factory'(ref:'entityManagerFactory')
 
 kie.globals(ref:'jbpmGlobals')
 
 kie.'object-marshalling-strategies'(){
 kie.'jpa-placeholder-resolver-strategy'()
 
 kie.'serializable-placeholder-resolver-strategy'('strategy-acceptor-ref':dacceptor)
 }
 }
 //Tried to wrap my JtaTransactionManager with KieSpringTransactionManager
 jbpmTransactionManager(KieSpringTransactionManager, 
 ref('transactionManager'))
 
 the environment value for transactionManager cannot be set here, because the 
 parser expects a JpaTransactionManager. I tried to add the 
 transactionManager manually to the environment and found the 
 KieSpringTransactionManager, which looked like it could help me somehow, but 
 in the end, there is always the default implementation of the 
 JtaTransactionManager used which can't find the transactionManager that I 
 configured. 
 
 Error:
 NamingException occurred when processing request: [GET] /bpm/test/testJbpm
 Cannot create resource instance. Stacktrace follows:
 javax.naming.NamingException: Cannot create resource instance
  at 
 org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:116)
  at 
 javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:154)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:831)
  at 

Re: [rules-users] Drools 6 Spring JTA Persistence

2013-09-04 Thread Martin Minka
If you don't mind, I am also interested to share opinions and work.

Martin


2013/9/4 Alexander Herwix a...@herwix.com

 Hey Markus,

 that sounds really interesting! I would love to know your opinion on how
 to integrate grails and drools in the best way. If we have similar ideas
 and goals for the plugin that would be really good way to proceed. Maybe we
 can set up a talk in irc or the like? I'm currently working on this full
 time so just hit me up on my mail address to set something up.

 Cheers, Alex

 Am 04.09.2013 um 19:44 schrieb Markus Schneider 
 markus.schneide...@gmail.com:

 Hi Alex,

 I'm developing a Grails Drools Plugin, too. At the moment I'm working on
 an ECA (Event Correlation  Analysis) solution so my current focus is on
 expert  fusion. But jBPM is also an important module that I'll need in the
 future.
 Maybe we can come togehter and create one feature rich grails plugin.
 Let me know if you're interested.

 Cheers

 -markus





 2013/9/4 Alexander Herwix a...@herwix.com

 Hey Martin,

 haven't looked at your code yet, but I have Drools 6 CR1 and 2 running in
 grails though without local HT and JTA persistence. It was pretty straight
 forward, just included the dependencies and pruned duplicate entries (check
 the dependency report).

 If I get the plugin working I would be glad to share a demo project.
 However, I think that a fully fledged release of the plugin to grails
 central would take some more time.

 Cheers, Alex

 Am 03.09.2013 um 21:23 schrieb Martin Minka martin.mi...@gmail.com:

 Alex,
 I am sorry, I don't have solution for your problem, but maybe I will work
 soon on same issue.
 Are you using Drools 6.0.0.CR2 ? If yes, where you able to overcome this
 problem
 http://drools.46999.n3.nabble.com/rules-users-classloader-problem-in-Drools-6-0-0-CR1-and-CR2-working-in-Beta5-td4025726.html?

 Do you mind to share your plugin code with community ?

 Best regards,
 Martin



 2013/9/3 Alexander Herwix a...@herwix.com

 Hey guys,

 I'm working on a Grails plugin for Drools/Jbpm 6 and I have trouble to
 get persistence working in a user friendly way. It would be awesome if
 someone with a better understanding of drools and especially drools spring
 integration could help me to figure this out :)

 I have considered multiple approaches:

 - Use a spring LocalContainerEntityManagerFactoryBean with a local
 JpaTransactionManager to configure a KieEnvironment via Spring.

 I basically got this working, but this doesn't provide real integration
 with Grails, as there are 2 seperate local TransactionManagers involved -
 limiting the ability to integrate drools in the grails app.

 - Use JTA-Transactions.

 As I want the plugin to be as user friendly as possible I would like to
 keep using the default tomcat container for development. There is the
 Atomikos Plugin for Grails which configures Grails to work with JTA. This
 works pretty nicely and should suffice for the development environment.

 My problem is integrating the Atomikos backed JTATransactionManager with
 the drools 6 spring environment configuration as I have not much experience
 with JTA. I have looked at the Tests for Kie-Spring and looked at as much
 documentation as I could find, but I can't seem to figure this out.

 This is what I use to configure the environment via spring (in Grails
 groovy syntax)

 jbpmGlobals(MapGlobalResolver)

 dacceptor(ClassObjectMarshallingStrategyAcceptor,['*.*'])

 kie.kstore(id:'kiestore')

 kie.environment(id: 'jbpmEnv'){
 kie.'entity-manager-factory'(ref:'entityManagerFactory')

 kie.globals(ref:'jbpmGlobals')

 kie.'object-marshalling-strategies'(){
 kie.'jpa-placeholder-resolver-strategy'()

 kie.'serializable-placeholder-resolver-strategy'('strategy-acceptor-ref':dacceptor)
 }
 }
 //Tried to wrap my JtaTransactionManager with KieSpringTransactionManager
 jbpmTransactionManager(KieSpringTransactionManager,
 ref('transactionManager'))


 the environment value for transactionManager cannot be set here, because
 the parser expects a JpaTransactionManager. I tried to add the
 transactionManager manually to the environment and found the
 KieSpringTransactionManager, which looked like it could help me somehow,
 but in the end, there is always the default implementation of the
 JtaTransactionManager used which can't find the transactionManager that I
 configured.

 Error:
 NamingException occurred when processing request: [GET]
 /bpm/test/testJbpm
 Cannot create resource instance. Stacktrace follows:
 javax.naming.NamingException: Cannot create resource instance
  at
 org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:116)
 at
 javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
 at org.apache.naming.NamingContext.lookup(NamingContext.java:154)
  at 

Re: [rules-users] Guvnor REST api, compile package

2013-09-04 Thread anchi
Ok, I somehow managed to resolve question 3 and 3.a. But questions 1. and 2.
remain, please point me to the right direction.

What I need is to build a package and if build was successful then create a
new snapshot.
My problem is how to build a package?

I found out that creating a new snapshot by calling
.../rest/packages/{packageName}/snapshot/{snapshotName} *sometimes* triggers
package build. But I cannot figure out how is this determined?

What I've found out is:
1. Approach that doesn't work:
  - update package version by sending modified package metadata to
.../rest/packages/{packageName} (I basically just change package
description)
  - then trigger creation of new snapshot with REST request
It does not compile the package

2. Approach that works:
 - click Save in Guvnor console (which changes package version)
 - then trigger creation of new snapshot with REST request
Package is compiled

So where is the catch? How can I make sure that package is built before
creating a snapshot?
I don't really see a point of having a REST interface if it still requires
to use Guvnor console for being able to use a knowledge base packages




--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-REST-api-compile-package-tp4025756p4025811.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Guvnor REST api, compile package

2013-09-04 Thread Demian Calcaprina
About 1, .../rest/packages/{packageName}/binary will triger the compile and
then return the PKG. But not sure what will happen if the compilation
fails.. you can try!

From the documentation:
Returns the compiled binary of the package {packageName} as a binary
stream. If the package has not been compiled yet or its binary is not up to
date, this will compile the package first.


On Wed, Sep 4, 2013 at 8:06 PM, anchi harij...@ovi.com wrote:

 Ok, I somehow managed to resolve question 3 and 3.a. But questions 1. and
 2.
 remain, please point me to the right direction.

 What I need is to build a package and if build was successful then create a
 new snapshot.
 My problem is how to build a package?

 I found out that creating a new snapshot by calling
 .../rest/packages/{packageName}/snapshot/{snapshotName} *sometimes*
 triggers
 package build. But I cannot figure out how is this determined?

 What I've found out is:
 1. Approach that doesn't work:
   - update package version by sending modified package metadata to
 .../rest/packages/{packageName} (I basically just change package
 description)
   - then trigger creation of new snapshot with REST request
 It does not compile the package

 2. Approach that works:
  - click Save in Guvnor console (which changes package version)
  - then trigger creation of new snapshot with REST request
 Package is compiled

 So where is the catch? How can I make sure that package is built before
 creating a snapshot?
 I don't really see a point of having a REST interface if it still requires
 to use Guvnor console for being able to use a knowledge base packages




 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Guvnor-REST-api-compile-package-tp4025756p4025811.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

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

Re: [rules-users] Guvnor REST api, compile package

2013-09-04 Thread anchi
Thanks for your answer.
Yes, I've just tried this, it doesn't work.

In this part where it says ...or its binary is not up to date..., it does
not clearly say what criteria is used to determine that binary is not up to
date.

So this is my use case scenario:
1. I have a package that compiles
2. I'm using Guvnor plugin for Eclipse to update one of the assets (BPMN
file) with a new version that will cause compile errors
3. Now I try to create a snapshot with REST call and I want to get a compile
error (since package cannot compile anymore)

But Guvnor just doesn't detect the change (although I can see in console
that version number has changed for my asset, but not for the package).



--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-REST-api-compile-package-tp4025756p4025813.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Getting data from a database(My SQL) to Guvnor

2013-09-04 Thread ashish6276
Hi,
 Can somebody guide me on how to pull data from a database(My SQL) to Guvnor
Decision table . Problem statement is to fill the rows in decision table by
getting data from My SQL database.
 Thanks in advance.

Regards,
Ashish



--
View this message in context: 
http://drools.46999.n3.nabble.com/Getting-data-from-a-database-My-SQL-to-Guvnor-tp4025814.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users