Jira opened for counting patterns issue - CEP-977 - Counting Patterns do
not work properly <https://wso2.org/browse/CEP-977>

Separately, you had mentioned that we can use e2[*prev*], e2[*last*] etc;
These are not documented anywhere AFAIK. Need to open a docsJIRA for this.
Are there any other similar keywords that can be used?

On Tue, Nov 4, 2014 at 10:13 AM, Seshika Fernando <[email protected]> wrote:

> Thanks. Shall open a jira for this.
>
> On Tue, Nov 4, 2014 at 9:56 AM, Sriskandarajah Suhothayan <[email protected]>
> wrote:
>
>>
>>
>> On Mon, Nov 3, 2014 at 3:57 AM, Seshika Fernando <[email protected]>
>> wrote:
>>
>>> Hi Suho,
>>>
>>> Leaving this particular example aside, I still have an issue with
>>> counting patterns.
>>> In the following example
>>>
>>> from e1 = data ->
>>> e2 = data[(e1.cardNum == e2.cardNum) and (e1.location != e2.location)]
>>> <4:>
>>> select e1.cardNum, e1.location as loc1, e2[0].location as loc2,
>>> e2[1].location as loc3, e2[2].location as loc4, e2[3].location as loc5
>>> insert into alert
>>>
>>> Assuming the below is the stream of transactions
>>>
>>> CardNum, Location
>>> 1234, Kandy
>>> 1234, Colombo
>>> 1234, Trinco
>>> 1234, Galle
>>> 1234, Nairobi
>>> 1234, Jaffna
>>>
>>> Then the first alert should be triggered as *[1234, Kandy, Colombo,
>>> Trinco, Galle, Nairobi] *since there are 4 transactions from the same
>>> card at locations different to the first transaction.
>>>
>>> However, currently we get alerts for every 2 events as follows..
>>>
>>> data=[1234, Kandy, Colombo, null, null, null]
>>>
>>> data=[1234, Kandy, Colombo, Trinco, null, null]
>>>
>>> data=[1234, Colombo, Trinco, null, null, null]
>>>
>>> data=[1234, Kandy, Colombo, Trinco, Galle, null]
>>>
>>> data=[1234, Colombo, Trinco, Galle, null, null]
>>>
>>> data=[1234, Trinco, Galle, null, null, null]
>>>
>>> data=[1234, Kandy, Colombo, Trinco, Galle, Nairobi]
>>>
>>> data=[1234, Colombo, Trinco, Galle, Nairobi, null]
>>>
>>> data=[1234, Trinco, Galle, Nairobi, null, null]
>>>
>>> data=[1234, Galle, Nairobi, null, null, null]
>>>
>>> data=[1234, Colombo, Trinco, Galle, Nairobi, Jaffna]
>>>
>>> data=[1234, Trinco, Galle, Nairobi, Jaffna, null]
>>>
>>> data=[1234, Galle, Nairobi, Jaffna, null, null]
>>>
>>> data=[1234, Nairobi, Jaffna, null, null, null]
>>>
>>>
>>> So I don't think this is how counting patterns are supposed to work,
>>> since there is no real use of putting <4:> if the alerts are going to come
>>> as above. WDYT?
>>>
>>> I feel we need to revisit counting patterns and their usability.
>>>
>>> It should not return null at-least it has to have 4 valid values.
>> I think that is a bug
>> will have a look
>>
>> For now as a work around, put a having condition to check is last one is
>> not a null
>>
>> from e1 = data ->
>> e2 = data[(e1.cardNum == e2.cardNum) and (e1.location != e2.location)]
>> <4:>
>> select e1.cardNum, e1.location as loc1, e2[0].location as loc2,
>> e2[1].location as loc3, e2[2].location as loc4, e2[3].location as loc5
>> having e2[3].location instanceof string
>> insert into alert
>>
>> Suho
>>
>>> seshi
>>>
>>>
>>> On Mon, Nov 3, 2014 at 9:06 AM, Supun Muthutantrige <[email protected]>
>>> wrote:
>>>
>>>> Hi Suho,
>>>>
>>>> Yes, the 3rd example worked for the above given scenario. And when more
>>>> than 3 addresses are allowed, what Seshika has mentioned can also be used.
>>>>
>>>> Thank you,
>>>> Regards
>>>>
>>>>
>>>> *Supun Rasitha Muthutantrige*
>>>> Software Engineer | Intern
>>>> WSO2 Inc: http://wso2.com
>>>> lean.enterprise.middleware
>>>> Mobile: 0758374608
>>>>
>>>
>>>
>>
>>
>> --
>>
>> *S. Suhothayan*
>> Technical Lead & Team Lead of WSO2 Complex Event Processor
>>  *WSO2 Inc. *http://wso2.com
>> * <http://wso2.com/>*
>> lean . enterprise . middleware
>>
>>
>> *cell: (+94) 779 756 757 <%28%2B94%29%20779%20756%20757> | blog:
>> http://suhothayan.blogspot.com/ <http://suhothayan.blogspot.com/>twitter:
>> http://twitter.com/suhothayan <http://twitter.com/suhothayan> | linked-in:
>> http://lk.linkedin.com/in/suhothayan <http://lk.linkedin.com/in/suhothayan>*
>>
>
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to