Copying and Reusing Task Steps

The reuse of code is a common technique In computer programming, used to save time, reduce redundancy and eliminate errors by applying the same segment of code in multiple applications. The Task Builder plays a similar role by allowing task steps to be copied and re-used within the same task or across multiple tasks. This article describes various methods to perform this operation.

The Home tab of the ribbon contains clipboard commands that allow you to reuse steps within a task by copying one or more steps and pasting them onto another section of the task. Because more than one instance of Task Builder can be opened simultaneously, code reuse can be performed across multiple tasks as well. The Copy command, in effect, copies the .AML code associated to each task step. This code can be pasted onto a specific step on the same task or another task using the Paste command. Alternatively, a Copy > Description command is available, allowing the textual description of each step to be copied and pasted onto another application outside of Task Builder, such as an email message or text file.

To copy and paste steps in the same task

  1. Select the task you want to work with to open Task Builder.
  2. From the Steps panel, select the steps you wish to copy. To select a group of steps, hold down CTRL during selection. Use CTRL+A to select all.
  3. On the ribbon, select the Home tab and click the Copy button from the Clipboard command group. Or, right-click the highlighted steps and select Copy from the context menu.
  4. From the Steps panel, select the step you want to place the previously copied steps. Then, on the ribbon, select the Home tab and then click the Paste button from the Clipboard command group.

The copied steps are pasted precisely at the step you selected. Existing steps are moved directly below the pasted steps.

To copy steps from one task to another existing task

  1. Select the task you want to copy steps from in order to open the first instance of Task Builder.
  2. Select the task you want steps to be pasted onto in order to open the second instance of Task Builder.
  3. From the Steps panel in the first instance of Task Builder, select the steps you wish to copy . To select a group of steps, hold down CTRL during selection. Use CTRL+A to select all.
  4. On the ribbon, select the Home tab and then click the Copy button from the Clipboard command group.
  5. From the Steps panel of the second instance of Task Builder (the one you wish to paste steps onto), on the ribbon, select the Home tab and then click the Paste button from the Clipboard command group.

The copied steps are pasted precisely at the step you selected. Existing steps are moved directly below the pasted steps.

To copy steps from one task to a new task

  1. Create and edit a new task to open an instance of Task Builder.
  2. Select the existing task you want to copy steps from to open another instance of Task Builder.
  3. From the Task Builder's Steps panel of the existing task, select the steps you wish to copy . To select a group of steps, hold down CTRL during selection. Use CTRL+A to select all.
  4. On the ribbon, select the Home tab and click the Copy button from the Clipboard command group.
  5. Select the Task Builder instance associated to the new task.
  6. Right-click anywhere inside the empty Steps panel and select Paste from the context menu. The copied steps are pasted directly onto the Steps panel of the new task.

To copy and paste step descriptions

  1. From the Steps panel of Task Builder, select the steps in which to copy the description from. To select more than one step, hold down CTRL during selection or use CTRL+A to select all steps.
  2. From the ribbon interface, select Copy > Description from the Clipboard command group or right-click and select Copy > Description from the context menu.
  3. The text can be pasted into any Automate Desktop field or text-box where plain text is accepted. You can also paste copied steps or step descriptions in other documents such as email messages or text files.
NOTE:
  • When Copy> Description is selected, the content of the clipboard becomes populated with the “Visual View” text-only description that is normally displayed in the Steps panel and does not contain any AML code (even if the Steps panel is currently set to be viewed in AML format).
  • To copy the AML code of a particular step instead of the text description, select Copy from the ribbon interface or right-click the step and select Copy from the context menu (not Copy > Description). Doing so will allow you to paste the AML code into a document, text file or any field in Automate Desktop that accepts text.
  • Selecting Copy will also allow you to paste the content as a step in the Steps panel.

Steps of an existing task can be re-used in a newly created task by selecting the Save Copy As command. This is an ideal method for copying all of the steps of an existing task onto a new task.

To save a copy of a task

  1. Open the task you wish to copy steps from by doing one of the following:
    • From Task Administrator, right-click the task and select Steps. The Task Builder appears for this task.
    • Select the task from the Repository section of the Server Management Console or Workflow Designer. A separate instance of the Task Builder appears for each task.
    • If a new (unmanaged) task was initially created by directly opening the Task Builder from the Start menu, select Open from the Application menu and navigate to the task (.AML) file you wish to open and click the Open button. In this case, a separate tab appears in the Steps pane of the Task Builder, each signifying an open task.
  2. From Task Builder's ribbon interface, select File > Save copy as.
  3. Navigate to the desired location, enter a name for the new task, and click Save.

Using Snippets

Another way of using a group of steps within a specific task is to save the steps as Snippets. Snippets provide an easy way to implement frequently used code into a task. They are particularly useful to those who use specific activities that contain commonly used properties or settings. Instead of re-entering the properties for a specific activity or series of activities every time they're added as task steps, users can save existing steps as a snippet and simply drag and drop the snippet wherever it is needed in any task.