Configuring a Modify Requested Changes activity
When you configure a Modify Requested Changes activity, you can define the property changes to add or remove from the change request. You can choose the properties you want the activity to change and, for each property, choose to remove the property from the request, clear the property value in the request, or specify the new value to be assigned to that property. For a multi-value property, you can choose to add or remove a value from that property. Additional options are available such as notification, error handling, changing the container where to create new objects, and adding or removing Active Roles controls from change requests.
To configure a Modify Requested Changes activity
- In the Active Roles console tree, expand Configuration | Policies | Workflow, and select the change workflow containing the Modify Requested Changes activity you want to configure.
This opens the Workflow Designer window in the details pane, representing the workflow definition as a process diagram.
- In the process diagram, right-click the name of the activity and click Properties.
- Go to the Target changes tab in the “Modify Requested Changes” Activity Properties dialog box.
- Configure the list of the properties you want the activity to modify:
- To add a property to the list, click Add property, and then select the desired property.
- To remove a property from the list, click the Delete button labeled X on the right side of the list item representing that property.
- After you have added a property, click in the Action field to specify the type of the changes you want the activity to make to that property:
- Click Set to have the activity assign a new value to the property.
- Click Clear to have the activity remove the property from the object.
- In case of a multi-value property, click Add value or Remove value for the activity to add or remove the value of the property.
- Click Remove from request if you want the workflow not to apply the changes to the property that were specified in the request that started the workflow.
- If an action other than Clear or Remove from request is selected, click in the Value filed to specify the property value you want the activity to set, add or remove. The following options are available:
- Text string Use the given string of characters as the value of the property. You can type the desired string.
- Property of workflow target object Use the value of a certain property of the target object of the request that started the workflow. You can select the desired property from a list of object properties.
- Property of workflow initiator Use the value of a certain property of the user whose request started the workflow. You can select the desired property from a list of object properties.
- Changed value of workflow target object property Use the value that is requested to be assigned to a certain property of the workflow target object. You can select the desired property from a list of object properties.
- Workflow parameter value Use the value of a certain parameter of the workflow. You can choose the desired parameter from a list of the workflow parameters.
- Property of object from workflow data context Use the value of a certain property of the object that will be selected by the activity on the basis of the data found in the workflow run-time environment. You can choose the desired property and specify which object you want the activity to select at workflow run time.
- Value generated by rule expression Use the string value of a certain rule expression. You can configure a rule expression to compose a string value based on properties of various objects found in the workflow run-time environment.
- Go to the Notification tab in the “Modify Requested Changes” Activity Properties dialog box to view or change notification settings. For instructions, see Configuring notification.
- Go to the Error handling tab in the “Modify Requested Changes” Activity Properties dialog box to view or change error handling settings. For instructions, see Configuring error handling.
- Click the Additional settings link at the bottom of the “Modify Requested Changes” Activity Properties dialog box.
- In the Additional Settings dialog box that appears, you can configure the activity to:
- Change the container where to create new objects. Click in the Modify object creation requests so as to create objects in this container box, and then choose from the following options:
- Fixed container in directory With this option, objects will be created in the given OU or container. You can select the desired OU or container in Active Directory when you configure the activity.
- Parent OU of workflow target object With this option, objects will be created in the OU that holds the target object of the request that started the workflow.
- Activity target object With this option, objects will be created in the OU or container created or otherwise processed by a particular CRUD activity at the time of executing the workflow. You can select the desired CRUD activity from the workflow definition when you configure the activity.
- Object identified by workflow parameter With this option, objects will be created in the OU or container specified by the value of a certain parameter of the workflow. You can choose the desired parameter from the workflow definition when you configure the activity.
- Object from workflow data context With this option, objects will be created in the OU or container that will be selected by the activity on the basis of the data found in the workflow environment at the time of executing the workflow. You can specify which OU or container you want the activity to select.
- Object identified by DN-value rule expression With this option, objects will be created in the OU or container whose Distinguished Name (DN) is specified by the string value of a certain rule expression. By using a rule expression you can compose a string value based on properties of various objects found in the workflow environment at the time of executing the workflow. You can create the desired rule expression when you configure the activity.
- Add or remove Active Roles controls from the request. To add or change a control, click Add or Change, and then, in the dialog box that appears, specify the name and, if applicable, the value of the control. If you want the activity to add the control to the request, click Include this control in the change request. If you want to ensure that the control never occurs in the request, click Exclude this control from the change request.
Controls can be used to pass additional information to Active Roles on how to process the request. See Active Roles SDK for information about controls.
Enabling or disabling an activity
Temporarily disabling an activity may be useful when the workflow is under construction so the workflow definition is not finalized and the activity should not run until a certain time.
To disable an activity or enable a disabled activity
- Select the workflow definition in the console tree to display the workflow as a process diagram.
- In the process diagram, right-click the activity and click Disable or Enable, respectively.
While an activity is disabled in a given workflow, Active Roles skips that activity when running that workflow. When you enable a disabled activity in a given workflow, you allow Active Roles to execute that activity when running that workflow.
Enabling or disabling a workflow
Temporarily disabling a workflow may be useful when the workflow is under construction so the workflow definition is not finalized and the activities included in the workflow should not run until a certain time.
To disable a workflow or enable a disabled workflow
- Right-click the workflow definition in the console tree and click Disable Workflow or Enable Workflow, respectively.
While a workflow is disabled, Active Roles does not run any activities included in that workflow regardless of the workflow start conditions. When you enable a disabled workflow, you allow Active Roles to run the activities included in that workflow.
Using the initialization script
When executing a workflow instance, Active Roles uses a single PowerShell operating environment, referred to as a runspace, for all script activities held in that workflow. The workflow run-time engine creates a runspace once the workflow instance has been started, and maintains the runspace during the execution of the workflow instance.
When you configure a workflow, you can specify PowerShell commands you want the workflow run-time engine to execute immediately after the runspace creation. These commands constitute the initialization script that the workflow engine runs prior to performing script activities.
With an initialization script, you can define runspace configuration data separately from the logic of the script activities and use it to initialize the environment for executing script activities. Specifically, you can:
- Load PowerShell modules and snap-ins. All activity scripts can use the modules and snap-ins loaded in the initialization script, without having to load the prerequisite modules or snap-ins on a per-activity basis.
The modules and snap-ins loaded in the initialization script are available to all script activities at workflow run time. For example, the Import-Module 'SmbShare' command added to the initialization script makes the Server Message Block (SMB) Share-specific cmdlets available to all script activities within the workflow.
- Initialize environment-specific variables, referred to as global variables. All activity script can retrieve and update global variables, which makes it possible to exchange data between different activity scripts.
The global variables are visible to all script activities at workflow run time. For example, the $rGuid = [Guid]::NewGuid() command added to the initialization script makes the $rGuid
variable available to all script activities within the workflow. To reference a variable that is defined in the initialization script, the activity script must use the $global:
qualifier, such as $global:rGuid
.
When execution of the workflow instance is suspended (for example, waiting for approval), and then resumed (for example, after receiving an approval decision), the runspace is reinitialized so the global variables may change. If you need to preserve the value of a global variable, add the [Persist()] attribute to the variable's name in the initialization script, such as [Persist()]$rGuid = [Guid]::NewGuid(). The global variables defined in this way are saved to a persistent storage upon suspending the workflow instance and restored from the storage when the workflow instance is resumed. To save a variable, Active Roles creates and stores an XML-based representation of the object signified by that variable, similarly to the Export-Clixml command in Windows PowerShell. When restoring the variable, Active Roles retrieves the XML data that represents the object, and creates the object based on that data, similarly to the Import-Clixml command.
To view or change the initialization script
- In the Active Roles console tree, expand Configuration | Policies | Workflow, and select the workflow you want to configure.
This opens the Workflow Designer window in the details pane, representing the workflow definition as a process diagram.
- In the details pane, click the Workflow options and start conditions button to expand the area above the process diagram, and then click the Configure button.
- Click the Initialization script tab in the dialog box that opens.
The Initialization script tab displays the current script. You can add or modify the script by typing in the edit box on that tab.