A question about use sliding window with and without entry point
by Yu Changyuan
Hi, everyone,
I just find that, insert an event into a entry point or insert it
directly into session will cause different behaviour, is this expected?
Here is the details:
1. drools run in stream mode and use pseudo clock
2. insert a MyEvent into entry-point "stream" and a MyEvent into session
directly every 1 seconds, start at 500ms.
3. call fireAllRules every 1seconds, at second 1, second 2, etc
4. drools version 5.5.0.Final
Below is the rule:
package me.ycy.drools.test1.data
import java.util.List
declare MyEvent
@role(event)
@timestamp(timestamp)
end
rule "over 0.3s"
when
$list: List() from collect(MyEvent() over window:time(300ms))
then
System.out.println("Rule: with in 0.3s --> " + $list);
end
rule "over 1s"
when
$list: List() from collect(MyEvent() over window:time(1s))
then
System.out.println("Rule: with in 1s --> " + $list);
end
rule "over 3s"
when
$list: List() from collect(MyEvent() over window:time(3s))
then
System.out.println("Rule: with in 3s --> " + $list);
end
rule "over 0.3s ep"
when
$list: List() from collect(MyEvent() over window:time(300ms) from
entry-point "stream")
then
System.out.println("Rule: with in 0.3s use ep --> " + $list);
end
rule "over 1s ep"
when
$list: List() from collect(MyEvent() over window:time(1s) from
entry-point "stream")
then
System.out.println("Rule: with in 1s use ep --> " + $list);
end
rule "over 3s ep"
when
$list: List() from collect(MyEvent() over window:time(3s) from
entry-point "stream")
then
System.out.println("Rule: with in 3s use ep --> " + $list);
end
// ------- end of rule
Finally, the output(just run 5 seconds)
-------------- fire at 1000 ---------------
Rule: with in 3s use ep --> [MyEvent(event 0,500)]
Rule: with in 1s use ep --> [MyEvent(event 0,500)]
Rule: with in 0.3s use ep --> [MyEvent(event 0,500)]
Rule: with in 3s --> [MyEvent(event 0,500)]
Rule: with in 1s --> [MyEvent(event 0,500)]
Rule: with in 0.3s --> []
-------------- fire at 2000 ---------------
Rule: with in 3s use ep --> [MyEvent(event 0,500), MyEvent(event 1,1500)]
Rule: with in 1s use ep --> [MyEvent(event 0,500), MyEvent(event 1,1500)]
Rule: with in 0.3s use ep --> [MyEvent(event 0,500), MyEvent(event 1,1500)]
Rule: with in 3s --> [MyEvent(event 0,500), MyEvent(event 1,1500)]
Rule: with in 1s --> [MyEvent(event 1,1500)]
Rule: with in 0.3s --> []
-------------- fire at 3000 ---------------
Rule: with in 3s use ep --> [MyEvent(event 0,500), MyEvent(event 1,1500),
MyEvent(event 2,2500)]
Rule: with in 1s use ep --> [MyEvent(event 0,500), MyEvent(event 1,1500),
MyEvent(event 2,2500)]
Rule: with in 0.3s use ep --> [MyEvent(event 0,500), MyEvent(event 1,1500),
MyEvent(event 2,2500)]
Rule: with in 3s --> [MyEvent(event 0,500), MyEvent(event 1,1500),
MyEvent(event 2,2500)]
Rule: with in 1s --> [MyEvent(event 2,2500)]
Rule: with in 0.3s --> []
-------------- fire at 4000 ---------------
Rule: with in 3s use ep --> [MyEvent(event 1,1500), MyEvent(event 2,2500),
MyEvent(event 3,3500)]
Rule: with in 1s use ep --> [MyEvent(event 1,1500), MyEvent(event 2,2500),
MyEvent(event 3,3500)]
Rule: with in 0.3s use ep --> [MyEvent(event 1,1500), MyEvent(event
2,2500), MyEvent(event 3,3500)]
Rule: with in 3s --> [MyEvent(event 1,1500), MyEvent(event 2,2500),
MyEvent(event 3,3500)]
Rule: with in 1s --> [MyEvent(event 3,3500)]
Rule: with in 0.3s --> []
-------------- fire at 5000 ---------------
Rule: with in 3s use ep --> [MyEvent(event 2,2500), MyEvent(event 3,3500),
MyEvent(event 4,4500)]
Rule: with in 1s use ep --> [MyEvent(event 2,2500), MyEvent(event 3,3500),
MyEvent(event 4,4500)]
Rule: with in 0.3s use ep --> [MyEvent(event 2,2500), MyEvent(event
3,3500), MyEvent(event 4,4500)]
Rule: with in 3s --> [MyEvent(event 2,2500), MyEvent(event 3,3500),
MyEvent(event 4,4500)]
Rule: with in 1s --> [MyEvent(event 4,4500)]
Rule: with in 0.3s --> []
--
Best regards,
Changyuan
11 years, 1 month
Traverse object chain from Guvnor
by rockford
I am working on a risk scanning application and evaluation Drools / Guvnor
for the application.
The rules will be written to check messages with structure like:
<message>
<attribute>value</attribute>
<attribute>value</attribute>
<levelTwo>
<attribute>value</attribute>
<attribute>value</attribute>
<levelTwo>
<attribute>value</attribute>
<attribute>value</attribute>
<levelThree>
<attribute>value</attribute>
<attribute>value</attribute>
The desired value to check would be something like:
message.levelTwo.levelThree.attribute - where levelTwo and levelThree are
objects from a list.
I know that this is possible using drl/mvel/java, but I am wondering if this
will work with Guvnor UI? We have several users writing tens of rules and
the users don't necessarily have the technical ability to write drl style
rules.
Does anyone know of a way to do this with the Guvnor UI?
Ken
--
View this message in context: http://drools.46999.n3.nabble.com/Traverse-object-chain-from-Guvnor-tp402...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 1 month
Suggestion/Feedback for DSL
by Sean Su
If we are not changing how the DSL is working, I would like to provide some
feedback to the development team here.
Currently the DSL definition file is like a key value property file where
the key being the DSL and value being the DRL part of that DSL statement.
This is nice as we can change the DRL without impacting the DSL.
However when we update the DSL part, even as simple as the wording to be
displayed on the web page, which happens often, the rules using the DSL
statement will be broken.
Proposal: if possible, Drools/Guvnor should maintain a key (like name of
that statement) independent from the context that used for the Display.
Users should be allowed to update DSL without rebuilding the rules using
it, as long as the independent key is maintained.
Sean
11 years, 1 month
Fusion in a J2ee container
by Danilo Rizzo
Hi All,
I would like to integrate Drools Fusion in a Web Application.
Do you have any experience about this?
I noticed in the example I found it is used FireUntilHalt which is a
blocking method, can it be replaced by FireAllRules once the event is
received?
thx
Danilo
11 years, 1 month
--Guvnor in Cluster mode with Oracle DB failing
by san_hegde
Hi,
I am trying to deploy Guvnor in Clustered Node, using Oracle 11
I am getting Caused By: java.sql.SQLSyntaxErrorException: ORA-00902: invalid
datatype
I am able to deploy in Non-cluster respository..
Any idea on why it is throwing that exception in cluster..
Below is my cluster configuration in repository xml..
<Cluster id="node1" syncDelay="2000">
<Journal
class="org.apache.jackrabbit.core.journal.OracleDatabaseJournal">
param name="revision" value="${rep.home}/revision.log" />
param name="driver"
value="oracle.jdbc.xa.client.OracleXADataSource" />
param name="url"
value="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=yes)(ADDRESS=(PROTOCOL=TCP)(HOST=gvu0513.austin.hp.com)(PORT=1525))(ADDRESS=(PROTOCOL=TCP)(HOST=gvu0514.austin.hp.com)(PORT=1525)))(CONNECT_DATA=(SERVICE_NAME
= BDDBD)))" />
param name="user" value="abc"/>
param name="password" value="abc"/>
</Journal>
</Cluster>
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-in-Cluster-mode-with-Oracle-DB-f...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 1 month
Guvnor 5.5 bug - when the advanced enum feature is used, the selected value is not saved in special condition
by Sean Su
When there are 3 drop downs, one determines the values of the other, the
selection in the last drop down is not saved when changing the rules twice
in the row.
For example: I have the following statement:
in fact [field1] [field2][field3]
each of the field is presented as a drop down by using the advanced ENUM
feature - 1 determines the values in 2 and the selection of 2 determines
the value of 3.
After the value in field3 is selected, I can move on and make the changes
in the rule. When the first change occurred, Guvnor remembers the values
being selected in all 3 fields. But when another change is make, the
selected value in the last field (field3) will be forgotten. Please note
this is only happening to the last field. I did not go further and make the
statement contain more than 3 drop downs.
I have tested this several times and am confident this is a bug in the 5.5
final version.
Thanks
Sean
11 years, 1 month