Re: [rules-users] accumulate function not registered

2014-06-19 Thread rogerL
Did a partial rollback and it resolve the problem.

Encountered this issue in effort to get around a spring boot from jar
problem. Initially refactored code then upgraded to 6.1.0-CR1. Was at that
point the issue arose. On rolling back my refactor (and maintaining the
drools 6.1.0-CR1 version) the issue was cleared.

A little perplexed on that. Suspect it may have something to do with class
loading, but only a guess. Does the location of the .drl (resource) files in
the project structure affect the build and boot process?  



--
View this message in context: 
http://drools.46999.n3.nabble.com/accumulate-function-not-registered-tp4030102p4030116.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] accumulate function not registered

2014-06-18 Thread rogerL
After upgrade to 6.1.0.CR1 rule compilation is generating a pluggable
accumulate function registration error.

Partial stack dump:
Caused by: java.lang.RuntimeException: Error while creating KieBase[Message
[id=1, level=ERROR,
path=com/s/c/manager/rules/campaign/priority/prioritize.drl, line=31,
column=0
   text=Unknown accumulate function: 'topPriority' on rule 'Insert highest
priority campaign'. All accumulate functions must be registered before
building a resource.], Message [id=2, level=ERROR,
path=com/s/c/manager/rules/campaign/priority/prioritize.drl, line=31,
column=0
   text=Rule Compilation error $tc cannot be resolved to a variable]]

The associated rule and accumulate import are:

import accumulate com.s.c.util.HighestPriorityCampaignAccumulateFunction
topPriority;

rule Insert highest priority campaign
when
not TopCampaign()
accumulate(TargetCampaigns($list : list, list.size 0), $tc :
topPriority( $list ) )
then
insert(new TopCampaign($tc));
end

Is this syntax no longer correct?



--
View this message in context: 
http://drools.46999.n3.nabble.com/accumulate-function-not-registered-tp4030102.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] NPE spring-boot project via a jar

2014-06-17 Thread rogerL
Hi,

Running into NPE on application boot up. It appears to be related to a
previous topic. I didn't add to it as the last entry appears to veer off
topic and didn't want it lost in the wash.
  
http://drools.46999.n3.nabble.com/rules-users-NullPointerException-with-kie-spring-6-0-1-and-Spring-4-0-td4027854.html

Using kie-spring-6.1.0.Beta4.jar, spring 4. As per the former topic, the
application starts up without issue in IDE env, etc. but fails on jar boot
up.

The stack is as follows:

Exception in thread main
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'kiePostProcessor' defined in class path resource
[qres/callManager.xml]: Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [org.kie.spring.KModuleBeanFactoryPostProcessor]: Constructor
threw exception; nested exception is java.lang.NullPointerException
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1076)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1021)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1121)
at
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:682)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
at com.s.c.util.ConfigUtility.loadProfileContext(ConfigUtility.java:42)
at com.s.c.manager.CallManager.init(CallManager.java:19)
at com.s.c.manager.CallManager.main(CallManager.java:46)
Caused by: org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class [org.kie.spring.KModuleBeanFactoryPostProcessor]:
Constructor threw exception; nested exception is
java.lang.NullPointerException
at 
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:164)
at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1069)
... 13 more
Caused by: java.lang.NullPointerException
at
org.kie.spring.KModuleBeanFactoryPostProcessor.initConfigFilePath(KModuleBeanFactoryPostProcessor.java:83)
at
org.kie.spring.KModuleBeanFactoryPostProcessor.init(KModuleBeanFactoryPostProcessor.java:68)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at 
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
... 15 more



--
View this message in context: 
http://drools.46999.n3.nabble.com/NPE-spring-boot-project-via-a-jar-tp4030081.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] Not and forall operator behaviour

2014-05-29 Thread rogerL
Are the two following statements not equivalent?

forall($msg:Message()
Message(this==$msg, sent==true, status!=State._INITIALIZED)
)


not( Message(sent==false, status==State._INITIALIZED) )

My understanding is that they both ensure that there are no Message objects
in WM with property 'sent' set to false and property 'status' set to
State._INITIALIZED.

In my situation, the 'forall' approach is working as expected, the 'not'
approach fires once (when there are no Message objects in WM) and never
again.

Appreciate if anyone could shed light on this.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Not-and-forall-operator-behaviour-tp4029761.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] Not and forall operator behaviour

2014-05-29 Thread rogerL
Davide,

Thank you for the clarification. My error was to interpret the not
operator as an existential function (ie: there is no such object that
exists) and viewing the object as a unit, rather than, as you pointed out,
logically manipulable.
In light of that, the logical OR in place of the comma makes sense.

Roger 



--
View this message in context: 
http://drools.46999.n3.nabble.com/Not-and-forall-operator-behaviour-tp4029761p4029764.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] Cannot issue fireUntilHalt when using persisted session

2014-05-28 Thread rogerL
Open ticket https://issues.jboss.org/browse/DROOLS-507.
I didn't provide any persist and reload code as the system hasn't ever
reached the point of saving a session.
I tried working around the issue by using fireAllRules and an interval rule.
I was able to persist; however, the reload is failed with an exception that
I believe may be related to 
https://issues.jboss.org/browse/DROOLS-422.
As such, I added a comment therein with the stack trace.




--
View this message in context: 
http://drools.46999.n3.nabble.com/Cannot-issue-fireUntilHalt-when-using-persisted-session-tp4029656p4029738.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] Cannot issue fireUntilHalt when using persisted session

2014-05-22 Thread rogerL
Due to an issue with reloading persisted sessions that contained a cron timer
rule, I upgraded to 6.1.0.Beta3. Now I'm encountering a problem with a
threaded fireUntilHalt command (cannot be issued on a persisted session). 

Exception in thread SimpleAsyncTaskExecutor-1
java.lang.UnsupportedOperationException: Command session.fireUntilHalt();
cannot be issued on a persisted session
at
org.drools.persistence.SingleSessionCommandService$TransactionInterceptor.execute(SingleSessionCommandService.java:474)
at
org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:353)
at
org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.fireUntilHalt(CommandBasedStatefulKnowledgeSession.java:272)...

It worked without issue in 6.0.1.Final. Though I suspect not, is this
expected behaviour? Alternately, are there configuration/other changes that
must be implemented.

Libs
spring 4.0.1
kie, drools, jbpm 6.1.0.Beta3
hibernate 4.3.4



 



--
View this message in context: 
http://drools.46999.n3.nabble.com/Cannot-issue-fireUntilHalt-when-using-persisted-session-tp4029656.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] Rule for only one of the below exists, help please?

2014-05-22 Thread rogerL
Have a look at the collect command. Something like:

ArrayList( size == 1 ) from collect( LineItem (materialID == 'a' || == 'b' 
||  == 'c' ) )



--
View this message in context: 
http://drools.46999.n3.nabble.com/Rule-for-only-one-of-the-below-exists-help-please-tp4029658p4029660.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