Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread Michael Anstis
Please note this relates to remote maven repositories; I.e. where kie-wb
(and it's maven repo) are on one machine; and your consuming application on
another machine.

If everything is on a single machine use of settings.xml is not needed as
artifacts should be resolved against .m2.

There is a thread asking about dynamic rules with .m2 running on this
mailing list in parallel to this one! I recommend reading those too.

Sent on the move
On 12 Dec 2013 07:32, "Michael Anstis"  wrote:

> Sent.. email titled something like "remote jars and dynamic modules".
>
> Sent on the move
> On 12 Dec 2013 07:26, "vimalkansal"  wrote:
>
>> Thanks manstis. I will be eagerly looking forward to the solution.
>>
>> Vimal
>>
>>
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027238.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] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread Michael Anstis
Sent.. email titled something like "remote jars and dynamic modules".

Sent on the move
On 12 Dec 2013 07:26, "vimalkansal"  wrote:

> Thanks manstis. I will be eagerly looking forward to the solution.
>
> Vimal
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027238.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

[rules-users] Fwd: Re: [rules-dev] 6.0 issue with remote jars and dynamic modules

2013-12-11 Thread Michael Anstis
Sent on the move
-- Forwarded message --
From: "Mark Proctor" 
Date: 6 Dec 2013 19:30
Subject: Re: [rules-dev] 6.0 issue with remote jars and dynamic modules
To: "Rules Dev List" , "Rules Users List" <
rules-users@lists.jboss.org>
Cc:

the jira
https://issues.jboss.org/browse/DROOLS-367

Mark
On 6 Dec 2013, at 14:39, Mark Proctor  wrote:

> There is problem, fixed in master, for remote jars. The KieRepository
currently, when using kie-ci, doesn’t obey the settings.xml active
profiles. This means it is not recognising the remote configured
repositories.
>
> While this is fixed, and we’ll have binaries out in about 2 weeks, it
means for now KieRepository can only resolve jars already in the local
m2_repo.
>
> Mark


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

Re: [rules-users] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread vimalkansal
Thanks manstis. I will be eagerly looking forward to the solution.

Vimal



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027238.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] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread Michael Anstis
You don't need to run on 2 machines; I was trying to explain why the
dependency could be resolved in kie-wb without the additional 
element in your consuming projects pom.

You are correct that the pom is used at build time. There were lots of
emails recently about your enquiry that showed the solution.  I'll ask a
colleague to forward to this list.

Sent on the move
On 12 Dec 2013 00:05, "vimalkansal"  wrote:

> Yes, you are correct, my application, .m2 and kie-wb are running on the
> same
> machine., and I can see your point. But in the different instance(the
> scenario that I originally described) I have a web application, .m2 and
> kie-web running on the same machine and my code is not able to download the
> jar file from local .m2 repo. I may also add that these 2 scenarios are on
> different machines :
>
> Machine 1: Java SE App, .m2, Kie-wb with M2_HOME env variable setup  --
> this
> works
>
> Machine 2: Java Web app, maven repo, Kie-wb (I am not sure if M2_HOME is
> setup, as this is different developers machine)
>
> I had a brief look at org.kie.scanner.embedder.MavenSettings.java and I
> have
> the feeling that on machine 2 (M2_HOME) is not set up, so basically the
> embedded maven is not pointing to the same maven repo to which Kie-wb is. I
> will try that when the developer is back.
>
> So as you can see, I am still working with local maven repo scenario. Now
> coming back to what you have suggested(for remote repo), i.e include the
> remote repo and the dependency on artifact (containing rules) in my
> applications POM file. Now this is confusing : Isn't the pom file used only
> at build stage when it will download any dependencies from the repositories
> specified in pom.xml, settings.xml? So in a way when I declare the
> dependency on my rule artifact in my applications's pom.xml, I am
> downloading the artifact at compile time. In other words when my
> application
> starts running, by that time it already has that artifact(i.e rules). After
> reading the doc I had the impression that by having kie-ci on classpath of
> the web app, web app should be able to download the artifact at run time
> rather than compile time.
>
> Thx
>
> Vimal
>
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027234.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] Insert to non-existing entry point causing NPE in drools server?

2013-12-11 Thread Wolfgang Laun
On 11/12/2013, dunnlow  wrote:
> Hmm, whelp, no, nothing empirical.  I think in my head I am combining a few
> things I've read.
>
> In the Developers Cookbook (pg130) there is a comment that entry points can
> help reduce cross products and can be used to partition memory.  I remember
> reading that the entry points are built during compile time, so I read that
> to mean that if I have 1000 rules, but only 1 rule with entry point "ep1"
> that if I insert a fact to ep1, the engine has already built the structure
> to only evaluate that 1 rule.  I thought that was the main reasoning behind
> entry points :-/  You are saying that my thinking here is incorrect?

Entry points (or streams) have been added for representing different event
data sources. I would not think highly of such a feature if its foremost intent
would be memory optimization, i.e., passing the implementor's buck to the
user. Now entry points may have the effect you have concluded from these
statements - your reasoning may very well be correct. But there's no doubt
that entry points are a static, compile time issue, and you are reporting
a problem due to dynamic variations in the data. Using an iffy optimisation
and trying to come to grips with it illustrates Michael A Jackson's
pair of rules for optimisation ;-)

To summarize: I wouldn't go up this alley unless I had data that would
show it's worth the effort.

>
> So, in the manual
> (http://docs.jboss.org/drools/release/6.0.0.Final/drools-docs/html/DroolsComplexEventProcessingChapter.html#d0e9947)
> during the banking example for entry points, there is little difference
> between having an "ATM Stream" and "Branch Stream" as shown and adding a
> "stream" attribute to the WithdrawRequest object and adding the constraint,
> stream=="Branch"?

Given the problems arising from changing the SW at the *source* of
these streams to accomodate the additional property: there is a big
difference. As for the efficiency of the rules, I'd hold my judgment
until after the benchmark :-)

Cheers
Wolfgang


>
> Thanks again
>
>
>
> laune wrote
>> What makes you think that using entry points "speeds things up"? The
>> Engine still has to evaluate the entry-point attribute of a fact
>> (handle),
>> just like any other attribute.
>>
>> Or do you have conclusive evidence based on solid benchmarks?
>>
>> -W
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Insert-to-non-existing-entry-point-causing-NPE-in-drools-server-tp4027204p4027226.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] Drools 6 support for changeset

2013-12-11 Thread Mark Proctor
it’s not quite that automatic.

You can only do updates vis the dynamic modules system. you have to build jars 
and update to the latest jar.

Go through the KIE examples docs, and the unit tests I showed you.

Mark
On 11 Dec 2013, at 22:31, wtang  wrote:

> Oh, I don't doubt for a moment that it is working.  I know it is working.  
> What I am trying to figure out is what step am I missing.
> 
> I installed drool 6.0 Eclipse plugin and simply added a loop in the out of
> the box hello word example.
> 
> while the loop is running, I went into the eclipse editor, modify and saved
> the hello word example in Sample.drl to print out instead of "Hello World"
> "Hello World".
> 
> The loop just keeps on printing out "Hello World" and not my changes which
> is "Hello World".
> 
> Here is the hello world program, I just modified it to add the loop:
> 
> public static final void main(String[] args) {
>try {
>   
>// load up the knowledge base
>   KieServices ks = KieServices.Factory.get();
>   KieContainer kContainer = ks.getKieClasspathContainer();
>   KieSession kSession = 
> kContainer.newKieSession("ksession-rules");
> 
>// go !
>   while(true) {
>   Thread.sleep(100);
>   Message message = new Message();
>   message.setMessage("Hello World");
>   message.setStatus(Message.HELLO);
>   kSession.insert(message);
>   kSession.fireAllRules();
>   }
>} catch (Throwable t) {
>t.printStackTrace();
>}
>}
> 
> 
> 
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/Drools-6-support-for-changeset-tp4027138p4027231.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] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread vimalkansal
Yes, you are correct, my application, .m2 and kie-wb are running on the same
machine., and I can see your point. But in the different instance(the
scenario that I originally described) I have a web application, .m2 and
kie-web running on the same machine and my code is not able to download the
jar file from local .m2 repo. I may also add that these 2 scenarios are on
different machines :

