Developing Apama Applications > Using Apama Studio > Working with Projects > Editing Apama files > Defining shorthand (templates) for frequently used EPL code
Defining shorthand (templates) for frequently used EPL code
EPL templates provide a way for you to define a short name for a longer pattern that you often specify in an EPL file. For example, Apama Studio provides the dict template. When you enter dict followed by a space, Apama Studio automatically inserts dictionary<>.
Apama Studio provides some templates and you can define additional templates. Each Apama project can use all EPL templates.
Apama Studio provides the following EPL templates. To use one, type its name followed by a space.
Name
Description
Pattern
dict
dictionary<>
dictionary<%\c>
ona
on all
on all %\c
onall
on all
on al %\c
seq
sequence<>
sequence<%\c>
In the pattern, %\c indicates the location of the cursor after you type the template name.
To define an EPL template:
1. In the Apama Studio menu bar, choose Window > Preferences .
2. Expand Apama.
3. Expand MonitorScript.
4. Click Editor Templates.
5. Click New.
6. In the Name field, specify what you want to enter to insert an instance of the template.
7. In the Description field, specify what Apama Studio should display in the EPL file.
8. In the Pattern field, duplicate what you specified in the Description field and insert %\c to indicate the location of the cursor after Apama Studio inserts the value.
9. Click OK twice. All Apama projects can now use this template.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.