Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-07-11 Thread Gobinath
Hi,
I defined the number of operands as the number of LogicalStreamProcessors
that can be partners. Not is handled by one LogicalStreamProcessor so it
can be partner with another LogicalStreamProcessor.

Does it make sense?

Thanks and Regards,
Gobinath

On Jul 11, 2017 3:06 PM, "Sriskandarajah Suhothayan"  wrote:

> Can you please elaborate on "more than two pattern operands is not
> supported by Siddhi"
> I thought (not C and D) is still one operand as we can't access C.
>
> On Tue, Jul 11, 2017 at 1:42 AM, Gobinath  wrote:
>
>> Hi Suho,
>>
>> I have added the test cases to all the cases you have mentioned except
>> the four listed below because having more than two pattern operands is not
>> supported by Siddhi. I hope it is okay to skip those test cases. WDYT?
>>
>>
>>- every ( (not C and D) and B ) -> A
>>- every ((not C and D) or B ) -> A
>>- every (B and (not C and D) ) -> A
>>- every (B or (not C and D) ) -> A
>>
>>
>> If there are no more cases to test, may I start with the SEQUENCE?
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Mon, Jul 3, 2017 at 2:32 PM, Gobinath  wrote:
>>
>>> Hi,
>>> Sure. I will add test cases for each of these cases.
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> On Mon, Jul 3, 2017 at 2:23 PM, Sriskandarajah Suhothayan >> > wrote:
>>>


 On Mon, Jul 3, 2017 at 5:18 PM, Gobinath  wrote:

> Hi,
>
> The following absent event cases are implemented and tested so far and
> now I am focusing on testing these patterns in the form of *Sequence*.
> If you find any cases that I missed or any improvements, please share 
> them.
>
>
>
> A not B for 1sec
>
> After the arrival of A, wait for 1 sec & B not arrived
>
> A → not B and C
>
> When C arrive if B is not available
>
> A → (not B and C) within 1sec
>
> If B not arrived but C arrived within 1 sec from A
>
> A → (not B for 1sec  and C) within 2sec
>
> Wait for 1 sec from the arrival of A; if B not arrived and C arrived
> and both happened within 2 sec from A
>
> not A for 1sec → B
>
> Wait for 1 sec; if A not arrived but B arrived after 1sec
>
> not A and B → C
>
> When B arrive if A is not available followed by C
>
> every ( not B and  A)  → C
>
> Every combination of the previous case
>
> every ( not B for 1sec) → C
>
> Check and emit C every second, if B not arrive
>
> A → not B  for 1 sec and not C for 1 sec
>
> After A, both B and C are not received within 1 sec
>
> not A  for 1 sec and not B for 1 sec → C
>
> A and B are not received for 1 sec and then C
>
> A → not B   for 1 sec or not C for 1 sec
>
> After A, wait for 1 sec B or C not received
>
> not A  for 1 sec or not B for 1 sec → C
>
> Wait for 1 sec; A or B not received followed by C
>
> A → not B for 1 sec or C
>
> After A, if C arrives, emit it otherwise emit after 1 sec if B not
> arrived
>
> not A for 1 sec or B → C
>
> Same as previous but the other way around
>
> I think these will also work but better if you can check them too via
 testcase.

 A → C or not B for 1 sec

 B or not A for 1 sec → C

 every (not B  for 1 sec and not C for 1 sec ) -> A

 every (not B  for 1 sec or not C for 1 sec ) -> A

 every (B *and* not C for 1 sec ) -> A

 every (not C for 1 sec *and* B ) -> A

 every (B *or* not C for 1 sec ) -> A

 every (not C for 1 sec *or* B ) -> A

 every (B *and* (not C and D) ) -> A

 every ( (not C and D) *and* B ) -> A

 every (B *or* (not C and D) ) -> A

 every ((not C and D) *or* B ) -> A


>
> Thanks & Regards,
> Gobinath
>
> On Sun, Jul 2, 2017 at 6:34 AM, Gobinath  wrote:
>
>> Thanks, Suho.
>>
>> Sure I will.
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Sun, Jul 2, 2017 at 6:32 AM, Sriskandarajah Suhothayan <
>> s...@wso2.com> wrote:
>>
>>> Thanks merged the PR.
>>>
>>> Can you inform in SOF that you have fixed this issue, and this is
>>> the PR.
>>>
>>> Thanks
>>> Suho
>>>
>>> On Sun, Jul 2, 2017 at 6:21 AM, Gobinath 
>>> wrote:
>>>
 Hi,

 Please find the PR [1] fixing the following issues in Siddhi.

 1. Logical pattern not obeying the '*within*' keyword

 2. Sequence not obeying the '*every*' keyword

 3. Logical pattern '*from* *A or B select...*' not producing the
 output

 With this fix, the problems asked in Stack Overflow [2] are
 resolved.


 [1] 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-07-10 Thread Gobinath
Hi Suho,

I have added the test cases to all the cases you have mentioned except the
four listed below because having more than two pattern operands is not
supported by Siddhi. I hope it is okay to skip those test cases. WDYT?


   - every ( (not C and D) and B ) -> A
   - every ((not C and D) or B ) -> A
   - every (B and (not C and D) ) -> A
   - every (B or (not C and D) ) -> A


If there are no more cases to test, may I start with the SEQUENCE?


Thanks & Regards,
Gobinath

On Mon, Jul 3, 2017 at 2:32 PM, Gobinath  wrote:

> Hi,
> Sure. I will add test cases for each of these cases.
>
>
> Thanks & Regards,
> Gobinath
>
> On Mon, Jul 3, 2017 at 2:23 PM, Sriskandarajah Suhothayan 
> wrote:
>
>>
>>
>> On Mon, Jul 3, 2017 at 5:18 PM, Gobinath  wrote:
>>
>>> Hi,
>>>
>>> The following absent event cases are implemented and tested so far and
>>> now I am focusing on testing these patterns in the form of *Sequence*.
>>> If you find any cases that I missed or any improvements, please share them.
>>>
>>>
>>>
>>> A not B for 1sec
>>>
>>> After the arrival of A, wait for 1 sec & B not arrived
>>>
>>> A → not B and C
>>>
>>> When C arrive if B is not available
>>>
>>> A → (not B and C) within 1sec
>>>
>>> If B not arrived but C arrived within 1 sec from A
>>>
>>> A → (not B for 1sec  and C) within 2sec
>>>
>>> Wait for 1 sec from the arrival of A; if B not arrived and C arrived and
>>> both happened within 2 sec from A
>>>
>>> not A for 1sec → B
>>>
>>> Wait for 1 sec; if A not arrived but B arrived after 1sec
>>>
>>> not A and B → C
>>>
>>> When B arrive if A is not available followed by C
>>>
>>> every ( not B and  A)  → C
>>>
>>> Every combination of the previous case
>>>
>>> every ( not B for 1sec) → C
>>>
>>> Check and emit C every second, if B not arrive
>>>
>>> A → not B  for 1 sec and not C for 1 sec
>>>
>>> After A, both B and C are not received within 1 sec
>>>
>>> not A  for 1 sec and not B for 1 sec → C
>>>
>>> A and B are not received for 1 sec and then C
>>>
>>> A → not B   for 1 sec or not C for 1 sec
>>>
>>> After A, wait for 1 sec B or C not received
>>>
>>> not A  for 1 sec or not B for 1 sec → C
>>>
>>> Wait for 1 sec; A or B not received followed by C
>>>
>>> A → not B for 1 sec or C
>>>
>>> After A, if C arrives, emit it otherwise emit after 1 sec if B not
>>> arrived
>>>
>>> not A for 1 sec or B → C
>>>
>>> Same as previous but the other way around
>>>
>>> I think these will also work but better if you can check them too via
>> testcase.
>>
>> A → C or not B for 1 sec
>>
>> B or not A for 1 sec → C
>>
>> every (not B  for 1 sec and not C for 1 sec ) -> A
>>
>> every (not B  for 1 sec or not C for 1 sec ) -> A
>>
>> every (B *and* not C for 1 sec ) -> A
>>
>> every (not C for 1 sec *and* B ) -> A
>>
>> every (B *or* not C for 1 sec ) -> A
>>
>> every (not C for 1 sec *or* B ) -> A
>>
>> every (B *and* (not C and D) ) -> A
>>
>> every ( (not C and D) *and* B ) -> A
>>
>> every (B *or* (not C and D) ) -> A
>>
>> every ((not C and D) *or* B ) -> A
>>
>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> On Sun, Jul 2, 2017 at 6:34 AM, Gobinath  wrote:
>>>
 Thanks, Suho.

 Sure I will.


 Thanks & Regards,
 Gobinath

 On Sun, Jul 2, 2017 at 6:32 AM, Sriskandarajah Suhothayan <
 s...@wso2.com> wrote:

> Thanks merged the PR.
>
> Can you inform in SOF that you have fixed this issue, and this is the
> PR.
>
> Thanks
> Suho
>
> On Sun, Jul 2, 2017 at 6:21 AM, Gobinath  wrote:
>
>> Hi,
>>
>> Please find the PR [1] fixing the following issues in Siddhi.
>>
>> 1. Logical pattern not obeying the '*within*' keyword
>>
>> 2. Sequence not obeying the '*every*' keyword
>>
>> 3. Logical pattern '*from* *A or B select...*' not producing the
>> output
>>
>> With this fix, the problems asked in Stack Overflow [2] are resolved.
>>
>>
>> [1] https://github.com/wso2/siddhi/pull/436
>>
>> [2] https://stackoverflow.com/questions/41557227/siddhi-logi
>> cal-and-with-within-executes-callback-unexpectedly
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>>
>> On Sat, May 13, 2017 at 8:02 AM, Gobinath 
>> wrote:
>>
>>> Hi,
>>>
>>> I've fixed the duplicate output with 'OR' in the PR #354 [1].
>>> According to this fix, the *addState* method of
>>> *LogicalPreStateProcessor* treats both PATTERN and SEQUENCE in the
>>> same way [2]. It does not break any existing tests but please check 
>>> whether
>>> it makes sense or not.
>>>
>>>
>>> [1] https://github.com/wso2/siddhi/pull/354
>>>
>>> [2] https://github.com/wso2/siddhi/pull/354/commits/803e4d0f
>>> 486d7268af117bcfe42f4c704f98b3b5#diff-32293ae88907e099f28593
>>> e5496e1e67R62
>>>
>>>
>>> Thanks & 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-07-03 Thread Gobinath
Hi,
Sure. I will add test cases for each of these cases.


Thanks & Regards,
Gobinath

On Mon, Jul 3, 2017 at 2:23 PM, Sriskandarajah Suhothayan 
wrote:

>
>
> On Mon, Jul 3, 2017 at 5:18 PM, Gobinath  wrote:
>
>> Hi,
>>
>> The following absent event cases are implemented and tested so far and
>> now I am focusing on testing these patterns in the form of *Sequence*.
>> If you find any cases that I missed or any improvements, please share them.
>>
>>
>>
>> A not B for 1sec
>>
>> After the arrival of A, wait for 1 sec & B not arrived
>>
>> A → not B and C
>>
>> When C arrive if B is not available
>>
>> A → (not B and C) within 1sec
>>
>> If B not arrived but C arrived within 1 sec from A
>>
>> A → (not B for 1sec  and C) within 2sec
>>
>> Wait for 1 sec from the arrival of A; if B not arrived and C arrived and
>> both happened within 2 sec from A
>>
>> not A for 1sec → B
>>
>> Wait for 1 sec; if A not arrived but B arrived after 1sec
>>
>> not A and B → C
>>
>> When B arrive if A is not available followed by C
>>
>> every ( not B and  A)  → C
>>
>> Every combination of the previous case
>>
>> every ( not B for 1sec) → C
>>
>> Check and emit C every second, if B not arrive
>>
>> A → not B  for 1 sec and not C for 1 sec
>>
>> After A, both B and C are not received within 1 sec
>>
>> not A  for 1 sec and not B for 1 sec → C
>>
>> A and B are not received for 1 sec and then C
>>
>> A → not B   for 1 sec or not C for 1 sec
>>
>> After A, wait for 1 sec B or C not received
>>
>> not A  for 1 sec or not B for 1 sec → C
>>
>> Wait for 1 sec; A or B not received followed by C
>>
>> A → not B for 1 sec or C
>>
>> After A, if C arrives, emit it otherwise emit after 1 sec if B not arrived
>>
>> not A for 1 sec or B → C
>>
>> Same as previous but the other way around
>>
>> I think these will also work but better if you can check them too via
> testcase.
>
> A → C or not B for 1 sec
>
> B or not A for 1 sec → C
>
> every (not B  for 1 sec and not C for 1 sec ) -> A
>
> every (not B  for 1 sec or not C for 1 sec ) -> A
>
> every (B *and* not C for 1 sec ) -> A
>
> every (not C for 1 sec *and* B ) -> A
>
> every (B *or* not C for 1 sec ) -> A
>
> every (not C for 1 sec *or* B ) -> A
>
> every (B *and* (not C and D) ) -> A
>
> every ( (not C and D) *and* B ) -> A
>
> every (B *or* (not C and D) ) -> A
>
> every ((not C and D) *or* B ) -> A
>
>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Sun, Jul 2, 2017 at 6:34 AM, Gobinath  wrote:
>>
>>> Thanks, Suho.
>>>
>>> Sure I will.
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> On Sun, Jul 2, 2017 at 6:32 AM, Sriskandarajah Suhothayan >> > wrote:
>>>
 Thanks merged the PR.

 Can you inform in SOF that you have fixed this issue, and this is the
 PR.

 Thanks
 Suho

 On Sun, Jul 2, 2017 at 6:21 AM, Gobinath  wrote:

> Hi,
>
> Please find the PR [1] fixing the following issues in Siddhi.
>
> 1. Logical pattern not obeying the '*within*' keyword
>
> 2. Sequence not obeying the '*every*' keyword
>
> 3. Logical pattern '*from* *A or B select...*' not producing the
> output
>
> With this fix, the problems asked in Stack Overflow [2] are resolved.
>
>
> [1] https://github.com/wso2/siddhi/pull/436
>
> [2] https://stackoverflow.com/questions/41557227/siddhi-logi
> cal-and-with-within-executes-callback-unexpectedly
>
>
> Thanks & Regards,
> Gobinath
>
>
> On Sat, May 13, 2017 at 8:02 AM, Gobinath 
> wrote:
>
>> Hi,
>>
>> I've fixed the duplicate output with 'OR' in the PR #354 [1].
>> According to this fix, the *addState* method of
>> *LogicalPreStateProcessor* treats both PATTERN and SEQUENCE in the
>> same way [2]. It does not break any existing tests but please check 
>> whether
>> it makes sense or not.
>>
>>
>> [1] https://github.com/wso2/siddhi/pull/354
>>
>> [2] https://github.com/wso2/siddhi/pull/354/commits/803e4d0f
>> 486d7268af117bcfe42f4c704f98b3b5#diff-32293ae88907e099f28593
>> e5496e1e67R62
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Mon, May 8, 2017 at 1:24 AM, Sriskandarajah Suhothayan <
>> s...@wso2.com> wrote:
>>
>>> I have merged that. +1 this also should give 1 output.
>>>
>>> Thanks for the fixes.
>>>
>>> Regards
>>> Suho
>>>
>>> On Mon, May 8, 2017 at 10:18 AM, Nirmal Fernando 
>>> wrote:
>>>
 Again, I'd only expect one o/p;
 Event{timestamp=1494203709496, data=[WSO2, null, 4.7],
 isExpired=false}

 On Mon, May 8, 2017 at 6:25 AM, Gobinath 
 wrote:

> Hi,
>
> I've found a minor bug and sent the PR [1] with the fix. Similar
> behavior is noticed 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-07-03 Thread Sriskandarajah Suhothayan
On Mon, Jul 3, 2017 at 5:18 PM, Gobinath  wrote:

> Hi,
>
> The following absent event cases are implemented and tested so far and now
> I am focusing on testing these patterns in the form of *Sequence*. If you
> find any cases that I missed or any improvements, please share them.
>
>
>
> A not B for 1sec
>
> After the arrival of A, wait for 1 sec & B not arrived
>
> A → not B and C
>
> When C arrive if B is not available
>
> A → (not B and C) within 1sec
>
> If B not arrived but C arrived within 1 sec from A
>
> A → (not B for 1sec  and C) within 2sec
>
> Wait for 1 sec from the arrival of A; if B not arrived and C arrived and
> both happened within 2 sec from A
>
> not A for 1sec → B
>
> Wait for 1 sec; if A not arrived but B arrived after 1sec
>
> not A and B → C
>
> When B arrive if A is not available followed by C
>
> every ( not B and  A)  → C
>
> Every combination of the previous case
>
> every ( not B for 1sec) → C
>
> Check and emit C every second, if B not arrive
>
> A → not B  for 1 sec and not C for 1 sec
>
> After A, both B and C are not received within 1 sec
>
> not A  for 1 sec and not B for 1 sec → C
>
> A and B are not received for 1 sec and then C
>
> A → not B   for 1 sec or not C for 1 sec
>
> After A, wait for 1 sec B or C not received
>
> not A  for 1 sec or not B for 1 sec → C
>
> Wait for 1 sec; A or B not received followed by C
>
> A → not B for 1 sec or C
>
> After A, if C arrives, emit it otherwise emit after 1 sec if B not arrived
>
> not A for 1 sec or B → C
>
> Same as previous but the other way around
>
> I think these will also work but better if you can check them too via
testcase.

A → C or not B for 1 sec

B or not A for 1 sec → C

every (not B  for 1 sec and not C for 1 sec ) -> A

every (not B  for 1 sec or not C for 1 sec ) -> A

every (B *and* not C for 1 sec ) -> A

every (not C for 1 sec *and* B ) -> A

every (B *or* not C for 1 sec ) -> A

every (not C for 1 sec *or* B ) -> A

every (B *and* (not C and D) ) -> A

every ( (not C and D) *and* B ) -> A

every (B *or* (not C and D) ) -> A

every ((not C and D) *or* B ) -> A


>
> Thanks & Regards,
> Gobinath
>
> On Sun, Jul 2, 2017 at 6:34 AM, Gobinath  wrote:
>
>> Thanks, Suho.
>>
>> Sure I will.
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Sun, Jul 2, 2017 at 6:32 AM, Sriskandarajah Suhothayan 
>> wrote:
>>
>>> Thanks merged the PR.
>>>
>>> Can you inform in SOF that you have fixed this issue, and this is the
>>> PR.
>>>
>>> Thanks
>>> Suho
>>>
>>> On Sun, Jul 2, 2017 at 6:21 AM, Gobinath  wrote:
>>>
 Hi,

 Please find the PR [1] fixing the following issues in Siddhi.

 1. Logical pattern not obeying the '*within*' keyword

 2. Sequence not obeying the '*every*' keyword

 3. Logical pattern '*from* *A or B select...*' not producing the output

 With this fix, the problems asked in Stack Overflow [2] are resolved.


 [1] https://github.com/wso2/siddhi/pull/436

 [2] https://stackoverflow.com/questions/41557227/siddhi-logi
 cal-and-with-within-executes-callback-unexpectedly


 Thanks & Regards,
 Gobinath


 On Sat, May 13, 2017 at 8:02 AM, Gobinath  wrote:

> Hi,
>
> I've fixed the duplicate output with 'OR' in the PR #354 [1].
> According to this fix, the *addState* method of
> *LogicalPreStateProcessor* treats both PATTERN and SEQUENCE in the
> same way [2]. It does not break any existing tests but please check 
> whether
> it makes sense or not.
>
>
> [1] https://github.com/wso2/siddhi/pull/354
>
> [2] https://github.com/wso2/siddhi/pull/354/commits/803e4d0f
> 486d7268af117bcfe42f4c704f98b3b5#diff-32293ae88907e099f28593
> e5496e1e67R62
>
>
> Thanks & Regards,
> Gobinath
>
> On Mon, May 8, 2017 at 1:24 AM, Sriskandarajah Suhothayan <
> s...@wso2.com> wrote:
>
>> I have merged that. +1 this also should give 1 output.
>>
>> Thanks for the fixes.
>>
>> Regards
>> Suho
>>
>> On Mon, May 8, 2017 at 10:18 AM, Nirmal Fernando 
>> wrote:
>>
>>> Again, I'd only expect one o/p;
>>> Event{timestamp=1494203709496, data=[WSO2, null, 4.7],
>>> isExpired=false}
>>>
>>> On Mon, May 8, 2017 at 6:25 AM, Gobinath 
>>> wrote:
>>>
 Hi,

 I've found a minor bug and sent the PR [1] with the fix. Similar
 behavior is noticed with *or* operator as well (Even after the
 fix). I have given the code and the output below for your concern.

 // Query: e1 or e2 -> e3

 define stream Stream1 (symbol string, price float, volume int);
 define stream Stream2 (symbol string, price float, volume int);

 @info(name = 'query1')
 from e1=Stream1[price > 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-07-03 Thread Gobinath
Hi,

The following absent event cases are implemented and tested so far and now
I am focusing on testing these patterns in the form of *Sequence*. If you
find any cases that I missed or any improvements, please share them.



A not B for 1sec

After the arrival of A, wait for 1 sec & B not arrived

A → not B and C

When C arrive if B is not available

A → (not B and C) within 1sec

If B not arrived but C arrived within 1 sec from A

A → (not B for 1sec  and C) within 2sec

Wait for 1 sec from the arrival of A; if B not arrived and C arrived and
both happened within 2 sec from A

not A for 1sec → B

Wait for 1 sec; if A not arrived but B arrived after 1sec

not A and B → C

When B arrive if A is not available followed by C

every ( not B and  A)  → C

Every combination of the previous case

every ( not B for 1sec) → C

Check and emit C every second, if B not arrive

A → not B  for 1 sec and not C for 1 sec

After A, both B and C are not received within 1 sec

not A  for 1 sec and not B for 1 sec → C

A and B are not received for 1 sec and then C

A → not B   for 1 sec or not C for 1 sec

After A, wait for 1 sec B or C not received

not A  for 1 sec or not B for 1 sec → C

Wait for 1 sec; A or B not received followed by C

A → not B for 1 sec or C

After A, if C arrives, emit it otherwise emit after 1 sec if B not arrived

not A for 1 sec or B → C

Same as previous but the other way around



Thanks & Regards,
Gobinath

On Sun, Jul 2, 2017 at 6:34 AM, Gobinath  wrote:

> Thanks, Suho.
>
> Sure I will.
>
>
> Thanks & Regards,
> Gobinath
>
> On Sun, Jul 2, 2017 at 6:32 AM, Sriskandarajah Suhothayan 
> wrote:
>
>> Thanks merged the PR.
>>
>> Can you inform in SOF that you have fixed this issue, and this is the PR.
>>
>> Thanks
>> Suho
>>
>> On Sun, Jul 2, 2017 at 6:21 AM, Gobinath  wrote:
>>
>>> Hi,
>>>
>>> Please find the PR [1] fixing the following issues in Siddhi.
>>>
>>> 1. Logical pattern not obeying the '*within*' keyword
>>>
>>> 2. Sequence not obeying the '*every*' keyword
>>>
>>> 3. Logical pattern '*from* *A or B select...*' not producing the output
>>>
>>> With this fix, the problems asked in Stack Overflow [2] are resolved.
>>>
>>>
>>> [1] https://github.com/wso2/siddhi/pull/436
>>>
>>> [2] https://stackoverflow.com/questions/41557227/siddhi-logi
>>> cal-and-with-within-executes-callback-unexpectedly
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>>
>>> On Sat, May 13, 2017 at 8:02 AM, Gobinath  wrote:
>>>
 Hi,

 I've fixed the duplicate output with 'OR' in the PR #354 [1]. According
 to this fix, the *addState* method of *LogicalPreStateProcessor*
 treats both PATTERN and SEQUENCE in the same way [2]. It does not break any
 existing tests but please check whether it makes sense or not.


 [1] https://github.com/wso2/siddhi/pull/354

 [2] https://github.com/wso2/siddhi/pull/354/commits/803e4d0f
 486d7268af117bcfe42f4c704f98b3b5#diff-32293ae88907e099f28593
 e5496e1e67R62


 Thanks & Regards,
 Gobinath

 On Mon, May 8, 2017 at 1:24 AM, Sriskandarajah Suhothayan <
 s...@wso2.com> wrote:

> I have merged that. +1 this also should give 1 output.
>
> Thanks for the fixes.
>
> Regards
> Suho
>
> On Mon, May 8, 2017 at 10:18 AM, Nirmal Fernando 
> wrote:
>
>> Again, I'd only expect one o/p;
>> Event{timestamp=1494203709496, data=[WSO2, null, 4.7],
>> isExpired=false}
>>
>> On Mon, May 8, 2017 at 6:25 AM, Gobinath 
>> wrote:
>>
>>> Hi,
>>>
>>> I've found a minor bug and sent the PR [1] with the fix. Similar
>>> behavior is noticed with *or* operator as well (Even after the
>>> fix). I have given the code and the output below for your concern.
>>>
>>> // Query: e1 or e2 -> e3
>>>
>>> define stream Stream1 (symbol string, price float, volume int);
>>> define stream Stream2 (symbol string, price float, volume int);
>>>
>>> @info(name = 'query1')
>>> from e1=Stream1[price > 20] or e2=Stream2[price >30] ->
>>> e3=Stream2['IBM' == symbol]
>>> select e1.symbol as symbol1, e2.price as price2, e3.price as price3
>>> insert into OutputStream;
>>>
>>> // Input
>>> Stream1.send(new Object[]{"WSO2", 55.6f, 100});
>>> Stream2.send(new Object[]{"GOOG", 72.7f, 100});
>>> Stream2.send(new Object[]{"IBM", 4.7f, 100});
>>>
>>> // Output
>>> Event{timestamp=1494203709496, data=[WSO2, null, 4.7],
>>> isExpired=false}
>>> Event{timestamp=1494203709496, data=[WSO2, null, 4.7],
>>> isExpired=false}
>>>
>>> If it is also a bug, please do let me know without merging the PR. I
>>> will fix it under the same PR.
>>>
>>> [1] https://github.com/wso2/siddhi/pull/345
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> On 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-07-02 Thread Gobinath
Thanks, Suho.

Sure I will.


Thanks & Regards,
Gobinath

On Sun, Jul 2, 2017 at 6:32 AM, Sriskandarajah Suhothayan 
wrote:

> Thanks merged the PR.
>
> Can you inform in SOF that you have fixed this issue, and this is the PR.
>
> Thanks
> Suho
>
> On Sun, Jul 2, 2017 at 6:21 AM, Gobinath  wrote:
>
>> Hi,
>>
>> Please find the PR [1] fixing the following issues in Siddhi.
>>
>> 1. Logical pattern not obeying the '*within*' keyword
>>
>> 2. Sequence not obeying the '*every*' keyword
>>
>> 3. Logical pattern '*from* *A or B select...*' not producing the output
>>
>> With this fix, the problems asked in Stack Overflow [2] are resolved.
>>
>>
>> [1] https://github.com/wso2/siddhi/pull/436
>>
>> [2] https://stackoverflow.com/questions/41557227/siddhi-logi
>> cal-and-with-within-executes-callback-unexpectedly
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>>
>> On Sat, May 13, 2017 at 8:02 AM, Gobinath  wrote:
>>
>>> Hi,
>>>
>>> I've fixed the duplicate output with 'OR' in the PR #354 [1]. According
>>> to this fix, the *addState* method of *LogicalPreStateProcessor* treats
>>> both PATTERN and SEQUENCE in the same way [2]. It does not break any
>>> existing tests but please check whether it makes sense or not.
>>>
>>>
>>> [1] https://github.com/wso2/siddhi/pull/354
>>>
>>> [2] https://github.com/wso2/siddhi/pull/354/commits/803e4d0f
>>> 486d7268af117bcfe42f4c704f98b3b5#diff-32293ae88907e099f28593
>>> e5496e1e67R62
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> On Mon, May 8, 2017 at 1:24 AM, Sriskandarajah Suhothayan >> > wrote:
>>>
 I have merged that. +1 this also should give 1 output.

 Thanks for the fixes.

 Regards
 Suho

 On Mon, May 8, 2017 at 10:18 AM, Nirmal Fernando 
 wrote:

> Again, I'd only expect one o/p;
> Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}
>
> On Mon, May 8, 2017 at 6:25 AM, Gobinath  wrote:
>
>> Hi,
>>
>> I've found a minor bug and sent the PR [1] with the fix. Similar
>> behavior is noticed with *or* operator as well (Even after the fix).
>> I have given the code and the output below for your concern.
>>
>> // Query: e1 or e2 -> e3
>>
>> define stream Stream1 (symbol string, price float, volume int);
>> define stream Stream2 (symbol string, price float, volume int);
>>
>> @info(name = 'query1')
>> from e1=Stream1[price > 20] or e2=Stream2[price >30] ->
>> e3=Stream2['IBM' == symbol]
>> select e1.symbol as symbol1, e2.price as price2, e3.price as price3
>> insert into OutputStream;
>>
>> // Input
>> Stream1.send(new Object[]{"WSO2", 55.6f, 100});
>> Stream2.send(new Object[]{"GOOG", 72.7f, 100});
>> Stream2.send(new Object[]{"IBM", 4.7f, 100});
>>
>> // Output
>> Event{timestamp=1494203709496, data=[WSO2, null, 4.7],
>> isExpired=false}
>> Event{timestamp=1494203709496, data=[WSO2, null, 4.7],
>> isExpired=false}
>>
>> If it is also a bug, please do let me know without merging the PR. I
>> will fix it under the same PR.
>>
>> [1] https://github.com/wso2/siddhi/pull/345
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Sun, May 7, 2017 at 2:06 PM, Gobinath 
>> wrote:
>>
>>> Sure. I'll check the issue and send a separate PR with the fix.
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> On Sun, May 7, 2017 at 1:51 PM, Sriskandarajah Suhothayan <
>>> s...@wso2.com> wrote:
>>>
 Yes, it looks like a bug to me, can you check why it's happening.

 Regards
 Suho

 On Sun, May 7, 2017 at 8:56 PM, Nirmal Fernando 
 wrote:

> Looks like a bug to me. I would expect only 1 event.
>
> On Sun, May 7, 2017 at 8:49 PM, Gobinath 
> wrote:
>
>> Hi,
>>
>> Thanks for accepting my proposal. I have a question regarding the
>> behavior of *and* in a pattern.
>>
>> // Query: e1 and e2 -> e3
>>
>> define stream Stream1 (symbol string, price float, volume int);
>> define stream Stream2 (symbol string, price float, volume int);
>>
>> @info(name = 'query1')
>> from e1=Stream1[price > 50.0f] and e2=Stream2['IBM' == symbol] ->
>> e3=Stream2[price > 20]
>> select e1.symbol as symbol1, e2.price as price2, e3.price as
>> price3
>> insert into OutputStream;
>>
>> // Input
>> Stream1.send(new Object[]{"GOOGLE", 72.7f, 100});
>> Stream2.send(new Object[]{"IBM", 4.7f, 100});
>> Stream2.send(new Object[]{"WSO2", 55.6f, 100});
>>
>>
>> // Output
>> 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-07-02 Thread Sriskandarajah Suhothayan
Thanks merged the PR.

Can you inform in SOF that you have fixed this issue, and this is the PR.

Thanks
Suho

On Sun, Jul 2, 2017 at 6:21 AM, Gobinath  wrote:

> Hi,
>
> Please find the PR [1] fixing the following issues in Siddhi.
>
> 1. Logical pattern not obeying the '*within*' keyword
>
> 2. Sequence not obeying the '*every*' keyword
>
> 3. Logical pattern '*from* *A or B select...*' not producing the output
>
> With this fix, the problems asked in Stack Overflow [2] are resolved.
>
>
> [1] https://github.com/wso2/siddhi/pull/436
>
> [2] https://stackoverflow.com/questions/41557227/siddhi-
> logical-and-with-within-executes-callback-unexpectedly
>
>
> Thanks & Regards,
> Gobinath
>
>
> On Sat, May 13, 2017 at 8:02 AM, Gobinath  wrote:
>
>> Hi,
>>
>> I've fixed the duplicate output with 'OR' in the PR #354 [1]. According
>> to this fix, the *addState* method of *LogicalPreStateProcessor* treats
>> both PATTERN and SEQUENCE in the same way [2]. It does not break any
>> existing tests but please check whether it makes sense or not.
>>
>>
>> [1] https://github.com/wso2/siddhi/pull/354
>>
>> [2] https://github.com/wso2/siddhi/pull/354/commits/803e4d0f
>> 486d7268af117bcfe42f4c704f98b3b5#diff-32293ae88907e099f28593e5496e1e67R62
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Mon, May 8, 2017 at 1:24 AM, Sriskandarajah Suhothayan 
>> wrote:
>>
>>> I have merged that. +1 this also should give 1 output.
>>>
>>> Thanks for the fixes.
>>>
>>> Regards
>>> Suho
>>>
>>> On Mon, May 8, 2017 at 10:18 AM, Nirmal Fernando 
>>> wrote:
>>>
 Again, I'd only expect one o/p;
 Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}

 On Mon, May 8, 2017 at 6:25 AM, Gobinath  wrote:

> Hi,
>
> I've found a minor bug and sent the PR [1] with the fix. Similar
> behavior is noticed with *or* operator as well (Even after the fix).
> I have given the code and the output below for your concern.
>
> // Query: e1 or e2 -> e3
>
> define stream Stream1 (symbol string, price float, volume int);
> define stream Stream2 (symbol string, price float, volume int);
>
> @info(name = 'query1')
> from e1=Stream1[price > 20] or e2=Stream2[price >30] ->
> e3=Stream2['IBM' == symbol]
> select e1.symbol as symbol1, e2.price as price2, e3.price as price3
> insert into OutputStream;
>
> // Input
> Stream1.send(new Object[]{"WSO2", 55.6f, 100});
> Stream2.send(new Object[]{"GOOG", 72.7f, 100});
> Stream2.send(new Object[]{"IBM", 4.7f, 100});
>
> // Output
> Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}
> Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}
>
> If it is also a bug, please do let me know without merging the PR. I
> will fix it under the same PR.
>
> [1] https://github.com/wso2/siddhi/pull/345
>
>
> Thanks & Regards,
> Gobinath
>
> On Sun, May 7, 2017 at 2:06 PM, Gobinath  wrote:
>
>> Sure. I'll check the issue and send a separate PR with the fix.
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Sun, May 7, 2017 at 1:51 PM, Sriskandarajah Suhothayan <
>> s...@wso2.com> wrote:
>>
>>> Yes, it looks like a bug to me, can you check why it's happening.
>>>
>>> Regards
>>> Suho
>>>
>>> On Sun, May 7, 2017 at 8:56 PM, Nirmal Fernando 
>>> wrote:
>>>
 Looks like a bug to me. I would expect only 1 event.

 On Sun, May 7, 2017 at 8:49 PM, Gobinath 
 wrote:

> Hi,
>
> Thanks for accepting my proposal. I have a question regarding the
> behavior of *and* in a pattern.
>
> // Query: e1 and e2 -> e3
>
> define stream Stream1 (symbol string, price float, volume int);
> define stream Stream2 (symbol string, price float, volume int);
>
> @info(name = 'query1')
> from e1=Stream1[price > 50.0f] and e2=Stream2['IBM' == symbol] ->
> e3=Stream2[price > 20]
> select e1.symbol as symbol1, e2.price as price2, e3.price as price3
> insert into OutputStream;
>
> // Input
> Stream1.send(new Object[]{"GOOGLE", 72.7f, 100});
> Stream2.send(new Object[]{"IBM", 4.7f, 100});
> Stream2.send(new Object[]{"WSO2", 55.6f, 100});
>
>
> // Output
> Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6],
> isExpired=false}
> Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6],
> isExpired=false}
>
> Is this the expected output?. Note that the output contains two
> exactly similar events but the pattern *e1 -> e2 and e3* outputs
> a single event 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-07-01 Thread Gobinath
Hi,

Please find the PR [1] fixing the following issues in Siddhi.

1. Logical pattern not obeying the '*within*' keyword

2. Sequence not obeying the '*every*' keyword

3. Logical pattern '*from* *A or B select...*' not producing the output

With this fix, the problems asked in Stack Overflow [2] are resolved.


[1] https://github.com/wso2/siddhi/pull/436

[2]
https://stackoverflow.com/questions/41557227/siddhi-logical-and-with-within-executes-callback-unexpectedly


Thanks & Regards,
Gobinath


On Sat, May 13, 2017 at 8:02 AM, Gobinath  wrote:

> Hi,
>
> I've fixed the duplicate output with 'OR' in the PR #354 [1]. According to
> this fix, the *addState* method of *LogicalPreStateProcessor* treats both
> PATTERN and SEQUENCE in the same way [2]. It does not break any existing
> tests but please check whether it makes sense or not.
>
>
> [1] https://github.com/wso2/siddhi/pull/354
>
> [2] https://github.com/wso2/siddhi/pull/354/commits/
> 803e4d0f486d7268af117bcfe42f4c704f98b3b5#diff-
> 32293ae88907e099f28593e5496e1e67R62
>
>
> Thanks & Regards,
> Gobinath
>
> On Mon, May 8, 2017 at 1:24 AM, Sriskandarajah Suhothayan 
> wrote:
>
>> I have merged that. +1 this also should give 1 output.
>>
>> Thanks for the fixes.
>>
>> Regards
>> Suho
>>
>> On Mon, May 8, 2017 at 10:18 AM, Nirmal Fernando  wrote:
>>
>>> Again, I'd only expect one o/p;
>>> Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}
>>>
>>> On Mon, May 8, 2017 at 6:25 AM, Gobinath  wrote:
>>>
 Hi,

 I've found a minor bug and sent the PR [1] with the fix. Similar
 behavior is noticed with *or* operator as well (Even after the fix). I
 have given the code and the output below for your concern.

 // Query: e1 or e2 -> e3

 define stream Stream1 (symbol string, price float, volume int);
 define stream Stream2 (symbol string, price float, volume int);

 @info(name = 'query1')
 from e1=Stream1[price > 20] or e2=Stream2[price >30] ->
 e3=Stream2['IBM' == symbol]
 select e1.symbol as symbol1, e2.price as price2, e3.price as price3
 insert into OutputStream;

 // Input
 Stream1.send(new Object[]{"WSO2", 55.6f, 100});
 Stream2.send(new Object[]{"GOOG", 72.7f, 100});
 Stream2.send(new Object[]{"IBM", 4.7f, 100});

 // Output
 Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}
 Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}

 If it is also a bug, please do let me know without merging the PR. I
 will fix it under the same PR.

 [1] https://github.com/wso2/siddhi/pull/345


 Thanks & Regards,
 Gobinath

 On Sun, May 7, 2017 at 2:06 PM, Gobinath  wrote:

> Sure. I'll check the issue and send a separate PR with the fix.
>
>
> Thanks & Regards,
> Gobinath
>
> On Sun, May 7, 2017 at 1:51 PM, Sriskandarajah Suhothayan <
> s...@wso2.com> wrote:
>
>> Yes, it looks like a bug to me, can you check why it's happening.
>>
>> Regards
>> Suho
>>
>> On Sun, May 7, 2017 at 8:56 PM, Nirmal Fernando 
>> wrote:
>>
>>> Looks like a bug to me. I would expect only 1 event.
>>>
>>> On Sun, May 7, 2017 at 8:49 PM, Gobinath 
>>> wrote:
>>>
 Hi,

 Thanks for accepting my proposal. I have a question regarding the
 behavior of *and* in a pattern.

 // Query: e1 and e2 -> e3

 define stream Stream1 (symbol string, price float, volume int);
 define stream Stream2 (symbol string, price float, volume int);

 @info(name = 'query1')
 from e1=Stream1[price > 50.0f] and e2=Stream2['IBM' == symbol] ->
 e3=Stream2[price > 20]
 select e1.symbol as symbol1, e2.price as price2, e3.price as price3
 insert into OutputStream;

 // Input
 Stream1.send(new Object[]{"GOOGLE", 72.7f, 100});
 Stream2.send(new Object[]{"IBM", 4.7f, 100});
 Stream2.send(new Object[]{"WSO2", 55.6f, 100});


 // Output
 Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6],
 isExpired=false}
 Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6],
 isExpired=false}

 Is this the expected output?. Note that the output contains two
 exactly similar events but the pattern *e1 -> e2 and e3* outputs a
 single event [1].

 [1] https://github.com/wso2/siddhi/blob/master/modules/siddh
 i-core/src/test/java/org/wso2/siddhi/core/query/pattern/Logi
 calPatternTestCase.java#L98


 Thanks & Regards,
 Gobinath

 On Mon, Apr 17, 2017 at 7:58 AM, Gobinath 
 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-05-13 Thread Gobinath
Hi,

I've fixed the duplicate output with 'OR' in the PR #354 [1]. According to
this fix, the *addState* method of *LogicalPreStateProcessor* treats both
PATTERN and SEQUENCE in the same way [2]. It does not break any existing
tests but please check whether it makes sense or not.


[1] https://github.com/wso2/siddhi/pull/354

[2]
https://github.com/wso2/siddhi/pull/354/commits/803e4d0f486d7268af117bcfe42f4c704f98b3b5#diff-32293ae88907e099f28593e5496e1e67R62


Thanks & Regards,
Gobinath

On Mon, May 8, 2017 at 1:24 AM, Sriskandarajah Suhothayan 
wrote:

> I have merged that. +1 this also should give 1 output.
>
> Thanks for the fixes.
>
> Regards
> Suho
>
> On Mon, May 8, 2017 at 10:18 AM, Nirmal Fernando  wrote:
>
>> Again, I'd only expect one o/p;
>> Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}
>>
>> On Mon, May 8, 2017 at 6:25 AM, Gobinath  wrote:
>>
>>> Hi,
>>>
>>> I've found a minor bug and sent the PR [1] with the fix. Similar
>>> behavior is noticed with *or* operator as well (Even after the fix). I
>>> have given the code and the output below for your concern.
>>>
>>> // Query: e1 or e2 -> e3
>>>
>>> define stream Stream1 (symbol string, price float, volume int);
>>> define stream Stream2 (symbol string, price float, volume int);
>>>
>>> @info(name = 'query1')
>>> from e1=Stream1[price > 20] or e2=Stream2[price >30] -> e3=Stream2['IBM'
>>> == symbol]
>>> select e1.symbol as symbol1, e2.price as price2, e3.price as price3
>>> insert into OutputStream;
>>>
>>> // Input
>>> Stream1.send(new Object[]{"WSO2", 55.6f, 100});
>>> Stream2.send(new Object[]{"GOOG", 72.7f, 100});
>>> Stream2.send(new Object[]{"IBM", 4.7f, 100});
>>>
>>> // Output
>>> Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}
>>> Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}
>>>
>>> If it is also a bug, please do let me know without merging the PR. I
>>> will fix it under the same PR.
>>>
>>> [1] https://github.com/wso2/siddhi/pull/345
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> On Sun, May 7, 2017 at 2:06 PM, Gobinath  wrote:
>>>
 Sure. I'll check the issue and send a separate PR with the fix.


 Thanks & Regards,
 Gobinath

 On Sun, May 7, 2017 at 1:51 PM, Sriskandarajah Suhothayan <
 s...@wso2.com> wrote:

> Yes, it looks like a bug to me, can you check why it's happening.
>
> Regards
> Suho
>
> On Sun, May 7, 2017 at 8:56 PM, Nirmal Fernando 
> wrote:
>
>> Looks like a bug to me. I would expect only 1 event.
>>
>> On Sun, May 7, 2017 at 8:49 PM, Gobinath 
>> wrote:
>>
>>> Hi,
>>>
>>> Thanks for accepting my proposal. I have a question regarding the
>>> behavior of *and* in a pattern.
>>>
>>> // Query: e1 and e2 -> e3
>>>
>>> define stream Stream1 (symbol string, price float, volume int);
>>> define stream Stream2 (symbol string, price float, volume int);
>>>
>>> @info(name = 'query1')
>>> from e1=Stream1[price > 50.0f] and e2=Stream2['IBM' == symbol] ->
>>> e3=Stream2[price > 20]
>>> select e1.symbol as symbol1, e2.price as price2, e3.price as price3
>>> insert into OutputStream;
>>>
>>> // Input
>>> Stream1.send(new Object[]{"GOOGLE", 72.7f, 100});
>>> Stream2.send(new Object[]{"IBM", 4.7f, 100});
>>> Stream2.send(new Object[]{"WSO2", 55.6f, 100});
>>>
>>>
>>> // Output
>>> Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6],
>>> isExpired=false}
>>> Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6],
>>> isExpired=false}
>>>
>>> Is this the expected output?. Note that the output contains two
>>> exactly similar events but the pattern *e1 -> e2 and e3* outputs a
>>> single event [1].
>>>
>>> [1] https://github.com/wso2/siddhi/blob/master/modules/siddh
>>> i-core/src/test/java/org/wso2/siddhi/core/query/pattern/Logi
>>> calPatternTestCase.java#L98
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> On Mon, Apr 17, 2017 at 7:58 AM, Gobinath 
>>> wrote:
>>>
 Hi,

 Please see the PR at [1]. Please do not merge it.


 Thanks & Regards,
 Gobinath

 [1] https://github.com/wso2/siddhi/pull/313


 On Mon, Apr 17, 2017 at 7:44 AM, Sriskandarajah Suhothayan <
 s...@wso2.com> wrote:

> Based on first look, it looks great.
>
> Can you send it as a PR so I can see the exact implementations and
> also give comments.
>
> Regards
> Suho
>
> On Mon, Apr 17, 2017 at 5:30 AM, Gobinath 
> wrote:
>
>> Hi,
>>
>> A prototype is 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-05-07 Thread Sriskandarajah Suhothayan
I have merged that. +1 this also should give 1 output.

Thanks for the fixes.

Regards
Suho

On Mon, May 8, 2017 at 10:18 AM, Nirmal Fernando  wrote:

> Again, I'd only expect one o/p;
> Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}
>
> On Mon, May 8, 2017 at 6:25 AM, Gobinath  wrote:
>
>> Hi,
>>
>> I've found a minor bug and sent the PR [1] with the fix. Similar behavior
>> is noticed with *or* operator as well (Even after the fix). I have given
>> the code and the output below for your concern.
>>
>> // Query: e1 or e2 -> e3
>>
>> define stream Stream1 (symbol string, price float, volume int);
>> define stream Stream2 (symbol string, price float, volume int);
>>
>> @info(name = 'query1')
>> from e1=Stream1[price > 20] or e2=Stream2[price >30] -> e3=Stream2['IBM'
>> == symbol]
>> select e1.symbol as symbol1, e2.price as price2, e3.price as price3
>> insert into OutputStream;
>>
>> // Input
>> Stream1.send(new Object[]{"WSO2", 55.6f, 100});
>> Stream2.send(new Object[]{"GOOG", 72.7f, 100});
>> Stream2.send(new Object[]{"IBM", 4.7f, 100});
>>
>> // Output
>> Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}
>> Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}
>>
>> If it is also a bug, please do let me know without merging the PR. I will
>> fix it under the same PR.
>>
>> [1] https://github.com/wso2/siddhi/pull/345
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Sun, May 7, 2017 at 2:06 PM, Gobinath  wrote:
>>
>>> Sure. I'll check the issue and send a separate PR with the fix.
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> On Sun, May 7, 2017 at 1:51 PM, Sriskandarajah Suhothayan >> > wrote:
>>>
 Yes, it looks like a bug to me, can you check why it's happening.

 Regards
 Suho

 On Sun, May 7, 2017 at 8:56 PM, Nirmal Fernando 
 wrote:

> Looks like a bug to me. I would expect only 1 event.
>
> On Sun, May 7, 2017 at 8:49 PM, Gobinath  wrote:
>
>> Hi,
>>
>> Thanks for accepting my proposal. I have a question regarding the
>> behavior of *and* in a pattern.
>>
>> // Query: e1 and e2 -> e3
>>
>> define stream Stream1 (symbol string, price float, volume int);
>> define stream Stream2 (symbol string, price float, volume int);
>>
>> @info(name = 'query1')
>> from e1=Stream1[price > 50.0f] and e2=Stream2['IBM' == symbol] ->
>> e3=Stream2[price > 20]
>> select e1.symbol as symbol1, e2.price as price2, e3.price as price3
>> insert into OutputStream;
>>
>> // Input
>> Stream1.send(new Object[]{"GOOGLE", 72.7f, 100});
>> Stream2.send(new Object[]{"IBM", 4.7f, 100});
>> Stream2.send(new Object[]{"WSO2", 55.6f, 100});
>>
>>
>> // Output
>> Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6],
>> isExpired=false}
>> Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6],
>> isExpired=false}
>>
>> Is this the expected output?. Note that the output contains two
>> exactly similar events but the pattern *e1 -> e2 and e3* outputs a
>> single event [1].
>>
>> [1] https://github.com/wso2/siddhi/blob/master/modules/siddh
>> i-core/src/test/java/org/wso2/siddhi/core/query/pattern/Logi
>> calPatternTestCase.java#L98
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Mon, Apr 17, 2017 at 7:58 AM, Gobinath 
>> wrote:
>>
>>> Hi,
>>>
>>> Please see the PR at [1]. Please do not merge it.
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> [1] https://github.com/wso2/siddhi/pull/313
>>>
>>>
>>> On Mon, Apr 17, 2017 at 7:44 AM, Sriskandarajah Suhothayan <
>>> s...@wso2.com> wrote:
>>>
 Based on first look, it looks great.

 Can you send it as a PR so I can see the exact implementations and
 also give comments.

 Regards
 Suho

 On Mon, Apr 17, 2017 at 5:30 AM, Gobinath 
 wrote:

> Hi,
>
> A prototype is implemented and available at [1]. Currently the
> query support for absent patterns and two simple pattern 
> identifications (e1
> -> not e2 and not e1 -> e2) are implemented. Please have a look
> at the unit test [2] to get the idea. Class names and variable names 
> are
> subject to change (will finalize later). I am waiting for your 
> feedback.
>
>
> Thanks & Regards,
> Gobinath
>
>
> [1] https://github.com/lgobinath/siddhi/tree/feature-absent-
> event-pattern
> [2] https://github.com/lgobinath/siddhi/blob/feature-absent-
> event-pattern/modules/siddhi-core/src/test/java/org/wso2/sid

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-05-07 Thread Nirmal Fernando
Again, I'd only expect one o/p;
Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}

On Mon, May 8, 2017 at 6:25 AM, Gobinath  wrote:

> Hi,
>
> I've found a minor bug and sent the PR [1] with the fix. Similar behavior
> is noticed with *or* operator as well (Even after the fix). I have given
> the code and the output below for your concern.
>
> // Query: e1 or e2 -> e3
>
> define stream Stream1 (symbol string, price float, volume int);
> define stream Stream2 (symbol string, price float, volume int);
>
> @info(name = 'query1')
> from e1=Stream1[price > 20] or e2=Stream2[price >30] -> e3=Stream2['IBM'
> == symbol]
> select e1.symbol as symbol1, e2.price as price2, e3.price as price3
> insert into OutputStream;
>
> // Input
> Stream1.send(new Object[]{"WSO2", 55.6f, 100});
> Stream2.send(new Object[]{"GOOG", 72.7f, 100});
> Stream2.send(new Object[]{"IBM", 4.7f, 100});
>
> // Output
> Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}
> Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}
>
> If it is also a bug, please do let me know without merging the PR. I will
> fix it under the same PR.
>
> [1] https://github.com/wso2/siddhi/pull/345
>
>
> Thanks & Regards,
> Gobinath
>
> On Sun, May 7, 2017 at 2:06 PM, Gobinath  wrote:
>
>> Sure. I'll check the issue and send a separate PR with the fix.
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Sun, May 7, 2017 at 1:51 PM, Sriskandarajah Suhothayan 
>> wrote:
>>
>>> Yes, it looks like a bug to me, can you check why it's happening.
>>>
>>> Regards
>>> Suho
>>>
>>> On Sun, May 7, 2017 at 8:56 PM, Nirmal Fernando  wrote:
>>>
 Looks like a bug to me. I would expect only 1 event.

 On Sun, May 7, 2017 at 8:49 PM, Gobinath  wrote:

> Hi,
>
> Thanks for accepting my proposal. I have a question regarding the
> behavior of *and* in a pattern.
>
> // Query: e1 and e2 -> e3
>
> define stream Stream1 (symbol string, price float, volume int);
> define stream Stream2 (symbol string, price float, volume int);
>
> @info(name = 'query1')
> from e1=Stream1[price > 50.0f] and e2=Stream2['IBM' == symbol] ->
> e3=Stream2[price > 20]
> select e1.symbol as symbol1, e2.price as price2, e3.price as price3
> insert into OutputStream;
>
> // Input
> Stream1.send(new Object[]{"GOOGLE", 72.7f, 100});
> Stream2.send(new Object[]{"IBM", 4.7f, 100});
> Stream2.send(new Object[]{"WSO2", 55.6f, 100});
>
>
> // Output
> Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6],
> isExpired=false}
> Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6],
> isExpired=false}
>
> Is this the expected output?. Note that the output contains two
> exactly similar events but the pattern *e1 -> e2 and e3* outputs a
> single event [1].
>
> [1] https://github.com/wso2/siddhi/blob/master/modules/siddh
> i-core/src/test/java/org/wso2/siddhi/core/query/pattern/Logi
> calPatternTestCase.java#L98
>
>
> Thanks & Regards,
> Gobinath
>
> On Mon, Apr 17, 2017 at 7:58 AM, Gobinath 
> wrote:
>
>> Hi,
>>
>> Please see the PR at [1]. Please do not merge it.
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> [1] https://github.com/wso2/siddhi/pull/313
>>
>>
>> On Mon, Apr 17, 2017 at 7:44 AM, Sriskandarajah Suhothayan <
>> s...@wso2.com> wrote:
>>
>>> Based on first look, it looks great.
>>>
>>> Can you send it as a PR so I can see the exact implementations and
>>> also give comments.
>>>
>>> Regards
>>> Suho
>>>
>>> On Mon, Apr 17, 2017 at 5:30 AM, Gobinath 
>>> wrote:
>>>
 Hi,

 A prototype is implemented and available at [1]. Currently the
 query support for absent patterns and two simple pattern 
 identifications (e1
 -> not e2 and not e1 -> e2) are implemented. Please have a look at
 the unit test [2] to get the idea. Class names and variable names are
 subject to change (will finalize later). I am waiting for your 
 feedback.


 Thanks & Regards,
 Gobinath


 [1] https://github.com/lgobinath/siddhi/tree/feature-absent-
 event-pattern
 [2] https://github.com/lgobinath/siddhi/blob/feature-absent-
 event-pattern/modules/siddhi-core/src/test/java/org/wso2/sid
 dhi/core/query/pattern/EveryAbsentPatternTestCase.java


 On Fri, Mar 31, 2017 at 6:28 AM, Gobinath 
 wrote:

> Hi all,
>
> Thanks Suho for your feedback. I have made the changes based on
> your suggestions and submitted the final 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-05-07 Thread Gobinath
Hi,

I've found a minor bug and sent the PR [1] with the fix. Similar behavior
is noticed with *or* operator as well (Even after the fix). I have given
the code and the output below for your concern.

// Query: e1 or e2 -> e3

define stream Stream1 (symbol string, price float, volume int);
define stream Stream2 (symbol string, price float, volume int);

@info(name = 'query1')
from e1=Stream1[price > 20] or e2=Stream2[price >30] -> e3=Stream2['IBM' ==
symbol]
select e1.symbol as symbol1, e2.price as price2, e3.price as price3
insert into OutputStream;

// Input
Stream1.send(new Object[]{"WSO2", 55.6f, 100});
Stream2.send(new Object[]{"GOOG", 72.7f, 100});
Stream2.send(new Object[]{"IBM", 4.7f, 100});

// Output
Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}
Event{timestamp=1494203709496, data=[WSO2, null, 4.7], isExpired=false}

If it is also a bug, please do let me know without merging the PR. I will
fix it under the same PR.

[1] https://github.com/wso2/siddhi/pull/345


Thanks & Regards,
Gobinath

On Sun, May 7, 2017 at 2:06 PM, Gobinath  wrote:

> Sure. I'll check the issue and send a separate PR with the fix.
>
>
> Thanks & Regards,
> Gobinath
>
> On Sun, May 7, 2017 at 1:51 PM, Sriskandarajah Suhothayan 
> wrote:
>
>> Yes, it looks like a bug to me, can you check why it's happening.
>>
>> Regards
>> Suho
>>
>> On Sun, May 7, 2017 at 8:56 PM, Nirmal Fernando  wrote:
>>
>>> Looks like a bug to me. I would expect only 1 event.
>>>
>>> On Sun, May 7, 2017 at 8:49 PM, Gobinath  wrote:
>>>
 Hi,

 Thanks for accepting my proposal. I have a question regarding the
 behavior of *and* in a pattern.

 // Query: e1 and e2 -> e3

 define stream Stream1 (symbol string, price float, volume int);
 define stream Stream2 (symbol string, price float, volume int);

 @info(name = 'query1')
 from e1=Stream1[price > 50.0f] and e2=Stream2['IBM' == symbol] ->
 e3=Stream2[price > 20]
 select e1.symbol as symbol1, e2.price as price2, e3.price as price3
 insert into OutputStream;

 // Input
 Stream1.send(new Object[]{"GOOGLE", 72.7f, 100});
 Stream2.send(new Object[]{"IBM", 4.7f, 100});
 Stream2.send(new Object[]{"WSO2", 55.6f, 100});


 // Output
 Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6],
 isExpired=false}
 Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6],
 isExpired=false}

 Is this the expected output?. Note that the output contains two exactly
 similar events but the pattern *e1 -> e2 and e3* outputs a single
 event [1].

 [1] https://github.com/wso2/siddhi/blob/master/modules/siddh
 i-core/src/test/java/org/wso2/siddhi/core/query/pattern/Logi
 calPatternTestCase.java#L98


 Thanks & Regards,
 Gobinath

 On Mon, Apr 17, 2017 at 7:58 AM, Gobinath  wrote:

> Hi,
>
> Please see the PR at [1]. Please do not merge it.
>
>
> Thanks & Regards,
> Gobinath
>
> [1] https://github.com/wso2/siddhi/pull/313
>
>
> On Mon, Apr 17, 2017 at 7:44 AM, Sriskandarajah Suhothayan <
> s...@wso2.com> wrote:
>
>> Based on first look, it looks great.
>>
>> Can you send it as a PR so I can see the exact implementations and
>> also give comments.
>>
>> Regards
>> Suho
>>
>> On Mon, Apr 17, 2017 at 5:30 AM, Gobinath 
>> wrote:
>>
>>> Hi,
>>>
>>> A prototype is implemented and available at [1]. Currently the query
>>> support for absent patterns and two simple pattern identifications (e1
>>> -> not e2 and not e1 -> e2) are implemented. Please have a look at
>>> the unit test [2] to get the idea. Class names and variable names are
>>> subject to change (will finalize later). I am waiting for your feedback.
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>>
>>> [1] https://github.com/lgobinath/siddhi/tree/feature-absent-
>>> event-pattern
>>> [2] https://github.com/lgobinath/siddhi/blob/feature-absent-
>>> event-pattern/modules/siddhi-core/src/test/java/org/wso2/sid
>>> dhi/core/query/pattern/EveryAbsentPatternTestCase.java
>>>
>>>
>>> On Fri, Mar 31, 2017 at 6:28 AM, Gobinath 
>>> wrote:
>>>
 Hi all,

 Thanks Suho for your feedback. I have made the changes based on
 your suggestions and submitted the final proposal. Started working on a
 prototype and will update you soon with the results.


 Thanks & Regards,
 Gobinath

 On Thu, Mar 30, 2017 at 12:28 PM, Sriskandarajah Suhothayan <
 s...@wso2.com> wrote:

> I have given some feedback on the gsoc site.
>
> Suho
>
> On Mon, 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-05-07 Thread Gobinath
Sure. I'll check the issue and send a separate PR with the fix.


Thanks & Regards,
Gobinath

On Sun, May 7, 2017 at 1:51 PM, Sriskandarajah Suhothayan 
wrote:

> Yes, it looks like a bug to me, can you check why it's happening.
>
> Regards
> Suho
>
> On Sun, May 7, 2017 at 8:56 PM, Nirmal Fernando  wrote:
>
>> Looks like a bug to me. I would expect only 1 event.
>>
>> On Sun, May 7, 2017 at 8:49 PM, Gobinath  wrote:
>>
>>> Hi,
>>>
>>> Thanks for accepting my proposal. I have a question regarding the
>>> behavior of *and* in a pattern.
>>>
>>> // Query: e1 and e2 -> e3
>>>
>>> define stream Stream1 (symbol string, price float, volume int);
>>> define stream Stream2 (symbol string, price float, volume int);
>>>
>>> @info(name = 'query1')
>>> from e1=Stream1[price > 50.0f] and e2=Stream2['IBM' == symbol] ->
>>> e3=Stream2[price > 20]
>>> select e1.symbol as symbol1, e2.price as price2, e3.price as price3
>>> insert into OutputStream;
>>>
>>> // Input
>>> Stream1.send(new Object[]{"GOOGLE", 72.7f, 100});
>>> Stream2.send(new Object[]{"IBM", 4.7f, 100});
>>> Stream2.send(new Object[]{"WSO2", 55.6f, 100});
>>>
>>>
>>> // Output
>>> Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6], isExpired=false}
>>> Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6], isExpired=false}
>>>
>>> Is this the expected output?. Note that the output contains two exactly
>>> similar events but the pattern *e1 -> e2 and e3* outputs a single event
>>> [1].
>>>
>>> [1] https://github.com/wso2/siddhi/blob/master/modules/siddh
>>> i-core/src/test/java/org/wso2/siddhi/core/query/pattern/Logi
>>> calPatternTestCase.java#L98
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> On Mon, Apr 17, 2017 at 7:58 AM, Gobinath  wrote:
>>>
 Hi,

 Please see the PR at [1]. Please do not merge it.


 Thanks & Regards,
 Gobinath

 [1] https://github.com/wso2/siddhi/pull/313


 On Mon, Apr 17, 2017 at 7:44 AM, Sriskandarajah Suhothayan <
 s...@wso2.com> wrote:

> Based on first look, it looks great.
>
> Can you send it as a PR so I can see the exact implementations and
> also give comments.
>
> Regards
> Suho
>
> On Mon, Apr 17, 2017 at 5:30 AM, Gobinath 
> wrote:
>
>> Hi,
>>
>> A prototype is implemented and available at [1]. Currently the query
>> support for absent patterns and two simple pattern identifications (e1
>> -> not e2 and not e1 -> e2) are implemented. Please have a look at
>> the unit test [2] to get the idea. Class names and variable names are
>> subject to change (will finalize later). I am waiting for your feedback.
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>>
>> [1] https://github.com/lgobinath/siddhi/tree/feature-absent-
>> event-pattern
>> [2] https://github.com/lgobinath/siddhi/blob/feature-absent-
>> event-pattern/modules/siddhi-core/src/test/java/org/wso2/sid
>> dhi/core/query/pattern/EveryAbsentPatternTestCase.java
>>
>>
>> On Fri, Mar 31, 2017 at 6:28 AM, Gobinath 
>> wrote:
>>
>>> Hi all,
>>>
>>> Thanks Suho for your feedback. I have made the changes based on your
>>> suggestions and submitted the final proposal. Started working on a
>>> prototype and will update you soon with the results.
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> On Thu, Mar 30, 2017 at 12:28 PM, Sriskandarajah Suhothayan <
>>> s...@wso2.com> wrote:
>>>
 I have given some feedback on the gsoc site.

 Suho

 On Mon, Mar 27, 2017 at 9:03 PM, Gobinath 
 wrote:

> Hi all,
>
> Thanks. I have shared the draft of my proposal titled
> "Non-Occurrence of Events for Siddhi Patterns" with WSO2 through GSoC
> dashboard and requesting your feedback on this.
>
>
> Thanks & Regards,
> Gobinath
>
> On Wed, Mar 15, 2017 at 1:30 PM, Sriskandarajah Suhothayan <
> s...@wso2.com> wrote:
>
>> Thanks for the GSoC idea, I hope this will be a good way to
>> improve the Siddhi language and make it more powerfull.
>> If time permits we can also add other use-cases of patterns &
>> sequences and improve it further.
>>
>> Since you are still not a commuter I hope these contributions
>> will help you be a committer to Siddhi as well :)
>> I'll make this as a formal idea, do work on a proposal as well.
>>
>> Regards
>> Suho
>>
>>
>> On Wed, Mar 15, 2017 at 6:09 PM, Gobinath 
>> wrote:
>>
>>> Hi team,
>>>
>>> This is Gobinath a former software engineer at WSO2 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-05-07 Thread Sriskandarajah Suhothayan
Yes, it looks like a bug to me, can you check why it's happening.

Regards
Suho

On Sun, May 7, 2017 at 8:56 PM, Nirmal Fernando  wrote:

> Looks like a bug to me. I would expect only 1 event.
>
> On Sun, May 7, 2017 at 8:49 PM, Gobinath  wrote:
>
>> Hi,
>>
>> Thanks for accepting my proposal. I have a question regarding the
>> behavior of *and* in a pattern.
>>
>> // Query: e1 and e2 -> e3
>>
>> define stream Stream1 (symbol string, price float, volume int);
>> define stream Stream2 (symbol string, price float, volume int);
>>
>> @info(name = 'query1')
>> from e1=Stream1[price > 50.0f] and e2=Stream2['IBM' == symbol] ->
>> e3=Stream2[price > 20]
>> select e1.symbol as symbol1, e2.price as price2, e3.price as price3
>> insert into OutputStream;
>>
>> // Input
>> Stream1.send(new Object[]{"GOOGLE", 72.7f, 100});
>> Stream2.send(new Object[]{"IBM", 4.7f, 100});
>> Stream2.send(new Object[]{"WSO2", 55.6f, 100});
>>
>>
>> // Output
>> Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6], isExpired=false}
>> Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6], isExpired=false}
>>
>> Is this the expected output?. Note that the output contains two exactly
>> similar events but the pattern *e1 -> e2 and e3* outputs a single event
>> [1].
>>
>> [1] https://github.com/wso2/siddhi/blob/master/modules/siddh
>> i-core/src/test/java/org/wso2/siddhi/core/query/pattern/Logi
>> calPatternTestCase.java#L98
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Mon, Apr 17, 2017 at 7:58 AM, Gobinath  wrote:
>>
>>> Hi,
>>>
>>> Please see the PR at [1]. Please do not merge it.
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> [1] https://github.com/wso2/siddhi/pull/313
>>>
>>>
>>> On Mon, Apr 17, 2017 at 7:44 AM, Sriskandarajah Suhothayan <
>>> s...@wso2.com> wrote:
>>>
 Based on first look, it looks great.

 Can you send it as a PR so I can see the exact implementations and also
 give comments.

 Regards
 Suho

 On Mon, Apr 17, 2017 at 5:30 AM, Gobinath  wrote:

> Hi,
>
> A prototype is implemented and available at [1]. Currently the query
> support for absent patterns and two simple pattern identifications (e1
> -> not e2 and not e1 -> e2) are implemented. Please have a look at
> the unit test [2] to get the idea. Class names and variable names are
> subject to change (will finalize later). I am waiting for your feedback.
>
>
> Thanks & Regards,
> Gobinath
>
>
> [1] https://github.com/lgobinath/siddhi/tree/feature-absent-
> event-pattern
> [2] https://github.com/lgobinath/siddhi/blob/feature-absent-
> event-pattern/modules/siddhi-core/src/test/java/org/wso2/sid
> dhi/core/query/pattern/EveryAbsentPatternTestCase.java
>
>
> On Fri, Mar 31, 2017 at 6:28 AM, Gobinath 
> wrote:
>
>> Hi all,
>>
>> Thanks Suho for your feedback. I have made the changes based on your
>> suggestions and submitted the final proposal. Started working on a
>> prototype and will update you soon with the results.
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Thu, Mar 30, 2017 at 12:28 PM, Sriskandarajah Suhothayan <
>> s...@wso2.com> wrote:
>>
>>> I have given some feedback on the gsoc site.
>>>
>>> Suho
>>>
>>> On Mon, Mar 27, 2017 at 9:03 PM, Gobinath 
>>> wrote:
>>>
 Hi all,

 Thanks. I have shared the draft of my proposal titled
 "Non-Occurrence of Events for Siddhi Patterns" with WSO2 through GSoC
 dashboard and requesting your feedback on this.


 Thanks & Regards,
 Gobinath

 On Wed, Mar 15, 2017 at 1:30 PM, Sriskandarajah Suhothayan <
 s...@wso2.com> wrote:

> Thanks for the GSoC idea, I hope this will be a good way to
> improve the Siddhi language and make it more powerfull.
> If time permits we can also add other use-cases of patterns &
> sequences and improve it further.
>
> Since you are still not a commuter I hope these contributions will
> help you be a committer to Siddhi as well :)
> I'll make this as a formal idea, do work on a proposal as well.
>
> Regards
> Suho
>
>
> On Wed, Mar 15, 2017 at 6:09 PM, Gobinath 
> wrote:
>
>> Hi team,
>>
>> This is Gobinath a former software engineer at WSO2 currently
>> doing masters at Western University. This time I plan to do GSoC 
>> with WSO2
>> and this is the basic idea of what I have discussed with Suho.
>> Based on Suho's suggestion, I come up with a proposal to
>> implement detecting non-occurring events using Siddhi patterns. The 
>> 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-05-07 Thread Nirmal Fernando
Looks like a bug to me. I would expect only 1 event.

On Sun, May 7, 2017 at 8:49 PM, Gobinath  wrote:

> Hi,
>
> Thanks for accepting my proposal. I have a question regarding the behavior
> of *and* in a pattern.
>
> // Query: e1 and e2 -> e3
>
> define stream Stream1 (symbol string, price float, volume int);
> define stream Stream2 (symbol string, price float, volume int);
>
> @info(name = 'query1')
> from e1=Stream1[price > 50.0f] and e2=Stream2['IBM' == symbol] ->
> e3=Stream2[price > 20]
> select e1.symbol as symbol1, e2.price as price2, e3.price as price3
> insert into OutputStream;
>
> // Input
> Stream1.send(new Object[]{"GOOGLE", 72.7f, 100});
> Stream2.send(new Object[]{"IBM", 4.7f, 100});
> Stream2.send(new Object[]{"WSO2", 55.6f, 100});
>
>
> // Output
> Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6], isExpired=false}
> Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6], isExpired=false}
>
> Is this the expected output?. Note that the output contains two exactly
> similar events but the pattern *e1 -> e2 and e3* outputs a single event
> [1].
>
> [1] https://github.com/wso2/siddhi/blob/master/modules/
> siddhi-core/src/test/java/org/wso2/siddhi/core/query/pattern/
> LogicalPatternTestCase.java#L98
>
>
> Thanks & Regards,
> Gobinath
>
> On Mon, Apr 17, 2017 at 7:58 AM, Gobinath  wrote:
>
>> Hi,
>>
>> Please see the PR at [1]. Please do not merge it.
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> [1] https://github.com/wso2/siddhi/pull/313
>>
>>
>> On Mon, Apr 17, 2017 at 7:44 AM, Sriskandarajah Suhothayan > > wrote:
>>
>>> Based on first look, it looks great.
>>>
>>> Can you send it as a PR so I can see the exact implementations and also
>>> give comments.
>>>
>>> Regards
>>> Suho
>>>
>>> On Mon, Apr 17, 2017 at 5:30 AM, Gobinath  wrote:
>>>
 Hi,

 A prototype is implemented and available at [1]. Currently the query
 support for absent patterns and two simple pattern identifications (e1
 -> not e2 and not e1 -> e2) are implemented. Please have a look at the
 unit test [2] to get the idea. Class names and variable names are subject
 to change (will finalize later). I am waiting for your feedback.


 Thanks & Regards,
 Gobinath


 [1] https://github.com/lgobinath/siddhi/tree/feature-absent-
 event-pattern
 [2] https://github.com/lgobinath/siddhi/blob/feature-absent-
 event-pattern/modules/siddhi-core/src/test/java/org/wso2/sid
 dhi/core/query/pattern/EveryAbsentPatternTestCase.java


 On Fri, Mar 31, 2017 at 6:28 AM, Gobinath  wrote:

> Hi all,
>
> Thanks Suho for your feedback. I have made the changes based on your
> suggestions and submitted the final proposal. Started working on a
> prototype and will update you soon with the results.
>
>
> Thanks & Regards,
> Gobinath
>
> On Thu, Mar 30, 2017 at 12:28 PM, Sriskandarajah Suhothayan <
> s...@wso2.com> wrote:
>
>> I have given some feedback on the gsoc site.
>>
>> Suho
>>
>> On Mon, Mar 27, 2017 at 9:03 PM, Gobinath 
>> wrote:
>>
>>> Hi all,
>>>
>>> Thanks. I have shared the draft of my proposal titled
>>> "Non-Occurrence of Events for Siddhi Patterns" with WSO2 through GSoC
>>> dashboard and requesting your feedback on this.
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> On Wed, Mar 15, 2017 at 1:30 PM, Sriskandarajah Suhothayan <
>>> s...@wso2.com> wrote:
>>>
 Thanks for the GSoC idea, I hope this will be a good way to improve
 the Siddhi language and make it more powerfull.
 If time permits we can also add other use-cases of patterns &
 sequences and improve it further.

 Since you are still not a commuter I hope these contributions will
 help you be a committer to Siddhi as well :)
 I'll make this as a formal idea, do work on a proposal as well.

 Regards
 Suho


 On Wed, Mar 15, 2017 at 6:09 PM, Gobinath 
 wrote:

> Hi team,
>
> This is Gobinath a former software engineer at WSO2 currently
> doing masters at Western University. This time I plan to do GSoC with 
> WSO2
> and this is the basic idea of what I have discussed with Suho.
> Based on Suho's suggestion, I come up with a proposal to
> implement detecting non-occurring events using Siddhi patterns. The 
> current
> Siddhi patterns allow identifying the patterns that present.
>
> See an example:
> from every e1=Stream1[price>20] -> e2=Stream2[price>e1.price]
> within 1 sec
> select e1.symbol as symbol1, e2.symbol as symbol2
> insert into OutputStream;

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-05-07 Thread Gobinath
Hi,

Thanks for accepting my proposal. I have a question regarding the behavior
of *and* in a pattern.

// Query: e1 and e2 -> e3

define stream Stream1 (symbol string, price float, volume int);
define stream Stream2 (symbol string, price float, volume int);

@info(name = 'query1')
from e1=Stream1[price > 50.0f] and e2=Stream2['IBM' == symbol] ->
e3=Stream2[price > 20]
select e1.symbol as symbol1, e2.price as price2, e3.price as price3
insert into OutputStream;

// Input
Stream1.send(new Object[]{"GOOGLE", 72.7f, 100});
Stream2.send(new Object[]{"IBM", 4.7f, 100});
Stream2.send(new Object[]{"WSO2", 55.6f, 100});


// Output
Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6], isExpired=false}
Event{timestamp=1494169305631, data=[GOOGLE, 4.7, 55.6], isExpired=false}

Is this the expected output?. Note that the output contains two exactly
similar events but the pattern *e1 -> e2 and e3* outputs a single event [1].

[1]
https://github.com/wso2/siddhi/blob/master/modules/siddhi-core/src/test/java/org/wso2/siddhi/core/query/pattern/LogicalPatternTestCase.java#L98


Thanks & Regards,
Gobinath

On Mon, Apr 17, 2017 at 7:58 AM, Gobinath  wrote:

> Hi,
>
> Please see the PR at [1]. Please do not merge it.
>
>
> Thanks & Regards,
> Gobinath
>
> [1] https://github.com/wso2/siddhi/pull/313
>
>
> On Mon, Apr 17, 2017 at 7:44 AM, Sriskandarajah Suhothayan 
> wrote:
>
>> Based on first look, it looks great.
>>
>> Can you send it as a PR so I can see the exact implementations and also
>> give comments.
>>
>> Regards
>> Suho
>>
>> On Mon, Apr 17, 2017 at 5:30 AM, Gobinath  wrote:
>>
>>> Hi,
>>>
>>> A prototype is implemented and available at [1]. Currently the query
>>> support for absent patterns and two simple pattern identifications (e1
>>> -> not e2 and not e1 -> e2) are implemented. Please have a look at the
>>> unit test [2] to get the idea. Class names and variable names are subject
>>> to change (will finalize later). I am waiting for your feedback.
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>>
>>> [1] https://github.com/lgobinath/siddhi/tree/feature-absent-
>>> event-pattern
>>> [2] https://github.com/lgobinath/siddhi/blob/feature-absent-
>>> event-pattern/modules/siddhi-core/src/test/java/org/wso2/sid
>>> dhi/core/query/pattern/EveryAbsentPatternTestCase.java
>>>
>>>
>>> On Fri, Mar 31, 2017 at 6:28 AM, Gobinath  wrote:
>>>
 Hi all,

 Thanks Suho for your feedback. I have made the changes based on your
 suggestions and submitted the final proposal. Started working on a
 prototype and will update you soon with the results.


 Thanks & Regards,
 Gobinath

 On Thu, Mar 30, 2017 at 12:28 PM, Sriskandarajah Suhothayan <
 s...@wso2.com> wrote:

> I have given some feedback on the gsoc site.
>
> Suho
>
> On Mon, Mar 27, 2017 at 9:03 PM, Gobinath 
> wrote:
>
>> Hi all,
>>
>> Thanks. I have shared the draft of my proposal titled "Non-Occurrence
>> of Events for Siddhi Patterns" with WSO2 through GSoC dashboard and
>> requesting your feedback on this.
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Wed, Mar 15, 2017 at 1:30 PM, Sriskandarajah Suhothayan <
>> s...@wso2.com> wrote:
>>
>>> Thanks for the GSoC idea, I hope this will be a good way to improve
>>> the Siddhi language and make it more powerfull.
>>> If time permits we can also add other use-cases of patterns &
>>> sequences and improve it further.
>>>
>>> Since you are still not a commuter I hope these contributions will
>>> help you be a committer to Siddhi as well :)
>>> I'll make this as a formal idea, do work on a proposal as well.
>>>
>>> Regards
>>> Suho
>>>
>>>
>>> On Wed, Mar 15, 2017 at 6:09 PM, Gobinath 
>>> wrote:
>>>
 Hi team,

 This is Gobinath a former software engineer at WSO2 currently doing
 masters at Western University. This time I plan to do GSoC with WSO2 
 and
 this is the basic idea of what I have discussed with Suho.
 Based on Suho's suggestion, I come up with a proposal to implement
 detecting non-occurring events using Siddhi patterns. The current 
 Siddhi
 patterns allow identifying the patterns that present.

 See an example:
 from every e1=Stream1[price>20] -> e2=Stream2[price>e1.price]
 within 1 sec
 select e1.symbol as symbol1, e2.symbol as symbol2
 insert into OutputStream;

 Detecting the absence of a pattern is not natively supported by
 Siddhi patterns for the moment. In other words, identifying event_a not
 followed by event_b within 2 minutes is not possible using the current
 patterns implementation (Note that a time frame is required 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-04-17 Thread Gobinath
Hi,

Please see the PR at [1]. Please do not merge it.


Thanks & Regards,
Gobinath

[1] https://github.com/wso2/siddhi/pull/313


On Mon, Apr 17, 2017 at 7:44 AM, Sriskandarajah Suhothayan 
wrote:

> Based on first look, it looks great.
>
> Can you send it as a PR so I can see the exact implementations and also
> give comments.
>
> Regards
> Suho
>
> On Mon, Apr 17, 2017 at 5:30 AM, Gobinath  wrote:
>
>> Hi,
>>
>> A prototype is implemented and available at [1]. Currently the query
>> support for absent patterns and two simple pattern identifications (e1
>> -> not e2 and not e1 -> e2) are implemented. Please have a look at the
>> unit test [2] to get the idea. Class names and variable names are subject
>> to change (will finalize later). I am waiting for your feedback.
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>>
>> [1] https://github.com/lgobinath/siddhi/tree/feature-absent-event-pattern
>> [2] https://github.com/lgobinath/siddhi/blob/feature-absent-
>> event-pattern/modules/siddhi-core/src/test/java/org/wso2/
>> siddhi/core/query/pattern/EveryAbsentPatternTestCase.java
>>
>>
>> On Fri, Mar 31, 2017 at 6:28 AM, Gobinath  wrote:
>>
>>> Hi all,
>>>
>>> Thanks Suho for your feedback. I have made the changes based on your
>>> suggestions and submitted the final proposal. Started working on a
>>> prototype and will update you soon with the results.
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> On Thu, Mar 30, 2017 at 12:28 PM, Sriskandarajah Suhothayan <
>>> s...@wso2.com> wrote:
>>>
 I have given some feedback on the gsoc site.

 Suho

 On Mon, Mar 27, 2017 at 9:03 PM, Gobinath  wrote:

> Hi all,
>
> Thanks. I have shared the draft of my proposal titled "Non-Occurrence
> of Events for Siddhi Patterns" with WSO2 through GSoC dashboard and
> requesting your feedback on this.
>
>
> Thanks & Regards,
> Gobinath
>
> On Wed, Mar 15, 2017 at 1:30 PM, Sriskandarajah Suhothayan <
> s...@wso2.com> wrote:
>
>> Thanks for the GSoC idea, I hope this will be a good way to improve
>> the Siddhi language and make it more powerfull.
>> If time permits we can also add other use-cases of patterns &
>> sequences and improve it further.
>>
>> Since you are still not a commuter I hope these contributions will
>> help you be a committer to Siddhi as well :)
>> I'll make this as a formal idea, do work on a proposal as well.
>>
>> Regards
>> Suho
>>
>>
>> On Wed, Mar 15, 2017 at 6:09 PM, Gobinath 
>> wrote:
>>
>>> Hi team,
>>>
>>> This is Gobinath a former software engineer at WSO2 currently doing
>>> masters at Western University. This time I plan to do GSoC with WSO2 and
>>> this is the basic idea of what I have discussed with Suho.
>>> Based on Suho's suggestion, I come up with a proposal to implement
>>> detecting non-occurring events using Siddhi patterns. The current Siddhi
>>> patterns allow identifying the patterns that present.
>>>
>>> See an example:
>>> from every e1=Stream1[price>20] -> e2=Stream2[price>e1.price] within
>>> 1 sec
>>> select e1.symbol as symbol1, e2.symbol as symbol2
>>> insert into OutputStream;
>>>
>>> Detecting the absence of a pattern is not natively supported by
>>> Siddhi patterns for the moment. In other words, identifying event_a not
>>> followed by event_b within 2 minutes is not possible using the current
>>> patterns implementation (Note that a time frame is required otherwise we
>>> have to wait for infinite time to say event_b has not arrived). The 
>>> current
>>> workaround [1] to detect non-delivered items is shown below:
>>>
>>> from arrivals_stream#window.time(2 minutes)
>>> select *
>>> insert expired events into overdue_deliveries_stream;
>>>
>>> from every arrivalEvent = arrivals_stream ->
>>> deliveryEvent = deliveries_stream[arrivalEvent.trackingId ==
>>> trackingId]
>>> or overdue_delivery = 
>>> overdue_deliveries_stream[arrivalEvent.trackingId
>>> == trackingId]
>>> select arrivalEvent.trackingId as trackingId,
>>> arrivalEvent.customerName as customerName, arrivalEvent.telephoneNo as
>>> telephoneNo, deliveryEvent.trackingId as deliveryId
>>> insert into filter_stream;
>>>
>>> from filter_stream [ (deliveryId is null)]
>>> select trackingId, customerName, telephoneNo
>>> insert into alert_stream;
>>>
>>> This solution requires a time window and it is inefficient if we are
>>> interested only on one occurrence of such a pattern (In other words same
>>> query without every keyword). Further, the query is more complex and not
>>> user-friendly.
>>>
>>> If we provide patterns to detect absence of patterns, the above
>>> query can be rewritten 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-04-17 Thread Sriskandarajah Suhothayan
Based on first look, it looks great.

Can you send it as a PR so I can see the exact implementations and also
give comments.

Regards
Suho

On Mon, Apr 17, 2017 at 5:30 AM, Gobinath  wrote:

> Hi,
>
> A prototype is implemented and available at [1]. Currently the query
> support for absent patterns and two simple pattern identifications (e1 ->
> not e2 and not e1 -> e2) are implemented. Please have a look at the unit
> test [2] to get the idea. Class names and variable names are subject to
> change (will finalize later). I am waiting for your feedback.
>
>
> Thanks & Regards,
> Gobinath
>
>
> [1] https://github.com/lgobinath/siddhi/tree/feature-absent-event-pattern
> [2] https://github.com/lgobinath/siddhi/blob/feature-
> absent-event-pattern/modules/siddhi-core/src/test/java/org/
> wso2/siddhi/core/query/pattern/EveryAbsentPatternTestCase.java
>
>
> On Fri, Mar 31, 2017 at 6:28 AM, Gobinath  wrote:
>
>> Hi all,
>>
>> Thanks Suho for your feedback. I have made the changes based on your
>> suggestions and submitted the final proposal. Started working on a
>> prototype and will update you soon with the results.
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Thu, Mar 30, 2017 at 12:28 PM, Sriskandarajah Suhothayan <
>> s...@wso2.com> wrote:
>>
>>> I have given some feedback on the gsoc site.
>>>
>>> Suho
>>>
>>> On Mon, Mar 27, 2017 at 9:03 PM, Gobinath  wrote:
>>>
 Hi all,

 Thanks. I have shared the draft of my proposal titled "Non-Occurrence
 of Events for Siddhi Patterns" with WSO2 through GSoC dashboard and
 requesting your feedback on this.


 Thanks & Regards,
 Gobinath

 On Wed, Mar 15, 2017 at 1:30 PM, Sriskandarajah Suhothayan <
 s...@wso2.com> wrote:

> Thanks for the GSoC idea, I hope this will be a good way to improve
> the Siddhi language and make it more powerfull.
> If time permits we can also add other use-cases of patterns &
> sequences and improve it further.
>
> Since you are still not a commuter I hope these contributions will
> help you be a committer to Siddhi as well :)
> I'll make this as a formal idea, do work on a proposal as well.
>
> Regards
> Suho
>
>
> On Wed, Mar 15, 2017 at 6:09 PM, Gobinath 
> wrote:
>
>> Hi team,
>>
>> This is Gobinath a former software engineer at WSO2 currently doing
>> masters at Western University. This time I plan to do GSoC with WSO2 and
>> this is the basic idea of what I have discussed with Suho.
>> Based on Suho's suggestion, I come up with a proposal to implement
>> detecting non-occurring events using Siddhi patterns. The current Siddhi
>> patterns allow identifying the patterns that present.
>>
>> See an example:
>> from every e1=Stream1[price>20] -> e2=Stream2[price>e1.price] within
>> 1 sec
>> select e1.symbol as symbol1, e2.symbol as symbol2
>> insert into OutputStream;
>>
>> Detecting the absence of a pattern is not natively supported by
>> Siddhi patterns for the moment. In other words, identifying event_a not
>> followed by event_b within 2 minutes is not possible using the current
>> patterns implementation (Note that a time frame is required otherwise we
>> have to wait for infinite time to say event_b has not arrived). The 
>> current
>> workaround [1] to detect non-delivered items is shown below:
>>
>> from arrivals_stream#window.time(2 minutes)
>> select *
>> insert expired events into overdue_deliveries_stream;
>>
>> from every arrivalEvent = arrivals_stream ->
>> deliveryEvent = deliveries_stream[arrivalEvent.trackingId ==
>> trackingId]
>> or overdue_delivery = 
>> overdue_deliveries_stream[arrivalEvent.trackingId
>> == trackingId]
>> select arrivalEvent.trackingId as trackingId,
>> arrivalEvent.customerName as customerName, arrivalEvent.telephoneNo as
>> telephoneNo, deliveryEvent.trackingId as deliveryId
>> insert into filter_stream;
>>
>> from filter_stream [ (deliveryId is null)]
>> select trackingId, customerName, telephoneNo
>> insert into alert_stream;
>>
>> This solution requires a time window and it is inefficient if we are
>> interested only on one occurrence of such a pattern (In other words same
>> query without every keyword). Further, the query is more complex and not
>> user-friendly.
>>
>> If we provide patterns to detect absence of patterns, the above query
>> can be rewritten as below:
>>
>> from every arrivalEvent = arrivals_stream ->  (not
>> deliveries_stream[arrivalEvent.trackingId == trackingId] within 2
>> min )
>> select arrivalEvent.trackingId as trackingId,
>> arrivalEvent.customerName as customerName, arrivalEvent.telephoneNo as
>> telephoneNo
>> insert into alert_stream;

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-04-16 Thread Gobinath
Hi,

A prototype is implemented and available at [1]. Currently the query
support for absent patterns and two simple pattern identifications (e1 ->
not e2 and not e1 -> e2) are implemented. Please have a look at the unit
test [2] to get the idea. Class names and variable names are subject to
change (will finalize later). I am waiting for your feedback.


Thanks & Regards,
Gobinath


[1] https://github.com/lgobinath/siddhi/tree/feature-absent-event-pattern
[2]
https://github.com/lgobinath/siddhi/blob/feature-absent-event-pattern/modules/siddhi-core/src/test/java/org/wso2/siddhi/core/query/pattern/EveryAbsentPatternTestCase.java


On Fri, Mar 31, 2017 at 6:28 AM, Gobinath  wrote:

> Hi all,
>
> Thanks Suho for your feedback. I have made the changes based on your
> suggestions and submitted the final proposal. Started working on a
> prototype and will update you soon with the results.
>
>
> Thanks & Regards,
> Gobinath
>
> On Thu, Mar 30, 2017 at 12:28 PM, Sriskandarajah Suhothayan  > wrote:
>
>> I have given some feedback on the gsoc site.
>>
>> Suho
>>
>> On Mon, Mar 27, 2017 at 9:03 PM, Gobinath  wrote:
>>
>>> Hi all,
>>>
>>> Thanks. I have shared the draft of my proposal titled "Non-Occurrence of
>>> Events for Siddhi Patterns" with WSO2 through GSoC dashboard and requesting
>>> your feedback on this.
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>>
>>> On Wed, Mar 15, 2017 at 1:30 PM, Sriskandarajah Suhothayan <
>>> s...@wso2.com> wrote:
>>>
 Thanks for the GSoC idea, I hope this will be a good way to improve the
 Siddhi language and make it more powerfull.
 If time permits we can also add other use-cases of patterns & sequences
 and improve it further.

 Since you are still not a commuter I hope these contributions will help
 you be a committer to Siddhi as well :)
 I'll make this as a formal idea, do work on a proposal as well.

 Regards
 Suho


 On Wed, Mar 15, 2017 at 6:09 PM, Gobinath  wrote:

> Hi team,
>
> This is Gobinath a former software engineer at WSO2 currently doing
> masters at Western University. This time I plan to do GSoC with WSO2 and
> this is the basic idea of what I have discussed with Suho.
> Based on Suho's suggestion, I come up with a proposal to implement
> detecting non-occurring events using Siddhi patterns. The current Siddhi
> patterns allow identifying the patterns that present.
>
> See an example:
> from every e1=Stream1[price>20] -> e2=Stream2[price>e1.price] within 1
> sec
> select e1.symbol as symbol1, e2.symbol as symbol2
> insert into OutputStream;
>
> Detecting the absence of a pattern is not natively supported by Siddhi
> patterns for the moment. In other words, identifying event_a not followed
> by event_b within 2 minutes is not possible using the current patterns
> implementation (Note that a time frame is required otherwise we have to
> wait for infinite time to say event_b has not arrived). The current
> workaround [1] to detect non-delivered items is shown below:
>
> from arrivals_stream#window.time(2 minutes)
> select *
> insert expired events into overdue_deliveries_stream;
>
> from every arrivalEvent = arrivals_stream ->
> deliveryEvent = deliveries_stream[arrivalEvent.trackingId ==
> trackingId]
> or overdue_delivery = 
> overdue_deliveries_stream[arrivalEvent.trackingId
> == trackingId]
> select arrivalEvent.trackingId as trackingId,
> arrivalEvent.customerName as customerName, arrivalEvent.telephoneNo as
> telephoneNo, deliveryEvent.trackingId as deliveryId
> insert into filter_stream;
>
> from filter_stream [ (deliveryId is null)]
> select trackingId, customerName, telephoneNo
> insert into alert_stream;
>
> This solution requires a time window and it is inefficient if we are
> interested only on one occurrence of such a pattern (In other words same
> query without every keyword). Further, the query is more complex and not
> user-friendly.
>
> If we provide patterns to detect absence of patterns, the above query
> can be rewritten as below:
>
> from every arrivalEvent = arrivals_stream ->  (not
> deliveries_stream[arrivalEvent.trackingId == trackingId] within 2 min
> )
> select arrivalEvent.trackingId as trackingId,
> arrivalEvent.customerName as customerName, arrivalEvent.telephoneNo as
> telephoneNo
> insert into alert_stream;
>
> As you can see, we can use the existing language components like not &
> within. This can be achieved by extending the existing
> StreamPreStateProcessors and StreamPostStateProcessors with an internal
> timer so that they can expire their internal list of events based on the
> time limit. It is somewhat similar to time windows but the 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-03-31 Thread Gobinath
Hi all,

Thanks Suho for your feedback. I have made the changes based on your
suggestions and submitted the final proposal. Started working on a
prototype and will update you soon with the results.


Thanks & Regards,
Gobinath

On Thu, Mar 30, 2017 at 12:28 PM, Sriskandarajah Suhothayan 
wrote:

> I have given some feedback on the gsoc site.
>
> Suho
>
> On Mon, Mar 27, 2017 at 9:03 PM, Gobinath  wrote:
>
>> Hi all,
>>
>> Thanks. I have shared the draft of my proposal titled "Non-Occurrence of
>> Events for Siddhi Patterns" with WSO2 through GSoC dashboard and requesting
>> your feedback on this.
>>
>>
>> Thanks & Regards,
>> Gobinath
>>
>> On Wed, Mar 15, 2017 at 1:30 PM, Sriskandarajah Suhothayan > > wrote:
>>
>>> Thanks for the GSoC idea, I hope this will be a good way to improve the
>>> Siddhi language and make it more powerfull.
>>> If time permits we can also add other use-cases of patterns & sequences
>>> and improve it further.
>>>
>>> Since you are still not a commuter I hope these contributions will help
>>> you be a committer to Siddhi as well :)
>>> I'll make this as a formal idea, do work on a proposal as well.
>>>
>>> Regards
>>> Suho
>>>
>>>
>>> On Wed, Mar 15, 2017 at 6:09 PM, Gobinath  wrote:
>>>
 Hi team,

 This is Gobinath a former software engineer at WSO2 currently doing
 masters at Western University. This time I plan to do GSoC with WSO2 and
 this is the basic idea of what I have discussed with Suho.
 Based on Suho's suggestion, I come up with a proposal to implement
 detecting non-occurring events using Siddhi patterns. The current Siddhi
 patterns allow identifying the patterns that present.

 See an example:
 from every e1=Stream1[price>20] -> e2=Stream2[price>e1.price] within 1
 sec
 select e1.symbol as symbol1, e2.symbol as symbol2
 insert into OutputStream;

 Detecting the absence of a pattern is not natively supported by Siddhi
 patterns for the moment. In other words, identifying event_a not followed
 by event_b within 2 minutes is not possible using the current patterns
 implementation (Note that a time frame is required otherwise we have to
 wait for infinite time to say event_b has not arrived). The current
 workaround [1] to detect non-delivered items is shown below:

 from arrivals_stream#window.time(2 minutes)
 select *
 insert expired events into overdue_deliveries_stream;

 from every arrivalEvent = arrivals_stream ->
 deliveryEvent = deliveries_stream[arrivalEvent.trackingId ==
 trackingId]
 or overdue_delivery = overdue_deliveries_stream[arrivalEvent.trackingId
 == trackingId]
 select arrivalEvent.trackingId as trackingId, arrivalEvent.customerName
 as customerName, arrivalEvent.telephoneNo as telephoneNo,
 deliveryEvent.trackingId as deliveryId
 insert into filter_stream;

 from filter_stream [ (deliveryId is null)]
 select trackingId, customerName, telephoneNo
 insert into alert_stream;

 This solution requires a time window and it is inefficient if we are
 interested only on one occurrence of such a pattern (In other words same
 query without every keyword). Further, the query is more complex and not
 user-friendly.

 If we provide patterns to detect absence of patterns, the above query
 can be rewritten as below:

 from every arrivalEvent = arrivals_stream ->  (not
 deliveries_stream[arrivalEvent.trackingId == trackingId] within 2 min )
 select arrivalEvent.trackingId as trackingId, arrivalEvent.customerName
 as customerName, arrivalEvent.telephoneNo as telephoneNo
 insert into alert_stream;

 As you can see, we can use the existing language components like not &
 within. This can be achieved by extending the existing
 StreamPreStateProcessors and StreamPostStateProcessors with an internal
 timer so that they can expire their internal list of events based on the
 time limit. It is somewhat similar to time windows but the processor can
 turn off the timer and ignore the events if it is a one time pattern
 detection.

 I hope it gives the basic idea and I am waiting for your suggestions
 and feedback.

 [1] https://docs.wso2.com/display/CEP400/Sample+0111+-+Detec
 ting+non-occurrences+with+Patterns


 Thanks & Regards,
 Gobinath
 --
 *Gobinath** Loganathan*
 Graduate Student,
 Electrical and Computer Engineering,
 Western University.
 Email  : slgobin...@gmail.com
 Mobile : (+1) 416-895-0721
 Blog: javahelps.com 


