Developing Apama Applications > Using Apama Studio > Working with Projects > Adding resources to Apama projects > Creating new blocks > Creating a block with the block editor
Creating a block with the block editor
Creating a block in Apama Studio consists of two main steps. In the first step you create the block metadata and specify its interface. In the second step you add the EPL code that implements the block’s behavior.
To add a new block to an Apama project using the block editor:
1. In the Project Explorer or Workbench Project view, right-click the default block folder (typically catalogs\<Project name> blocks) and select New > Block button from the pop-up context menu. The New Event Modeler Block dialog is displayed.
2. In the New Event Modeler Block dialog, specify the name of the project in the Containing folder field if you want to create the block in a different project; you can also click Browse to select the project from a list of projects in the workspace.
3. Also in the New Event Modeler Block dialog, select Block Editor in the Generate block using field and click Next. The Create a new Apama Block dialog is displayed.
4. In the Create a new Apama Block dialog, fill in the various fields or accept the default values. The most important fields to set at this point are the block name and version. The Type field specifies what type of code will be generated for the block. The choices are:
*Callback — Implements the block as an event type; this is the default. Generates EPL code to which you can add custom code.
*Callback (DEBUG) — Implements the block as an event type. Generates EPL code to which you can add custom code. Also generates statements that can help you debug the EPL you are adding. You can easily switch your block between Callback and Callback (DEBUG).
5. Click Finish. The block definition file for the new block is added to the project and the block’s metadata is displayed in the Builder tab of the block editor.
6. The left side of the Builder tab displays the parameters, input feeds, output feeds, and operations that make up the block; a new block will not contain any entries here. To add one of these elements:
a. Right click the element you want to add and select Add Parameter, Add Input Feed, Add Output Feed, or Add Operation. The right side of the Builder tab displays the item’s properties.
b. Fill in the values for the properties.
7. For input feeds and output feeds, right click the element and select Add Field.
8. In the Properties panel for the field you added in the previous step fill in the values for the properties and field validation specifications. Repeat for each field you want to add to an input or output feed.
9. When you finish specifying the block’s metadata, save the file.
For details about adding EPL code to a block, see Adding EPL code to a block.
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.