Re: [rules-users] Excel Syntax in Decision Tables

2014-05-26 Thread Wolfgang Laun
Oops, sorry: The constraint goes into the leftmost pair of parentheses.
Simply exchance to order of the patterns: Classification(); $f: FATCA();

-W

On 26/05/2014, crosbis2  wrote:
> It's guvnor-5.5.0.Final-jboss-as-7.0
>
> Yes i copied your syntax
>
> 
>
> and got this
>
> 
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Excel-Syntax-in-Decision-Tables-tp4029520p4029693.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] Slf4j Log4j logger not working with Drools drl while using as a global variable.

2014-05-26 Thread Soumya.plavaga
I am using global slf4j log4j logger as a global variable within our drl and
inserting that global logger value at runtime into kiesession. While we are
trying to do logger.info with multiple arguments then it's giving the
following exception stack trace -

Exception executing consequence for rule "Test Logger 2" in
test.rules.system: java.lang.RuntimeException: cannot invoke method: info
at
org.drools.core.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at
org.drools.core.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1027)
at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:129)
at
org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:71)
at
org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:935)
at
org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1200)
at
org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:952)
at
org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:926)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:232)
at
test.platform.rules.executor.service.impl.RuleExecutorServiceImplTest.testExecuteRule(RuleExecutorServiceImplTest.java:230)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at
org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at
org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
at
org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:232)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at
org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at
org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:175)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.RuntimeException: cannot invoke method: info
at
org.mvel2.optimizers.impl.refl.nodes.MethodAccessor.getValue(MethodAccessor.java:63)
at
org.mvel2.optimizers.impl.refl.nodes.VariableAccessor.getValue(VariableAccessor.java:37)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:86)
at
org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)
at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)
at org.mvel2.MVEL.executeExpression(MVEL.java:930)
at
org.drools.core.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:107)
at
org.drools.core.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1016)
... 36 more
Caused by: java.lang.Array

Re: [rules-users] Nested Collect probably

2014-05-26 Thread Wolfgang Laun
It's not possible to use the conditional element "or" inside an
accumulate. (Reading up on the "or" CE should give you an idea why.)
And that's why I
used a boolean expression as a constraint within the third pattern.

-W

On 26/05/2014, Chris B  wrote:
> Actually it is a event from an application usecaseThanks for your reply and
> I
> think I am very close with your help.This rule is giving error Line 99:5
> mismatched input 'or' in rule "usecase-test"]rule "usecase-test"when
> $e0 : Event ()ParsedValue(event == $e0, ruleId == "0", varName ==
> "V0_1", $e0_V0_1_varStringValue : varStringValue)ParsedValue(event ==
> $e0, ruleId == "0", varName == "V0_2", $e0_V0_2_varStringValue :
> varStringValue)accumulate( ParsedValue( ruleId == "0", varName ==
> "V0_1",  varStringValue == $e0_V0_1_varStringValue, $e : event ) and
>
> ParsedValue( event == $e, ruleId == "0", varName == "V0_2", varStringValue
> == $e0_V0_2_varStringValue ) and ((   
> ParsedValue( event ==
> $e, ruleId == "1", varName == "V1_1", varStringValue == "X1_1")   
> and
>   
> ParsedValue( event == $e, ruleId == "1", varName == "V1_2", varStringValue
> == "X1_2"))   or *[<  (   ParsedValue( 
> event == $e, ruleId ==
> "2", varName == "V2_1", varStringValue == "X2_1") and
>   ParsedValue(
> event == $e, ruleId == "2", varName == "V2_2", varStringValue == "X2_2")
>
> ));$es: collectSet( $e ); $es.size() >= 5 )   then
> System.out.println( "usecase-test" + $es.size());endThe Event comes from
> application and is parsed for values.The event from same application will
> have the same values for ruleId=0, varName-V0_1 and V0_2So any event with
> same values for V0_1 and V0_2 is coming from same application.The rule says
> if from same applicationyou have values which has this combinationruleId ==
> "1", varName == "V1_1", varStringValue == "X1_1"ruleId == "1", varName ==
> "V1_2", varStringValue == "X1_2"or this combinationruleId == "2", varName
> ==
> "V2_1", varStringValue == "X2_1"ruleId == "2", varName == "V2_2",
> varStringValue == "X2_2"or this combination sayruleId == "3", varName ==
> "V3_1", varStringValue == "X3_1"ruleId == "3", varName == "V3_2",
> varStringValue == "X3_2"ruleId == "3", varName == "V3_3", varStringValue ==
> "X3_3"In pure english it isFirst I have to identify if I am dealing with
> events from same applicationThis is by comparing (2) parsed values V0_1 and
> V0_2. If they are same across events .. then it having same source.Next
> lets
> check for other conditions..From Rule 1.. I want to check values of V1_1
> and
> V1_2, if there is a issueFrom Rule 2.. I want to check values of V2_1 and
> V2_2, if there is a issueNow I do not want to raise exception as soon as
> condition is met.. since the problem can occur and can be ignored. But if
> it
> happens more than 5 times from the same source, then I want to raise an
> alert.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Nested-Collect-probably-tp4029681p4029703.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] Nested Collect probably

2014-05-26 Thread Chris B
I tried a simpler version

rule "usecase2-test2"
when
$e0 : Event ()
ParsedValue(event == $e0, ruleId == "0", varName == "V0_1",
$e0_V0_1_varStringValue : varStringValue)
ParsedValue(event == $e0, ruleId == "0", varName == "V0_2",
$e0_V0_2_varStringValue : varStringValue)
accumulate( 
ParsedValue( ruleId == "0", varName == "V0_1",  varStringValue ==
$e0_V0_1_varStringValue, $e:event ) 
and 
ParsedValue( event == $e, ruleId == "0", varName == "V0_2",
varStringValue == $e0_V0_2_varStringValue ) 
and 
ParsedValue( event == $e, ruleId == "1", varName == "V1_1",
varStringValue == "X1_1")
and
ParsedValue( event == $e, ruleId == "1", varName == "V1_2",
varStringValue == "X1_2");
$es: collectSet( $e ); 
$es.size() >= 2 ) 

then
System.out.println( "usecase2" + $es.size());
end

but when I insert 2 events with same source (meaning same values with
(ruleId == "0", varName == "V0_1") and (ruleId == "0", varName == "V0_2")
and right values for rule1 variables
then also it works with one single event and never satisfies this condition.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Nested-Collect-probably-tp4029681p4029704.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] Nested Collect probably

2014-05-26 Thread Chris B
Actually it is a event from an application usecaseThanks for your reply and I
think I am very close with your help.This rule is giving error Line 99:5
mismatched input 'or' in rule "usecase-test"]rule "usecase-test"when   
$e0 : Event ()ParsedValue(event == $e0, ruleId == "0", varName ==
"V0_1", $e0_V0_1_varStringValue : varStringValue)ParsedValue(event ==
$e0, ruleId == "0", varName == "V0_2", $e0_V0_2_varStringValue :
varStringValue)accumulate( ParsedValue( ruleId == "0", varName ==
"V0_1",  varStringValue == $e0_V0_1_varStringValue, $e : event ) and
ParsedValue( event == $e, ruleId == "0", varName == "V0_2", varStringValue
== $e0_V0_2_varStringValue ) and (  (   ParsedValue( 
event ==
$e, ruleId == "1", varName == "V1_1", varStringValue == "X1_1") 
and 
ParsedValue( event == $e, ruleId == "1", varName == "V1_2", varStringValue
== "X1_2")  )   or *[<  (   ParsedValue( event == 
$e, ruleId ==
"2", varName == "V2_1", varStringValue == "X2_1")   and 
ParsedValue(
event == $e, ruleId == "2", varName == "V2_2", varStringValue == "X2_2")
));$es: collectSet( $e ); $es.size() >= 5 ) then   
System.out.println( "usecase-test" + $es.size());endThe Event comes from
application and is parsed for values.The event from same application will
have the same values for ruleId=0, varName-V0_1 and V0_2So any event with
same values for V0_1 and V0_2 is coming from same application.The rule says
if from same applicationyou have values which has this combinationruleId ==
"1", varName == "V1_1", varStringValue == "X1_1"ruleId == "1", varName ==
"V1_2", varStringValue == "X1_2"or this combinationruleId == "2", varName ==
"V2_1", varStringValue == "X2_1"ruleId == "2", varName == "V2_2",
varStringValue == "X2_2"or this combination sayruleId == "3", varName ==
"V3_1", varStringValue == "X3_1"ruleId == "3", varName == "V3_2",
varStringValue == "X3_2"ruleId == "3", varName == "V3_3", varStringValue ==
"X3_3"In pure english it isFirst I have to identify if I am dealing with
events from same applicationThis is by comparing (2) parsed values V0_1 and
V0_2. If they are same across events .. then it having same source.Next lets
check for other conditions..From Rule 1.. I want to check values of V1_1 and
V1_2, if there is a issueFrom Rule 2.. I want to check values of V2_1 and
V2_2, if there is a issueNow I do not want to raise exception as soon as
condition is met.. since the problem can occur and can be ignored. But if it
happens more than 5 times from the same source, then I want to raise an
alert.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Nested-Collect-probably-tp4029681p4029703.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] @propertyReactive not work when condition are coded in java

2014-05-26 Thread Davide Sottara
The engine analyzes the constraints to see which property a pattern is
"watching":

So, it expects something like:
Person( name == "alice" )

If you invoke your custom logic:
Person( myEqualComparator( ..., name, ... ) )
it's unlikely that the engine will recognize that a field is involved
and, even then, that it should react to.

The simplest solution is to force the pattern to react to the field,
doing either:

Person( myEqual(...), $n : name )

or, in alternative:

Person( myEqual(...) ) @watch( name )

Please let us know if it works for you.
Thanks
Davide


On 05/22/2014 02:49 PM, wtang wrote:
> I have rule1 and rule2 and rule1 is modifying an object whose property is
> checked in the when part of rule2 and rule2 should fire.
>
> The problem is rule2 is not firing.  When I took out the @PropertyReactive
> annotation, then rule2 will fire.
>
> After further investigation, I find the cause is because in the when part I
> am calling java function to do the comparison as suppose to using native
> operators like "==".
>
> Property Reactive seems to be not working when in the WHEN part of the rules
> we are calling java function to do the comparison as suppose to using native
> operators like ==, <, >, etc.  
>
> Please advice.
>
>
>
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/propertyReactive-not-work-when-condition-are-coded-in-java-tp4029657.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] java.lang.VerifyError org/drools/reteoo/ReteooRuleBase, method: setupRete signature: ()V