Machine 1: Java SE App, .m2, Kie-wb with M2_HOME env variable setup  -- this
works

Machine 2: Java Web app, maven repo, Kie-wb (I am not sure if M2_HOME is
setup, as this is different developers machine) 

I had a brief look at org.kie.scanner.embedder.MavenSettings.java and I have
the feeling that on machine 2 (M2_HOME) is not set up, so basically the
embedded maven is not pointing to the same maven repo to which Kie-wb is. I
will try that when the developer is back. 

So as you can see, I am still working with local maven repo scenario. Now
coming back to what you have suggested(for remote repo), i.e include the
remote repo and the dependency on artifact (containing rules) in my
applications POM file. Now this is confusing : Isn't the pom file used only
at build stage when it will download any dependencies from the repositories
specified in pom.xml, settings.xml? So in a way when I declare the
dependency on my rule artifact in my applications's pom.xml, I am
downloading the artifact at compile time. In other words when my application
starts running, by that time it already has that artifact(i.e rules). After
reading the doc I had the impression that by having kie-ci on classpath of
the web app, web app should be able to download the artifact at run time
rather than compile time. 

Thx

Vimal






--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027234.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] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread Michael Anstis
I assume .m2, kie-wb and your application are all running on the same
computer? Delete from your .m2 and try again (without having the repository
in your pom). It should fail.

When everything is in the same computer it is harder (for you) to replicate
a remote maven repository. Deleting from .m2 can help achieve this.

That said this thread is becoming a general catch all for multiple issues.

Can you please clearly state what the problem now is?

Sent on the move
On 11 Dec 2013 22:28, "vimalkansal"  wrote:

> Hi Manstis,
>
> Also, I am running another instane of KIE-WB which points to the default
> M2_REPO i.e /home/user/.m2 and I I have done "build and deploy" to push the
> built jar to this repo.
>
> Then I have written a Java SE application and I am able to successfully
> dynamically download the jar and run the rule without having the above
> changes you mentioned, please see my pom.xml attached pom.xml
> 
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027230.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] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread vimalkansal
And here is how my Java code looks like :

public class HelloWorldRuleExecutor {

public static void main(String[] args) {
// TODO Auto-generated method stub
String msg = "xxx";
KieServices ks = KieServices.Factory.get();
KieContainer kContainer = null;
kContainer = ks.newKieContainer(ks.newReleaseId("au.com.xyz",
"HelloWorld", "1.0.0-SNAPSHOT"));
if (kContainer == null)
System.out.println("Null");
 KieSession kSession = kContainer.newKieSession();
 //kSession.addEventListener( new 
DebugRuleRuntimeEventListener());
//kSession.setGlobal("message",msg);
//defaultStatelessKieSession
 kSession.fireAllRules();
// System.out.println(msg);

}

}



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027232.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] Drools 6 support for changeset

2013-12-11 Thread wtang
Oh, I don't doubt for a moment that it is working.  I know it is working.  
What I am trying to figure out is what step am I missing.

I installed drool 6.0 Eclipse plugin and simply added a loop in the out of
the box hello word example.

while the loop is running, I went into the eclipse editor, modify and saved
the hello word example in Sample.drl to print out instead of "Hello World"
"Hello World".

The loop just keeps on printing out "Hello World" and not my changes which
is "Hello World".

Here is the hello world program, I just modified it to add the loop:

public static final void main(String[] args) {
try {

// load up the knowledge base
KieServices ks = KieServices.Factory.get();
KieContainer kContainer = ks.getKieClasspathContainer();
KieSession kSession = 
kContainer.newKieSession("ksession-rules");

// go !
while(true) {
Thread.sleep(100);
Message message = new Message();
message.setMessage("Hello World");
message.setStatus(Message.HELLO);
kSession.insert(message);
kSession.fireAllRules();
}
} catch (Throwable t) {
t.printStackTrace();
}
}



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-6-support-for-changeset-tp4027138p4027231.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] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread vimalkansal
Hi Manstis,

Also, I am running another instane of KIE-WB which points to the default
M2_REPO i.e /home/user/.m2 and I I have done "build and deploy" to push the
built jar to this repo.

Then I have written a Java SE application and I am able to successfully
dynamically download the jar and run the rule without having the above
changes you mentioned, please see my pom.xml attached pom.xml
  



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027230.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] Drools6 : Having trouble in using kie-ci

2013-12-11 Thread vimalkansal
Hi Manstis,

I am going to try out what you have suggested, but I have the following
questions :

In the first instance this answer looked alright, but then how is it a
dynamic module? I was under the impression (as mentioned in the doco also)
that by having kie-ci on the classpath, it can pull down the jars
dynamically from maven repo with a statement like "kContainer =
ks.newKieContainer(ks.newReleaseId("com.xyz", "HelloWorld",
"1.0.0-SNAPSHOT"));"

Can you please correct me if my understanding is wrong. And, if my
understanding is correct, how does kie-ci know about my maven repo?



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools6-Having-trouble-in-using-kie-ci-tp4027208p4027229.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] Drools 6.0.0: Please clarify: rdrl vs rdslr and what you can do with each

2013-12-11 Thread SrjTx
Drools 6.0.0

I have searched doc and google, but have not found what I am looking for -
if you have link that would be great too.

I am creating my first .dsl file and using them in a guided rule.  I notice
that when you select this, the file extension is rdslr versus rdrl.  Also, 
you can access any .dsl (that is in the project?  directory? - not clear
where all it searches)

I also notice that you can add "regular" rule parts just like a rdrl file,
but they are prefixed with a >

My question is, if you wanted, could you write only rdslr files and do
everything you could in a rdrl even if you didn't use any dsl?

Rephrased, is rdrl a subset of rdslr functionality? 



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-6-0-0-Please-clarify-rdrl-vs-rdslr-and-what-you-can-do-with-each-tp4027228.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] Drools 6 support for changeset

2013-12-11 Thread Mark Proctor
we have unit tests that say otherwise:
https://github.com/sotty/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java

You’ll need to provide more information, or better still copy one of those unit 
tests to try and create a failed assertion that shows any issues.

Mark
On 11 Dec 2013, at 18:20, wtang  wrote:

> Hi just tried a simple example in which I loop and then I change the rule but
> I did not see my changes taking place.  Please advice.
> 
> while(true) {
>   Thread.sleep(100);
>   Message message = new Message();
>   message.setMessage("Hello World");
>   message.setStatus(Message.HELLO);
>   kSession.insert(message);
>   kSession.fireAllRules();
>   }
> 
> // I change hello world rule while this loop is running but did not see my
> changes getting pick up.
> 
> 
> 
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/Drools-6-support-for-changeset-tp4027138p4027225.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] Insert to non-existing entry point causing NPE in drools server?

2013-12-11 Thread dunnlow
Hmm, whelp, no, nothing empirical.  I think in my head I am combining a few
things I've read.  

In the Developers Cookbook (pg130) there is a comment that entry points can
help reduce cross products and can be used to partition memory.  I remember
reading that the entry points are built during compile time, so I read that
to mean that if I have 1000 rules, but only 1 rule with entry point "ep1"
that if I insert a fact to ep1, the engine has already built the structure
to only evaluate that 1 rule.  I thought that was the main reasoning behind
entry points :-/  You are saying that my thinking here is incorrect? 

So, in the manual
(http://docs.jboss.org/drools/release/6.0.0.Final/drools-docs/html/DroolsComplexEventProcessingChapter.html#d0e9947)
during the banking example for entry points, there is little difference
between having an "ATM Stream" and "Branch Stream" as shown and adding a
"stream" attribute to the WithdrawRequest object and adding the constraint,
stream=="Branch"? 

Thanks again



laune wrote
> What makes you think that using entry points "speeds things up"? The
> Engine still has to evaluate the entry-point attribute of a fact (handle),
> just like any other attribute.
> 
> Or do you have conclusive evidence based on solid benchmarks?
> 
> -W





--
View this message in context: 
http://drools.46999.n3.nabble.com/Insert-to-non-existing-entry-point-causing-NPE-in-drools-server-tp4027204p4027226.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] Drools 6 support for changeset

2013-12-11 Thread wtang
Hi just tried a simple example in which I loop and then I change the rule but
I did not see my changes taking place.  Please advice.

while(true) {
Thread.sleep(100);
Message message = new Message();
message.setMessage("Hello World");
message.setStatus(Message.HELLO);
kSession.insert(message);
kSession.fireAllRules();
}

// I change hello world rule while this loop is running but did not see my
changes getting pick up.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-6-support-for-changeset-tp4027138p4027225.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] Kie Work Bench missing repositories menu option

2013-12-11 Thread anjana.ackroyd
Sorry one last question hopefully 

To clone a repository on my machine I run 

git clone gitolite@vlslcdapp01:com.enterprise.service/service-rules-dsl


In the Kie-wb I am trying to clone a repository , if I put the URL as 

git://gitolite@vlslcdapp01:com.enterprise.service/service-rules-dsl it
doesnt like it

I cant just put git://com.enterprise.service/service-rules-dsl because my
repo is hosted on a remote machine  




--
View this message in context: 
http://drools.46999.n3.nabble.com/Re-rules-users-Kie-Work-Bench-missing-repositories-menu-option-tp4027198p4027224.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] Kie Work Bench missing repositories menu option

2013-12-11 Thread Mark Proctor

On 11 Dec 2013, at 16:54, anjana.ackroyd  wrote:

> Yay! I found the conflicting process using that port and now its all golden .
> I see all the menu options. 
great :)

> Although it would be nice to have it working on tomcat as well because thats
> the JVM we use enterprise wide. But for now I am going to go ahead and play
> with the work bench in jboss!
We’ll try and look into it. Any tomcat experts? Help would be appreciated.

Mark
> 
> 
> Thanks a lot !
> 
> 
> 
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/Re-rules-users-Kie-Work-Bench-missing-repositories-menu-option-tp4027198p4027222.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] Kie Work Bench missing repositories menu option

2013-12-11 Thread anjana.ackroyd
Yay! I found the conflicting process using that port and now its all golden .
I see all the menu options. 
Although it would be nice to have it working on tomcat as well because thats
the JVM we use enterprise wide. But for now I am going to go ahead and play
with the work bench in jboss!


Thanks a lot !



--
View this message in context: 
http://drools.46999.n3.nabble.com/Re-rules-users-Kie-Work-Bench-missing-repositories-menu-option-tp4027198p4027222.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] Stateless session commands and ExecutionResults (5.5.0.Final)

2013-12-11 Thread Stephen Masters
Hmm … so the use of batch execution instead of InsertObjectCommand improved 
things. However I have noticed that although rules are activating as expected, 
and facts are being inserted, my queries don’t seem to get any results. For 
instance with the following code:

Based on a stateless session:

List cmds = new ArrayList();
cmds.add(CommandFactory.newInsert(new IbanValidationRequest(iban), 
"request"));
cmds.add(CommandFactory.newQuery("annotations", "annotations"));

ExecutionResults results = 
ksession.execute(CommandFactory.newBatchExecution(cmds));

QueryResults queryResults = ( QueryResults ) results.getValue( 
"annotations" );
System.out.println("Found [" + queryResults.size() + "]");

Based on a stateful session:

