Developing Apama Applications > Using Apama Studio > Working with Projects > Adding resources to Apama projects > Creating new event definition files for EPL applications > Creating event definitions from XML files
Creating event definitions from XML files
You can create an event definition that is based on the structure of an XML document. The generated event definition is based on the following:
*All fields are treated as string.
*All prefixes are ignored, in other words, event definitions will be generated even if inner elements have different namespaces.
*Namespace attributes (attributes having an xmlns prefix) are ignored.
*All inner event names are prepended with Element_.
*Generated event definitions will have an xmlTextNode field if the XML element contains a text value and also contains an attribute.
To create an event definition from an XML file:
1. In the Project Explorer view, right-click the project’s eventdefinitions folder and select New > Event Definition from the pop-up menu. The New Event Definition dialog is displayed.
2. In the New Event Definition dialog, in the Generate Event Definition using field, select XML File and click Next. The Choose output location for Event Definition dialog is displayed.
3. In the Choose output location for Event Definition dialog, enter information in the following fields:
a. The Containing Folder field is the folder where the file will be saved; by default this is the currently selected folder of the current project, but you can select another folder or project using the Browse button.
b. In the File name field, specify the name of the new file. Specifying the .mon extension is optional as Apama Studio will add the .mon file extension. Apama Studio will not let you specify anything except .mon as a file extension.
c. The Package field is optional; information in this field is an EPL package name.
4. Click Next. This displays the Select XML File dialog.
5. In the Select XML File dialog, in the XML File field, specify the name of the XML file on which you want to base the event. You can use the Browse button to navigate to the desired file. The Down Arrow button switches the scope between Workplace and FileSystem.
6. In the Select XML File dialog, in the Event Name field, specify the name you want to assign to the root level event.
7. Click Finish. Apama Studio creates an EPL file that defines the root level event along with associated nested events.
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.