Re: [rules-users] Deploy Drools in AS7 as OSGi bundles

2012-10-02 Thread Dan Seaver
Thanks for your candid reply. I'm just diving into OSGi and am
experiencing the same WTF. Hopefully, I'll be able to stay on this
project for a bit and actually get somewhere, but it doesn't look good
right now. Good news... GE Healthcare may be opening the door and
allowing us to participate in the Open Source community. If that
happens, I may be able to pitch in.

 

Thanks for the pointers.

 

-   Dan

 

From: Mark Proctor [via Drools]
[mailto:ml-node+s46999n4020067...@n3.nabble.com] 
Sent: Monday, October 01, 2012 9:42 PM
To: Seaver, Daniel (GE Healthcare)
Subject: Re: [rules-users] Deploy Drools in AS7 as OSGi bundles

 

Our OSGi stuff is best effort - working on OSGi was like sticking
needles directly into the back of my eyeball, not fun. tbh I find OSGi a
real PITA. Too many of our dependencies do not have real OSGi bundles
available, so we have to resort to the spring repository - where the
versions almost never match our original target version. Further when it
fails it's almost freaking impossible to determine why it fails. 

We use the spring test module, we provide it all the dependencies that
you see, and run the tests. Other than suggesting to look at the spring
OSGi test executions, I can't really offer more help. But it will nearly
always boil down to wrong jars or wrong versions of jars - figuring out
which of those are the problem, is not easy. Either it works, of it
doesn't. If it doesn't,  there is no simple way to debug why OSGi
doesn't work. Generally I have to take it back to the last version that
worked and keep incrementally changing it until I find out specifically
doesn't work, so I can address it. 

You might find it useful to look at the bundle context that spring osgi
creates, here is all the bundles and their versions necessary for the
unit tests to run: 
https://github.com/droolsjbpm/droolsjbpm-build-distribution/blob/master/
drools-osgi-bundles/org.drools.osgi.test/src/test/filtered-resources/boo
t-bundles.properties

good luck :) Please document any helpers you find, and submit as pull
requests. 


Mark 


On 1 Oct 2012, at 21:26, Dan Seaver [hidden email] wrote: 


 Thanks Mark, but I still am having issues. 
 I cloned the latest droolsjbpm-build-distribution and built 
 drools-osgi-bundles and reviewed the documentation you refenced. I
don't see 
 it stated anywhere, but I assume I need to install and start all of
the jars 
 in drools-osgi-bundles-distribution-5.5.0-SNAPSHOT.zip. 
 
 So, I put all of those jars in the AS7's Standalone deployments folder
and 
 started up AS7. The only jar that seemed to have trouble is 
 *com.springsource.antlr-2.7.6.jar* because of an
*IllegalArgumentException: 
 A fragment is not a module*. 
 
 Now I tried to deploy the *knowledge-api-5.5.0-SNAPSHOT.jar*, and I
get an 
 error with *com.springsource.com.sun.tools.xjc:2.1.7* (see stacktrace 
 below), which prohibits me from installing and starting any of the
other 
 drools bundles mentioned in the doc. 
 
 Any thoughts about what's amiss? 
 
 Stack Trace: 
 == 
 10:10:44,609 ERROR
[org.jboss.osgi.framework.internal.FrameworkEventsPlugin] 
 (MSC service thread 1-8) Framework ERROR: 
 org.osgi.framework.BundleException: Cannot resolve bundle resModule: 
 [org.drools.api:5.5.0.SNAPSHOT] 
at 

org.jboss.osgi.framework.internal.ResolverPlugin.resolve(ResolverPlugin.
java:157) 
 [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final] 
at 

org.jboss.osgi.framework.internal.AbstractBundleState.ensureResolved(Abs
tractBundleState.java:551) 
 [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final] 
at 

org.jboss.osgi.framework.internal.HostBundleState.startInternal(HostBund
leState.java:211) 
 [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final] 
at 

org.jboss.osgi.framework.internal.AbstractBundleState.start(AbstractBund
leState.java:494) 
 [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final] 
at 

org.jboss.as.osgi.deployment.BundleStartTracker$1.processService(BundleS
tartTracker.java:144) 
 [jboss-as-osgi-service-7.1.1.Final.jar:7.1.1.Final] 
at 

org.jboss.as.osgi.deployment.BundleStartTracker$1.transition(BundleStart
Tracker.java:119) 
 [jboss-as-osgi-service-7.1.1.Final.jar:7.1.1.Final] 
at 

org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceContro
llerImpl.java:1416) 
 [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 
at 

org.jboss.msc.service.ServiceControllerImpl.access$2700(ServiceControlle
rImpl.java:49) 
 [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 
at 

org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceCont
rollerImpl.java:1954) 
 [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 
at 

java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
r.java:886) 
 [rt.jar:1.6.0_26] 
at 

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
va:908) 
 [rt.jar:1.6.0_26] 
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26] 
 Caused by: 

[rules-users] switching off JIT compiler in 5.4.0.Final

2012-10-02 Thread Willem van Asperen
Dear List,

Does anyone know of a way to disable JIT in 5.4.0.Final? There is a snag 
in that version that seems to not play nice with my application. If 
there is a way to disable it then I could just bridge the time until 
5.4.1.Final is released.

I have tried the following:

-Dmvel.disable.jit=true

and

-Ddrools.permgenThreshold=0

but still the same issue.

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


Re: [rules-users] Deploy Drools in AS7 as OSGi bundles

2012-10-02 Thread Ioannis Canellos

 Our OSGi stuff is best effort - working on OSGi was like sticking needles
 directly into the back of my eyeball, not fun. tbh I find OSGi a real PITA.
 Too many of our dependencies do not have real OSGi bundles available, so we
 have to resort to the spring repository - where the versions almost never
 match our original target version. Further when it fails it's almost
 freaking impossible to determine why it fails.


The problem with the spring enterprise bundle repository, is that spring
source is no longer actively interested in OSGi (ever since they donated
spring-dm to the eclipse foundation) and a lot of the bundles they provide
are either out of date, or just say not optimal. A much shorter repository
but with better maintained bundles is the repository
of service-mix bundles:
http://repo1.maven.org/maven2/org/apache/servicemix/bundles/ which host
bundles for service-mix, camel etc.

Of course, bundles and metadata are always one side of the problem.
Usually, the use of class loaders requires some treatment too.

I'd like to contribute too, in providing a better OSGi support and maybe
add some integration tests using pax-exam or arquillian.

-- 
*Ioannis Canellos*
*

**
Blog: http://iocanel.blogspot.com
**
Twitter: iocanel
*
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Protobuf Marshaller Question (ScheduledActivation Persistence)

2012-10-02 Thread Philipp Herzig
Thanks Edson for your reply. I am really looking forward to work on a
solution for this.

What you write also makes absolutely sense to me. As far as I can see,
the ScheduledActivation is unmarshalled correctly to the Agenda.
Moreover, after unmarshalling the agenda my logger says that there is
one active and one scheduled activation (interestingly, the agendaSize
equals zero, but anyway).

logger.info(agenda size: +agenda.agendaSize());
logger.info(activations: +agenda.getActivations().length);
logger.info(scheduledActivations: +agenda.getScheduledActivations().length);
logger.info(activeActivations: +agenda.getActiveActivations() );
logger.info(dormantActivations: +agenda.getDormantActivations());

