Re: [rules-users] Drools Developers get PAID MORE as demand QUADROUPLES!!!

2011-12-15 Thread Anderson Neves
Good news =D is there any graphs showing how this is around the world?

Regards,
Anderson Neves

2011/12/15 Mark Proctor 

>  Good news for those with Drools skills, your in demand!!! Latest results
> in the UK from itjobswatch.co.uk <http://www.itjobswatch.co.uk/> shows
> over a three times increase in demand for Drools jobs since Dec 2010. It
> doesn't take much to imagine where that curve is going to be in 2014.
>
>
> http://www.dzone.com/links/r/drools_developers_get_paid_more_as_demand_quadrou.html
>
> ___
> 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] Drools Flow - Wait State - How to use ruleflow variables in the constraint?

2011-05-10 Thread Anderson Neves
Hi everybody.

I am using Drools 5.1.1 with persistence support. In the Wait State node I
only have the option to write a constraint in the rule way, and I have not
discovered how to use a variable of the ruleflow in it. Please, see the
hypothetical scenario below:

variable - a variable of the ruleflow that has the same attribute as the
class of the example
attribute - an atribute of the class of the example
Type - the class of the example

Constraint with mvel dialect:

Type(attribute == variable.attribute)


The error is something like there is no getVariable() in the class Type.
Thank you very much for the help

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


[rules-users] Spring + Drools + Console Application

2011-04-04 Thread Anderson Neves
Hi everybody.

I am having a problem to instantiate a console application with Drools and
Sping. With Spring, I am able to instanciate a bean and print its value to
console, but with Spring + Drools I get this error:

Exception in thread "main"
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'kbase': Invocation of init method failed; nested exception is
java.lang.RuntimeException: Unable to parser Reader
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
at com.test.Test.main(Test.java:10)
Caused by: java.lang.RuntimeException: Unable to parser Reader
at org.drools.compiler.DrlParser.getParser(DrlParser.java:313)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at org.drools.compiler.DrlParser.parse(DrlParser.java:147)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:263)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:458)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:519)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at
org.drools.container.spring.beans.KnowledgeBaseBeanFactory.afterPropertiesSet(KnowledgeBaseBeanFactory.java:103)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 15 more
Caused by: java.lang.NullPointerException
at java.io.FilterInputStream.close(Unknown Source)
at
sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream.close(Unknown
Source)
at sun.nio.cs.StreamDecoder.implClose(Unknown Source)
at sun.nio.cs.StreamDecoder.close(Unknown Source)
at java.io.InputStreamReader.close(Unknown Source)
at
org.antlr.runtime.ANTLRReaderStream.load(ANTLRReaderStream.java:92)
at
org.antlr.runtime.ANTLRInputStream.(ANTLRInputStream.java:68)
at
org.antlr.runtime.ANTLRInputStream.(ANTLRInputStream.java:52)
at
org.antlr.runtime.ANTLRInputStream.(ANTLRInputStream.java:48)
at
org.antlr.runtime.ANTLRInputStream.(ANTLRInputStream.java:40)
at org.drools.compiler.DrlParser.getParser(DrlParser.java:308)
... 24 more

I use eclipse, and running from the IDE Spring + Drools in a console
application works fine. This problem happens when I generate an executable
jar and try the "java -jar" command.

My main method is below

public static void main(String[] args) {
ClassPathXmlApplicationContext context = new
ClassPathXmlApplicationContext("appConfig.xml");
StatefulKnowledgeSession ksession = (StatefulKnowledgeSession)
context.getBean("ksession");
System.out.println(ksession);
}

And my applicationContext.xml is below


http://www.springframework.org/schema/beans";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xmlns:drools="http://drools.org/schema/drools-spring";
   xmlns:camel=

Re: [rules-users] FAIL - getProcessInstances() from persisted StatefulKnowledgeSession

2011-03-30 Thread Anderson Neves
Hi Stephan.

Thank you for the replay. Next time I will read the javadoc before asking
here.

Regards,
Anderson

