Apama 10.15.0 | Using Apama with Software AG Designer | Using Query Designer | Creating queries in Query Designer | Editing source code in Query Designer
 
Editing source code in Query Designer
The Query Designer provides a Source tab to view or modify the EPL source code for the query definition. Changes made in the Design tab are reflected in the Source tab, and vice versa.
Query Designer provides an Actions pane that lets you specify actions to perform when a match set is found. For each action added in the Actions pane, Query Designer inserts a %custom statement in the EPL query definition. The recommendation is that only Query Designer should insert %custom() statements.
The %custom() statements appear in the find statement block and can be interleaved with regular EPL. %custom() signifies a block of EPL that was added in the Actions pane of the Design tab. You can modify the string that contains the name of the action, the string that contains the description of the action, or the EPL inside the braces, { and }, of the %custom() statement. You should not modify other content inside the parentheses.
For example, you might see something like this in the code editor:
package com.apama.samples.usercomplaints;
 
query FindUsersComplainingAfterNoService {
 
inputs {
SupportCall() key subscriberId within 3 days;
CallDataRecord() key customerId as subscriberId within 3 days;
}
 
// Identifies subscribers who have not been able to make any successful
// calls after 2 days,
// and have made two support calls, the second of which escalated the
// problem.
find wait (2 days):previous -> SupportCall:firstCall
-> SupportCall:secondCall
where secondCall.escalated
without CallDataRecord:cdr where cdr.callSucceeded between
(previous firstCall)
{
%custom("title":"sendCustomerEscalationAlert","description":"Send
a warning about escalated a support call")
{
send CustomerEscalationAlert(firstCall.subscriberId,
"User escalated support request") to
"com.apama.samples.user_complaints";
}
}
}
If you want to change the syntax coloring that is used for queries, see the description of the Apama preference page Syntax Coloring.