Since the ProtobufOutputMarshaller seems to use the scheduled job
instances (Timers _timers = writeTimers(
context.wm.getTimerService().getTimerJobInstances(), context ); I
tried to look what's in these list. However, in all cases the list of
job instances is empty.

logger.info(timer service2: +((StatefulKnowledgeSessionImpl)
this.session).getTimerService());
logger.info(timer service2: +((StatefulKnowledgeSessionImpl)
this.session).getTimerService().getTimerJobInstances());

logger.info(timer service wm: +((InternalWorkingMemory)
((StatefulKnowledgeSessionImpl)
this.session).session).getTimerService());
logger.info(timer service wm: +((InternalWorkingMemory)
((StatefulKnowledgeSessionImpl)
this.session).session).getTimerService().getTimerJobInstances());


As suggested by you, I simply switched to the current 5.5.0.Beta1 deps
from nexus (because I don't know where I can get the branch builds
from beyond version 5.4.0.Final). However, a quick test run tells me
that the problem persists.
Therefore, I'm gonna write a self-contained test and file a JIRA
accordingly. I keep you updated.

Thanks a lot,

Philipp


2012/10/1 Edson Tirelli ed.tire...@gmail.com:

Phillip,

Thanks for investigating this. There are few developers that know this
 area of the code, and so it is indeed a bit hard to get extra information.

Here is a quick recap: although the serialization change on Drools 5.3
 involved a move to use protobuf as the serialization framework, Protobuf is
 nothing more than a way to easily handle the actual data persistence. The
 whole logic is one layer up in the scale and there is where the
 investigation should focus. So, lets forget Protobuf for the moment.

Before 5.3, we used to serialize all the data structures and intermediate
 data inside a session using custom data structures. That was a big problem
 because, for instance, if a session was serialized with one version of
 Drools, and then someone tried to use any other version of Drools to
 deserialize the session, it would not work. Even a simple bug fix could
 affect the internal data structures and make a session impossible to
 deserialize. To avoid that, from 5.3 and forward, we no longer serialize
 everything, but instead we serialize only the necessary raw data that allows
 us to reconstruct a session.

 To be more clear, lets imagine that we have a session and a fact A1 in
 there, and an activation of rule R1 for fact A1. When the session is
 serialized, we will basically serialize fact A1 and a record that R1 was
 active for fact A1. When we deserialize the session, we will re-propagate A1
 through the engine, recreating all the data structures and then correlate
 the new activation of R1 with the serialized activation of R1.

 Having said that, even scheduled activations should be properly
 serialized/deserialized. I think there was a bug fixed related to timer
 serialization, so the first thing I would like to suggest is to check your
 use case against the 5.4.x branch where fixed bugs are committed. If you
 still see the problem there, then please open a JIRA with a self-contained
 test showing the problem, and I will take a look as soon as I can.

 Thanks,
 Edson


 On Mon, Oct 1, 2012 at 1:04 PM, Philipp Herzig pher...@gmail.com wrote:

 Dear developers,

 Unfortunately, I was not able to solve this problem yet. However, I
 found another issue that seems to be related.
 More precisely, when I try to delete the rules that led to the
 ScheduledActivations (which are not fired after unmarshalling, i.e.,
 there are orphan activations on the agenda) I get the following
 trace:

 java.lang.NullPointerException
 at
 org.drools.time.impl.JDKTimerService.removeJob(JDKTimerService.java:134)
 at
 org.drools.reteoo.RuleTerminalNode$RTNCleanupAdapter.cleanUp(RuleTerminalNode.java:524)
 at org.drools.reteoo.BetaNode.doRemove(BetaNode.java:454)
 at org.drools.common.BaseNode.remove(BaseNode.java:106)
 at
 org.drools.reteoo.RuleTerminalNode.doRemove(RuleTerminalNode.java:410)
 at org.drools.common.BaseNode.remove(BaseNode.java:106)
 at
 org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:261)
 at
 

Re: [rules-users] Deploy Drools in AS7 as OSGi bundles

2012-10-02 Thread Mark Proctor

On 2 Oct 2012, at 07:29, Ioannis Canellos ioca...@gmail.com wrote:

 Our OSGi stuff is best effort - working on OSGi was like sticking needles 
 directly into the back of my eyeball, not fun. tbh I find OSGi a real PITA. 
 Too many of our dependencies do not have real OSGi bundles available, so we 
 have to resort to the spring repository - where the versions almost never 
 match our original target version. Further when it fails it's almost freaking 
 impossible to determine why it fails.
 
 The problem with the spring enterprise bundle repository, is that spring 
 source is no longer actively interested in OSGi (ever since they donated 
 spring-dm to the eclipse foundation) and a lot of the bundles they provide 
 are either out of date, or just say not optimal. A much shorter repository 
 but with better maintained bundles is the repository of service-mix bundles: 
 http://repo1.maven.org/maven2/org/apache/servicemix/bundles/ which host 
 bundles for service-mix, camel etc.
 
 Of course, bundles and metadata are always one side of the problem. Usually, 
 the use of class loaders requires some treatment too.
 
 I'd like to contribute too, in providing a better OSGi support and maybe add 
 some integration tests using pax-exam or arquillian.