2011/3/30 
>
> Hi,
>
> see javadoc of
org.drools.runtime.process.ProcessRuntime.getProcessInstances():
>
>  * Returns a collection of currently active process instances.  Note
that only process
>  * instances that are currently loaded and active inside the engine
will be returned.
>  * When using persistence, it is likely not all running process
instances will be loaded
>  * as their state will be stored persistently.  It is recommended not
to use this
>  * method to collect information about the state of your process
instances but to use
>  * a history log for that purpose.
>
> If no instance is loaded yet, that this behaviour is exactly as described.
>
> Mit freundlichen Grüssen/Best regards
>
> i. A.
> Stephan Koops
> Software Engineer
> We4IT GmbH
>
>
> ***
> Sie wollen aktuelle Informationen zu Lotus-Produkten? Dann besuchen Sie
unseren Blog:
>
> http://www.lotus-notes-domino-blog.de
> ***
>
>
> We4IT GmbH
> Technologiepark 11
> 33100 Paderborn
>
> Tel: +49 5251 / 70993 - 24
> Fax: +49 5251 / 70993 - 01
> Mobil:
> E-Mail: stephan.ko...@we4it.com
>
> Internet: http://www.we4it.com
>
> HRB 20740, Amtsgericht Bremen
> Geschäftsführer: Stefan Sucker, Vicente Diaz Fernandez
> USt.-ID.-Nr. DE 220 859 831
>
> Diese Nachricht ist vertraulich und ausschließlich für die adressierte
Person und/oder Organisation bestimmt. Vertrauliche und/oder spezifische
Informationen können hierin enthalten sein. Falls Sie ein nicht
beabsichtigter Empfänger dieser Nachricht sind, sind das Kopieren, Verteilen
und/oder das Aufnehmen aus dem Inhalt resultierender Handlungen untersagt.
Haben Sie diese Nachricht fehlerhaft und/oder unvollständig erhalten,
benachrichtigen Sie uns bitte umgehend unter unseren oben genannten
Kontaktmöglichkeiten.
> This message is confidential and intended solely for the person or
organization to which it is addressed. It may contain privileged and
confidential information. If you are not the intended recipient, you should
not copy, distribute or take any action on reliance on it. If you have
received this transmission in error, please notify us immediately by e-mail
at the above address.
>
>
> From: Anderson Neves 
> To: Rules Users List 
> Date: 30.03.2011 05:34
> Subject: [rules-users] FAIL - getProcessInstances() from persisted
 StatefulKnowledgeSession
> 
>
>
> Hi everybody.
>
> I configured the session persistence and persisted an instantiated
process. When I get the session from the database and use the method
getProcessInstances(), it returns an empty collection. But, when I call
getProcessInstance(1), and 1 is the InstanceId of the ProcessInstanceInfo
(table that contains the process instance), I get the correct process
instance. Is this a bug? See the code below.
>
> statefulSession =
JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, knowledgeBase,
null, environment);
>
> Collation processInstances =
statefulSession.getProcessInstances(); // FAIL - return empty collection
>
> ProcessInstance processInstance = statefulSession.getProcessInstance(1);
// OK - return the process instance
>
>
> Regards,
> Anderson___
> 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] FAIL - getProcessInstances() from persisted StatefulKnowledgeSession

2011-03-29 Thread Anderson Neves
Hi everybody.

I configured the session persistence and persisted an instantiated process.
When I get the session from the database and use the method
getProcessInstances(), it returns an empty collection. But, when I call
getProcessInstance(1), and 1 is the InstanceId of the ProcessInstanceInfo
(table that contains the process instance), I get the correct process
instance. Is this a bug? See the code below.

statefulSession =
JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, knowledgeBase,
null, environment);

Collation processInstances =
statefulSession.getProcessInstances(); // FAIL - return empty collection

ProcessInstance processInstance = statefulSession.getProcessInstance(1); //
OK - return the process instance


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


Re: [rules-users] endless loop even with "no-loop"

2011-03-23 Thread Anderson Neves
Hi.

I like to add negated attributes in the condition, or other attributes that
better describe the object state, like below. If you write two rules to the
same object state, you should think to join the rules into one rule.

rule
 when
$object:Type(attribute=="value", secondAttribute == false,
thirdAttribute == "")
 then
// do consequence
end

Regards,
Anderson

2011/3/23 Gabor Szokoli 

> This is I think something all of us came across while learning Drools...
>
> So I searched for "drools loop faq" in google but nothing useful came up.
> I propose to extend the "inifinite recursion" section in the faq with
> the best practices for avoiding this!
>
> My favorite way to avoid unnecessary activations is to include the
> consequence among the conditions, negated:
>
> rule
>  when
>   $object:Type(attribute!="value")
>  then
>  modify ($object) { setAttribute("value")}
> end
>
>
> Gabor
>
> On Wed, Mar 23, 2011 at 12:30 PM, James Gu 
> wrote:
> > Hi, I am working on rule and found that it is very easy to cause endless
> > loop.
> >
> > For example:
> > Rule 1 match status and update message.
> > Rule 2 match type and update message.
> > This will cause endless loop even I add "no-loop" on each rule. Is there
> > anyway to avoid this? for example: each rule only execute one time, or
> set a
> > maximum execute times.
> >
> >
> > rule "rule 1"
> > no-loop
> >when
> >m : Message( status == Message.HELLO)
> >then
> >System.out.println( "rule 1" );
> >m.setMessage( "update 1" );
> >update( m );
> >
> > end
> >
> > rule "rule 2"
> > no-loop
> >when
> >m:Message( type=="type1" )
> >then
> >System.out.println( "rule 2" );
> >m.setMessage( "update 2" );
> >update( m );
> > end
> >
> > --
> > View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/endless-loop-even-with-no-loop-tp2719917p2719917.html
> > Sent from the Drools - User mailing list archive at Nabble.com.
> > ___
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools Licence

