[rules-users] KieScanner with Maven 3

2014-04-25 Thread Maxime Falaize
Hello,

Does the KieScanner support Maven 3? I noted that LATEST, RELEASE and
SNAPSHOT metaversions for Maven are no longer supported by Maven 3 so do I
have to understand that we cannot use the KieScanner with Maven 3?

By the way I noted that if I set my KieContainer with a LATEST version, the
KieScanner systematically redeploy my JAR as the KieScanner compare the
real version with "LATEST". I've seen that there were some changes in the
KieScanner in the 6.1.0, did you fix it? I can't test right now because I
face a rule compilation problem with the new 6.1.0 version and I still have
to figure this out.

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

Re: [rules-users] Drools 6.0.1: Pushing changes back to Workbench GIT using SSH

2014-04-15 Thread Maxime Falaize
Can anyone give me a solution please ?
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Pooling stateful sessions to have threaded executions of a ruleset

2014-04-14 Thread Maxime Falaize
I'm disposing after use because if i'm not the working memory is not empty
between 2 calls right ? And I am saying that I'm using them as a pool
because I have 5 sessions that could be used at the same time, which is
impossible if I declare only one.

If you have recommandation for my use case, please tell me as I found
nothing in the doc about this.


2014-04-13 22:42 GMT+02:00 Mark Proctor :

> as it says in the docs. we've designed things to put in foundations for
> future multi-threaded exploitation, but there is nothing there now.
>
> The  example code doesn't make too much sense to me. As you are saying you
> are using them as a pool, but you are disposing after use.
>
> Mark
>
> On 11 Apr 2014, at 08:48, Mercier Jonathan 
> wrote:
>
>  Le 09/04/2014 11:20, Maxime Falaize a écrit :
>
> I confirm that the multithreaded rules evaluation is not currently
> supported. See
> https://github.com/droolsjbpm/drools/blob/master/drools-core/src/main/java/org/drools/core/RuleBaseConfiguration.java#L683
>
>
> 2014-04-07 12:27 GMT+02:00 Maxime Falaize :
>
>> I'm sorry but I don't understand what you are talking about. In this
>> article, there is nothing about multithreaded rules evaluation. It just
>> says that the Phreak algorithm is designed for thread safety and 
>> *future*multicore processors exploitation. It doesn't mean that it is already
>> multithreaded. Moreover I tested my appliciation with and without
>> multithreaded sessions (I am using Drools 6.0.1.Final) and I noted a faster
>> execution in the multithreaded one.
>>
>>
>> 2014-04-04 13:53 GMT+02:00 jmercier :
>>
>>  Le 04/03/2014 09:55, Maxime Falaize a écrit :
>>>  > Hello,
>>> >
>>> > I want to ask you if it is a good practive to pool stateful sessions
>>> > for a specific ruleset to improve the execution performance.
>>> > Actually in my application I execute my rules by calling SOAP
>>> > webservice. For performance purpose, I test multithreaded calls to my
>>> > webservice and I noted that when I pool sessions in the server side,
>>> > it improves the performance a lot.
>>> >
>>> > To pool sessions, I just declare multiple ksession tag in my
>>> > kmodule.xml :
>>> >
>>> > 
>>> > 
>>> >  
>>> > 
>>> > 
>>> > 
>>> >  
>>> >
>>> > In my spring webservice endpoint I just put that code to handle the
>>> > pool :
>>> >
>>> > @Endpoint
>>> > public class ExampleEndpoint implements InitializingBean {
>>> >
>>> > @Autowired
>>> > private ExampleRuleService ruleService;
>>> >  private Map isRunningMap = new
>>> > HashMap();
>>> > private static final int NB_POOL_SESSIONS = 5;
>>> >
>>> > @PayloadRoot(localPart = "com.example.ExampleRequest")
>>> >  @ResponsePayload
>>> > public ExampleResponse handleRequest(
>>> > @RequestPayload ExampleRequest request) throws
>>> > InterruptedException {
>>> > KieServices ks = KieServices.Factory.get();
>>> > KieContainer kc = ks.getKieClasspathContainer();
>>> >  while (true) {
>>> > for (int i = 0; i < NB_POOL_SESSIONS; i++) {
>>> > boolean run = false;
>>> >
>>> > synchronized (isRunningMap) {
>>> > if (!isRunningMap.get(i)) {
>>> >  isRunningMap.put(i, true);
>>> > run = true;
>>> > }
>>> > }
>>> >
>>> > if (run) {
>>> > KieSession ksession = kc.newKieSession("KSession"
>>> > + (i + 1));
>>> >  ExampleResponse response =
>>> > ruleService.run(ksession, request);
>>> > ksession.dispose();
>>> >
>>> > isRunningMap.put(i, false);
>>> > return response;
>>> >  }
>>> > }
>>> > Thread.sleep(100);
>>> > }
>>> > }
>>> >
>>> > public void afterPropertiesSet() throws Exception {
>>> > for (int i 

Re: [rules-users] Drools 6.0.1: Pushing changes back to Workbench GIT using SSH

2014-04-10 Thread Maxime Falaize
I've tried to generate a public/private key pair and put the public one
into the .security folder but it still doesn't work. Can you explain what I
have to do exactly ?

Thanks


2014-04-07 19:27 GMT+02:00 Alexandre Porcelli :

> Hi Rishi,
>
>  The SSH server public key info for workbench is stored into .security
> folder (more info about it here:
> http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/wb.Workbench.html#wb.systemProperties
> )
>
> Regards,
> ---
> Alexandre Porcelli
> Principal Software Engineer
> Red Hat Business Systems and Intelligence Group
>
> On Jan 21, 2014, at 11:32 PM, dotrc  wrote:
>
> > I am using workbench for managing my rules maven projects within the
> embedded
> > GIT repository. I am aware that using git:// protocol, I can clone an
> > existing rule repository; I can do this successfully.
> >
> > For authoring rules, I want to use Eclipse (using EGit). I want to push
> my
> > commits back to the GIT repo. I understand that I'll have to use ssh
> > protocol instead of git for specifying the repo, something like this:
> > ssh://{userName}@localhost:8001/{repoName}
> >
> > When we use a standard GIT repo like stash, it gives us an option to set
> our
> > public key on the stash server, but I'm not able to find a way to do that
> > with the embedded ssh server within workbench. Hence, I'm not able to
> > authenticate myself and perform a push.
> >
> > We tried creating a private-public key pair using ssh-keygen and put that
> > within c:\users\\.ssh and added the public key to
> > 'authorized_keys(2) (though I know this may not be the right place) and
> then
> > used the private key as the identity file with ssh client directly from
> > cygwin, again to no avail.
> >
> > Any pointers will be really appreciated.
> >
> > Also, should the username be 'admin' or any other specific one for
> pushing?
> > Will the existing Windows username work?
> >
> > Thanks,
> > Rishi
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> http://drools.46999.n3.nabble.com/Drools-6-0-1-Pushing-changes-back-to-Workbench-GIT-using-SSH-tp4027800.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
>



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

Re: [rules-users] Pooling stateful sessions to have threaded executions of a ruleset

2014-04-09 Thread Maxime Falaize
I confirm that the multithreaded rules evaluation is not currently
supported. See
https://github.com/droolsjbpm/drools/blob/master/drools-core/src/main/java/org/drools/core/RuleBaseConfiguration.java#L683


2014-04-07 12:27 GMT+02:00 Maxime Falaize :

> I'm sorry but I don't understand what you are talking about. In this
> article, there is nothing about multithreaded rules evaluation. It just
> says that the Phreak algorithm is designed for thread safety and 
> *future*multicore processors exploitation. It doesn't mean that it is already
> multithreaded. Moreover I tested my appliciation with and without
> multithreaded sessions (I am using Drools 6.0.1.Final) and I noted a faster
> execution in the multithreaded one.
>
>
> 2014-04-04 13:53 GMT+02:00 jmercier :
>
> Le 04/03/2014 09:55, Maxime Falaize a écrit :
>> > Hello,
>> >
>> > I want to ask you if it is a good practive to pool stateful sessions
>> > for a specific ruleset to improve the execution performance.
>> > Actually in my application I execute my rules by calling SOAP
>> > webservice. For performance purpose, I test multithreaded calls to my
>> > webservice and I noted that when I pool sessions in the server side,
>> > it improves the performance a lot.
>> >
>> > To pool sessions, I just declare multiple ksession tag in my
>> > kmodule.xml :
>> >
>> > 
>> > 
>> >  
>> > 
>> > 
>> > 
>> >  
>> >
>> > In my spring webservice endpoint I just put that code to handle the
>> > pool :
>> >
>> > @Endpoint
>> > public class ExampleEndpoint implements InitializingBean {
>> >
>> > @Autowired
>> > private ExampleRuleService ruleService;
>> >  private Map isRunningMap = new
>> > HashMap();
>> > private static final int NB_POOL_SESSIONS = 5;
>> >
>> > @PayloadRoot(localPart = "com.example.ExampleRequest")
>> >  @ResponsePayload
>> > public ExampleResponse handleRequest(
>> > @RequestPayload ExampleRequest request) throws
>> > InterruptedException {
>> > KieServices ks = KieServices.Factory.get();
>> > KieContainer kc = ks.getKieClasspathContainer();
>> >  while (true) {
>> > for (int i = 0; i < NB_POOL_SESSIONS; i++) {
>> > boolean run = false;
>> >
>> > synchronized (isRunningMap) {
>> > if (!isRunningMap.get(i)) {
>> >  isRunningMap.put(i, true);
>> > run = true;
>> > }
>> > }
>> >
>> > if (run) {
>> > KieSession ksession = kc.newKieSession("KSession"
>> > + (i + 1));
>> >  ExampleResponse response =
>> > ruleService.run(ksession, request);
>> > ksession.dispose();
>> >
>> > isRunningMap.put(i, false);
>> > return response;
>> >      }
>> > }
>> > Thread.sleep(100);
>> > }
>> > }
>> >
>> > public void afterPropertiesSet() throws Exception {
>> > for (int i = 1; i <= NB_POOL_SESSIONS; i++) {
>> > isRunningMap.put((i - 1), false);
>> >  }
>> > }
>> >
>> > }
>> >
>> > It works well because in my benchmark I improve 5 times the
>> > performance (as I have 5 different threads) but I wondered if it is a
>> > good practice and if it does not hide any issues that I could have in
>> > the future.
>> >
>> > Thanks for your help.
>> >
>> > --
>> > Maxime FALAIZE
>> > ___
>> > rules-users mailing list
>> > rules-users@lists.jboss.org
>> > https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>> Hi maxime,
>>
>> I do not remember if use drools 6 or drools 5. If you using drools 6.
>> Phreaks algorithm use multi threading according to use 'from
>> accummulate' far i understand here:
>>
>> http://planet.jboss.org/post/drools_6_performance_with_the_phreak_algorithm
>>
>> Instead to put a thread by ksession here rules evaluation are
>> multi-threaded.
>>
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> --
> Maxime FALAIZE
>



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

Re: [rules-users] Pooling stateful sessions to have threaded executions of a ruleset

2014-04-07 Thread Maxime Falaize
I'm sorry but I don't understand what you are talking about. In this
article, there is nothing about multithreaded rules evaluation. It just
says that the Phreak algorithm is designed for thread safety and
*future*multicore processors exploitation. It doesn't mean that it is
already
multithreaded. Moreover I tested my appliciation with and without
multithreaded sessions (I am using Drools 6.0.1.Final) and I noted a faster
execution in the multithreaded one.


2014-04-04 13:53 GMT+02:00 jmercier :

> Le 04/03/2014 09:55, Maxime Falaize a écrit :
> > Hello,
> >
> > I want to ask you if it is a good practive to pool stateful sessions
> > for a specific ruleset to improve the execution performance.
> > Actually in my application I execute my rules by calling SOAP
> > webservice. For performance purpose, I test multithreaded calls to my
> > webservice and I noted that when I pool sessions in the server side,
> > it improves the performance a lot.
> >
> > To pool sessions, I just declare multiple ksession tag in my
> > kmodule.xml :
> >
> > 
> > 
> >  
> > 
> > 
> > 
> >  
> >
> > In my spring webservice endpoint I just put that code to handle the
> > pool :
> >
> > @Endpoint
> > public class ExampleEndpoint implements InitializingBean {
> >
> > @Autowired
> > private ExampleRuleService ruleService;
> >  private Map isRunningMap = new
> > HashMap();
> > private static final int NB_POOL_SESSIONS = 5;
> >
> > @PayloadRoot(localPart = "com.example.ExampleRequest")
> >  @ResponsePayload
> > public ExampleResponse handleRequest(
> > @RequestPayload ExampleRequest request) throws
> > InterruptedException {
> > KieServices ks = KieServices.Factory.get();
> > KieContainer kc = ks.getKieClasspathContainer();
> >  while (true) {
> > for (int i = 0; i < NB_POOL_SESSIONS; i++) {
> > boolean run = false;
> >
> > synchronized (isRunningMap) {
> > if (!isRunningMap.get(i)) {
> >  isRunningMap.put(i, true);
> > run = true;
> > }
> > }
> >
> > if (run) {
> > KieSession ksession = kc.newKieSession("KSession"
> > + (i + 1));
> >  ExampleResponse response =
> > ruleService.run(ksession, request);
> > ksession.dispose();
> >
> > isRunningMap.put(i, false);
> > return response;
> >  }
> > }
> > Thread.sleep(100);
> > }
> > }
> >
> > public void afterPropertiesSet() throws Exception {
> > for (int i = 1; i <= NB_POOL_SESSIONS; i++) {
> > isRunningMap.put((i - 1), false);
> >  }
> > }
> >
> > }
> >
> > It works well because in my benchmark I improve 5 times the
> > performance (as I have 5 different threads) but I wondered if it is a
> > good practice and if it does not hide any issues that I could have in
> > the future.
> >
> > Thanks for your help.
> >
> > --
> > Maxime FALAIZE
> > ___
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> Hi maxime,
>
> I do not remember if use drools 6 or drools 5. If you using drools 6.
> Phreaks algorithm use multi threading according to use 'from
> accummulate' far i understand here:
> http://planet.jboss.org/post/drools_6_performance_with_the_phreak_algorithm
>
> Instead to put a thread by ksession here rules evaluation are
> multi-threaded.
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users




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

[rules-users] Pooling stateful sessions to have threaded executions of a ruleset

2014-04-03 Thread Maxime Falaize
Hello,

I want to ask you if it is a good practive to pool stateful sessions for a
specific ruleset to improve the execution performance.
Actually in my application I execute my rules by calling SOAP webservice.
For performance purpose, I test multithreaded calls to my webservice and I
noted that when I pool sessions in the server side, it improves the
performance a lot.

To pool sessions, I just declare multiple ksession tag in my kmodule.xml :









In my spring webservice endpoint I just put that code to handle the pool :

@Endpoint
public class ExampleEndpoint implements InitializingBean {

@Autowired
private ExampleRuleService ruleService;
private Map isRunningMap = new HashMap();
private static final int NB_POOL_SESSIONS = 5;

@PayloadRoot(localPart = "com.example.ExampleRequest")
@ResponsePayload
public ExampleResponse handleRequest(
@RequestPayload ExampleRequest request) throws
InterruptedException {
KieServices ks = KieServices.Factory.get();
KieContainer kc = ks.getKieClasspathContainer();
while (true) {
for (int i = 0; i < NB_POOL_SESSIONS; i++) {
boolean run = false;

synchronized (isRunningMap) {
if (!isRunningMap.get(i)) {
isRunningMap.put(i, true);
run = true;
}
}

if (run) {
KieSession ksession = kc.newKieSession("KSession" + (i
+ 1));
ExampleResponse response = ruleService.run(ksession,
request);
ksession.dispose();
isRunningMap.put(i, false);
return response;
}
}
Thread.sleep(100);
}
}

public void afterPropertiesSet() throws Exception {
for (int i = 1; i <= NB_POOL_SESSIONS; i++) {
isRunningMap.put((i - 1), false);
}
}

}

It works well because in my benchmark I improve 5 times the performance (as
I have 5 different threads) but I wondered if it is a good practice and if
it does not hide any issues that I could have in the future.

Thanks for your help.

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

[rules-users] drools-camel-server-example exception

2014-03-27 Thread Maxime Falaize
Hello,

I was testing SOAP requests with the drools-camel-server-example and I have
trouble with it.
Everything is fine when I run org.drools.server.CxfSoapClientServerTest but
I noted that the SOAP request is sent to a spring reference of the cxf
endpoint and when I want to change it to
cxfrs://http://localhost:9002/soapto be more realistic, it raises this
exception :

Caused by: org.apache.cxf.interceptor.Fault: .No message body writer has
been found for class : class
com.sun.xml.internal.messaging.saaj.soap.ver1_1.Message1_1Impl, ContentType
: text/plain.
at
org.apache.cxf.jaxrs.client.WebClient$BodyWriter.handleMessage(WebClient.java:938)
~[cxf-rt-frontend-jaxrs-2.6.8.jar:2.6.8]
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
~[cxf-api-2.6.8.jar:2.6.8]
at
org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:839)
~[cxf-rt-frontend-jaxrs-2.6.8.jar:2.6.8]
... 90 common frames omitted
Caused by: org.apache.cxf.jaxrs.client.ClientWebApplicationException: .No
message body writer has been found for class : class
com.sun.xml.internal.messaging.saaj.soap.ver1_1.Message1_1Impl, ContentType
: text/plain.
at
org.apache.cxf.jaxrs.client.AbstractClient.reportMessageHandlerProblem(AbstractClient.java:635)
~[cxf-rt-frontend-jaxrs-2.6.8.jar:2.6.8]
at
org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:401)
~[cxf-rt-frontend-jaxrs-2.6.8.jar:2.6.8]
at
org.apache.cxf.jaxrs.client.WebClient$BodyWriter.handleMessage(WebClient.java:930)
~[cxf-rt-frontend-jaxrs-2.6.8.jar:2.6.8]
... 92 common frames omitted

I don't know how to correct this issue.

To be more precise, I edited the camel-client-test.xml and changed in the
soap route  to http://localhost:9002/soap"/>.

Thanks for your help.

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

Re: [rules-users] Not able to detect how to correct ERR 102

2014-03-21 Thread Maxime Falaize
Is your DSL file in the same directory of your DSLR ?


2014-03-21 14:55 GMT+01:00 ankit3j :

> Yes Maxime, still the same error.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Not-able-to-detect-how-to-correct-ERR-102-tp4028884p4028897.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
>



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

Re: [rules-users] Not able to detect how to correct ERR 102

2014-03-21 Thread Maxime Falaize
Try with this :

rule "hello rule"
when
There is a Customer with first name "David"
then
Greet Customer
end

and this DSL :


[condition][]There is a Customer with first name {name}=$customer :
Customer(firstName == {name})
[consequence][]Greet Customer=System.out.println("Hello " +
$customer.getFirstName());
-


Of course your DSLR file is dependent of the DSL. Without the DSL, Drools
cannot guess what you want to do.


2014-03-21 14:12 GMT+01:00 ankit3j :

> Contents of Sample.dsl
>
> 
> [condition][]There is a Customer with first name "{name}"=$customer :
> Customer(firstName == {name})
> [consequence][]Greet Customer=System.out.println("Hello " +
> $customer.getFirstName());
>
> -
>
> Personally, I don't think its dependent on DSL contents as I have not yet
> compiled anything. From my point of view, my DSLR file is still independent
> of whatever DSL I am using.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Not-able-to-detect-how-to-correct-ERR-102-tp4028884p402.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
>



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

Re: [rules-users] Not able to detect how to correct ERR 102

2014-03-21 Thread Maxime Falaize
The problem seems to be in the DSL file. Can you give us its contents ?


2014-03-21 12:47 GMT+01:00 ankit3j :

> Below is a sample DSLR code I am trying out. Now I am getting error in
> "when"
> block. After hours of trying to search for a solution I have not yet been
> able to detect the error.
>
> package com.sample
> import com.sample.*;
> //expander sample.dsl
> rule "hello rule"
> when
> There is a "$customer" with first name "David"  // This is
> where the error is
> then
> Greet Customer
> end
>
> [ERR 102] Mismatched input "is" in rule "hello rule"
>
> Any idea whats wrong with this line??
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Not-able-to-detect-how-to-correct-ERR-102-tp4028884.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
>



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