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
10 years, 5 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.
10 years, 5 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.
10 years, 5 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.
10 years, 5 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
10 years, 5 months
kie-drools-wb-6.0.1 : view "artifact repository" is empty
by jps
Hello,
The artifact repository view in drools-wb is suddenly empty :( after having
uploaded a new jar. Before this operation, I had 3 artifacts that were
listed ..
I try to redeploy the app, restart jboss, delete JBOSS_HOME/bin/repository
and start again ... but still the list of artifact in the repository is
empty, although i can see it's not empty on the disk in
JBOSS_HOME/bin/repository/kie/...
Something has been corrupted somewhere. But I'm stuck. Any idea or
suggestions ?
What can prevent drools-wb from getting the repo data ?
Thanks
jps
--
View this message in context: http://drools.46999.n3.nabble.com/kie-drools-wb-6-0-1-view-artifact-repos...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 5 months
Equality semantics of logical assertions and stated assertions
by mikerod
I understand that logical insertions in Drools does not insert two facts that
are equal according to their #equals implementation (and associated
#hashCode logic).
I'm basing this off of my own investigation plus the (well written)
documentation @
http://docs.jboss.org/drools/release/5.2.0.Final/drools-expert-docs/html/....
However, normal/stated fact assertions only use identity-based equality
checks - by default.
It looks like this can be changed to value-based equality via
RuleBaseConfiguration.
I have found some related, old Jiras:
https://issues.jboss.org/browse/JBRULES-266
https://issues.jboss.org/browse/JBRULES-233
In both cases, Mark Proctor had a final remark, but I wasn't able to
understand what was really decided and why.
One specific comment @ https://issues.jboss.org/browse/JBRULES-266 is,
"logical assertions are always equality based. Stated facts can now use
identity and equality - using your configuration settings.
I have added another configuration setting to dictate how logical over-ride
works. Does it discard the original fact, or turn it into two stated fact
handles."
What is the reasoning behind only using the value-based equality for logical
assertions?
Why is it not configurable as stated fact assertions are?
Also, why is the default behavior of stated fact assertion to be
identity-based equality?
- I find the inconsistency between the default for normal assertions and the
(only option) for logical assertion to be a bit confusing/inconsistent.
I'm just looking for an understanding the motivation behind these design
decisions.
I have had a lot of performance issues using, primarily, logical assertions
due to the "no duplicate" checking being done.
Even the stated assertions do still come with a cost of creating the initial
FactHandle.
With deeply nested/complex domain objects, the #equals and #hashCode
implementations may be quite expensive when executed many times throughout
rule execution.
This is especially prominent in accumulators that may later accumulate these
objects into collections that then are also subject to this equals/hashCode
"penalty".
I have a related post a while back @
http://drools.46999.n3.nabble.com/Object-size-impact-on-session-insertion....
I do not believe it is typical to use complex domain model objects as the
keys to something like a HashMap.
One reason (there are more; especially for mutable objects) would be due to
the performance around having them be hashed and equality checked regularly
when the
map is accessed, modified, etc.
The creation of many FactHandle's has shown up in some of my profiling
performance problems due to this the constructor immediately hashing my
domain model objects.
I think the reason the fact handles use this information is for value-based
equality comparisons - such as the only method used by the Truth Maintenance
System logical assertions.
I would really appreciate more insight into the motivation for not allowing
#equals facts to be logically asserted separately into working memory -
especially since there is a price to pay for the behavior in my case.
--
View this message in context: http://drools.46999.n3.nabble.com/Equality-semantics-of-logical-assertion...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 5 months
Repositories in Kie-Drools
by Sumit Dhaniya
I want to use a repository hosted on cloud as repository in my kie ide.
I tried creating a new repo cloning an existing repo but after cloning kie
ide creates a new repo path at localhost and doesn't uses the cloud repo
path.
Can I achieve this or I'll have to find a way to sync two repositories one
linked to kie and another to cloud repo.
--
View this message in context: http://drools.46999.n3.nabble.com/Repositories-in-Kie-Drools-tp4030254.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 5 months