@key declarations for a type - What's under the hood?
by profversaggi
Is there any way to interrogate exactly, as in get a printed representation
of what goes on under the hood for one of these type of declarations ?
As an example: (as per the docs) for a declared type like the following:
declare Person
*firstName : String @key*
*lastName : String @key*
age : int
end
The compiler will implicitly generate 3 constructors: one without
parameters,
one with the @key fields, and one with all fields.
Person() // parameterless constructor
Person( String firstName, String lastName )
Person( String firstName, String lastName, int age )
...creating an instance using the @key constructor
/Person person = new Person( "John", "Doe" );/
****************
So lets say I do the following:
declare Here
location: String @key
end
I understand that it does the above, but it *also* lets me do this as well:
* Here here = new Here("kitchen");
System.out.println( here );
System.out.println( here.getLocation(); );
$lh : Here (location == "kitchen")
System.out.println( "You are in the " + $lh.getLocation() );*
And get ...
*Here( location=kitchen )
kitchen
You are in the kitchen*
... from various rules I've created ... so there is a lot going on under the
hood, I just want to get a complete inventory of what that is and how I
inspect it for more complex type declarations.
Any ideas?
-matt
--
View this message in context: http://drools.46999.n3.nabble.com/key-declarations-for-a-type-What-s-unde...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
StatefulKnowledgeSession
by Raja Sekhar
Hi,
How do cache the StatefulKnowledgeSession, instead of creating a new
session every time.
Using storm for data extraction and calling the rules to process them
--
Raja Sekhar Amirapu
------------------------------------------------------
"If any anyone can do it, i can do it. If no one else can do it, i must do
it"
11 years, 10 months
bench marking results for drools
by Raja Sekhar
Hi All,
For benchmark of drools rules.Any strategies are available?
I want to test my rules with 10,000 facts to 20,000,000 facts?
--
Raja Sekhar Amirapu
------------------------------------------------------
"If any anyone can do it, i can do it. If no one else can do it, i must do
it"
11 years, 10 months
master - [BZ-1069337] fix incremental compilation when multiple KieContainers use the same ReleaseId
by SrjTx
I stumbled on this commit today hoping it would fix the behaviour we have
been chasing for quite some time to no avail.
In our setup we have tow containers pointing to the same releaseID via
LATEST. The version is static at 1.0 using KIE. We have two drl rules. One
rule contains logic will fire from container1 and the other from container 2
- they use two independent entry-points and objects unique to the respective
entry-point.
The test is simple, we send objects into both entry-points that should fire
both rules - they do. We make changes to the rules via KIE wb, deploy the
project, the containers pickup the changes however at runtime only changes
to rule 1 seem to b "loaded". More specifically container 1 pickups up the
new deltas while container 2 never does.
We are running inside a JBoss container env. The workaround is to restart
jboss and then the latest are used. I have verified that the jar that is
produced in .m2 is correct. I even saw the changes in the kbase.cache file
inside our jar.
Any ideas? Is LATEST not handled even with the above fix?
Are we experiencing https://issues.jboss.org/browse/SWITCHYARD-1840???
Thanks
-J
-
--
View this message in context: http://drools.46999.n3.nabble.com/master-BZ-1069337-fix-incremental-compi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
Drools error log msg?
by Markus Schneider
Hi list,
I see the following error msg in my drools log but I don't know how to
interpret this.
Do I have a serious problem here?
Has anybody a clue?
Thanks in advance.
Cheers,
-markus
| Error ==>[AfterActivationFiredEvent: getActivation()=[Activation
rule=UpdateAlertRule, act#=37, salience=900, tuple=[fact
0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event : 19]
],
getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87]
| Error ==>[BeforeActivationFiredEvent: getActivation()=[Activation
rule=EventRetractionRule, act#=36, salience=1, tuple=[fact
0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event : 19]
],
getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87]
EventRetractionRule is processed.
| Error ==>[ObjectRetractedEventImpl: getFactHandle()=[fact
0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event :
19], getOldObject()=rapideca.plugins.rbm.entity.Event : 19,
getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87,
getPropagationContext()=PropagationContextImpl [activeActivations=0,
dormantActivations=2, entryPoint=EntryPoint::DEFAULT, factHandle=[fact
0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event :
19], leftTuple=[fact
0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event : 19]
, originOffset=-1, propagationNumber=40, rule=[Rule
name=EventRetractionRule, agendaGroup=MAIN, salience=1, no-loop=true],
type=1]]
2014-02-25 08:59:03,524 [eventQueueReceiverJmsListenerContainer-1] INFO
log.RuleLogHandler - RuleLog with id: 38 was successfully saved.
| Error ==>[AfterActivationFiredEvent: getActivation()=[Activation
rule=EventRetractionRule, act#=36, salience=1, tuple=[fact
0:-1:184363445:184363445:19:null:null]
],
getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87]
11 years, 10 months
6.0.1.F Regex validation in DSL causes errors
by SrjTx
I have tried the following regexes.
{startTime:[01]?[0-9]|2[0-3]:[0-5][0-9]}
{startTime:[0-9]+} -- not a time of course, but thought I would give it
something easy
{startTime:"[0-9]+"}
just {startTime} works
When a regex is present , I get errors like:
[9] Unable to expand: Beer *List* Unknown BLone BLone 25-Feb-2014 startTime
25-Feb-2014 endTime
[ERR 102] Line 9:8 mismatched input '*List*' in rule "a"
DSL lookes like
[when]Beer *List* {x} {y} ... {startTime[0-9]+} ... =eval($foo.doThis("{x}",
"{y}", ..., "{startTime}, ..."))
--
View this message in context: http://drools.46999.n3.nabble.com/6-0-1-F-Regex-validation-in-DSL-causes-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
Drools 6.x - Stand alone Examples!
by mattmadhavan
Hello,
I am looking for a sample of Drools 6.x example. For some reason I cannot
resolve the Maven dependencies for the 6.x samples. I am good with 5.x.
*DO I need to add any maven repository for the 6.x artifacts? Looks like
they may not be present in the public Maven repo?*
For instance none of these artifacts resolve!
I have tried various 6.x.x [Sapshot, Final] version for : ${drools.version}
Thanks in advance!
Matt'M
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-6-x-Stand-alone-Examples-tp40282...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months