In this step of the Woodgrove bank customization scenario, Ken creates the workflow that supports the custom activity for change requests. To design the WF workflow, Ken considers the following factors:
- When should the workflow run? The
workflow needs to start when the applicable change request is
approved.
- What does the workflow need to do? The
workflow needs to add a computer to a group in Active Directory
Domain Services (AD DS), and then change the status of the
automated activity to "complete."
- What information does the workflow
need? The change request provides information about the
specific computer and group to use. Properties of the workflow
activities can retrieve the change request information from the
Service Manager activity associated with the change request.
To create and implement his new workflow, Ken follows the steps outlined in the rest of this section. He uses the Woodgrove.AutomatedActivity.AddComputerToGroupMP management pack, as described in Step 1: Open the Woodgrove.AutomatedActivity.AddComputerToADGroupMP Management Pack. These procedures assume that this management pack is still open in the Authoring Tool.
Create a New Workflow
Ken uses this procedure to create a workflow named AddComputerToADGroupWF in the Woodgrove.AutomatedActivity.AddComputerToADGroupMP management pack.
To create the new workflow
- If the Authoring Tool is not open, start the Authoring
Tool.
- If the
Woodgrove.AutomatedActivity.AddComputerToADGroupMP
management pack is not open, open it: On the File menu,
point to Open, and then click File. In the Open
File dialog box, click
Woodgrove.AutomatedActivity.AddComputerToGroupMP.xml, and
then click Open.
- In the Management Pack Explorer, right-click
Workflows, and then click Create.
- On the General page of the Create Workflow wizard, in
the Name box, type AddComputerToADGroupWF, and then
click Next.
- On the Trigger Condition page, click the Run only
when a database object meets specified conditions option, and
then click Next.
- On the Trigger Criteria page, under Class name,
click Browse.
- In the Class Property dialog box, click Automated
Activity: Add Computer To AD Group, and then click OK to
return to the Trigger Criteria page.
- Under Change event, in the list, select When an
instance of the class is updated and then click Additional
Criteria.
- In the Pick additional criteria dialog box, click the Change
To tab, select the Status property of Automated
Activity: Add Computer To AD Group class and then click
Add.
- Under criteria, select [Activity] Status equals In
Progress and then in the In Pick additional criteria dialog
box, click OK.
- On the Trigger Criteria page of the Create Workflow Wizard,
click OK.
- On the Summary page, review the settings for the new
workflow, and then click Create. After the wizard has
completed, click Close.
- In the Management Pack Explorer, right-click the
management pack, and then click Save.
If you receive a message that says "The Management Pack could not be saved due to this error: Failed to open file[] or the specified XmlWriter object," click OK to close the message box. This is a known issue in this release of the Authoring Tool and does not prevent the management pack from saving.
For general information about these steps, see How to Create a New Workflow and How to Save and Build a Workflow.
Add the Workflow Activities
Ken uses this procedure to add the WF activities Add AD DS Computer to Group and Set Activity Status to Completed to his workflow.
To add WF activities to the workflow
- In the Management Pack Explorer, expand
Workflows, right-click AddComputerToADGroupWF, and
then click Edit.
- In the Activities Toolbox pane, locate the Active
Directory Activities group.
- Drag Add AD DS Computer to Group to the authoring pane
and drop it between the Workflow Start and End icons.
- Drag Set Activity Status to Completed and drop it
between the previous activity and the End icon.
For general information about these steps, see How to Add an Activity to a Workflow.
Configure the Activity Properties
Ken uses this procedure to set the Computer Name and Group Name properties of the Add AD DS Computer to Group activity to retrieve the values of the Automated Activity: Add Computer To AD Group properties Computer Name, Group Name, and Activity ID from the change request. In addition, he sets the Computer Domain name property of the Add AD DS Computer to Group activity to a constant value.
To configure the activity properties
- In the Details pane, click Computer Name, click
the ellipsis button (...), click Use a class
property, click ComputerName, and then click
OK.
- In the Details pane for the Add AD DS Computer to
Group activity, click Group Name, click the ellipsis
button (...), click Use a class property, click
GroupName, and then click OK.
- In the Details pane, click Computer Domain name,
and in the text box, type woodgrove.com.
- In the authoring pane, click the Set Activity Status to
Completed activity.
- Click Activity ID, and click the ellipsis button
(…) that appears next to the property. On the left side of
the dialog box, click Use a class property, and then, in the
property list, click ID (Internal). Click OK.
- In the Management Pack Explorer, right-click the
management pack, and then click Save.
For general information about these steps, see How to Set an Activity Property to Use a Value from the Trigger Class and How to Set an Activity Property to a Constant Value.