2014-05-26 Thread Davide Sottara
I can't tell for sure... 5.4.0 is relatively old, and there is not much
that can be done with the released jars.
I suspect that you had some duplicate, incompatible classes on the
classpath (having BOTH drools-all and the others
seems suspicious), and the classloader was 'almost always' picking up
the one that made it work. Out of pure luck.
Davide

On 05/26/2014 11:45 AM, Ivo Escamilla wrote:
>
> Thanks for your answer. It is the unique application in the server.
> The server is on my local. Right, it was working fine and then started
> throwing the exception.
>
> In the pom I had drools-core, drools-spring and drools-all-jdk5
> version 5.4.0.Final. I deleted all and use only drools- spring
> 5.4.0.Final and I solve the issue. I don't know why it works. I tried
> many things like new versions, deleted from my local and installed
> them again, with any success. It works using jetty but not with jboss.
> But using only that dependency fixed the issue. Do you know why?
>
> El may 26, 2014 11:02 AM, "Davide Sottara"  > escribió:
>
> You mean that it used to work with your combination (jboss 4.2 +
> drools
> 5.4.0)
> and then it suddenly started throwing the exception?
> It seems strange.. do you have other applications deployed on the
> same
> instance
> of jboss? Maybe it's picking up a different version of the jars from
> somewhere else
> Davide
>
> On 05/26/2014 10:10 AM, ivonne wrote:
>
> > Hi
> >
> > I am using jboss 4.2 and drools core 5.4.0.Final. The
> application was
> > working fine but without any change it started to throw an error
> when spring
> > bean for kbase is created. This is the error:
> > org.springframework.beans.factory.BeanCreationException: Error
> creating bean
> > with name 'kbase': Invocation of init method failed; nested
> exception is
> > java.lang.VerifyError: (class: org/drools/reteoo/ReteooRuleBase,
> method:
> > setupRete signature: ()V) Incompatible argument to function
> >
> > If I run the application using jetty it works fine.
> >
> > I've been looking about the error with any sucess.
> >
> > Thanks
> >
> >
> >
> >
> > --
> > View this message in context:
> 
> http://drools.46999.n3.nabble.com/java-lang-VerifyError-org-drools-reteoo-ReteooRuleBase-method-setupRete-signature-V-tp4029694.html
> > Sent from the Drools: User forum mailing list archive at
> Nabble.com.
> > ___
> > rules-users mailing list
> > [hidden email]
> 
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
>
> ___
> rules-users mailing list
> [hidden email] 
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> 
> If you reply to this email, your message will be added to the
> discussion below:
> 
> http://drools.46999.n3.nabble.com/java-lang-VerifyError-org-drools-reteoo-ReteooRuleBase-method-setupRete-signature-V-tp4029694p4029698.html
>
> To unsubscribe from java.lang.VerifyError
> org/drools/reteoo/ReteooRuleBase, method: setupRete signature:
> ()V, click here
> 
> .
> NAML
> 
> 
>
>
>
>
> ___
> 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] Cannot issue fireUntilHalt when using persisted session

2014-05-26 Thread Davide Sottara
Could you please show the code where you persist, reload and invoke
fireUntilHalt() on the session?
Ideally, could you open a jira ticket and post the code there? We'll
take a look then.
Thanks
Davide

On 05/22/2014 01:43 PM, rogerL wrote:
> 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
>

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


Re: [rules-users] java.lang.VerifyError org/drools/reteoo/ReteooRuleBase, method: setupRete signature: ()V

2014-05-26 Thread Ivo Escamilla
Thanks for your answer. It is the unique application in the server. The
server is on my local. Right, it was working fine and then started throwing
the exception.

In the pom I had drools-core, drools-spring and drools-all-jdk5 version
5.4.0.Final. I deleted all and use only drools- spring 5.4.0.Final and I
solve the issue. I don't know why it works. I tried many things like new
versions, deleted from my local and installed them again, with any success.
It works using jetty but not with jboss. But using only that dependency
fixed the issue. Do you know why?
El may 26, 2014 11:02 AM, "Davide Sottara"  escribió:

> You mean that it used to work with your combination (jboss 4.2 + drools
> 5.4.0)
> and then it suddenly started throwing the exception?
> It seems strange.. do you have other applications deployed on the same
> instance
> of jboss? Maybe it's picking up a different version of the jars from
> somewhere else
> Davide
>
> On 05/26/2014 10:10 AM, ivonne wrote:
>
> > Hi
> >
> > I am using jboss 4.2 and drools core 5.4.0.Final. The application was
> > working fine but without any change it started to throw an error when
> spring
> > bean for kbase is created. This is the error:
> > org.springframework.beans.factory.BeanCreationException: Error creating
> bean
> > with name 'kbase': Invocation of init method failed; nested exception is
> > java.lang.VerifyError: (class: org/drools/reteoo/ReteooRuleBase, method:
> > setupRete signature: ()V) Incompatible argument to function
> >
> > If I run the application using jetty it works fine.
> >
> > I've been looking about the error with any sucess.
> >
> > Thanks
> >
> >
> >
> >
> > --
> > View this message in context:
> http://drools.46999.n3.nabble.com/java-lang-VerifyError-org-drools-reteoo-ReteooRuleBase-method-setupRete-signature-V-tp4029694.html
> > Sent from the Drools: User forum mailing list archive at Nabble.com.
> > ___
> > rules-users mailing list
> > [hidden email] 
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
>
> ___
> rules-users mailing list
> [hidden email] 
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://drools.46999.n3.nabble.com/java-lang-VerifyError-org-drools-reteoo-ReteooRuleBase-method-setupRete-signature-V-tp4029694p4029698.html
>  To unsubscribe from java.lang.VerifyError
> org/drools/reteoo/ReteooRuleBase, method: setupRete signature: ()V, click
> here
> .
> NAML
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] java.lang.VerifyError org/drools/reteoo/ReteooRuleBase, method: setupRete signature: ()V

