1

How to write query dynamically in WSO2-CEP. As in PSQL user has the option to write query dynamically, is there any alternative in CEP tool to achieve it?

Use case: 1. Suppose, if in the stream both function and data are available then there must be some option or by making some adapter user can make rules dynamically.

for ex.

steam : 1. function1:sum, function2: avg, function3: count, value1: 1, value2: 2, value3: 3 2. function1:sum, function2: min, function3: max, value1: 1, value2: 2, value3: 3

Rule should be created dynamically as following:

  1. select sum(value1) as value1,avg(value2) as value2, count(value3) as value 3 from ....
  2. select sum(value1) as value1,min(value2) as value2, max(value3) as value 3 from ....

Thanks Gagan

Community
  • 1
  • 1

1 Answers1

0

In CEP we use ExecutionPlans to deploy queries+configurations. So if you want to change a query you need to edit the execution plan. In a manual use case, ExecutionPlan can be changed from management console. When you change an ExecutionPlan changes will come into effect immediately. However you will loose current states such as windows. Do you want this rules to be changed depending on the incoming events? If so you can add another layer of siddhi query which will analyze incoming events and send them to desired query.

Tishan

Tishan
  • 890
  • 6
  • 11
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment). – Ben Jan 23 '15 at 16:20
  • Thanks for the tip Ben. Will do once I have enough reputation. – Tishan Jan 24 '15 at 18:59