You define a function in Apama Studio. In the Apama Developer perspective, select File > New > Scenario Function. Apama Studio prompts you for some metadata and then creates a skeleton function definition file (.fdf), which is an XML file. The skeleton file indicates where you need to add data and what kind of data you need to add.
See
Using Apama Studio,
Creating new scenario functions for details about the scenario function definition file format.