2014-05-26 Thread Davide Sottara
You mean that it used to work with your combination (jboss 4.2 + drools
5.4.0)
and then it suddenly started throwing the exception?
It seems strange.. do you have other applications deployed on the same
instance
of jboss? Maybe it's picking up a different version of the jars from
somewhere else
Davide

On 05/26/2014 10:10 AM, ivonne wrote:
> Hi
>
> I am using jboss 4.2 and drools core 5.4.0.Final. The application was
> working fine but without any change it started to throw an error when spring
> bean for kbase is created. This is the error:
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'kbase': Invocation of init method failed; nested exception is
> java.lang.VerifyError: (class: org/drools/reteoo/ReteooRuleBase, method:
> setupRete signature: ()V) Incompatible argument to function
>
> If I run the application using jetty it works fine.
>
> I've been looking about the error with any sucess.
>
> Thanks
>
>
>
>
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/java-lang-VerifyError-org-drools-reteoo-ReteooRuleBase-method-setupRete-signature-V-tp4029694.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] Abstraction between rules and data model?

2014-05-26 Thread Davide Sottara
We are working on the trait framework for cases like this. Essentially,
it allows to use
interfaces when writing rules AND to inject the interfaces dynamically
at runtime,
at the instance level. It relies on transparent proxies which wrap the
data classes
and implement the required interfaces. A simple field aliasing mechanism
is provided
(work in progress). For more complex transformations, "virtual" fields
can be added.
See section 7.7.8 of the manual for more details and let me know if it
can help
with your use case.
Best,
Davide

On 05/26/2014 09:55 AM, Wolfgang Laun wrote:
> Even a relatively sophisticated transformation would be easier to implement
> and most certainly safer from changes in the unstable Drools API than some
> hook-and-intercept mechanism built into Drools.
>
> Notice that violent structural departure of the model the BUs see from what
> you call "persistence model" might make it impossible for the BUs to come
> up with rules that can be transformed to match the other model at all;
> if it is possible, rules might still incur a heavy performance penalty.
>
> It is (IMHO) a myth that "Rules" is a foolproof way of establishing
> business logic
> independent from the data model and application environment with which
> this logic should be able to cooperate. As long as everything is kept in the
> abstract (i.e., formulated in terms of mathematics) it will look  good, but
> any implementation may throw a spanner in the works, or worse.
>
> -W
>
> On 26/05/2014, Péter Gergely, Horváth  wrote:
>> Hi Wolfgang,
>>
>> Thank you for your input. You are right that some of the cases could simply
>> be covered by regexp-replace, but I'm afraid, not all of them. Interfaces
>> could also help, but we have a requirement that the business rules should
>> not be tightly coupled to the underlying persistence model. (I understand
>> that some might say this is not ideal, but that is our current situation)
>>
>> I am wondering whether it is possible to hook into Drools engine and
>> intercept field value reference expression evaluations in run time (e.g if
>> "foo.bars" is used in an expression, we could return "foo.barList") ? By
>> injecting some custom code, we could make the necessary decisions and
>> extract the proper value from an object. Unfortunately these parts of
>> Drools are pretty much undocumented.
>>
>> Regards,
>> Peter
>>
>>
>>
>> 2014-05-26 13:57 GMT+02:00 Wolfgang Laun :
>>
>>> What you describe can be done with /bin/sed.
>>>
>>> Notice that the DSL processor doesn't require you to translate entire
>>> patterns; there is a mechanism for translating "keywords", which is
>>> just arbitrary tokens to whatever replacement text.
>>>
>>> If a "bar" must be translated to a "barList" in the context of a class
>>> "Foo" but not in any other context, a more sophisticated translation
>>> is required in any case (with /bin/sed still being sufficient if
>>> patterns aren't split across lines).
>>>
>>> Some say that good design makes use of Interfaces, which leaves room
>>> for actual implementations being changed as long as the interfaces are
>>> implemented. Here, note that rules can be written against interface
>>> types.
>>>
>>> -W
>>>
>>>
>>> On 26/05/2014, Péter Gergely, Horváth  wrote:
 Hi All,

 We are evaluating Drools 6 for our use case, and face challenges where
 we
 would need some ideas from more experienced users of Drools.

 We have an application with a massive code base and a large number of
>>> model
 (entity) classes. We are in the process of moving away from inherited
 legacy technologies and refactoring the old code base. As a part of
 this
 work we would like extract some of the hard-coded business logic to
 external rules, that is why we are looking at Drools as a potential
 solution.

 What we would like to have is some kind of abstraction or mapping
 between
 actual entities and rules the business users can define so that they do
>>> not
 have to know the _exact_ details of the data model (field names,
 precise
 relations etc). This would be important for us so that we can refactor
>>> the
 old model classes without affecting business rules; also it would make
>>> life
 easier for the business users. While IDE support might make refactoring
 easier, we definitely want to have a separation between rules and
>>> entities.
 Given our situation, writing and maintaining "stable" wrapper/adapter
 classes for the sole purpose of rule processing is out of question. I
>>> have
 checked the documentation of Drools DSL support and for me it seems to
 be
 overkill for our use case: we do not really need a custom language, but
 simply an abstraction between rules and the data model classes.

 What I could imagine is a piece of code, (a custom property resolver? -
>>> no
 sure how it is called) which maps property expressions to actual
>>> properties
 based on

[rules-users] java.lang.RuntimeException: Cannot find KieModule: org.acme:myartifact:1.0-SNAPSHOT

2014-05-26 Thread ganeshneelekani
Hi Team,

I am facing issue in drools 6.0 ,I have added kie-ci.jar in class
path,Drools is not able to found maven release snapshot.I have gone with
many post and not got the answer, Please let me know any one faced the
issues and they succeed to solve this 

Stacktrace is below.
java.lang.RuntimeException: Cannot find KieModule:
org.acme:myartifact:1.0-SNAPSHOT

20:47:34,646 ERROR [stderr] (http-localhost-127.0.0.1-8080-7)   at
org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:86)

20:47:34,649 ERROR [stderr] (http-localhost-127.0.0.1-8080-7)   at
com.sample.ProcessTest.callJavaclass(ProcessTest.java:36)

20:47:34,651 ERROR [stderr] (http-localhost-127.0.0.1-8080-7)   at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

20:47:34,652 ERROR [stderr] (http-localhost-127.0.0.1-8080-7)   at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)



--
View this message in context: 
http://drools.46999.n3.nabble.com/java-lang-RuntimeException-Cannot-find-KieModule-org-acme-myartifact-1-0-SNAPSHOT-tp4029696.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] java.lang.VerifyError org/drools/reteoo/ReteooRuleBase, method: setupRete signature: ()V

2014-05-26 Thread ivonne
Hi

I am using jboss 4.2 and drools core 5.4.0.Final. The application was
working fine but without any change it started to throw an error when spring
bean for kbase is created. This is the error:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'kbase': Invocation of init method failed; nested exception is
java.lang.VerifyError: (class: org/drools/reteoo/ReteooRuleBase, method:
setupRete signature: ()V) Incompatible argument to function

If I run the application using jetty it works fine.

I've been looking about the error with any sucess.

Thanks




--
View this message in context: 
http://drools.46999.n3.nabble.com/java-lang-VerifyError-org-drools-reteoo-ReteooRuleBase-method-setupRete-signature-V-tp4029694.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] Excel Syntax in Decision Tables

2014-05-26 Thread crosbis2
It's guvnor-5.5.0.Final-jboss-as-7.0

Yes i copied your syntax 

 

and got this 

 




--
View this message in context: 
http://drools.46999.n3.nabble.com/Excel-Syntax-in-Decision-Tables-tp4029520p4029693.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] Excel Syntax in Decision Tables

2014-05-26 Thread Wolfgang Laun
Which Drools version are you using?

The upper case 'T' in "Type == 3" is *very* unlikely.

And did you copy this exactly as I posted? Especially the final "()" is
essential in the second row.

-W

On 26/05/2014, crosbis2  wrote:
> Hi Laune,
>
> I tried what you prescribed but get the following in the source code when i
> upload it.
>
>  fatca: FATCA(Type == 3); Classification()
>
>
> ?
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Excel-Syntax-in-Decision-Tables-tp4029520p4029690.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] Abstraction between rules and data model?

2014-05-26 Thread Wolfgang Laun
Even a relatively sophisticated transformation would be easier to implement
and most certainly safer from changes in the unstable Drools API than some
hook-and-intercept mechanism built into Drools.

Notice that violent structural departure of the model the BUs see from what
you call "persistence model" might make it impossible for the BUs to come
up with rules that can be transformed to match the other model at all;
if it is possible, rules might still incur a heavy performance penalty.

It is (IMHO) a myth that "Rules" is a foolproof way of establishing
business logic
independent from the data model and application environment with which
this logic should be able to cooperate. As long as everything is kept in the
abstract (i.e., formulated in terms of mathematics) it will look  good, but
any implementation may throw a spanner in the works, or worse.

-W

On 26/05/2014, Péter Gergely, Horváth  wrote:
> Hi Wolfgang,
>
> Thank you for your input. You are right that some of the cases could simply
> be covered by regexp-replace, but I'm afraid, not all of them. Interfaces
> could also help, but we have a requirement that the business rules should
> not be tightly coupled to the underlying persistence model. (I understand
> that some might say this is not ideal, but that is our current situation)
>
> I am wondering whether it is possible to hook into Drools engine and
> intercept field value reference expression evaluations in run time (e.g if
> "foo.bars" is used in an expression, we could return "foo.barList") ? By
> injecting some custom code, we could make the necessary decisions and
> extract the proper value from an object. Unfortunately these parts of
> Drools are pretty much undocumented.
>
> Regards,
> Peter
>
>
>
> 2014-05-26 13:57 GMT+02:00 Wolfgang Laun :
>
>> What you describe can be done with /bin/sed.
>>
>> Notice that the DSL processor doesn't require you to translate entire
>> patterns; there is a mechanism for translating "keywords", which is
>> just arbitrary tokens to whatever replacement text.
>>
>> If a "bar" must be translated to a "barList" in the context of a class
>> "Foo" but not in any other context, a more sophisticated translation
>> is required in any case (with /bin/sed still being sufficient if
>> patterns aren't split across lines).
>>
>> Some say that good design makes use of Interfaces, which leaves room
>> for actual implementations being changed as long as the interfaces are
>> implemented. Here, note that rules can be written against interface
>> types.
>>
>> -W
>>
>>
>> On 26/05/2014, Péter Gergely, Horváth  wrote:
>> > Hi All,
>> >
>> > We are evaluating Drools 6 for our use case, and face challenges where
>> > we
>> > would need some ideas from more experienced users of Drools.
>> >
>> > We have an application with a massive code base and a large number of
>> model
>> > (entity) classes. We are in the process of moving away from inherited
>> > legacy technologies and refactoring the old code base. As a part of
>> > this
>> > work we would like extract some of the hard-coded business logic to
>> > external rules, that is why we are looking at Drools as a potential
>> > solution.
>> >
>> > What we would like to have is some kind of abstraction or mapping
>> > between
>> > actual entities and rules the business users can define so that they do
>> not
>> > have to know the _exact_ details of the data model (field names,
>> > precise
>> > relations etc). This would be important for us so that we can refactor
>> the
>> > old model classes without affecting business rules; also it would make
>> life
>> > easier for the business users. While IDE support might make refactoring
>> > easier, we definitely want to have a separation between rules and
>> entities.
>> >
>> > Given our situation, writing and maintaining "stable" wrapper/adapter
>> > classes for the sole purpose of rule processing is out of question. I
>> have
>> > checked the documentation of Drools DSL support and for me it seems to
>> > be
>> > overkill for our use case: we do not really need a custom language, but
>> > simply an abstraction between rules and the data model classes.
>> >
>> > What I could imagine is a piece of code, (a custom property resolver? -
>> no
>> > sure how it is called) which maps property expressions to actual
>> properties
>> > based on a custom annotation on the entity class or something like
>> > that,
>> so
>> > that a rule containing "Foo.bars" expression does not have to change
>> > even
>> > if we decide to rename "Foo.bars" to "Foo.barList" in the model
>> > classes.
>> > (This was just a simple example of a potential use cases)
>> >
>> > Could you please share your thoughts on this topic and point me into
>> > the
>> > right direction?
>> >
>> > Thanks,
>> > Peter
>> >
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>

___

Re: [rules-users] Excel Syntax in Decision Tables

2014-05-26 Thread crosbis2
Hi Laune,

I tried what you prescribed but get the following in the source code when i
upload it. 

 fatca: FATCA(Type == 3); Classification() 


?



--
View this message in context: 
http://drools.46999.n3.nabble.com/Excel-Syntax-in-Decision-Tables-tp4029520p4029690.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] Abstraction between rules and data model?

2014-05-26 Thread Péter Gergely , Horváth
Hi Wolfgang,

Thank you for your input. You are right that some of the cases could simply
be covered by regexp-replace, but I'm afraid, not all of them. Interfaces
could also help, but we have a requirement that the business rules should
not be tightly coupled to the underlying persistence model. (I understand
that some might say this is not ideal, but that is our current situation)

I am wondering whether it is possible to hook into Drools engine and
intercept field value reference expression evaluations in run time (e.g if
"foo.bars" is used in an expression, we could return "foo.barList") ? By
injecting some custom code, we could make the necessary decisions and
extract the proper value from an object. Unfortunately these parts of
Drools are pretty much undocumented.

Regards,
Peter



2014-05-26 13:57 GMT+02:00 Wolfgang Laun :

> What you describe can be done with /bin/sed.
>
> Notice that the DSL processor doesn't require you to translate entire
> patterns; there is a mechanism for translating "keywords", which is
> just arbitrary tokens to whatever replacement text.
>
> If a "bar" must be translated to a "barList" in the context of a class
> "Foo" but not in any other context, a more sophisticated translation
> is required in any case (with /bin/sed still being sufficient if
> patterns aren't split across lines).
>
> Some say that good design makes use of Interfaces, which leaves room
> for actual implementations being changed as long as the interfaces are
> implemented. Here, note that rules can be written against interface
> types.
>
> -W
>
>
> On 26/05/2014, Péter Gergely, Horváth  wrote:
> > Hi All,
> >
> > We are evaluating Drools 6 for our use case, and face challenges where we
> > would need some ideas from more experienced users of Drools.
> >
> > We have an application with a massive code base and a large number of
> model
> > (entity) classes. We are in the process of moving away from inherited
> > legacy technologies and refactoring the old code base. As a part of this
> > work we would like extract some of the hard-coded business logic to
> > external rules, that is why we are looking at Drools as a potential
> > solution.
> >
> > What we would like to have is some kind of abstraction or mapping between
> > actual entities and rules the business users can define so that they do
> not
> > have to know the _exact_ details of the data model (field names, precise
> > relations etc). This would be important for us so that we can refactor
> the
> > old model classes without affecting business rules; also it would make
> life
> > easier for the business users. While IDE support might make refactoring
> > easier, we definitely want to have a separation between rules and
> entities.
> >
> > Given our situation, writing and maintaining "stable" wrapper/adapter
> > classes for the sole purpose of rule processing is out of question. I
> have
> > checked the documentation of Drools DSL support and for me it seems to be
> > overkill for our use case: we do not really need a custom language, but
> > simply an abstraction between rules and the data model classes.
> >
> > What I could imagine is a piece of code, (a custom property resolver? -
> no
> > sure how it is called) which maps property expressions to actual
> properties
> > based on a custom annotation on the entity class or something like that,
> so
> > that a rule containing "Foo.bars" expression does not have to change even
> > if we decide to rename "Foo.bars" to "Foo.barList" in the model classes.
> > (This was just a simple example of a potential use cases)
> >
> > Could you please share your thoughts on this topic and point me into the
> > right direction?
> >
> > Thanks,
> > Peter
> >
>
> ___
> 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] Abstraction between rules and data model?

2014-05-26 Thread Wolfgang Laun
What you describe can be done with /bin/sed.

Notice that the DSL processor doesn't require you to translate entire
patterns; there is a mechanism for translating "keywords", which is
just arbitrary tokens to whatever replacement text.

If a "bar" must be translated to a "barList" in the context of a class
"Foo" but not in any other context, a more sophisticated translation
is required in any case (with /bin/sed still being sufficient if
patterns aren't split across lines).

Some say that good design makes use of Interfaces, which leaves room
for actual implementations being changed as long as the interfaces are
implemented. Here, note that rules can be written against interface
types.

-W


On 26/05/2014, Péter Gergely, Horváth  wrote:
> Hi All,
>
> We are evaluating Drools 6 for our use case, and face challenges where we
> would need some ideas from more experienced users of Drools.
>
> We have an application with a massive code base and a large number of model
> (entity) classes. We are in the process of moving away from inherited
> legacy technologies and refactoring the old code base. As a part of this
> work we would like extract some of the hard-coded business logic to
> external rules, that is why we are looking at Drools as a potential
> solution.
>
> What we would like to have is some kind of abstraction or mapping between
> actual entities and rules the business users can define so that they do not
> have to know the _exact_ details of the data model (field names, precise
> relations etc). This would be important for us so that we can refactor the
> old model classes without affecting business rules; also it would make life
> easier for the business users. While IDE support might make refactoring
> easier, we definitely want to have a separation between rules and entities.
>
> Given our situation, writing and maintaining "stable" wrapper/adapter
> classes for the sole purpose of rule processing is out of question. I have
> checked the documentation of Drools DSL support and for me it seems to be
> overkill for our use case: we do not really need a custom language, but
> simply an abstraction between rules and the data model classes.
>
> What I could imagine is a piece of code, (a custom property resolver? - no
> sure how it is called) which maps property expressions to actual properties
> based on a custom annotation on the entity class or something like that, so
> that a rule containing "Foo.bars" expression does not have to change even
> if we decide to rename "Foo.bars" to "Foo.barList" in the model classes.
> (This was just a simple example of a potential use cases)
>
> Could you please share your thoughts on this topic and point me into the
> right direction?
>
> Thanks,
> Peter
>

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


Re: [rules-users] Excel Syntax in Decision Tables

2014-05-26 Thread Wolfgang Laun
As the documentation tries to explain, there are four rows in the
heading of acondition column.

1 The first contains CONDITION (or condition).
2 The second defines the class for a Pattern.
3 The third one contains a constraint.
4 The fourth is for a comment.

So, use
   fatca: FATCA(); Classification()
for the second one and
type == $param
for the fourth one.

-W

On 26/05/2014, crosbis2  wrote:
> Hi,
>
> I'm sorry to disturb the forum with this one.
>
> 
>
> I want to replicate this code in a decision table. There is a parse
> exception when i try to convert a table due to  the code fatca : FATCA()
> i.e. There is Fatca [Fatca] even though the rule validates ok.
>
> I know it is a pattern with no condition attached. so i tried putting it
> with the actual condition and also making it standalone with condition
> null.
> neither will convert to a decision table even though the syntax looks
> correct from the view source?
>
>
> 
>
> Anyone any ideas on what i need to do for this problem?
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Excel-Syntax-in-Decision-Tables-tp4029520p4029686.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] Excel Syntax in Decision Tables

2014-05-26 Thread crosbis2
Hi,

I'm sorry to disturb the forum with this one.

 

I want to replicate this code in a decision table. There is a parse
exception when i try to convert a table due to  the code fatca : FATCA()
i.e. There is Fatca [Fatca] even though the rule validates ok. 

I know it is a pattern with no condition attached. so i tried putting it
with the actual condition and also making it standalone with condition null.
neither will convert to a decision table even though the syntax looks
correct from the view source?


 

Anyone any ideas on what i need to do for this problem? 



--
View this message in context: 
http://drools.46999.n3.nabble.com/Excel-Syntax-in-Decision-Tables-tp4029520p4029686.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] Abstraction between rules and data model?

2014-05-26 Thread Péter Gergely , Horváth
Hi All,

We are evaluating Drools 6 for our use case, and face challenges where we
would need some ideas from more experienced users of Drools.

We have an application with a massive code base and a large number of model
(entity) classes. We are in the process of moving away from inherited
legacy technologies and refactoring the old code base. As a part of this
work we would like extract some of the hard-coded business logic to
external rules, that is why we are looking at Drools as a potential
solution.

What we would like to have is some kind of abstraction or mapping between
actual entities and rules the business users can define so that they do not
have to know the _exact_ details of the data model (field names, precise
relations etc). This would be important for us so that we can refactor the
old model classes without affecting business rules; also it would make life
easier for the business users. While IDE support might make refactoring
easier, we definitely want to have a separation between rules and entities.

Given our situation, writing and maintaining "stable" wrapper/adapter
classes for the sole purpose of rule processing is out of question. I have
checked the documentation of Drools DSL support and for me it seems to be
overkill for our use case: we do not really need a custom language, but
simply an abstraction between rules and the data model classes.

What I could imagine is a piece of code, (a custom property resolver? - no
sure how it is called) which maps property expressions to actual properties
based on a custom annotation on the entity class or something like that, so
that a rule containing "Foo.bars" expression does not have to change even
if we decide to rename "Foo.bars" to "Foo.barList" in the model classes.
(This was just a simple example of a potential use cases)

Could you please share your thoughts on this topic and point me into the
right direction?

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

Re: [rules-users] Nested Collect probably

2014-05-26 Thread Wolfgang Laun
Due to imprecise wording, this may or may not be what you want. The rule fires,
if there are 5 or more Employees, each of them with the property that
   - the employee has visited CCNA in year X
   - the employee has visited CCNP in year X
   - the employee has visited CCIE or J5SE in 2000 OR
 has visited J4WS in 2001 or 2002 or 2003 (OR both)

(There is no relation between the years X of different employees.)

rule findCombi
when
accumulate(
Certificate( course == "CCNA", $e: employee, $y: year )
and
Certificate( course == "CCNP", employee == $e, year == $y )
and
Certificate( employee == $e,
 ((course == "CCIE" || == "J5SE" ) && year == 2000 )
  ||
  course == "J4WS" && year == 2001 || == 2002 || == 2003 );
$es: collectSet( $e ); $es.size() >= 5 )
then
System.out.println( "more than 5" );
end



On 26/05/2014, Chris B  wrote:
> I have a class
>
> Employee
> (name)
>
> Certificates
> (course, year, employee)
>
> If the employees have CCNA & CCNP from the "same" year and then if they took
> "CCIE or J5SE in 2000"  or "J4WS in 2001 or 2002, or 2003"
> The Action should be taken if there are more than 5 such employees.
>
> The connection between Employee and Certificates is through
> Certificates.employee, but I can change it to a list of certificates in
> Employee also if needed.
>
> I start with
> $e: Employee()
> Certificate (employee == $e, course == "CCNA", $ccnaYear : year)
> Certificate (employee == $e, course == "CCNP", $ccnpYear : year)
> //this will get the years for one employee..
> //now we need to get all other employees from same year..
> //but we still need to make sure all certificates are from the same
> employee.
> ArrayList( size >= 2 ) from collect(Certificate (
> ((course == "CCNA", year == $ccnaYear, $e_this:employee) && (course ==
> "CCNP", year == $ccnpYear, employee == $e_this))
> &&
> (
> ((course == "CCIE", year == 2000, employee == $e_this) || (course == J5SE",
> year == 2000, employee == $e_this))
> ||
> ((course == "J4WS", year == 2001, employee == $e_this) || (course == "J4WS",
> year == 2002, employee == $e_this) || (course == "J4WS", year == 2003,
> employee == $e_this))
> )
> )
>
> This is going crazy at this stage.
> First problem, - I start with one employee, and try to get his years of CCNA
> and CCNP
> Next I am collecting Certificates instead of Employees which I should be
> collecting and checking the length of the employees.
>
> I think something like this will help me
> http://blog.athico.com/2007/06/chained-from-accumulate-collect.html
> But I am unable to convert it into my usecase.
>
> Please help.
> Thanks
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Nested-Collect-probably-tp4029681.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] "Cannot find KieModule" with kieServices.newKieContainer() with LATEST or RELEASE instead of explicit version number (eg: 0.0.1)

2014-05-26 Thread ganeshneelekani
Hi tari,

Did this issue get solved. i am facing the same issue with drools and maven, 
Let me know your suggestions.


Thanks,
Ganesh Neelelkani




--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Cannot-find-KieModule-with-kieServices-newKieContainer-with-LATEST-or-RELEASE-instead-of-tp4027941p4029682.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] Nested Collect probably

2014-05-26 Thread Chris B
I have a class

Employee
(name)

Certificates
(course, year, employee)

If the employees have CCNA & CCNP from the “same” year and then if they took
“CCIE or J5SE in 2000”  or “J4WS in 2001 or 2002, or 2003”
The Action should be taken if there are more than 5 such employees.

The connection between Employee and Certificates is through
Certificates.employee, but I can change it to a list of certificates in
Employee also if needed.

I start with
$e: Employee()
Certificate (employee == $e, course == “CCNA”, $ccnaYear : year)
Certificate (employee == $e, course == “CCNP”, $ccnpYear : year)
//this will get the years for one employee..
//now we need to get all other employees from same year..
//but we still need to make sure all certificates are from the same
employee.
ArrayList( size >= 2 ) from collect(Certificate (
((course == “CCNA”, year == $ccnaYear, $e_this:employee) && (course ==
“CCNP”, year == $ccnpYear, employee == $e_this))
&&
(
((course == “CCIE”, year == 2000, employee == $e_this) || (course == J5SE”,
year == 2000, employee == $e_this))
||
((course == “J4WS”, year == 2001, employee == $e_this) || (course == “J4WS”,
year == 2002, employee == $e_this) || (course == “J4WS”, year == 2003,
employee == $e_this))
)
)

This is going crazy at this stage.
First problem, - I start with one employee, and try to get his years of CCNA
and CCNP
Next I am collecting Certificates instead of Employees which I should be
collecting and checking the length of the employees.

I think something like this will help me
http://blog.athico.com/2007/06/chained-from-accumulate-collect.html
But I am unable to convert it into my usecase.

Please help.
Thanks




--
View this message in context: 
http://drools.46999.n3.nabble.com/Nested-Collect-probably-tp4029681.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