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 Design tab supports the definition of queries without the need to write code. However, it also provides a Source tab, so that an application developer can 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";
}
}
}
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.