Introduction
This article describes the difference between "active" and "passive" task steps and how to use them in your tasks.
What's the Difference Between Active and Passive Mode?
"Active" / "Passive" mode only affects the task flow:
| ► | Active task steps are processed at their place in the task flow. |
| ► | Passive tasks steps have their run time postponed until their output is needed by another step — this is default behaviour. This doesn't typically cause problems because tasks are designed so that the consuming step is immediately after the output step, but where this doesn't happen it can cause problems later. |
How to Force Active or Passive Mode
To force a task step into active or passive mode, you must add a Run VBScript
The Run VBScript tool is used to create a task step that runs a Visual Basic Script using data produced by other steps in the task. step to the beginning of the task and write a script that sets the mode of the step or steps in question. The required scripts are:
| ► | To force active mode — Steps("<step_name>").ActiveMode = True |
| ► | To force passive mode — Steps("<step_name>").ActiveMode = False |
Example Problematic Scenario
The Web Service Connector is one tool that is automatically put into passive mode when its output is required by another later task step. This is a good example tool to use as, unlike specific program connector tools where the logging on and off of the API is handled by the tool itself, the Web Service Connector is typically called multiple times to do this.
Let's take this task flow:
There are three Web Service Connector steps:
- Log On — Log onto the web service
- Get Data
- Log Off — Log off the web service
The Get Data step's output is consumed by the Save Get Data's Output step. Because of this, the Get Data step will not run until the Save Get Data's Output step is initiated whereas, because the output from the Log On and Log Off steps are not consumed, those steps are run in their proper sequence. This is not the intention of the task flow — the actual attempt to retrieve the requested data is now made AFTER the log off event:
| ► | Log On |
| ► | Log Off |
| ► | Get Data |
| ► | Save Get Data's Output |
To correct the task flow, do the following:
- Add a Run VBScript step to the relevant task.
- Add a meaningful Name for this step.
- Go to the Main tab.
- From the Task Browser, change Scope to Task.
- Expand Steps then the step you want to change.
- Drag the Name property to the script area.
- Delete
Nameand replace withActiveMode = True.Your script should now look like:

In this example, for completeness we have also set the Log On step to active to ensure it is processed in the correct location of the task flow.
- Click OK to save and close the step.
- Join the Run VBScript step to the beginning of the task:

Now when the above task is processed, the Log On and Get Data steps are processed in the their position in the task flow, that is, second and third.