statefulSession.insert(new IbanValidationRequest(iban));
statefulSession.fireAllRules();
QueryResults queryResults = 
statefulSession.getQueryResults("annotations");
System.out.println("Found [" + queryResults.size() + "]");

What I’m finding is that if I invoke a query against a stateful session, I get 
a result. However, with stateless sessions, I am examining the 
ExecutionResults, and finding that they do contain a reference to an 
“annotations” QueryResults. However that collection of query results is empty.

btw - I’m also noticing that the code example in the user guide for batch 
executions with queries doesn’t use the current syntax for adding a query 
command. I’m guessing this syntax changed without an associated update to the 
user guide.

Steve




On 11 Dec 2013, at 11:49, Wolfgang Laun  wrote:

> The mean thing is that the code
>   org.drools.command.CommandFactory
> uses the generic interface
>   org.drools.command.Command
> for all commands without specifying the generic parameter with the many
> newXyz methods. If it were written well, it would tell you what to
> expect from the command execution, since interface
>   org.drools.runtime.CommandExecutor
> has the generic
>T execute(Command command)
> 
> So you dig around in the code and may detect that ksession.execute(
> cmd ) with cmd being made by newInsertElements(...) returns a
> Collection. Mighty helpful.
> 
> Fixing the Experts would help a little, avoiding utter stupefaction.
> 
> Cheers
> -W
> 
> 
> 
> On 11/12/2013, Stephen Masters  wrote:
>> Thanks for that, Wolfgang. I have been working on something else for a few
>> days, but just switched over to batch execution, and that is giving me some
>> appropriate results (my tests are passing).
>> 
>> Which leads me to the question ...
>> 
>> Given that Example 3.4.1 in the Drools 5.5.0.Final user guide does not
>> compile, is that because there is a bug in the implementation of command
>> execution? Or is it a bug in the example. i.e.
>> The results should just not be assigned to anything?
>> The results (an ArrayList containing the facts which were just inserted)
>> should be assigned to a List of Object?
>> The example should just be removed from the user guide, as it is no longer a
>> valid/recommended approach?
>> 
>> Anybody with thoughts on that? Assuming that the answer is a documentation
>> fix, I’ll be happy to correct it appropriately and submit a pull request.
>> 
>> Cheers,
>> 
>> Steve
>> 
>> 
>> 
>> 
>> On 4 Dec 2013, at 12:24, Wolfgang Laun  wrote:
>> 
>>> I think you have to put your insert command into a list
>>> List> cmds = new ArrayList();
>>> and pass this via batch execution
>>> CommandFactory.newBatchExecution( cmds )
>>> 
>>> -W
>>> 
>>> On 04/12/2013, Stephen Masters  wrote:
 Hi folks,
 
 Can anyone explain how stateless session execution results should work?
 Working through the docs and tracing the code, it’s getting a bit
 confusing.
 
 Firstly, according to the user manual, one should be able to insert a
 list
 of facts as a Command, and get an instance of ExecutionResults back,
 which
 can then be queried. Here’s the example code:
 StatelessKnowledgeSession ksession =
 kbase.newStatelessKnowledgeSession();
 
 Command cmd = CommandFactory.newInsertElements( Arrays.asList( Object[]
 {
 
 new Cheese( "stilton" ),
 
 new Cheese( "brie" ),
 
 new Cheese( "cheddar" ),
 
 });
 
 ExecutionResults bresults = ksession.execute( cmd );
 
 That doesn’t compile, so I fixed it as follows:
 
   Command cmd = CommandFactory.newInsertElements( Arrays.asList(
   new Cheese( "stilton" ),
   new Cheese( "brie" ),
   new Cheese( "cheddar" )
));
   ExecutionResults bresults = ksession.execute( cmd );
 
 This does now compile, but running it throws a ClassCastException:
java.lang.ClassCastException: java.util.ArrayList cannot be cast to
 org.drools.runtime.ExecutionResults
 
 Taking a look thr

Re: [rules-users] Stateless session commands and ExecutionResults (5.5.0.Final)

2013-12-11 Thread Wolfgang Laun
The mean thing is that the code
   org.drools.command.CommandFactory
uses the generic interface
   org.drools.command.Command
for all commands without specifying the generic parameter with the many
newXyz methods. If it were written well, it would tell you what to
expect from the command execution, since interface
   org.drools.runtime.CommandExecutor
has the generic
T execute(Command command)

So you dig around in the code and may detect that ksession.execute(
cmd ) with cmd being made by newInsertElements(...) returns a
Collection. Mighty helpful.

Fixing the Experts would help a little, avoiding utter stupefaction.

Cheers
-W



On 11/12/2013, Stephen Masters  wrote:
> Thanks for that, Wolfgang. I have been working on something else for a few
> days, but just switched over to batch execution, and that is giving me some
> appropriate results (my tests are passing).
>
> Which leads me to the question ...
>
> Given that Example 3.4.1 in the Drools 5.5.0.Final user guide does not
> compile, is that because there is a bug in the implementation of command
> execution? Or is it a bug in the example. i.e.
> The results should just not be assigned to anything?
> The results (an ArrayList containing the facts which were just inserted)
> should be assigned to a List of Object?
> The example should just be removed from the user guide, as it is no longer a
> valid/recommended approach?
>
> Anybody with thoughts on that? Assuming that the answer is a documentation
> fix, I’ll be happy to correct it appropriately and submit a pull request.
>
> Cheers,
>
> Steve
>
>
>
>
> On 4 Dec 2013, at 12:24, Wolfgang Laun  wrote:
>
>> I think you have to put your insert command into a list
>>  List> cmds = new ArrayList();
>> and pass this via batch execution
>>  CommandFactory.newBatchExecution( cmds )
>>
>> -W
>>
>> On 04/12/2013, Stephen Masters  wrote:
>>> Hi folks,
>>>
>>> Can anyone explain how stateless session execution results should work?
>>> Working through the docs and tracing the code, it’s getting a bit
>>> confusing.
>>>
>>> Firstly, according to the user manual, one should be able to insert a
>>> list
>>> of facts as a Command, and get an instance of ExecutionResults back,
>>> which
>>> can then be queried. Here’s the example code:
>>> StatelessKnowledgeSession ksession =
>>> kbase.newStatelessKnowledgeSession();
>>>
>>> Command cmd = CommandFactory.newInsertElements( Arrays.asList( Object[]
>>> {
>>>
>>>  new Cheese( "stilton" ),
>>>
>>>  new Cheese( "brie" ),
>>>
>>>  new Cheese( "cheddar" ),
>>>
>>>  });
>>>
>>> ExecutionResults bresults = ksession.execute( cmd );
>>>
>>> That doesn’t compile, so I fixed it as follows:
>>>
>>>Command cmd = CommandFactory.newInsertElements( Arrays.asList(
>>>new Cheese( "stilton" ),
>>>new Cheese( "brie" ),
>>>new Cheese( "cheddar" )
>>> ));
>>>ExecutionResults bresults = ksession.execute( cmd );
>>>
>>> This does now compile, but running it throws a ClassCastException:
>>> java.lang.ClassCastException: java.util.ArrayList cannot be cast to
>>> org.drools.runtime.ExecutionResults
>>>
>>> Taking a look through the Drools code, it would appear that Command has
>>> a
>>> generic type, which in the case of an InsertElementsCommand is:
>>> GenericCommand>
>>>
>>> In turn, the execute command in StatelessKnowledgeSessionImpl casts its
>>> result to that generic type:
>>> public  T execute(Command command) {
>>> Object o = ((GenericCommand) command).execute( context );
>>> ...
>>> return (T) o;
>>>
>>> So the ClassCastException is because the execute method returns an
>>> ArrayList
>>> of FactHandle instead of an ExecutionResults.
>>>
>>> I’m assuming that I must have got the wrong end of the stick somewhere,
>>> so
>>> what should I be doing to get an ExecutionResults from a stateless
>>> session,
>>> which I can then query?
>>>
>>> Cheers,
>>>
>>> Steve
>>
>> ___
>> 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] Stateless session commands and ExecutionResults (5.5.0.Final)

2013-12-11 Thread Stephen Masters
Thanks for that, Wolfgang. I have been working on something else for a few 
days, but just switched over to batch execution, and that is giving me some 
appropriate results (my tests are passing).

Which leads me to the question ...

Given that Example 3.4.1 in the Drools 5.5.0.Final user guide does not compile, 
is that because there is a bug in the implementation of command execution? Or 
is it a bug in the example. i.e.
The results should just not be assigned to anything?
The results (an ArrayList containing the facts which were just inserted) should 
be assigned to a List of Object?
The example should just be removed from the user guide, as it is no longer a 
valid/recommended approach?

Anybody with thoughts on that? Assuming that the answer is a documentation fix, 
I’ll be happy to correct it appropriately and submit a pull request.

Cheers,

Steve

 


On 4 Dec 2013, at 12:24, Wolfgang Laun  wrote:

> I think you have to put your insert command into a list
>  List> cmds = new ArrayList();
> and pass this via batch execution
>  CommandFactory.newBatchExecution( cmds )
> 
> -W
> 
> On 04/12/2013, Stephen Masters  wrote:
>> Hi folks,
>> 
>> Can anyone explain how stateless session execution results should work?
>> Working through the docs and tracing the code, it’s getting a bit
>> confusing.
>> 
>> Firstly, according to the user manual, one should be able to insert a list
>> of facts as a Command, and get an instance of ExecutionResults back, which
>> can then be queried. Here’s the example code:
>> StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
>> 
>> Command cmd = CommandFactory.newInsertElements( Arrays.asList( Object[] {
>> 
>>  new Cheese( "stilton" ),
>> 
>>  new Cheese( "brie" ),
>> 
>>  new Cheese( "cheddar" ),
>> 
>>  });
>> 
>> ExecutionResults bresults = ksession.execute( cmd );
>> 
>> That doesn’t compile, so I fixed it as follows:
>> 
>>Command cmd = CommandFactory.newInsertElements( Arrays.asList(
>>new Cheese( "stilton" ),
>>new Cheese( "brie" ),
>>new Cheese( "cheddar" )
>> ));
>>ExecutionResults bresults = ksession.execute( cmd );
>> 
>> This does now compile, but running it throws a ClassCastException:
>>  java.lang.ClassCastException: java.util.ArrayList cannot be cast to
>> org.drools.runtime.ExecutionResults
>> 
>> Taking a look through the Drools code, it would appear that Command has a
>> generic type, which in the case of an InsertElementsCommand is:
>> GenericCommand>
>> 
>> In turn, the execute command in StatelessKnowledgeSessionImpl casts its
>> result to that generic type:
>>  public  T execute(Command command) {
>>  Object o = ((GenericCommand) command).execute( context );
>>  ...
>>  return (T) o;
>> 
>> So the ClassCastException is because the execute method returns an ArrayList
>> of FactHandle instead of an ExecutionResults.
>> 
>> I’m assuming that I must have got the wrong end of the stick somewhere, so
>> what should I be doing to get an ExecutionResults from a stateless session,
>> which I can then query?
>> 
>> Cheers,
>> 
>> Steve
> 
> ___
> 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] Entry Point from parameter in Guvnor Decision Table?

2013-12-11 Thread Michael Anstis
Your best option would be to add a BRL Fragment column.

You'd then have to add a "Free Form Text" condition, enter plain DRL using
@{a-variable-name} as the entry-point in the DRL.

With kind regards,

Mike



On 9 December 2013 23:41, dunnlow  wrote:

> manstis wrote
> > Are you using a XLS decision table or a web one?
>
> I'm using the Guvnor web-guided editor to build the decision table.
>
> Thanks,
> -J
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Entry-Point-from-parameter-in-Guvnor-Decision-Table-tp4027132p4027179.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