Apama Documentation : Using Apama with Software AG Designer : 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.
Before you define query actions, you should add the query input events and specify the query pattern. If this query uses parameters, 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 Actions pane of the Query Designer, click the drop down arrow to the right of the plus sign and select Send Event to create a send event action. The New Query Send Event Action dialog appears.
2. Click Choose, and select the Event type.
3. In the Name field, enter a name for the send event action.
4. In the Description field, optionally enter a description of what the action performs.
5. In the Channel field, specify an EPL expression to which the event will be sent. The EPL expression must evaluate to a string. If you are using a string literal, you have to enclose the string literal within quotes.
For example, in the sample Delayed_InOrder_Events_Car_Sample, you can use an EPL expression caralert.carId in the Channel field for the event type apamax.querysamples.delayedcarevents.CarEngineAlert. Here, "caralert." is a channel name prefix which is combined with the carId value. If the value of carId is 10, then the channel to which the event will be sent is caralert.10.
*To insert an event field or an expression, right-click the Channel field and select the required event field or expression.
*To convert an expression to a plain text:
i. Select the expression that you want to convert to plain text
ii. Right-click the selected expression
iii. Select switch to plain text [ctrl-p]
*To convert plain text to an expression:
i. Select the plain text that you want to convert to an expression
ii. Right-click the selected plain text
iii. Select switch to expression [ctrl-e]
6. In the Fields table, specify a value to every field name.
To specify a value to a field name, select the field name and click the edit sign . The Edit dialog appears.
In the Edit dialog:
*To insert an expression, right-click in the text box and select the required expression. Click OK.
*To convert an expression to a plain text:
i. Select the expression that you want to convert to plain text
ii. Right-click the selected expression
iii. Select switch to plain text [ctrl-p]
iv. Click OK
*To convert plain text to an expression:
i. Select the plain text that you want to convert to an expression
ii. Right-click the selected plain text
iii. Select switch to expression [ctrl-e]
iv. Click OK
The Fields table displays event fields and the values to be specified for the event. Values can be any valid EPL expression. Only string literals need to be enclosed within quotes. If any fields that are not present in the event definition have been incorrectly added to the Send Event action's event in the Source editor tab, then these fields are listed in the missing fields table. These missing fields and values are persisted with the Send Event action when you click OK. If you do not want these missing fields and values to persist, click Clear List. Clear List removes all the missing fields and values from the Send Event action.
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 there is a syntax error in the Source view, you cannot display the Design view until you correct the error. The recommendation is that only Query Designer should insert %send() statements. 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.
To edit a send event action, select the send event action and click the edit sign .
To delete a send event action, select the send event action and click the delete sign .
The 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-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback