check list size
by Sumit Dhaniya
I have a class which contains some lists, I want to apply rules on size of
list and want to use functions like first(), last() but list objects which
are in my class are identified as collections and only collection related
functions are shown.
For eg.
class A {
java.util.List bList = new ArrayList();
}
now it shows bList as collection type and it doesn't shows size and related
list function instead shows collection functions like contains etc.
Can't I use it like both a collection as well as List?
I tried importing java.util.List but it still don't recognize my List
objects as List
--
View this message in context: http://drools.46999.n3.nabble.com/check-list-size-tp4030303.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months
drools-wb 6.1.0.CR1-wildfly - error when upload jar M2 Repo
by jps
Hello,
I've installed kie-drools-wb-distribution-wars-6.1.0.CR1-wildfly with all
the defaults - i.e m2 repo is in WIDLFLY_HOME/bin/repositories/kie) and
everything works fine so, except that I can't manage to upload a JAR.
The JAR I'm trying to upload is a mavenized JAR, it has no dependencies but
a parent pom. I get this Exception in the logs :
16:33:54,459 ERROR [io.undertow.request] (default task-9) UT005023:
Exception handling request to
/kie-drools-wb-distribution-wars-6.1.0.CR1-wildfly/org.kie.workbench.drools.KIEDroolsWebapp/m2repo/file:
java.lang.LinkageError:
com/ning/http/client/providers/netty/NettyAsyncHttpProvider
at
org.sonatype.maven.wagon.AhcWagon.openConnectionInternal(AhcWagon.java:150)
[wagon-ahc-1.2.1.jar:]
at
org.apache.maven.wagon.AbstractWagon.openConnection(AbstractWagon.java:105)
[wagon-provider-api-1.0.jar:1.0]
at
org.apache.maven.wagon.AbstractWagon.connect(AbstractWagon.java:207)
[wagon-provider-api-1.0.jar:1.0]
at
org.sonatype.aether.connector.wagon.WagonRepositoryConnector.connectWagon(WagonRepositoryConnector.java:345)
[aether-connector-wagon-1.13.1.jar:]
at
org.sonatype.aether.connector.wagon.WagonRepositoryConnector.pollWagon(WagonRepositoryConnector.java:385)
[aether-connector-wagon-1.13.1.jar:]
at
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:571)
[aether-connector-wagon-1.13.1.jar:]
at
org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
[aether-util-1.13.1.jar:]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
[rt.jar:1.7.0_11]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
[rt.jar:1.7.0_11]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_11]
16:33:54,463 ERROR [stderr] (pool-14-thread-1) Exception in thread
"pool-14-thread-1" java.lang.LinkageError:
com/ning/http/client/providers/netty/NettyAsyncHttpProvider
16:33:54,464 ERROR [stderr] (pool-14-thread-1) at
org.sonatype.maven.wagon.AhcWagon.openConnectionInternal(AhcWagon.java:150)
16:33:54,464 ERROR [stderr] (pool-14-thread-1) at
org.apache.maven.wagon.AbstractWagon.openConnection(AbstractWagon.java:105)
16:33:54,471 ERROR [stderr] (pool-14-thread-1) at
org.apache.maven.wagon.AbstractWagon.connect(AbstractWagon.java:207)
16:33:54,472 ERROR [stderr] (pool-14-thread-1) at
org.sonatype.aether.connector.wagon.WagonRepositoryConnector.connectWagon(WagonRepositoryConnector.java:345)
16:33:54,473 ERROR [stderr] (pool-14-thread-1) at
org.sonatype.aether.connector.wagon.WagonRepositoryConnector.pollWagon(WagonRepositoryConnector.java:385)
16:33:54,473 ERROR [stderr] (pool-14-thread-1) at
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:571)
16:33:54,474 ERROR [stderr] (pool-14-thread-1) at
org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
16:33:54,474 ERROR [stderr] (pool-14-thread-1) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
16:33:54,474 ERROR [stderr] (pool-14-thread-1) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
16:33:54,475 ERROR [stderr] (pool-14-thread-1) at
java.lang.Thread.run(Thread.java:722)
I also try to upload my parent pom ... but I get an error message "The JAR
does not contain a valid pom" ... of course it's not a JAR, it's just a
pom.xml
Can someone give me some hints on how to do this ?
Can I workaround and do a "mvn install" to put the JAR in the REPO under
WIDLFLY_HOME/bin/repositories/kie ?
Any help or hint would be appreciated.
Regards
-JPS
--
View this message in context: http://drools.46999.n3.nabble.com/drools-wb-6-1-0-CR1-wildfly-error-when-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months
Hang in Drools Builder during Building Workspace with Eclipse
by Borris
If I have
global java.util.List <com.blah.CountedValue <> > countsList;
then Drools Builder never finishes. If I have
global java.util.List <com.blah.CountedValue > countsList;
Then the problem does not occur. So it's the diamond brackets <> causing
the hang.
I'm not claiming this is the code I want - I was part way through
changing some stuff between Drools and Java and ended up with the <>
present whilst I was thinking. Either auto-save or my fingers doing the
equivalent a bit later triggered the hang.
The impact is massive, unfortunately, as Eclipse tries to build the
workspace (by default) on starting, and you need to have finished
workspace building before you can get the the dlg to disable the
automatic workspace building or the use of Drools Builder.
This happens in 6.1.0.201407130611 - but I was using 6.1.0.201407061813
when it went wrong.
Is there anything else I can add to be helpful?
Borris
11 years, 6 months
Error due to same class name
by Sumit Dhaniya
I've two classes with same name but in different packages.
I created several guided rules which use these classes when I validate
individual rules they get validated but when I try to Build and Deploy the
project it fails cause it try to find a field in another class.
Unable to create Field Extractor for 'isPH'Field/method 'isPH' not found for
cla
ss 'com.****.****.db.user.TmSlot'
: [Rule name='ProducerHour']
org.drools.core.RuntimeDroolsException: Field/method 'isPH' not found for
class
'com.****.****.db.user.TmSlot'
Unable to Analyse Expression isPH == true:
[Error: unable to resolve method using strict-mode:
com.****.****.db.user.TmSlot.isPH()]
[Near : {... isPH == true ....}]
--
View this message in context: http://drools.46999.n3.nabble.com/Error-due-to-same-class-name-tp4030304....
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months
Confusion on choosing Listeners
by Shrinath Managuli
Hi Drools,
I'm not completely sure about choosing Listener from which package either from drools-core or kie-api. I do see Listeners are available as below in kie-api and drools-core api.
kie-api
org.kie.api.event.rule
AgendaEventListener.java
RuleRuntimeEventListener.java
WorkingMemoryEventListener.java
kie-api org.kie.api.event.rule.process
ProcessEventListener.java
drools-core
org.drools.core.event
AgendaEventListener
WorkingMemoryEventListener
RuleBaseEventListener
KieSession accepts listener from kie-api. In which we can configure drools-core listeners? What Listeners are preferred to use?
Please share your thoughts.
Thanks,
Shrinath.
11 years, 6 months
Project Authoring in kie ide
by Sumit Dhaniya
I updated the POJO's which were getting used in rules due to which some of
the rules started throwing error and the left hand side panel consisting of
Organisational Unit, repository and project was no longer visible.
I tried restarting the server and then even deleting and creating a new
repository but left hand side panel of project authoring perspective is
still not getting displayed.
--
View this message in context: http://drools.46999.n3.nabble.com/Project-Authoring-in-kie-ide-tp4030298....
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months
unexpected/spurious ClassCastException
by Borris
I am getting an unexpected cast exception. The backtrace looks like
Exception in thread "main" java.lang.ClassCastException:
com.tastiereasier.rulez.ContextFoodItem cannot be cast to
com.tastiereasier.domain.FoodItem
at
ConditionEvaluatorb792d1e4169f4ac98945e49e1412d793.evaluate(Unknown Source)
at
org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:216)
at
org.drools.core.rule.constraint.MvelConstraint.isAllowedCachedLeft(MvelConstraint.java:185)
at
org.drools.core.common.SingleNonIndexSkipBetaConstraints.isAllowedCachedLeft(SingleNonIndexSkipBetaConstraints.java:141)
at
org.drools.core.phreak.PhreakJoinNode.doLeftInserts(PhreakJoinNode.java:98)
at org.drools.core.phreak.PhreakJoinNode.doNode(PhreakJoinNode.java:60)
at
org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:547)
at
org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:533)
at
org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:334)
at
org.drools.core.phreak.RuleNetworkEvaluator.evalStackEntry(RuleNetworkEvaluator.java:224)
at
org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:166)
at
org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:116)
at
org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:193)
at
org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:68)
at
org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:928)
at
org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1193)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1202)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1175)
at com.tastiereasier.rulez.Rulez.insertAndFire(Rulez.java:168)
at com.tastiereasier.rulez.Rulez.addDinerToContext(Rulez.java:310)
at com.tastiereasier.rulez.Rulez.<init>(Rulez.java:101)
at com.tastiereasier.rulez.Rulez.main(Rulez.java:44)
The rules that are triggering this are:
rule contextDinerDislike
enabled true
when
ContextDiner( $diner; )
DatumPreference
(
datumPreferenceType == DatumPreference.Type.PREFERENCE,
belief.factor < 0.0,
$datum: datum
)
from $diner.getDatumPreferences()
then
insert( new ContextFoodItem( (FoodItem) $datum, true ) );
end
rule spotNewContextDinerLike
enabled true
when
ContextDiner( $diner; )
DatumPreference
(
datumPreferenceType == DatumPreference.Type.PREFERENCE,
belief.factor > 0.0,
$datum: datum
)
from $diner.getDatumPreferences()
then
insert( new ContextFoodItem( (FoodItem) $datum, false ) );
end
If I disable either rule, then the other proceeds fine and no cast
exception happens.
I can't see why the cast should ever be asked for - it doesn't make sense.
If I changed the boolean parameter in the new in the insert - so both
are either true or both
are either false, there are no cast exceptions (there must be a clue here).
If I put a debug after the insertion, the backtrace actually happens
after return from the
insert() method - implying it's something on the agenda?
I tried using the Audit stuff to see if it gave any clues - but I've
never used that before
and simply got a heap exhaustion from Eclipse after 1/2 hour trying to
ingest something like 200
meg of trace data - I've got a lot of data being initialised into the
workspace before these rules
get a chance to do anything.
It's feeling remarkably like a bug to me, but I don't know how to
interpret the backtrace usefully,
so it's possible I've got something messed up elsewhere - although I've
disabled massive amounts
of rules that I can.
I grabbed a snapshot last night and it didn't change anything. (I was on
a snapshot from early June to fix being able to have Drools editor
reference my external jars.)
Does this look like a bug or user error? It's going to take some effort
to try and extract a test case
so I really don't want to spend the effort on that unless it looks the
only way.
Sage observations most appreciated.
Borris
11 years, 6 months