Using the Apama Studio Development Environment > Using Query Designer > Creating queries in Query Designer > Adding query actions > Adding query send event actions
Adding query send event actions
In the Query Designer Actions pane, add the send event action(s) you want Apama to perform when it finds a match for the event pattern specified in the query. You can specify one or more send actions as well as one or more custom actions. See Adding query actions for an understanding of these two kinds of actions.
Before you define query actions, you should add the query input events and specify the query pattern. If this is a parameterized query, you should add the query parameters before you add actions. You can then refer to the parameters in the actions.
To add a send action to a query:
1. In the Query Designer Actions pane, click the down arrow to the right of the plus sign and select Send Event to display the New Query Send Event Action dialog.
2. Select the Event type.
3. In the Name field, enter a name for the send event action. The recommendation is that you do not define an action whose name is onload, ondie, onunload, onBeginRecovery, or onConcludeRecovery. In EPL monitors, actions with these names have special meaning.
4. In the Description field, optionally enter a description of what the actions does.
5. In the Channel field, specify an EPL expression to which the event will be sent. Channel can be a string literal which needs to be enclosed within quotes. For an expression no quotes are required in the Channel field.
6. The Fields table displays event fields and the values need to be specified for the event to be sent. Values can be any valid EPL expression. Only string literals need to be enclosed within quotes.
7. Click OK when the send action definition is complete.
If you look at the Source view of the query, you can see that for each action you define, Query Designer inserts a %send statement in the EPL query definition. The %send() statements appear in the find statement block and can be interleaved with regular EPL.
In the Source view, the modifications you can make to %send statements are to modify the quoted name, the quoted description, and the channel. Any changes you make in the Source view will appear in Query Designer. If you make an invalid change in the source then you cannot display the Design view until you correct the error.
The recommendation is that only Query Designer should insert %send()statements.
8. At runtime, when the query finds a match it executes all specified actions in the order in which they are listed in the Actions pane. Two arrows at the top of the Actions pane let you change this order. To change the order, select the action you want to move and then click the appropriate arrow as many times as needed.
Copyright © 2013-2015 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.