Please feel free to submit a pull request that moves us to maintained OSGi 
bundles.

There is an outstanding OSGi pull request for Camel. However I cannot accept 
the submission until it comes with a unit test. Anyone want to finish that off? 
Here is the JIRA, pull requests are linked from the JIRA.
https://issues.jboss.org/browse/JBRULES-3389

Here is a sample OSGi unit test:
https://github.com/droolsjbpm/droolsjbpm-build-distribution/blob/master/drools-osgi-bundles/org.drools.osgi.test/src/test/java/org/drools/osgi/integrationtests/SimpleOsgiTest.java

The unit test doesn't need to do much, just show we can build an end point and 
drive data through it.

Mark
  
 -- 
 Ioannis Canellos
 
 Blog: http://iocanel.blogspot.com
 Twitter: iocanel
 
 
 ___
 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] switching off JIT compiler in 5.4.0.Final

2012-10-02 Thread Jean-Paul Shemali

Hi Willem,

The only thing that I managed to do before Mario fixed the issue for me in 
5.4.1.Final was to include a modified version of MvelConstraint in my own code 
(of course earlier in the classpath so that it replaced the one from drools) 
and changing the value of static member JIT_THRESOLD to Integer.MAX_VALUE

Quick hoax, but it could help

 Date: Tue, 2 Oct 2012 08:20:53 +0200
 From: wil...@van.asperen.org
 To: rules-users@lists.jboss.org
 Subject: [rules-users] switching off JIT compiler in 5.4.0.Final
 
 Dear List,
 
 Does anyone know of a way to disable JIT in 5.4.0.Final? There is a snag 
 in that version that seems to not play nice with my application. If 
 there is a way to disable it then I could just bridge the time until 
 5.4.1.Final is released.
 
 I have tried the following:
 
 -Dmvel.disable.jit=true
 
 and
 
 -Ddrools.permgenThreshold=0
 
 but still the same issue.
 
 Thanks,
 Willem
 ___
 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] mixing activation-group and ruleflow-group

2012-10-02 Thread raffi
Hi and thank you for the approach. There are points I don't really understand
in this solution. I have to create n instances (depending on number of
categories) of Superiors class in my main java file in the way
/Superior sup = new Superior(pets, null)/?
How is the set superior filled? I don't really understand the part
/superiors contains $xname/.

Thank you



--
View this message in context: 
http://drools.46999.n3.nabble.com/mixing-activation-group-and-ruleflow-group-tp4020058p4020074.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] Declared Types with large number of fields

2012-10-02 Thread Michael Anstis
I think this answers your question:
https://issues.jboss.org/browse/JBRULES-3621

You could try 5.5.0.Beta1 which includes the fix.

On 2 October 2012 10:56, Phani Saripalli saripalli.ph...@gmail.com wrote:

 Hi.
 I am using declared types in .drl rule rule. When I kept the number of
 fields in a declared type low, drools works fine. When I am increasing the
 number of fields in a declared type to 300 or even more, drools raising an
 exception.
 Particularly, it is giving this.


 ava.lang.ClassFormatError: Too many arguments in method signature in class
 file com/sample/Project
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
 at

 org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.fastFindClass(JavaDialectRuntimeData.java:615)
 at

 org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:254)
 at

 org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:237)
 at

 org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:88)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 at
 org.drools.base.ClassTypeResolver.resolveType(ClassTypeResolver.java:155)
 at

 org.drools.compiler.PackageBuilder.processTypeDeclarations(PackageBuilder.java:2049)
 at
 org.drools.compiler.PackageBuilder.mergePackage(PackageBuilder.java:1218)
 at
 org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:829)
 at

 org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:467)
 at

 org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:673)
 at

 org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:45)
 at

 org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:34)
 at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:67)
 at com.sample.DroolsTest.main(DroolsTest.java:24)


 I suspect, it is something to do with creating class, constructor with so
 many arguments at run time. I am looking for a solution, something like
 declared types, or a workaround. The purpose for which I am using Drools
 limits to use the traditional Java classes, or defining a Java class.
 Also, is there any way, to perform calculations, or value propagations.
 That, Drools could assume some value to a variable given a certain
 constraint on it.

 For example, x  6  x  9, Drools could assume x as 7 or 8 and fire
 rules?

 Thank you.
 Phani



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Declared-Types-with-large-number-of-fields-tp4020076.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] mixing activation-group and ruleflow-group

2012-10-02 Thread raffi
After I saw that there is the possibility for show logging in console I used
it. And I tested another approach. Reading the logging I saw, that the
output with the help of
rule show recomms
salience -999
when
$recomm : Recommendation()
then
System.out.println($recomm);
end

distorts the result. Objects are shown and after that are correctly
retracted.
How can I get only the Recommendation instances from working memory in my
main java class?
I think it has to be something with the /getObjects/ method for my ksession
variable!?



--
View this message in context: 
http://drools.46999.n3.nabble.com/mixing-activation-group-and-ruleflow-group-tp4020058p4020078.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] mixing activation-group and ruleflow-group

2012-10-02 Thread Wolfgang Laun
On 02/10/2012, raffi christian.koeh...@s2008.tu-chemnitz.de wrote:

 How can I get only the Recommendation instances from working memory in my
 main java class?
 I think it has to be something with the /getObjects/ method for my ksession
 variable!?

Use a query. getObjects() returns all WM fact objects, but the query
will give you just the Recommendataion objects.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] mixing activation-group and ruleflow-group

2012-10-02 Thread Wolfgang Laun
On 02/10/2012, raffi christian.koeh...@s2008.tu-chemnitz.de wrote:
 Hi and thank you for the approach. There are points I don't really
 understand
 in this solution. I have to create n instances (depending on number of
 categories) of Superiors class in my main java file in the way
 /Superior sup = new Superior(pets, null)/?
 How is the set superior filled?

You should do this in Java, using a POJO class, inserting right after
session start. You do know how to add elements to a SetString?


 I don't really understand the part
 /superiors contains $xname/.

This is DRL for calling a collection's contains() method, i.e.:
   x.getSuperior().contains( $xname )

-W


 Thank you



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/mixing-activation-group-and-ruleflow-group-tp4020058p4020074.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] switching off JIT compiler in 5.4.0.Final

2012-10-02 Thread Willem van Asperen

Hi Jean-Paul,

Thanks. Very helpful. I'll give it a try.

I think the next obvious question is: when do we expect 5.4.1.Final to 
be released? I've looked in the maven repository but it's not there (yet).


Regards,
Willem

On 10/02/2012 10:57 AM, Jean-Paul Shemali wrote:

Hi Willem,

The only thing that I managed to do before Mario fixed the issue for 
me in 5.4.1.Final was to include a modified version of MvelConstraint 
in my own code (of course earlier in the classpath so that it replaced 
the one from drools) and changing the value of static member 
JIT_THRESOLD to Integer.MAX_VALUE


Quick hoax, but it could help

 Date: Tue, 2 Oct 2012 08:20:53 +0200
 From: wil...@van.asperen.org
 To: rules-users@lists.jboss.org
 Subject: [rules-users] switching off JIT compiler in 5.4.0.Final

 Dear List,

 Does anyone know of a way to disable JIT in 5.4.0.Final? There is a 
snag

 in that version that seems to not play nice with my application. If
 there is a way to disable it then I could just bridge the time until
 5.4.1.Final is released.

 I have tried the following:

 -Dmvel.disable.jit=true

 and

 -Ddrools.permgenThreshold=0

 but still the same issue.

 Thanks,
 Willem
 ___
 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] No viable alternative at input since upgrade to 5.4.0.Final

2012-10-02 Thread tekbrain
Hi,

We have rules in domain specific language that don't work anymore.

In our dsl mapping definition:

Language expression: COUNT\({attr:[A-Z][A-Z_\d]+}\)
{constraint:(|\=||\=|\=\=|!\=)}  {num:[\d\.]+}
Rule mapping: ArrayList( size {constraint} {num} ) from collect (Fact( name
== {attr}, dataset == 0, ignore == false ))
Scope: condition (when)

[condition][]COUNT\({attr:[A-Z][A-Z_\d]+}\)
{constraint:(|\=||\=|\=\=|!\=)} {num:[\d\.]+}=ArrayList( size
{constraint} {num} ) from collect (Fact( name == {attr}, dataset == 0,
ignore == false ))


One of the rules:
rule 'BP - HOMULTIPLE'
  agenda-group user-rules
  no-loop true
  when
COUNT(BP_HOCONDITION) = 2
  then
set BP_HOMULTIPLE
end

Expanded rule should be something like this:
rule 'BP - HOMULTIPLE'
  agenda-group user-rules
  no-loop true
  when
ArrayList(size = 2) from collect (Fact( name == BP_HOCONDITION,
dataset == 0, ignore == false ))
  then
insertLogical(new StateFact(BP_HOMULTIPLE));
end

Everything was working with Drools 5.1 but with Drools 5.4.0.Final, we have
this kind of errors:
[3788,20]: [ERR 101] Line 3788:20 no viable alternative at input '=' in
rule BP - HOMULTIPLE

Did we forget something?

Thanks,

Jean-Luc






--
View this message in context: 
http://drools.46999.n3.nabble.com/No-viable-alternative-at-input-since-upgrade-to-5-4-0-Final-tp4020083.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] No viable alternative at input since upgrade to 5.4.0.Final

2012-10-02 Thread Wolfgang Laun
Do not use '(' and ')' in patterns. This confuses the overall regex
for matching a line. This is sufficient:

   {constraint:|\=||\=|\=\=|!\=}

-W

On 02/10/2012, tekbrain jlpiol...@plexo.ca wrote:
 Hi,

 We have rules in domain specific language that don't work anymore.

 In our dsl mapping definition:

 Language expression: COUNT\({attr:[A-Z][A-Z_\d]+}\)
 {constraint:(|\=||\=|\=\=|!\=)}  {num:[\d\.]+}
 Rule mapping: ArrayList( size {constraint} {num} ) from collect (Fact( name
 == {attr}, dataset == 0, ignore == false ))
 Scope: condition (when)

 [condition][]COUNT\({attr:[A-Z][A-Z_\d]+}\)
 {constraint:(|\=||\=|\=\=|!\=)} {num:[\d\.]+}=ArrayList( size
 {constraint} {num} ) from collect (Fact( name == {attr}, dataset == 0,
 ignore == false ))


 One of the rules:
 rule 'BP - HOMULTIPLE'
   agenda-group user-rules
   no-loop true
   when
 COUNT(BP_HOCONDITION) = 2
   then
 set BP_HOMULTIPLE
 end

 Expanded rule should be something like this:
 rule 'BP - HOMULTIPLE'
   agenda-group user-rules
   no-loop true
   when
 ArrayList(size = 2) from collect (Fact( name == BP_HOCONDITION,
 dataset == 0, ignore == false ))
   then
 insertLogical(new StateFact(BP_HOMULTIPLE));
 end

 Everything was working with Drools 5.1 but with Drools 5.4.0.Final, we have
 this kind of errors:
 [3788,20]: [ERR 101] Line 3788:20 no viable alternative at input '=' in
 rule BP - HOMULTIPLE

 Did we forget something?

 Thanks,

 Jean-Luc






 --
 View this message in context:
 http://drools.46999.n3.nabble.com/No-viable-alternative-at-input-since-upgrade-to-5-4-0-Final-tp4020083.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] No viable alternative at input since upgrade to 5.4.0.Final

2012-10-02 Thread tekbrain
Thanks to you!

It was really the problem.

Everything is working now.

Jean-Luc



--
View this message in context: 
http://drools.46999.n3.nabble.com/No-viable-alternative-at-input-since-upgrade-to-5-4-0-Final-tp4020083p4020085.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] Deploy Drools in AS7 as OSGi bundles

2012-10-02 Thread Cristiano Gavião

Hi,

As my system uses Tycho for its build, what I did was to create an 
Equinox P2 repository that includes one eclipse feature that contains 
JBPM 5.3, Drools and all dependencies bundles needed. I've used Eclipse 
Orbit bundles for all other dependecy: 
http://download.eclipse.org/tools/orbit/downloads/drops/S20120917013952/


That worked great for 5.3, but unfortunately is no working with the 
snapshot versions of JBPM and Drools. There are some new package imports 
in the manifest that couldn't be resolved anymore:


Unable to satisfy dependency from org.drools.compiler 5.5.0.SNAPSHOT 
to package org.jboss.weld.environment.se.discovery.url 0.0.0.





On 02/10/12 03:29, Ioannis Canellos wrote:


Our OSGi stuff is best effort - working on OSGi was like sticking
needles directly into the back of my eyeball, not fun. tbh I find
OSGi a real PITA. Too many of our dependencies do not have real
OSGi bundles available, so we have to resort to the spring
repository - where the versions almost never match our original
target version. Further when it fails it's almost freaking
impossible to determine why it fails.


The problem with the spring enterprise bundle repository, is 
that spring source is no longer actively interested in OSGi (ever 
since they donated spring-dm to the eclipse foundation) and a lot of 
the bundles they provide are either out of date, or just say not 
optimal. A much shorter repository but with better maintained bundles 
is the repository of service-mix bundles: 
http://repo1.maven.org/maven2/org/apache/servicemix/bundles/ which 
host bundles for service-mix, camel etc.


Of course, bundles and metadata are always one side of the problem. 
Usually, the use of class loaders requires some treatment too.


I'd like to contribute too, in providing a better OSGi support and 
maybe add some integration tests using pax-exam or arquillian.

--
*Ioannis Canellos*
/

/*/
/Blog: http://iocanel.blogspot.com http://iocanel.blogspot.com//
/*/
Twitter: iocanel
/




___
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] droolsjbpm-build-bootstrap script is broken ?

2012-10-02 Thread Cristiano Gavião
Hi,

I want to investigate why I couldn't build my system using the latest 
snapshot of jbpm and drools..

So, I cloned the 
g...@github.com:droolsjbpm/droolsjbpm-build-bootstrap.git repository and 
I'm following the readme.md file.

When I try $ droolsjbpm-build-bootstrap/script/git-clone-others.sh, I'm 
getting a error:

===
This directory already exists: droolsjbpm-build-bootstrap
===

===
Repository: droolsjbpm-knowledge
===
Too many arguments.

usage: git clone [options] [--] repo [dir]

 -v, --verbose be more verbose
 -q, --quiet   be more quiet


Am I missing something or the script is broken ?

regards,

Cristiano



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


[rules-users] Drools and Weld dependency ?

2012-10-02 Thread Cristiano Gavião
Hi,

I'm trying to use JBPM 5.4-SNAPSHOT and Drools 5.5-SNAPSHOT in a OSGi env.

drools-compiler's generated manifest has a import package to 
org.jboss.weld.environment.se.discovery.url.

Could someone explain me what is this new dependency ? Weld is really 
mandatory to drools 5.5 ?

thanks,

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


Re: [rules-users] Drools and Weld dependency ?

2012-10-02 Thread Mark Proctor

On 3 Oct 2012, at 03:49, Cristiano Gavião cvgav...@gmail.com wrote:

 Hi,
 
 I'm trying to use JBPM 5.4-SNAPSHOT and Drools 5.5-SNAPSHOT in a OSGi env.
 
 drools-compiler's generated manifest has a import package to 
 org.jboss.weld.environment.se.discovery.url.
 
 Could someone explain me what is this new dependency ? Weld is really 
 mandatory to drools 5.5 ?
It's not mandatory.

The Weld stuff is just if you need the new CDI extensions we are working on.

Mark
 
 thanks,
 
 Cristiano
 ___
 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] Checking Template Columns matching with Excel columns

2012-10-02 Thread himansu.nayak
Hi,
I am using drools template and spredsheet in my application.
my generic rules are maintain in template and rules data are maintained in
spreadsheet.
Currently i am declaring the columns name in my template file for using the
field of excel.
ex:
Inside template (drt)
template header
rulesName
Application
Admission
Permission
.
.
.
.

inside excel
rule(col 1), application(col2),admission(col3), permission(col4), . . . . .

i want to make sure the excel col name has to match with exact name inside
template. currently drools checks the order of the col declared in template
with excel columns but not the actual name with the excel columns.
Any possibility by which i can force drools to match the exact col name with
the col name defined inside template file?

Thanks...



-
Thanks...
Himansu
--
View this message in context: 
http://drools.46999.n3.nabble.com/Checking-Template-Columns-matching-with-Excel-columns-tp4020090.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