Creating a Script

The Script or SDK Script activities enable you to build a custom script using Workflow's Script Editor.

To Create a Script

  1. Add a Script or SDK Script activity to your workflow definition by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
  2. Select the activity in the Designer Pane.
  3. In the Script property box, select a script in the Script or SDK Script folder tree, and click the script's read-only contents in the Properties Pane. Alternatively, double-click the script in the folder tree.
  4. Write your script in the Script Editor.

Using the Script Editor

Tip: Review the Script Editor documentation for detailed information about each of the panes in the Script Editor.

  • Begin writing your script in the Script Pane.
    • Blue text represents key words for the current script language.
    • Green or gray text represents code or text that has been commented out.
    • Tip: To comment out text in C#, precede the text with //. In VB.NET, precede the text with '. You can also right-click and point to Advanced for commenting options.

    • Insert code you want run in place of Write your code here.
    • Once you begin typing code, the Script Editor's IntelliPrompt feature automatically provides suggestions and information as you code.

      Tip: Right-click inside the Script Editor and point to IntelliPrompt to manually access IntelliPrompt.

    • To set a bookmark to a specific location in the editor, right-click an area and select Toggle Bookmark. Navigate to bookmarks by selecting Next Bookmark and Previous Bookmark.
    • To increase/decrease the indentation of the selected lines, right-click the selected lines, point to Advanced, and select Increase Indent or Decrease Indent.

      Note: The Namespace of a script cannot be changed to ensure there are no naming conflicts between scripting activities.

C# Example

The following represents the C# code used to add a stamp to the first page of the entry specified in the activity's Script's Default Entry property box using an SDK Script activity.

VB.NET Example

The following represents the VB.NET code used to add a stamp to the entry specified in the activity's Script's Default Entry property box using an SDK Script activity.

Related Topics