Script
This activity runs a custom VB.NET or C# script.
How does this activity look in the Designer Pane?
To add this activity to a workflow definition
- Drag it from the Toolbox Pane and drop it in the Designer Pane.
To configure this activity
Select the activity in the Designer Pane to configure the following property boxes.
-
Activity Name
Once added to a workflow definition, the default name of an activity can be changed. Providing a custom name for an activity helps you remember the role it plays.
To name an activity
- Add an activity to your workflow by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
- Select the activity in the Designer Pane.
- Under Activity Name in the Properties Pane, replace the default name.
Note: Activity names cannot be the same as any other activity name in the workflow, they cannot be the same as the workflow's name, they must be less than 100 characters, they must contain at least one alphanumeric character, they cannot be "Name," and they cannot be the same as the activity's runtime type (which is usually only an issue with custom activities).
-
Activity Description
Use the Activity Description to provide descriptive text to help you remember the role that the activity plays in the workflow. All activities contain a default description that you can modify while constructing your workflow.
To modify an activity description
- Add an activity to your workflow by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
- Select the activity in the Designer Pane.
- Under Activity Description in the Properties Pane, replace the default description.
-
Scripting Language
This property box lets you choose which programming language the script(s) will be compiled in when a Script or SDK Script activity is run.
To configure Scripting Language
- Add a Script activity to your workflow definition by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
- Select the activity in the Designer Pane.
- Under Scripting Language in the Properties Pane select VB.NET or C# for your programming language.
Note: Changing the scripting language will not delete any scripts. But, only scripts written in the selected language will be run.
-
Script
This property box shows the organization of your script folders and the scripts configured by the Script activity. It also shows you the scripts' contents in a read-only format that you can copy and paste. You can open the Script Editor from this property box.
To configure the Script property box
- Add the Script activity to your workflow definition by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
- Select the activity in the Designer Pane.
- In the Script property box, select a script in the Script folder tree, and click the script's read-only contents in the Properties Pane to open that script in the Script Editor. Alternatively, double-click the script in the folder tree.
-
Script's Default Entry
To select which entry or entries an activity will act on
- Add the activity to your workflow by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
- Select the activity in the Designer Pane.
- In the Properties Pane, in the appropriate property box, choose which entry the activity will act on.
- Starting Entry: The entry the workflow began with.
- Other Entry: To choose an entry that was returned or created in a previous step in the current workflow, click the Select link and choose an entry from the Select Entry dialog box.
Note: Some activities do not have the starting entry selected by default. If you are configuring one of these activities, click the Select link to choose an entry for the activity to act on.
-
Advanced
Configure how to treat unhandled script exceptions.
- Server Default: Use the Workflow Server default setting set in the Scripting Options dialog box in the Workflow Administration Console.
- Errors: Workflow treats unhandled script exceptions as errors that terminate the workflow instance.
- Warnings: Workflow treats unhandled script exceptions as warnings. The workflow instance continues running.
- Check for retryable errors: Workflow can handle certain types of exceptions and will attempt to automatically retry the script instead of reporting a warning.
Note: If you have more than one connection profile for your workflow definition, the Connection Profile property box lets you specify which connection profile this activity will use.
Note: Each workflow definition that has a script activity maintains two projects, one for VB and one for C#, that contain common code and a list of external reference assemblies that the activities can use. Each activity adds one or more code files to one of the scripting projects, and when the workflow definition is published, the two projects are compiled into separate assemblies.