>>>
>>>
>>>
>>> --
>>>
>>> *S. Suhothayan*
>>> Associate Director / Architect & Team Lead of WSO2 Complex Event
>>> Processor
>>> *WSO2 Inc. *http://wso2.com
>>> * *
>>> lean . enterprise . middleware
>>>
>>>

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-03-30 Thread Sriskandarajah Suhothayan
I have given some feedback on the gsoc site.

Suho

On Mon, Mar 27, 2017 at 9:03 PM, Gobinath  wrote:

> Hi all,
>
> Thanks. I have shared the draft of my proposal titled "Non-Occurrence of
> Events for Siddhi Patterns" with WSO2 through GSoC dashboard and requesting
> your feedback on this.
>
>
> Thanks & Regards,
> Gobinath
>
> On Wed, Mar 15, 2017 at 1:30 PM, Sriskandarajah Suhothayan 
> wrote:
>
>> Thanks for the GSoC idea, I hope this will be a good way to improve the
>> Siddhi language and make it more powerfull.
>> If time permits we can also add other use-cases of patterns & sequences
>> and improve it further.
>>
>> Since you are still not a commuter I hope these contributions will help
>> you be a committer to Siddhi as well :)
>> I'll make this as a formal idea, do work on a proposal as well.
>>
>> Regards
>> Suho
>>
>>
>> On Wed, Mar 15, 2017 at 6:09 PM, Gobinath  wrote:
>>
>>> Hi team,
>>>
>>> This is Gobinath a former software engineer at WSO2 currently doing
>>> masters at Western University. This time I plan to do GSoC with WSO2 and
>>> this is the basic idea of what I have discussed with Suho.
>>> Based on Suho's suggestion, I come up with a proposal to implement
>>> detecting non-occurring events using Siddhi patterns. The current Siddhi
>>> patterns allow identifying the patterns that present.
>>>
>>> See an example:
>>> from every e1=Stream1[price>20] -> e2=Stream2[price>e1.price] within 1
>>> sec
>>> select e1.symbol as symbol1, e2.symbol as symbol2
>>> insert into OutputStream;
>>>
>>> Detecting the absence of a pattern is not natively supported by Siddhi
>>> patterns for the moment. In other words, identifying event_a not followed
>>> by event_b within 2 minutes is not possible using the current patterns
>>> implementation (Note that a time frame is required otherwise we have to
>>> wait for infinite time to say event_b has not arrived). The current
>>> workaround [1] to detect non-delivered items is shown below:
>>>
>>> from arrivals_stream#window.time(2 minutes)
>>> select *
>>> insert expired events into overdue_deliveries_stream;
>>>
>>> from every arrivalEvent = arrivals_stream ->
>>> deliveryEvent = deliveries_stream[arrivalEvent.trackingId == trackingId]
>>> or overdue_delivery = overdue_deliveries_stream[arrivalEvent.trackingId
>>> == trackingId]
>>> select arrivalEvent.trackingId as trackingId, arrivalEvent.customerName
>>> as customerName, arrivalEvent.telephoneNo as telephoneNo,
>>> deliveryEvent.trackingId as deliveryId
>>> insert into filter_stream;
>>>
>>> from filter_stream [ (deliveryId is null)]
>>> select trackingId, customerName, telephoneNo
>>> insert into alert_stream;
>>>
>>> This solution requires a time window and it is inefficient if we are
>>> interested only on one occurrence of such a pattern (In other words same
>>> query without every keyword). Further, the query is more complex and not
>>> user-friendly.
>>>
>>> If we provide patterns to detect absence of patterns, the above query
>>> can be rewritten as below:
>>>
>>> from every arrivalEvent = arrivals_stream ->  (not
>>> deliveries_stream[arrivalEvent.trackingId == trackingId] within 2 min )
>>> select arrivalEvent.trackingId as trackingId, arrivalEvent.customerName
>>> as customerName, arrivalEvent.telephoneNo as telephoneNo
>>> insert into alert_stream;
>>>
>>> As you can see, we can use the existing language components like not &
>>> within. This can be achieved by extending the existing
>>> StreamPreStateProcessors and StreamPostStateProcessors with an internal
>>> timer so that they can expire their internal list of events based on the
>>> time limit. It is somewhat similar to time windows but the processor can
>>> turn off the timer and ignore the events if it is a one time pattern
>>> detection.
>>>
>>> I hope it gives the basic idea and I am waiting for your suggestions and
>>> feedback.
>>>
>>> [1] https://docs.wso2.com/display/CEP400/Sample+0111+-+Detec
>>> ting+non-occurrences+with+Patterns
>>>
>>>
>>> Thanks & Regards,
>>> Gobinath
>>> --
>>> *Gobinath** Loganathan*
>>> Graduate Student,
>>> Electrical and Computer Engineering,
>>> Western University.
>>> Email  : slgobin...@gmail.com
>>> Mobile : (+1) 416-895-0721
>>> Blog: javahelps.com 
>>>
>>>
>>
>>
>>
>> --
>>
>> *S. Suhothayan*
>> Associate Director / Architect & Team Lead of WSO2 Complex Event
>> Processor
>> *WSO2 Inc. *http://wso2.com
>> * *
>> lean . enterprise . middleware
>>
>>
>> *cell: (+94) 779 756 757 <077%20975%206757> | blog:
>> http://suhothayan.blogspot.com/ twitter:
>> http://twitter.com/suhothayan  | linked-in:
>> http://lk.linkedin.com/in/suhothayan *
>>
>
>
>
> --
> *Gobinath** Loganathan*
> Graduate Student,
> Electrical and Computer Engineering,
> Western University.
> Email  : slgobin...@gmail.com
> 

Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-03-27 Thread Gobinath
Hi all,

Thanks. I have shared the draft of my proposal titled "Non-Occurrence of
Events for Siddhi Patterns" with WSO2 through GSoC dashboard and requesting
your feedback on this.


Thanks & Regards,
Gobinath

On Wed, Mar 15, 2017 at 1:30 PM, Sriskandarajah Suhothayan 
wrote:

> Thanks for the GSoC idea, I hope this will be a good way to improve the
> Siddhi language and make it more powerfull.
> If time permits we can also add other use-cases of patterns & sequences
> and improve it further.
>
> Since you are still not a commuter I hope these contributions will help
> you be a committer to Siddhi as well :)
> I'll make this as a formal idea, do work on a proposal as well.
>
> Regards
> Suho
>
>
> On Wed, Mar 15, 2017 at 6:09 PM, Gobinath  wrote:
>
>> Hi team,
>>
>> This is Gobinath a former software engineer at WSO2 currently doing
>> masters at Western University. This time I plan to do GSoC with WSO2 and
>> this is the basic idea of what I have discussed with Suho.
>> Based on Suho's suggestion, I come up with a proposal to implement
>> detecting non-occurring events using Siddhi patterns. The current Siddhi
>> patterns allow identifying the patterns that present.
>>
>> See an example:
>> from every e1=Stream1[price>20] -> e2=Stream2[price>e1.price] within 1 sec
>> select e1.symbol as symbol1, e2.symbol as symbol2
>> insert into OutputStream;
>>
>> Detecting the absence of a pattern is not natively supported by Siddhi
>> patterns for the moment. In other words, identifying event_a not followed
>> by event_b within 2 minutes is not possible using the current patterns
>> implementation (Note that a time frame is required otherwise we have to
>> wait for infinite time to say event_b has not arrived). The current
>> workaround [1] to detect non-delivered items is shown below:
>>
>> from arrivals_stream#window.time(2 minutes)
>> select *
>> insert expired events into overdue_deliveries_stream;
>>
>> from every arrivalEvent = arrivals_stream ->
>> deliveryEvent = deliveries_stream[arrivalEvent.trackingId == trackingId]
>> or overdue_delivery = overdue_deliveries_stream[arrivalEvent.trackingId
>> == trackingId]
>> select arrivalEvent.trackingId as trackingId, arrivalEvent.customerName
>> as customerName, arrivalEvent.telephoneNo as telephoneNo,
>> deliveryEvent.trackingId as deliveryId
>> insert into filter_stream;
>>
>> from filter_stream [ (deliveryId is null)]
>> select trackingId, customerName, telephoneNo
>> insert into alert_stream;
>>
>> This solution requires a time window and it is inefficient if we are
>> interested only on one occurrence of such a pattern (In other words same
>> query without every keyword). Further, the query is more complex and not
>> user-friendly.
>>
>> If we provide patterns to detect absence of patterns, the above query can
>> be rewritten as below:
>>
>> from every arrivalEvent = arrivals_stream ->  (not
>> deliveries_stream[arrivalEvent.trackingId == trackingId] within 2 min )
>> select arrivalEvent.trackingId as trackingId, arrivalEvent.customerName
>> as customerName, arrivalEvent.telephoneNo as telephoneNo
>> insert into alert_stream;
>>
>> As you can see, we can use the existing language components like not &
>> within. This can be achieved by extending the existing
>> StreamPreStateProcessors and StreamPostStateProcessors with an internal
>> timer so that they can expire their internal list of events based on the
>> time limit. It is somewhat similar to time windows but the processor can
>> turn off the timer and ignore the events if it is a one time pattern
>> detection.
>>
>> I hope it gives the basic idea and I am waiting for your suggestions and
>> feedback.
>>
>> [1] https://docs.wso2.com/display/CEP400/Sample+0111+-+Detec
>> ting+non-occurrences+with+Patterns
>>
>>
>> Thanks & Regards,
>> Gobinath
>> --
>> *Gobinath** Loganathan*
>> Graduate Student,
>> Electrical and Computer Engineering,
>> Western University.
>> Email  : slgobin...@gmail.com
>> Mobile : (+1) 416-895-0721
>> Blog: javahelps.com 
>>
>>
>
>
>
> --
>
> *S. Suhothayan*
> Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
> *WSO2 Inc. *http://wso2.com
> * *
> lean . enterprise . middleware
>
>
> *cell: (+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
> twitter: http://twitter.com/suhothayan
>  | linked-in:
> http://lk.linkedin.com/in/suhothayan *
>



-- 
*Gobinath** Loganathan*
Graduate Student,
Electrical and Computer Engineering,
Western University.
Email  : slgobin...@gmail.com
Mobile : (+1) 416-895-0721
Blog: javahelps.com 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [GSoC][Siddhi][CEP]: Siddhi Pattern for Absence of Events

2017-03-15 Thread Sriskandarajah Suhothayan
Thanks for the GSoC idea, I hope this will be a good way to improve the
Siddhi language and make it more powerfull.
If time permits we can also add other use-cases of patterns & sequences and
improve it further.

Since you are still not a commuter I hope these contributions will help you
be a committer to Siddhi as well :)
I'll make this as a formal idea, do work on a proposal as well.

Regards
Suho


On Wed, Mar 15, 2017 at 6:09 PM, Gobinath  wrote:

> Hi team,
>
> This is Gobinath a former software engineer at WSO2 currently doing
> masters at Western University. This time I plan to do GSoC with WSO2 and
> this is the basic idea of what I have discussed with Suho.
> Based on Suho's suggestion, I come up with a proposal to implement
> detecting non-occurring events using Siddhi patterns. The current Siddhi
> patterns allow identifying the patterns that present.
>
> See an example:
> from every e1=Stream1[price>20] -> e2=Stream2[price>e1.price] within 1 sec
> select e1.symbol as symbol1, e2.symbol as symbol2
> insert into OutputStream;
>
> Detecting the absence of a pattern is not natively supported by Siddhi
> patterns for the moment. In other words, identifying event_a not followed
> by event_b within 2 minutes is not possible using the current patterns
> implementation (Note that a time frame is required otherwise we have to
> wait for infinite time to say event_b has not arrived). The current
> workaround [1] to detect non-delivered items is shown below:
>
> from arrivals_stream#window.time(2 minutes)
> select *
> insert expired events into overdue_deliveries_stream;
>
> from every arrivalEvent = arrivals_stream ->
> deliveryEvent = deliveries_stream[arrivalEvent.trackingId == trackingId]
> or overdue_delivery = overdue_deliveries_stream[arrivalEvent.trackingId
> == trackingId]
> select arrivalEvent.trackingId as trackingId, arrivalEvent.customerName as
> customerName, arrivalEvent.telephoneNo as telephoneNo,
> deliveryEvent.trackingId as deliveryId
> insert into filter_stream;
>
> from filter_stream [ (deliveryId is null)]
> select trackingId, customerName, telephoneNo
> insert into alert_stream;
>
> This solution requires a time window and it is inefficient if we are
> interested only on one occurrence of such a pattern (In other words same
> query without every keyword). Further, the query is more complex and not
> user-friendly.
>
> If we provide patterns to detect absence of patterns, the above query can
> be rewritten as below:
>
> from every arrivalEvent = arrivals_stream ->  (not
> deliveries_stream[arrivalEvent.trackingId == trackingId] within 2 min )
> select arrivalEvent.trackingId as trackingId, arrivalEvent.customerName as
> customerName, arrivalEvent.telephoneNo as telephoneNo
> insert into alert_stream;
>
> As you can see, we can use the existing language components like not &
> within. This can be achieved by extending the existing
> StreamPreStateProcessors and StreamPostStateProcessors with an internal
> timer so that they can expire their internal list of events based on the
> time limit. It is somewhat similar to time windows but the processor can
> turn off the timer and ignore the events if it is a one time pattern
> detection.
>
> I hope it gives the basic idea and I am waiting for your suggestions and
> feedback.
>
> [1] https://docs.wso2.com/display/CEP400/Sample+0111+-+D
> etecting+non-occurrences+with+Patterns
>
>
> Thanks & Regards,
> Gobinath
> --
> *Gobinath** Loganathan*
> Graduate Student,
> Electrical and Computer Engineering,
> Western University.
> Email  : slgobin...@gmail.com
> Mobile : (+1) 416-895-0721
> Blog: javahelps.com 
>
>



-- 

*S. Suhothayan*
Associate Director / Architect & Team Lead of WSO2 Complex Event Processor
*WSO2 Inc. *http://wso2.com
* *
lean . enterprise . middleware


*cell: (+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan
 | linked-in:
http://lk.linkedin.com/in/suhothayan *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev