Using the Workflow Designer
Common Tasks
This section describes how to perform common tasks in the Workflow Designer.
Creating a new Workflow
Shortcut: CTRL + N
- Select File --> New.... The Create new Workflow dialog box opens.
- Enter a Name for the Workflow.
- (optional): Assign a Category and a Description. Click Ok.
Opening an existing Workflow
Shortcut: CTRL + O
- Select File --> Open... The Open Workflow dialog box opens.
- Select the Workflow(s) that you want to open and click Ok.
Saving a Workflow
Shortcut: CTRL + S, CTRL + SHIFT + S
- Select File -->Save.
Saves the Workflow definition to the underlying storage. - Select File -->Save as...
Saves the Workflow definition under a new name to the underlying storage. The source Workflow is not affected.
Compiling a Workflow
Shortcut: CTRL + B
When a Workflow is compiled the current Workflow definition is compiled, and the result is saved to the underlying storage. Compiling the Workflow does not affect the Workflow definition files in the storage.
- Select Workflow --> Compile
Compiling all open Workflows
Shortcut: CTRL + SHIFT + B
Compiles all Workflows that are currently open in the Workflow designer.
- Select Workflow --> Compile all --> Compile open Workflows
Compiling all changed Workflows
Shortcut: CTRL + SHIFT + C
Compiles all open Workflows that have uncompiled changes.
- Select Workflow --> Compile all --> Compile all changed Workflows
Searching a Workflow
Shortcut: CTRL + F
Use the shortcut to open the search control.
- Press F3 to step forward in the search results.
- Press SHIFT + F3 to step backwards in the search results.
- Press CTRL + SHIFT + F to show all results. The list can be used to navigate between the results of the current search.
For more information, see Special considerations.
Editing expressions
Expressions can be edited in a separate window to get a better view of large code snippets. The editor can also be shown by pressing the show outline button ().
Adding an argument
Select Arguments at the bottom of the Workflow Designer. The Arguments pane is activated.
Adding a variable
Select Variables at the bottom of the Workflow Designer. The Variables pane is activated.
Adding a variable using the Add variables dialog box
Shortcut: CTRL + ,
Select Workflow --> Edit variables...
The selection in the Workflow Designer must be within scope.
Adding a typed variable
Shortcut: CTRL + SHIFT + ,
When editing the value of an activity argument it is possible to add a variable of the correct type. Use the shortcut to open the add variables dialog with a new variable of the type returned by the focused expression.
Managing imports
Shortcut: CTRL + I
Imports are the namespaces available in the Workflow. These can be used to simplify the declaration of classes in expressions by removing the need to write the full class name.
- Select Imports at the bottom of the Workflow Designer. To find the namespace you are looking for, simply start typing in the textbox or use the list.
Some imports are already added to the list by default when you create a new Workflow.
Using the activity Toolbox
The toolbox contains the activities that are currently available to the Workflow. To add an activity to the Workflow, simply drag and drop it onto the designer surface.
The activity list only shows activities available in the assemblies referenced by the current Workflow. If you want access to an activity currently not available in the list, you must first add the assembly in question (see Managing assembly references).
Filtering toolbox items
Start typing in the textbox and the toolbox tree is filtered as you type.
Adding a toolbox item
It is possible to add new activities to the toolbox.
- From the context control, select Choose items. A dialog box opens.
- Select the activities that you want to add.
Adding a third-party activity to the toolbox
- Select Workflow --> Manage the references for the Workflow
- Add the assembly (or assemblies) containing the activities you want to add, and click OK.
- Activate the Toolbox tab (F12).
- Right-click the group where you want to add the new activities.
- Select Choose items.
- Select your activities and click OK. The new activities are added to the toolbox.
Resetting the toolbox
Reset the toolbox contents to default activities.
- Right-click and select Reset toolbox.
Saving a toolbox configuration as a system template
The current toolbox configuration can be saved as a template to be used when new Workflows are created.
- Right-click and select Save configuration as system template.
Using the Designer area
The designer area uses various Microsoft Activity Designers to visualize the activities. For more information, see http://msdn.microsoft.com/en-us/library/ee829528(v=vs.110).aspx.
Adding an activity to a Workflow
- Drag the activity from the toolbox into the desired position on the designer area.
- To insert an activity between two other activities, drag and hold the activity at the insertion point and wait for the indicator to show up. If the activity cannot be dropped, make sure you have not zoomed into an activity (by checking the breadcrumb at the top of the designer area) and verify that the target activity can accept the type you are trying to insert.
Using scope activities
A Scope activity is an activity that wraps a list of other activities. Examples of scope activities are Sequence and Cancellable scope. The scope activity can also contain variables that are only used in the scope.
- To add an activity to a scope, drag the activity into the scope designer on the designer area.
- It is also possible to wrap two activities with a sequence: To do this, drag the selected activity to the designer area (which already contains an activity), hold the new activity below or over the existing activity and wait for the placeholder to appear.
Using flowchart activities
A Flowchart activity is used to create Workflows that define and manage complex flow controls. Compared to a Scope activity, a flowchart activity makes it easier to visualize a complex flow.
Validating a Workflow
When editing expressions for arguments, the user receives syntax feedback while typing the expression. If any typos exist in an expression, or if the resulting type is wrong, a validation error indicator will appear next to the expression editor. However, this validation is only done on the syntax itself and will not detect any runtime errors. The validation runs in the background after the user has finished editing an expression and does not have to be manually started.
Editing Xaml
It is possible to edit the Workflow Xaml as text. To toggle between Xaml and Designer mode, use the Toggle Designer/Xaml command (F7). The Xaml is automatically validated shortly after the user stops typing.
The Xaml edit mode should only be used to correct Xaml load errors that prevent a Workflow (or separate WF activities) from being loaded into the Designer. Any other actions, such as adding activities and/or argument values should be done in designer mode. Note that the undo/redo feature can be disrupted when toggling between Xaml and Designer mode, which can make it difficult to revert a Workflow to its original state.
The Xaml mode is read-only by default to prevent any accidental editing.
The current Xaml load errors are shown in the error list with a line and column indication.
- You can save Xaml that contains errors, but it is not recommended.
- You cannot save Xaml that is not well-formed.