Saving an ESQL file

When you edit your ESQL file, you can save it both to preserve the additions and modifications that you have made and to force the editor to validate the file's content.

Before you start

To complete this task, you must have completed the following task:

To save an ESQL file:

  1. Switch to the Broker Application Development perspective.
  2. Create a new ESQL file or open an existing ESQL file.
  3. Make the changes to the contents of the ESQL file.
  4. When you have finished working, save the file to retain all your changes by clicking File > Save <filename>.esql or File > Save All (the menu always shows the current filename correctly).

    When you save the file, the validator is invoked by the editor to check that the ESQL obeys all grammar and syntax rules (specified by the syntax diagrams and explanations in ESQL reference).

    You can request additional validation when you set ESQL preferences. Click Window > Preferences. The Preferences dialog is displayed:

  5. Expand the item for ESQL and Mapping on the left and click Validation. You can choose a value of warning (the default), error, or ignore for the following four categories of error:
    1. Unresolved identifiers
    2. Message references do not match message definitions
    3. Database references do not match database schema
    4. Use of deprecated keywords

    Validating message definitions can impact response times in the editor, particularly if you have complicated ESQL that makes many references to a complex message definition. You might choose to delay this validation. Invoke validation when you have finished developing the message flow and are about to deploy it, to avoid runtime errors.

    For each error found, the editor writes an entry in the Tasks view, providing both the code line number and the reason for the error.
  6. If you double-click the error, the editor positions your cursor on the line in which it found that error. The line is also highlighted by the error icon The error icon (white cross in a red circle) in the margin to the left.

    The editor might also find potential error situations, that it highlights as warnings (with the warning iconThe warning icon (black exclamation mark in a yellow triangle)), which it also writes to the tasks view. For example, you might have included a BROKER SCHEMA statement that references an invalid schema (namespace).

    Check your code, and make the corrections required by that statement or function.

Save As

You can save a copy of this ESQL file by using File > Save As....

  1. Click File > Save <name> As....
  2. Specify the message flow project in which you want to save a copy of the ESQL file. The project name defaults to the current project. You can accept this name, or choose another name from the valid options that are displayed in the File Save dialog.
  3. Specify the name for the new copy of the ESQL file. If you want to save this ESQL file in the same project, you must either give it another name, or confirm that you want to overwrite the current copy (that is, copy the file to itself).

    If you want to save this ESQL file in another project, the project must already exist (you can only select from the list of existing projects). You can save the file with the same or another name in another project.

  4. Click OK. The message flow is saved and the message flow editor validates its contents. The editor provides a report of any errors that it finds in the Tasks view.
Related reference
Built-in nodes
ESQL reference