2011-03-22 Thread Anderson Neves
Hi Diego.

Thank you very much.

2011/3/22 Diego López León 

> Hi Anderson,
> Drools is licensed under Apache Software License. I suggest you to
> take a look at http://www.apache.org/foundation/licence-FAQ.html#IsItFee
>
> best.
>
> 2011/3/22 Anderson Neves :
> > Hi everybody.
> >
> > Can Drools be used in a commercial application? Like Hibernate can. I
> read
> > the licence, but still have doubts.
> >
> > Regards,
> > Anderson
> >
> > ___
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
>
>
> --
> diego
> ___
> 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] Drools Licence

2011-03-22 Thread Anderson Neves
Hi everybody.

Can Drools be used in a commercial application? Like Hibernate can. I read
the licence, but still have doubts.

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


Re: [rules-users] Problem persisting human tasks

2011-03-07 Thread Anderson Neves
Hi,

When I started to using drools flow persistence, I was getting the same
error "java.lang.IllegalStateException: EntityManager is closed". After a
lot of time I figured out that I was using the command "ksession.dispose();"
and when I removed this command everything worked fine.

Regards,
Anderson

2010/11/23 raic 

>
> Hi,
>
> I'm having problems using drools flow persistance with human tasks. I'm
> using drools server.
>
> On one hand, I have my test application, which starts a MinaTaskServer for
> registering human tasks, and then, the application generates JSON commands
> for executing a flow with human tasks on the execution server.
>
> Without using flow persistence, this is working ok, i'm able to retrieve
> the
> pending tasks and completing them without problems.
>
> When I try to configure flow persistence on the execution server, i can
> start the process, the tasks are registered ok and drools flow tables are
> generated in my database (processinstanceinfo,sessioninfo,workiteminfo...)
> with the correct flow information. The problem appears when i retrieve a
> pending task, and then, i want to complete it. It seems that the
> communication between MinaTaskServer and ExecutionServer is not ok.
>
> The error i'm getting is the following:
>
>
> [2010:11:327 18:11:661:debug] Message receieved on client :
> EventTriggerResponse
>
> [2010:11:327 18:11:661:debug] Arguments :
> [org.drools.task.event.EventPayload@1b2df13]
> Task completed 1
> [2010:11:327 18:11:661:debug] Message receieved on client :
> EventTriggerResponse
> [2010:11:327 18:11:661:debug] Arguments :
> [org.drools.task.event.EventPayload@1f7c6e1]
> Task completed 1
> [2010:11:327 18:11:770:debug] Message receieved on client : GetTaskResponse
> [2010:11:327 18:11:770:debug] Arguments : [org.drools.task.Task@d17fbb51]
> [2010:11:327 18:11:770:exception] Uncaught exception on client
> java.lang.IllegalStateException: EntityManager is closed
> at org.hibernate.ejb.EntityManagerImpl.getSession(EntityManagerImpl.java
> :66)
>at
>
> org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:182)
>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>at java.lang.reflect.Method.invoke(Unknown Source)
>at
>
> org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:358)
>at $Proxy132.find(Unknown Source)
>at
>
> org.drools.persistence.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:88)
>at
>
> org.drools.process.workitem.wsht.WSHumanTaskHandler$GetCompletedTaskResponseHandler.execute(WSHumanTaskHandler.java:250)
>at
>
> org.drools.task.service.TaskClientHandler.messageReceived(TaskClientHandler.java:80)
>at
>
> org.drools.task.service.mina.MinaTaskClientHandler.messageReceived(MinaTaskClientHandler.java:47)
>at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713)
>at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
>at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
>at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
>at
>
> org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:375)
>at
>
> org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:229)
>at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
>at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
>at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
>at
>
> org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)
>at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
>at
>
> org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)
>at
>
> org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:638)
>at
>
> org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598)
>at
>
> org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587)
>at
>
> org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61)