4.8 Workflow Examples

These topics provide step-by-step guidance for creating sample workflows from start to finish.

4.8.1 Find the Management Server with the Fewest AppManager Agents

If you install the AppManager Integration Adapter (AppManager adapter), you can design a workflow to determine which management server (MS) in your AppManager environment to use when deploying the next AppManager agent. Each AppManager agent in the environment has a primary MS and an optional secondary MS. Ideally, each MS handles a similar workload with a similar number of agents.

To help balance the number of AppManager agents associated with each MS in your AppManager environment, you can create the following workflows:

  • A parent workflow that uses the Add Computer to Deployment Rule activity to deploy a new AppManager agent to a server you want to monitor. Deployment rules in AppManager can differ from one server to the next, and the workflow determines which rules to use based on the MS you want to configure as the primary MS for the new agent. When the parent workflow needs the name of the MS to use as the primary MS for the new agent, it launches the child workflow. After the child workflow provides the host name of the MS, the parent workflow deploys the agent and assigns the specified MS as the agent’s primary MS.

  • A child workflow that determines which MS is currently the primary MS for the fewest number of agents. The child workflow sends the host name of the MS to the parent workflow.

This example walks you through creating the child workflow.

Assumptions

This example assumes the following:

  • A parent workflow exists to launch this workflow

  • Workflow Automation communicates with only one AppManager environment

  • Deployment rule names are based on the MS they assign as the primary MS to the agent

  • There are no UNIX computers in the AppManager environment

Building the Workflow

When you complete this sample procedure, your workflow should look like this:

To create a workflow to determine where to deploy the next AppManager agent:

  1. In the Library Browser, drag the following activities from the specified activity libraries to the design grid:

    Activity

    Library

    Start of Workflow

    Basic Workflow Control

    Find Objects (2)

    Basic Workflow Control

    For Each

    Basic Workflow Control

    Extract Nth Match of Regular Expression

    Data Manipulation

    Set Work Item Attributes

    Data Manipulation

    Echo State

    Basic Workflow Control

    Set Process Result

    Basic Workflow Control

    End of Workflow

    Basic Workflow Control

  2. Use connectors to join the activities, in the following order:

    • Start of Workflow to Find Objects (1)

    • Find Objects (1) to For Each

    • For Each to Extract Nth Match of Regular Expression

    • Extract Nth Match of Regular Expression to Find Objects (2)

    • Find Objects (2) to Set Work Item Attributes

    • Find Objects (2) to For Each

    • Set Work Item Attributes to For Each

    • For Each to Echo State

    • Echo State to Set Process Result

    • Set Process Result to End of Workflow

  3. On the View tab in the Properties group, click Workflow Properties.

  4. On the Work Item tab, add two custom work item attributes with the following properties:

     

    Attribute 1

    Attribute 2

    Name

    minimumAgentCount

    MSwithLowestNumberofAgents

    Display Name

    Minimum Agent Count

    MS with Lowest Number of Agents

    Type

    Integer Number

    String

    Value

    1000000

    MSwithLowestNumberofAgents

    Description

    Stores the value of the least number of agents on an MS (default is 1000000 so will always be reset on first loop)

     

    Read Only

    Yes

    Yes

  5. On the Workflow Properties window, under Custom Work Item Attributes, use the Move Up or Move Down buttons to ensure minimumAgentCount is in the first evaluation position.

  6. Click OK.

  7. Double-click the Start of Workflow activity, and then complete the following steps:

    1. On the Trigger tab, click Add.

    2. Under Available Triggers, select Manual Trigger, and then click Add.

    3. Click OK.

  8. Double-click the first Find Objects activity, and then complete the following steps:

    1. On the General tab, in the Name field, type Get Management Servers.

    2. On the Query tab, under Object Type, select AppManager > AppManager Repository > Windows Computer, and then click OK.

    3. Click the Windows Computer sub-tab.

    4. Click Create Filter.

    5. On the Expression Editor window, click New Template, and then click Expression.

    6. Click <attribute>, select Management Server, and then click OK.

    7. Click <attribute value>, and then click Enter Simple Value.

    8. Click true.

      This expression ensures the activity only retrieves management server computers in the AppManager adapter namespace.

    9. On the Expression Editor window, click OK.

    10. Select the Generate Object Locators check box.

    11. Click OK.

  9. Double-click the For Each activity, and then complete the following steps:

    1. On the General tab, in the Name field, type For Each MS.

    2. Click the Values tab.

    3. For the Input Array parameter, select the Use Input Builder check box.

    4. In the Value field for the Input Array parameter, click the Input Builder button.

    5. On the Input Builder window, click New Input Element, and then click Activity Output Parameter.

    6. Under Output Parameter Name, expand Get Management Servers, select Object Locators, and then click OK.

      The Object Locators output parameter is a string array that contains a list of the management server computers in the AppManager adapter namespace.

    7. On the Input Builder window, click OK.

    8. In the Value field for the Start Index parameter, specify the position in the input string array from which you want the For Each activity to retrieve a value on the first pass through the loop. The default value is 0, which references the first element in the string array.

      On each pass through the loop, the activity adds the specified increment to the current index to calculate the Next Index output parameter. The activity uses Next Index on the next pass through the loop. On the first pass, the activity assigns the start index to the Current Index output parameter. For example, if Start Index is 0 and Increment is 1, the first time the activity executes, it retrieves the value from index position 0 in the string array, and then sets Next Index to 1. The second time the activity executes, the activity retrieves the value from index position 1 in the string array, and then sets Next Index to 2. The activity increments the index value on each execution until Next Index is equal to or greater than the last index position in the string array.

    9. On the activity properties window, click OK.

  10. Double-click the connector between For Each MS and Extract Nth Match of Regular Expression, and then complete the following steps:

    1. Select Only traverse this connector when the following conditions are met.

    2. Under Conditional Expression, click Create Expression.

    3. On the Expression Editor window, click New Template, and then click Parameter Expression.

    4. Click <parameter name>, expand For Each MS, select Complete, and then click OK.

    5. Click <attribute value>, and then click Enter Simple Value.

    6. Click false.

      The expression allows the workflow to take this path as long as the For Each MS activity is processing the list of management server computers. When the For Each MS activity processes the last management server computer in the string array, it sets the Complete output parameter to true, and the expression prevents the workflow from taking this path.

    7. On the Expression Editor window, click OK.

    8. Uncheck Show Label.

    9. Click OK.

  11. Double-click the connector between For Each MS and Echo State, and then complete the following steps:

    1. Select Only traverse this connector when the following conditions are met.

    2. Under Conditional Expression, click Create Expression.

    3. On the Expression Editor window, click New Template, and then click Parameter Expression.

    4. Click <parameter name>, expand For Each MS, select Complete, and then click OK.

    5. Click <attribute value>, and then click Enter Simple Value.

    6. Click true.

      The expression allows the workflow to take this path only after the For Each MS activity processes the last management server computer in the string array and sets the Complete Output parameter to true.

    7. On the Expression Editor window, click OK.

    8. Uncheck Show Label.

    9. Click OK.

  12. Double-click the Extract Nth Match of Regular Expression activity, and then complete the following steps:

    1. On the General tab, in the Name field, type Get Name of MS.

    2. Click the Values tab.

    3. For the Input String parameter, select the Use Input Builder check box.

    4. In the Value field for the Input String parameter, click the Input Builder button.

    5. On the Input Builder window, click New Input Element, and then click Activity Output Parameter.

    6. Under Output Parameter Name, expand For Each MS, select Output Value, and then click OK.

      The Output Value output parameter contains a locator for a management server computer.

    7. On the Input Builder window, click OK.

    8. In the Regular Expression parameter, type the following: /IQAM_WindowsComputer=(\w+)

    9. In the Segments parameter, type 1(1).

    10. Select the Output as String check box.

    11. In the Output String Separator parameter, type a comma (,).

    12. Click OK.

  13. Double-click the second Find Objects activity, and then complete the following steps:

    1. On the General tab, in the Name field, type Find # Agents on MS.

    2. On the Query tab, under Object Type, select AppManager > AppManager Repository > Windows Computer, and then click OK.

    3. Click the Windows Computer sub-tab.

    4. Click Create Filter.

    5. On the Expression Editor window, click New Template, and then click Expression.

    6. Click <attribute>, select Primary Management Server, and then click OK.

    7. Click is equal to, and then click contains.

    8. Click <attribute value>, and then click Use Input Builder.

    9. On the Input Builder window, click New Input Element, and then click Activity Output Parameter.

    10. Expand Get Name of MS, click Result String, and then click OK.

    11. On the Input Builder window, click OK.

    12. On the Expression Editor window, click OK.

    13. Ensure Generate Object Locators is checked.

    14. Click OK.

  14. Double-click the connector between Find # Agents on MS and For Each MS, and then complete the following steps:

    1. Select Only traverse this connector when the following conditions are met.

    2. Under Conditional Expression, click Create Expression.

    3. On the Expression Editor window, click New Template, and then click Parameter Expression.

    4. Click <parameter name>, expand Find # Agents on MS, select Number of Object Locators, and then click OK.

    5. Click is equal to, and then click is greater than or equal to.

    6. Click <attribute value>, and then click Use Input Builder.

    7. On the Input Builder window, click New Input Element, and then click Work Item Attribute.

    8. Under Custom Work Item Attributes, click Minimum Agent Count, and then click OK.

    9. On the Input Builder window, click OK.

    10. On the Expression Editor window, click OK.

    11. Uncheck Show Label.

    12. Click OK.

  15. Double-click the connector between Find # Agents on MS and Set Work Item Attributes, and then complete the following steps:

    1. Select Only traverse this connector when the following conditions are met.

    2. Under Conditional Expression, click Create Expression.

    3. On the Expression Editor window, click New Template, and then click Parameter Expression.

    4. Click <parameter name>, expand Find # Agents on MS, select Number of Object Locators, and then click OK.

    5. Click is equal to, and then click is less than.

    6. Click <attribute value>, and then click Use Input Builder.

    7. On the Input Builder window, click New Input Element, and then click Work Item Attribute.

    8. Under Custom Work Item Attributes, click Minimum Agent Count, and then click OK.

    9. On the Input Builder window, click OK.

    10. On the Expression Editor window, click OK.

    11. Uncheck Show Label.

    12. Click OK.

  16. Double-click the Set Work Item Attributes activity, and then complete the following steps:

    1. On the General tab, in the Name field, type Update MS with Lowest Agent Count.

    2. Click the Attributes tab.

    3. Under Available Custom Attributes, select each of the following attributes, and then click Add:

      • Minimum Agent Count

      • MS with Lowest Number of Agents

    4. Under Configured Custom Attributes, for the Minimum Agent Count attribute, select the Use Input Builder check box.

    5. In the Value field for the Minimum Agent Count parameter, click the Input Builder button.

    6. On the Input Builder window, click New Input Element, and then click Activity Output Parameter.

    7. Under Output Parameter Name, expand Find # Agents on MS, select Number of Object Locators, and then click OK.

    8. On the Input Builder window, click OK.

    9. Under Configured Custom Attributes, for the MS with Lowest Number of Agents attribute, select the Use Input Builder check box.

    10. In the Value field for the MS with Lowest Number of Agents parameter, click the Input Builder button.

    11. On the Input Builder window, click New Input Element, and then click Activity Output Parameter.

    12. Under Output Parameter Name, expand Get Name of MS, select Result String, and then click OK.

    13. On the Input Builder window, click OK.

    14. Click OK.

  17. Double-click the Echo State activity, and then complete the following steps:

    1. On the General tab, in the Name field, type Echo - MS with Lowest Agent Count.

    2. Click the Values tab.

    3. For the Echo parameter, select the Use Input Builder check box.

    4. In the Value field for the Echo parameter, click the Input Builder button.

    5. On the Input Builder window, click New Input Element, and then click Work Item Attribute.

    6. Under Custom Work Item Attributes, click MS with Lowest Number of Agents, and then click OK.

    7. On the Input Builder window, click OK.

    8. Click OK.

  18. Double-click the Set Process Result activity, and then complete the following steps:

    1. Click the Values tab.

    2. Set the Workflow Result parameter to Success.

    3. For the Workflow Output Value parameter, select the Use Input Builder check box.

    4. In the Value field for the Workflow Output Value parameter, click the Input Builder button.

    5. On the Input Builder window, click New Input Element, and then click Activity Output Parameter.

    6. Under Output Parameter Name, expand Echo - MS with Lowest Agent Count, select Echo, and then click OK.

    7. On the Input Builder window, click OK.

    8. Click OK.

  19. In the Workflow Designer, on the Workflow tab, in the File group, click Save Workflow.

  20. On the Workflow tab, in the File group, click Close Workflow Designer.

Adding Functionality to the Workflow

To increase the complexity and capability of this workflow you might add one or more of the following:

  • Multiple environments - Workflow Automation can communicate with multiple AppManager environments. For example, your company might divide its management servers between three AppManager environments, each in a different geographic location.

  • Agents on UNIX computers - If your AppManager environment deploys agents to both Windows and UNIX computers, you can add another Find Objects activity to retrieve all agents on UNIX computers, and then use the Simple Calculator activity to add the results to the output of the Find # Agents on MS activity.

  • Server types - Your AppManager environment might divide management servers into similar groups based on their function, such as UNIX, Windows, Exchange Server, or SQL Server. The workflow first determines to which group it should deploy the new agent, and then determines the specific MS.

4.8.2 Creating a Snapshot on a Virtual Machine

If you install the Workflow Automation Adapter for VMware vCenter Server (vCenter adapter), you can design a workflow that creates a new snapshot for an existing virtual machine (VM). In this example, the workflow has a manual trigger. When a Process Operator manually triggers the workflow in the Operations Console, the workflow presents a user input form that asks for the following information:

  • Name of the data center that hosts the VM

  • Name of the VM for which to create the snapshot

  • Name of the new snapshot

  • Optional description of the new snapshot

  • Whether to include the VM memory in the snapshot

  • Whether to quiesce the file system while creating the snapshot

After the Process Operator provides the requested input, the workflow looks for the VM and creates the snapshot.

Assumptions

This example assumes your environment has only one vCenter Server and that all datacenters have unique names.

Building the Workflow

When you complete this sample procedure, your workflow should look like this:

To create a workflow to create a new snapshot on a virtual machine:

  1. In the Library Browser, drag the following activities from the specified activity libraries to the design grid:

    Activity

    Library

    Start of Workflow

    Basic Workflow Control

    Collect Input from User

    Email and User Interaction

    Find Virtual Machines

    VMware vCenter

    Create Snapshot

    VMware vCenter

    End of Workflow

    Basic Workflow Control

  2. Use connectors to join the activities, in the following order:

    • Start of Workflow to Collect Input from User

    • Collect Input from User to Find Virtual Machines

    • Find Virtual Machines to Create Snapshot

    • Create Snapshot to End of Workflow

  3. Double-click the Start of Workflow activity, and then complete the following steps:

    1. On the Trigger tab, click Add.

    2. Under Available Triggers, select Manual Trigger, and then click Add.

    3. Click OK.

  4. Double-click the Collect Input from User activity, and then complete the following steps:

    1. On the Input Form tab, click Edit.

    2. On the General tab of the Create/Edit User Input Form wizard, specify a title for the user input form, such as Snapshot Information.

    3. Type a description, and then click Next.

    4. On the Form Input Fields tab of the Create/Edit User Input Form wizard, add the following field definitions in the specified order:

      Type

      Parameter ID

      Parameter Name

      Required

      Single Line Text

      DataCenterName

      Datacenter Name

      Yes

      Single Line Text

      VMName

      VM Name

      Yes

      Single Line Text

      SnapshotName

      Name of New Snapshot

      Yes

      Single Line Text

      Snapshot Description

      Snapshot Description (optional)

      No

      Check Box

      IncludeMemory

      Include VM Memory in Snapshot

       

      Check Box

      Quiesce

      Quiesce File System

       

    5. Click Finish.

    6. Click OK.

  5. Double-click the Find Virtual Machines activity, and then complete the following steps:

    1. On the Query tab, select Generate Object Locators.

    2. Click the Datacenter sub-tab.

    3. Click Edit Filter.

    4. On the Expression Editor window, click New Template, and then click Expression.

    5. Click <attribute>, select Datacenter name, and then click OK.

    6. Click <attribute value>, and then click Use Input Builder.

    7. On the Input Builder window, click New Input Element, and then click Activity Output Parameter.

    8. Expand Collect Input from User, click Datacenter Name, and then click OK.

    9. On the Input Builder window, click OK.

    10. On the Expression Editor window, click OK.

    11. Click the Virtual Machine sub-tab.

    12. Click Edit Filter.

    13. On the Expression Editor window, click New Template, and then click Expression.

    14. Click <attribute>, select Inventory name, and then click OK.

    15. Click <attribute value>, and then click Use Input Builder.

    16. On the Input Builder window, click New Input Element, and then click Activity Output Parameter.

    17. Expand Collect Input from User, click VM Name, and then click OK.

    18. On the Input Builder window, click OK.

    19. On the Expression Editor window, click OK.

    20. Click OK.

  6. Double-click the Create Snapshot activity.

  7. On the Values tab, complete the following steps for each input parameter:

    1. Select the Use Input Builder check box.

    2. In the Value field, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Activity Output Parameter.

    4. For each input parameter, expand the specified activity, and then click the specified output parameter.

      Input Parameter

      Activity Name

      Output Parameter Name

      Virtual Machines

      Find Virtual Machines

      Object Locators

      Snapshot Name

      Collect Input from User

      Name of New Snapshot

      Snapshot Description

      Collect Input from User

      Snapshot Description (optional)

      Memory Snapshot

      Collect Input from User

      Include VM Memory in Snapshot

      Quiesce File System

      Collect Input from User

      Quiesce File System

    5. On the Input Builder window, click OK.

    6. Click OK.

  8. In the Workflow Designer, on the Workflow tab, in the File group, click Save Workflow.

  9. On the Workflow tab, in the File group, click the Close Workflow Designer.

Adding Functionality to the Workflow

To increase the complexity and capability of this workflow, you might add one or more of the following:

  • Automatic trigger - You can add a trigger that initiates a work item when a user sends an email with the subject Request Snapshot to a monitored email address. If the user correctly formats the message body, you can use an Extract Nth Match of Regular Expression activity to parse the contents and retrieve the following:

    • Name of the datacenter hosting the VM

    • Name of the VM for which to create the snapshot

    • Name of the new snapshot

    • Optional description of the new snapshot

    • Whether to include the VM memory in the snapshot

    • Whether to quiesce the file system

  • Error checking - If the contents of the triggering email are not in the correct format, the Extract Nth Match of Regular Expression activity cannot parse the contents and generates an error. A Capture Workflow Errors activity can retrieve the error and proceed down an alternate flow to a Send Email activity. The Send Email activity notifies the person who requested the new snapshot that the email request was in the wrong format.

  • Multiple vCenter Servers - If your environment has multiple vCenter servers, you can add a field definition to the user input form to request the name of the vCenter server. Datacenters in different vCenter servers can have the same name. To ensure the Find Virtual Machines activity finds the VM, you must add a filter that matches the specified vCenter server name to one in your environment.

4.8.3 Creating a New User Account

If you install the Workflow Automation Adapter for Directory and Resource Administrator (DRA adapter), you can design a workflow that creates a new user account in response to an email.

Assumptions

This example assumes the following:

  • Your Workflow Automation environment monitors Microsoft Exchange Server mailboxes

  • The email subject is Create new user

  • The body of the email is formatted as follows:

    FirstName LastName

    Domain

    Location

    Department

Building the Workflow

When you complete this sample procedure, your workflow should look like this:

To create a workflow to determine where to deploy the next AppManager agent:

  1. In the Library Browser, drag the following activities from the specified activity libraries to the design grid:

    Activity

    Library

    Start of Workflow

    Basic Workflow Control

    Extract Nth Match of Regular Expression

    Data Manipulation

    Set Work Item Attributes (2)

    Data Manipulation

    Find Active Directory Objects

    NetIQ Directory and Resource Administrator

    Create User

    NetIQ Directory and Resource Administrator

    Simple Calculator

    Data Manipulation

    End of Workflow

    Basic Workflow Control

  2. Use connectors to join the activities, in the following order:

    • Start of Workflow to Extract Nth Match of Regular Expression

    • Extract Nth Match of Regular Expression to Set Work Item Attributes (1)

    • Set Work Item Attributes (1) to Find Active Directory Objects

    • Find Active Directory Objects to Set Work Item Attributes (2)

    • Set Work Item Attributes (2) of Simple Calculator

    • Simple Calculator to Find Active Directory Objects

    • Find Active Directory Objects to Create User

    • Create User to End of Workflow

  3. On the View tab, in the Properties group, click Workflow Properties.

  4. On the Work Item tab, under Custom Work Item Attributes, add eight attributes with the following properties:

     

    Attribute 1

    Attribute 2

    Attribute 3

    Attribute 4

    Name

    FirstName

    FirstInitial

    LastName

    UserLogon

    Display Name

    First Name

    First Initial

    Last Name

    User Logon

    Type

    String

    String

    String

    String

    Value

     

     

     

     

    Description

     

     

     

     

    Hidden

    No

    Yes

    No

    No

    Read Only

    Yes

     

    Yes

    Yes

     

    Attribute 5

    Attribute 6

    Attribute 7

    Attribute 8

    Name

    Department

    CreateIn

    SearchIn

    Counter

    Display Name

    Department

    Create In

    Search In

    Counter

    Type

    String

    String

    String

    Integer Number

    Value

     

     

     

    0

    Description

     

     

     

     

    Hidden

    Yes

    No

    Yes

    Yes

    Read Only

     

    Yes

     

     

    At run time, the workflow populates the custom work item attributes with values it retrieves from the email that initiated the work item. Activities in the workflow retrieve the values from the work item attributes during the course of the workflow.

  5. On the Workflow Properties window, click OK.

  6. Double-click the Start of Workflow activity, and then complete the following steps:

    1. On the Trigger tab, click Add.

    2. Under Available Triggers, click Create New Trigger.

    3. On the Create Trigger window, in the Trigger Name field, type New User Email.

    4. On the Initiate New Work Item If tab, click New Template.

    5. Under Expression Templates, click Any event of a specific type and attribute value, and then click OK.

    6. Click <event type>.

    7. Under Event Type, click Exchange.New Message Event, and then click OK.

    8. Click <event attribute>.

    9. Under Event Attribute, click Subject, and then click OK.

    10. Click <event attribute value>.

    11. In the text box, type New user account, and then click OK.

    12. On the Create New Trigger window, click OK.

    13. Under Associated Triggers, verify the new trigger is present, and then click OK.

      The trigger only initiates a work item if an email message with a matching subject line arrives in a monitored mailbox.

  7. Double-click the Extract Nth Match of Regular Expression activity, and then complete the following steps:

    1. On the General tab, in the Name field, type Extract First Initial.

    2. Click the Values tab.

    3. For the Input String parameter, select the Use Input Builder check box.

    4. In the Value field for the Input String parameter, click the Input Builder button.

    5. On the Input Builder window, click New Input Element, and then click Event Attribute.

    6. Under Event Type, select Exchange.New Message Event, and then click OK.

    7. Click <Event Attribute>.

    8. Under Event Attribute, click Text Body.

    9. On the Attribute Qualifiers tab, select the Use Word check box.

    10. In the Value field, click the Browse button.

    11. On the Use Word window, select the Use word # check box.

    12. In the Use word # field, type 1, and then click OK.

    13. On the Input Builder window, click OK.

    14. In the Regular Expression parameter, type (.).

    15. In the Segments parameter, type 1(1).

    16. Select the Output as String check box.

    17. In the Output String Separator parameter, type a comma (,).

    18. Click OK.

  8. Double-click the first Set Work Item Attributes activity.

  9. On the Attributes tab, under Available Custom Attributes, select each of the following attributes, and then click Add, in the following order:

    • First Initial

    • First Name

    • Last Name

    • User Logon Name

    • Create In

    • Search In

    • Department

    • Subject

  10. Under Configured Custom Attributes, for the First Initial attribute, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the First Initial attribute, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Activity Output Parameter.

    4. Under Output Parameter Name, expand Extract First Initial, select Result String, and then click OK.

    5. On the Input Builder window, click OK.

  11. Under Configured Custom Attributes, for the First Name attribute, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the First Name attribute, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Event Attribute.

    4. Under Event Type, select Exchange.New Message Event, and then click OK.

    5. Click <Event Attribute>.

    6. Under Event Attribute, click Text Body.

    7. On the Attribute Qualifiers tab, select the Use Word check box.

    8. In the Value field, click the Browse button.

    9. On the Use Word window, select the Use word # check box.

    10. In the Use word # field, type 1, and then click OK.

    11. On the Input Builder window, click OK.

  12. Under Configured Custom Attributes, for the Last Name attribute, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the Last Name attribute, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Event Attribute.

    4. Under Event Type, select Exchange.New Message Event, and then click OK.

    5. Click <Event Attribute>.

    6. Under Event Attribute, click Text Body.

    7. On the Attribute Qualifiers tab, select the Use Word check box.

    8. In the Value field, click the Browse button.

    9. On the Use Word window, select the Use word # check box.

    10. In the Use word # field, type 2, and then click OK.

    11. On the Input Builder window, click OK.

  13. Under Configured Custom Attributes, for the User Logon Name attribute, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the User Logon Name attribute, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Event Attribute.

    4. Under Event Type, select Exchange.New Message Event, and then click OK.

    5. Click <Event Attribute>.

    6. Under Event Attribute, click Text Body.

    7. On the Attribute Qualifiers tab, select the Use Word check box.

    8. In the Value field, click the Browse button.

    9. On the Use Word window, select the Use word # check box.

    10. In the Use word # field, type 2, and then click OK.

    11. Click New Input Element, and then click Activity Output Parameter.

    12. Under Output Parameter Name, expand Extract First Initial, select Result String, and then click OK.

    13. On the Input Builder window, click OK.

  14. Under Configured Custom Attributes, for the Create In attribute, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the Create In attribute, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Event Attribute.

    4. Under Event Type, select Exchange.New Message Event, and then click OK.

    5. Click <Event Attribute>.

    6. Under Event Attribute, click Text Body.

    7. On the Attribute Qualifiers tab, select the Use Word check box.

    8. In the Value field, click the Browse button.

    9. On the Use Word window, select the Use word # check box.

    10. In the Use word # field, type 3, and then click OK.

    11. Click New Input Element, and then click Free-Form Text.

    12. In the free-form text box, type \, and then click OK.

    13. Click New Input Element, and then click Event Attribute.

    14. Under Event Type, select Exchange.New Message Event, and then click OK.

    15. Click <Event Attribute>.

    16. Under Event Attribute, click Text Body.

    17. On the Attribute Qualifiers tab, select the Use Word check box.

    18. In the Value field, click the Browse button.

    19. On the Use Word window, select the Use word # check box.

    20. In the Use word # field, type 4, and then click OK.

    21. Click New Input Element, and then click Free-Form Text.

    22. In the free-form text box, type \, and then click OK.

    23. Click New Input Element, and then click Event Attribute.

    24. Under Event Type, select Exchange.New Message Event, and then click OK.

    25. Click <Event Attribute>.

    26. Under Event Attribute, click Text Body.

    27. On the Attribute Qualifiers tab, select the Use Word check box.

    28. In the Value field, click the Browse button.

    29. On the Use Word window, select the Use word # check box.

    30. In the Use word # field, type 5, and then click OK.

    31. On the Input Builder window, click OK.

  15. Under Configured Custom Attributes, for the Search In attribute, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the Search In attribute, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Event Attribute.

    4. Under Event Type, select Exchange.New Message Event, and then click OK.

    5. Click <Event Attribute>.

    6. Under Event Attribute, click Text Body.

    7. On the Attribute Qualifiers tab, select the Use Word check box.

    8. In the Value field, click the Browse button.

    9. On the Use Word window, select the Use word # check box.

    10. In the Use word # field, type 3, and then click OK.

    11. On the Input Builder window, click OK.

  16. Under Configured Custom Attributes, for the Department attribute, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the Department attribute, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Event Attribute.

    4. Under Event Type, select Exchange.New Message Event, and then click OK.

    5. Click <Event Attribute>.

    6. Under Event Attribute, click Text Body.

    7. On the Attribute Qualifiers tab, select the Use Word check box.

    8. In the Value field, click the Browse button.

    9. On the Use Word window, select the Use word # check box.

    10. In the Use word # field, type 5, and then click OK.

    11. On the Input Builder window, click OK.

  17. Under Configured Custom Attributes, for the Subject attribute, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the Subject attribute, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Free-Form Text.

    4. In the free-form text box, type Create New User Account for, and then click OK.

    5. Click New Input Element, and then click Space.

    6. Click New Input Element, and then click Work Item Attribute.

    7. Under Custom Work Item Attributes, click First Name, and then click OK.

    8. Click New Input Element, and then click Space.

    9. Click New Input Element, and then click Work Item Attribute.

    10. Under Custom Work Item Attributes, click Last Name, and then click OK.

    11. Click New Input Element, and then click Space.

    12. Click New Input Element, and then click Free-Form Text.

    13. In the free-form text box, type in, and then click OK.

    14. Click New Input Element, and then click Space.

    15. Click New Input Element, and then click Work Item Attribute.

    16. Under Custom Work Item Attributes, click Create In, and then click OK.

    17. On the Input Builder window, click OK.

      At run time, the workflow populates the subject of the work item with the new user’s name and location. Process Operators can check the progress of the work item in the Operations Console.

  18. On the activity properties window, click OK.

  19. Double-click the Find Active Directory Objects activity, and then complete the following steps:

    1. Click the Values tab.

    2. For the Search In parameter, select the Use Input Builder check box.

    3. In the Value field for the Search In parameter, click the Input Builder button.

    4. On the Input Builder window, click New Input Element, and then click Work Item Attribute.

    5. Under Custom Work Item Attributes, click Search In, and then click OK.

    6. Select the Search Specific Object Types radio button.

    7. Select the User Accounts check box.

    8. Expand User Accounts.

    9. For the User Logon Name Pattern parameter, select the Use Input Builder check box.

    10. In the Value field for the User Logon Name Pattern parameter, click the Input Builder button.

    11. On the Input Builder window, click New Input Element, and then click Work Item Attribute.

    12. Under Custom Work Item Attributes, click User Logon Name, and then click OK.

    13. On the activity properties window, click OK.

  20. Double-click the connector between Find Active Directory Objects and Simple Calculator, and then complete the following steps:

    1. In the Name field, type User ID already in use.

    2. Select Only traverse this connector when the following conditions are met.

    3. Under Conditional Expression, click Edit Expression.

    4. On the Expression Editor window, click New Template, and then click Parameter Expression.

    5. Click <parameter name>, expand Find Active Directory Objects, select Number of Object Locators, and then click OK.

    6. Click is equal to, and then click is greater than.

    7. Click <attribute value>, and then click Edit Simple Value.

    8. In the text field, type 0, and then click OK.

    9. On the Expression Editor window, click OK.

    10. On the Connector Properties window, click OK.

  21. Double-click the Simple Calculator activity, and then complete the following steps:

    1. Click the Values tab.

    2. For the Expression parameter, select the Use Input Builder check box.

    3. In the Value field for the Expression parameter, click the Input Builder button.

    4. On the Input Builder window, click New Input Element, and then click Work Item Attribute.

    5. Under Custom Work Item Attributes, click Counter, and then click OK.

    6. Click New Input Element, and then click Free-Form Text.

    7. In the free-form text box, type +1, and then click OK.

    8. On the Input Builder window, click OK.

    9. On the activity properties window, click OK.

  22. Double-click the second Set Work Item Attributes activity.

  23. On the General tab, in the Name field, type Increment User Logon Name.

  24. On the Attributes tab, under Available Custom Attributes, select the following:

    • User Logon Name

    • Counter

  25. Under Configured Custom Attributes, for the User Logon Name attribute, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the User Logon Name attribute, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Work Item Attribute.

    4. Under Custom Work Item Attributes, click User Logon Name, and then click OK.

    5. Click New Input Element, and then click Activity Output Parameter.

    6. Under Output Parameter Name, expand Simple Calculator, select Result, and then click OK.

    7. On the Input Builder window, click OK.

  26. Under Configured Custom Attributes, for the Counter attribute, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the Counter attribute, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Activity Output Parameter.

    4. Under Output Parameter Name, expand Simple Calculator, select Result, and then click OK.

    5. On the Input Builder window, click OK.

  27. On the activity properties window, click OK.

  28. Double-click the connector between Find Active Directory Objects and Create User, and then complete the following steps:

    1. In the Name field, type User ID available.

    2. Select Only traverse this connector when the following conditions are met.

    3. Under Conditional Expression, click Edit Expression.

    4. On the Expression Editor window, click New Template, and then click Parameter Expression.

    5. Click <parameter name>, expand Find Active Directory Objects, select Number of Object Locators, and then click OK.

    6. Click <attribute value>, and then click Edit Simple Value.

    7. In the text field, type 0, and then click OK.

    8. On the Expression Editor window, click OK.

    9. On the Connector Properties window, click OK.

  29. Double-click the Create User activity, and then click the Values tab.

  30. For the Create In parameter, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the Create In parameter, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Work Item Attribute.

    4. Under Custom Work Item Attributes, click Create In, and then click OK.

    5. On the Input Builder window, click OK.

  31. For the Full Name parameter, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the Full Name parameter, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Work Item Attribute.

    4. Under Custom Work Item Attributes, click First Name, and then click OK.

    5. Click New Input Element, and then click Space.

    6. Click New Input Element, and then click Work Item Attribute.

    7. Under Custom Work Item Attributes, click Last Name, and then click OK.

    8. On the Input Builder window, click OK.

  32. For the First Name parameter, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the First Name parameter, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Work Item Attribute.

    4. Under Custom Work Item Attributes, click First Name, and then click OK.

    5. On the Input Builder window, click OK.

  33. For the Last Name parameter, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the Last Name parameter, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Work Item Attribute.

    4. Under Custom Work Item Attributes, click Last Name, and then click OK.

    5. On the Input Builder window, click OK.

  34. For the Pre-Windows 2000 Logon Name parameter, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the Pre-Windows 2000 Logon Name parameter, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Work Item Attribute.

    4. Under Custom Work Item Attributes, click User Logon Name, and then click OK.

    5. On the Input Builder window, click OK.

  35. For the User Logon Name parameter, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the User Logon Name parameter, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Work Item Attribute.

    4. Under Custom Work Item Attributes, click User Logon Name, and then click OK.

    5. On the Input Builder window, click OK.

  36. For the Department parameter, complete the following steps:

    1. Select the Use Input Builder check box.

    2. In the Value field for the Department parameter, click the Input Builder button.

    3. On the Input Builder window, click New Input Element, and then click Work Item Attribute.

    4. Under Custom Work Item Attributes, click Department, and then click OK.

    5. On the Input Builder window, click OK.

  37. On the activity properties window, click OK.

  38. In the Workflow Designer, on the Workflow tab, in the File group, click Save Workflow.

  39. On the Workflow tab, in the File group, click the Close Workflow Designer.

Adding Functionality to the Workflow

To increase the complexity and capability of this workflow you might add one or more of the following:

  • POP3 email support - You can add another trigger to the Start of Workflow activity to respond to a properly formatted email message arriving in a monitored POP3 mailbox.

  • Complex email formatting - The email message matching the trigger can contain more complex formatting, from which you can retrieve information to populate more input parameters on the Create User activity or additional custom work item attributes.

  • Send credentials to system administrator - You can send an email containing the new user’s ID and password to the system administrator, who can then provide the credentials to the user.