Apama Documentation : Developing Apama Applications : Developing Apama Applications in Event Modeler : Creating Blocks : Defining new blocks in Software AG Designer : Adding EPL code to the block definition
Adding EPL code to the block definition
In Software AG Designer, when you click the Source tab of the block builder editor, the block's definition file is shown. Software AG Designer generates and populates all XML elements including the <code> element. The <code> element contains the EPL code that specifies the block's behavior.
Software AG Designer generates skeleton EPL with comments that indicate where to insert your code. The generated code defines the actions listed below. Each of these actions is a field in the event type that defines the block. The block's scenario will call these actions to accomplish the work of the block. For each defined action, you can add custom code that specifies the exact behavior you need.
*For each block parameter, there is an action that updates that parameter.
*For each block input feed, there is an action that takes as its arguments the fields of the feed.
*For each block operation, there is an action that performs the operation.
*For each block output feed, there is an action that takes as its arguments the fields of the feed.
*setup action
*instancepreSpawnInit action
*instancePostSpawnInit action
*cleanup action
*start action (for input blocks based on existing event definitions)
*stop action (for input blocks based on existing event definitions)
*send action (for output blocks based on existing event definitions)
In addition to defining these actions, Software AG Designer generates sections for adding user-defined monitors, user-defined variables, and user-defined actions. Also, the generated EPL code defines a block-level variable named blockInstanceId$. This variable contains the integer that uniquely identifies the instance of the block among those owned by the containing scenario and all its instances.
To add EPL code to the block
1. In Software AG Designer, in the Project Explorer view, double-click the block's .bdf file.
2. In the block builder editor, click the Source tab.
3. On the Source tab, enter code as needed only where there is a white background.
Code appears either with a gray background or a white background. Code with a gray background is maintained by Apama and is not editable. The sections of code with a white background are the areas where you add your custom EPL code. Remember to remove the comment flags from lines on which you specify code.
4. Save the project.
As you add and edit code in your block, you have the full range of Apama features as described in Editing Apama files. You also have the full range of navigating features as described in Navigating in Apama files.
Copyright © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback