[
https://issues.jboss.org/browse/JBRULES-2623?page=com.atlassian.jira.plug...
]
Edson Tirelli commented on JBRULES-2623:
----------------------------------------
The initial goal of this work is to decouple window definition from window usage, allowing
for different window types to be supported and reused among different rules. At this
point, the goal is to support:
* *time based windows*, both strict and non-strict. I.e., for a window time(1h), support
both immediate propagation and propagation only after the window is full.
* *length based windows*, strict and non-stritct. Support optional grouping expression.
E.g. (pseudo-syntax):
{code:title=example.drl|borderStyle=solid}
// the following would create a window with the last 10 orders for each customer ID
@o : Order() over length(10, $o.customerId)
{code}
* *batch time windows* (a.k.a., tumbling windows)
* *batch length windows* (a.k.a., tumbling windows)
At this point it is not clear yet if we can/should support modifiers
"unique"/"distinct", "group-by" and "order-by".
Proposed syntax would be:
{code:title=drl.ebnf|borderStyle=solid}
windowDeclaration :=
DECLARE WINDOW id
annotation*
lhsPattern
(HAVING modifier)?
END
modifier := DISTINCT LEFT_PAREN expr RIGHT_PAREN
{code}
E.g.:
{code:title=example.drl|borderStyle=solid}
declare window ticks
@simple( test )
$s : StockTick( source == "NYCE" )
over window:length(5, $s.symbol)
from entry-point "stock tick stream"
end
{code}
The usage in regular rules would be supported as a new "from" construct:
{code:title=example.drl|borderStyle=solid}
rule X
when
Company( $symbol : symbol )
acc( StockTick( symbol == $symbol, $p: price ) from window ticks,
$avg : average( $p ) )
then
// the average price of the last 5 stock ticks for company $symbol
// in the NYCE is $avg
end
{code}
Decouple window definitions from pattern matching, allowing windows
to be reused among various patterns/rules
-------------------------------------------------------------------------------------------------------------
Key: JBRULES-2623
URL:
https://issues.jboss.org/browse/JBRULES-2623
Project: Drools
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: drools-api, drools-compiler (fusion), drools-core (fusion)
Affects Versions: 5.1.0.FINAL
Reporter: Edson Tirelli
Assignee: Edson Tirelli
Labels: fusion_roadmap
Fix For: 5.4.0.Beta1
Decouple window definitions from pattern matching, allowing windows to be reused among
various patterns/rules.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira