MicroStrategy ONE

Creating a procedure

Creating a procedure is very similar to creating a script. The Procedure window is used in much the same way as the standard Script window.

Procedures are only available for use with project sources. Procedures cannot be used with Narrowcast Server statements.

To create a new procedure

  1. In Command Manager, from the File menu, select New Procedure. A Procedure window opens.
  2. In the Properties tab, in the Name field, type the name of the procedure. This is the name that the procedure is saved under in the Procedures folder.
  3. In the Description field, type a description of the procedure. This description is shown in the comments for the procedure's outline.
  4. To include any additional classes, click the Browse (...) button next to the Classpath field. Browse to the class file and click Accept.
  5. Type your procedure in the Code Editor tab. Many of the steps for editing a script, such as indenting, commenting, and inserting sample script statements, apply to procedures as well. For detailed instructions, see Editing a script.

    The syntax highlighting for procedures is different than the syntax highlighting for Command Manager scripts.

  6. To create an input for your procedure, in the Properties tab click Add Input. Click in the Name column to rename the input. To change the type of the input (for example, String or Integer), click the Type column and select the new type from the drop-down list.
  7. In the Sample Editor tab, type an example of how to execute the procedure, with inputs.
  8. To test the procedure, follow the steps in Testing a procedure against a project source.
  9. To save the procedure, from the File menu select Save. The procedure is saved in the directory specified in the General tab of the Options dialog box, under the name specified in the Name field in the Properties tab. For more information about how procedures are saved, see Saving and loading a procedure.

Related Topics

Procedures

Using Java in Command Manager procedures

Editing a script

Enabling or disabling syntax highlighting

Procedure window