Sample workflow setup

The example which follows is an illustration of how to set up a basic workflow process for a workflow triggered by an e-mail listener. Use these instructions as a guide when creating your first workflow, substituting the applicable data and settings for the context of your environment, and for the type of event listener you will be using.

Note: This exercise assumes that Process Manager has been installed, the workflow database created, the necessary e-mail server and user/group connections set up, and that the Process Manager services have been started on the server.

Successful completion of this sample workflow depends on a properly-configured e-mail listener. You will also need to provide the attributes and settings for your environment, including:

Creating a workflow

Creating and deploying a workflow generally involves completing the following procedures:

  1. Create the workflow layout.
  2. Create an event listener.
  3. Create e-mail templates.
  4. Finalize the workflow and assign the attributes.
  5. Start the event listener.

Sample scenario

In this scenario, an event listener has been programmed to monitor the organization's Help Desk e-mail account. When a qualifying e-mail arrives, the listener kicks off the workflow. When the workflow starts, it sends an e-mail to a designated manager for approval of a new hardware request. If the manager approves the request, the workflow e-mails the employee and sends an assignment to the Help Desk to install the new hardware. If the request is not approved, the workflow sends an e-mail to notify the employee the request was denied. All activity and responses are automatically recorded in the workflow log file.

Step 1: Create the workflow layout

To begin, we will create the basic workflow layout, add the necessary actions, and define the sequence in which the actions should take place.

  1. Click Start | All Programs | LANDesk Process Manager | Process Designer.
  2. Choose the Process Manager server and click Connect.
  3. In the workflow explorer, right-click Workflows | New | Folder, then enter Sample workflows for the folder name.
  4. Right-click Sample workflows, click New | Workflow, then enter Hardware request for the workflow name.
  5. Double-click Hardware request to open the new workflow on the design canvas.
  6. In the Actions toolbox on the right side of the screen, find the Get approval action in the System group, and drag and release its icon underneath Hardware request on the canvas. This adds the Get approval action to the workflow, along with its required outcome options, Approved and Denied. (Whenever you drag an action to the canvas, any required outcomes are automatically inserted in their relative position on the canvas.)
  7. Drag the right scroll bar on the Canvas pane downward to move the window to display enough empty space to add several more actions below the existing icons.
  8. In the System group in the Actions toolbox, drag and drop the Send email action underneath the Approved icon on the canvas. Then drag another Send e-mail action and drop it underneath the Denied icon on the canvas.
  9. Find the Assign manual task icon in the System group in the Actions toolbox and drag it to the left of the Approved icon on the canvas.
  10. Click the Hardware request icon at the top of the layout, hold down the left mouse button, and drag in a downward direction, releasing the button on the Get approval action. This draws an arrow from the Primary action (Hardware request) to the Get approval action, and establishes the sequence in which those actions are to take place.
  11. Use the technique described above to draw arrows from the Approved outcome to its Send e-mail action, and from the Denied outcome to its Send e-mail action. Then draw an arrow from Approved to Assign manual task.
  12. Click the Layout diagram button on the toolbar to refresh the display and have Process Designer align and space the actions on the canvas.
  13. Click Validate (green checkmark icon) in the Validation panel at left side of the screen, and note the comments listed. These indicate the attributes that need to be defined for each of the actions, before the workflow can be deployed. We will define these attributes and set their properties in Step 4: Finalize the workflow and assign the attributes below.
  14. For now, click the Save button on the toolbar to save the workflow layout.

Step 2: Create an event listener

The next step is to create the event listener. If the triggering event was a database entry, you would create a database listener; if you wanted it to be triggered by a web service, you would create a web service listener. In this case, we need to monitor the Help Desk e-mail Inbox, so we will create an e-mail listener. Once it has been started, it will "listen" to the designated e-mail account, and when the trigger e-mail arrives, the listener will start the workflow.

To complete this section, in step 14 you will need an e-mail content definition file. This is a simple text file that specifies the content the listener needs to listen for. For this example, a sample definition file, EmailListenerSample.txt is included in the Program Files\ LANDesk\Process Manager\WorkflowManager folder.

  1. On the toolbar, click Configure | Event listeners.
  2. Click Add to create a new event listener.
  3. On the Type tab, select E-mail.
  4. Click the Details tab.
  5. In the Name text box, type Hardware request e-mail listener.
  6. In the Workflow to start box, click the [...] (ellipsis) button, click the plus sign next to Sample workflows, select Hardware request, and click OK.
  7. Click the Settings tab.
  8. In the Mail server type dropdown list, select IMAP or POP3.
  9. In the Mail server text box, type the name of the mail server where the e-mail account resides.
  10. (If you selected IMAP in Step 8) In the Mailbox name text box, type the name of the mailbox or folder to be monitored.
    (If you selected POP3 in Step 8) Since with POP3 you cannot specify a mailbox name, it is recommended that you use a dedicated email account.
  11. In the User Id text box, type the user ID for the account the listener will be monitoring.
  12. In the User password text box, type the password to access the user account.
  13. Click Test to test the connection to the e-mail account using the login and authentication information you provided. If the listener was able to contact the specified e-mail account, a message will appear, indicating a successful connection. If not, you may need to re-type the information, user ID, or password.  When the connection is successful, click OK.
  14. Click Open, navigate to and select the e-mail content definition text file, and click OK. This inserts the content the listener needs to listen for in the Sample e-mail content text box.
  15. When you are satisfied with the e-mail content, click the Mappings tab.
  16. Click Autogenerate external unique system identifier.
  17. In the Requester dropdown list, select Requester.
  18. Click Autogenerate field mappings, then click Yes to save the event listener.
  19. Click OK, then click Close.

Step 3: Create e-mail templates

Creating e-mail templates enables you to set up the messaging that will be used to assign tasks, request approvals, notify participants of workflow actions, etc. For this example, we will create a template to send an e-mail to a manager to request approval for purchase of new computer hardware.

  1. On the toolbar, click Configure | Templates | E-mail.
  2. Click Add to create a new e-mail template.
  3. In the Name text box, type Approval request.
  4. In the Action drop-down list, select Get approvals. This adds the template you are creating to the dropdown list you will use later on to specify which e-mail template you want to use.
  5. In the Sender text box, type the name or e-mail address you want to appear in the From field of the e-mail message. For this example, type Help Desk.
  6. In the Subject text box, type the subject of the e-mail. For this example, type Your approval is needed.
  7. In the Message body text box,type the following text

    One of your employees has requested a new monitor.  Please use the buttons below to approve or deny this request. Thank you. Help Desk.

  8. Click OK to save the e-mail template.
  9. Refer to the above instructions to create three more e-mail templates: a) to notify the employee if the request is approved, b) to notify the employee if the request is denied, and c) to assign a task to the Help Desk or IT staff to install the new monitor.
  10. When you are finished, click OK to close the E-mail Template Manager dialog box.

Step 4: Finalize the workflow and assign the attributes

Sometimes, after creating the basic workflow design, preparing e-mail templates, and setting up the event listener, other needs or tasks become apparent. If so, you can add them before finalizing the workflow.

Once you are satisfied with the workflow, you need to make sure all required attributes are configured. The Validation panel to the left of the canvas is where Process Designer reports any missing attributes. We'll use the Validation panel to resolve any missing attributes.

To assign the required attributes
  1. Click Validate (green checkmark icon) in the Validation panel to refresh the screen and make sure all actions have been verified and issues reported.
  2. Double-click the first validation message, Missing approval recipient.
  3. Below the empty list of approvers, click Add...
  4. In the Contact type dropdown list, select User.
  5. In the Contact location dropdown list, select the location where the approver's network account resides (local machine, domain, etc.)
  6. In the Search filter text box, type an asterisk (*), or type the first few characters of the approver's name, followed by an asterisk, and click Search.
  7. Select the approver from the Available contacts list, and click OK.
  8. At the bottom of the Attributes panel, click Choose template.
  9. In the list of e-mail templates Select Approval request and click OK.
  10. Click Validate and note that the Missing approval recipient message is removed from the list.
  11. Double-click the next validation message, Missing e-mail recipient.
  12. Using steps 1-10 above as a guide, assign the attributes for e-mail templates and notification recipients for the Approved and Denied outcomes.
  13. Click the validation message for Missing assignment recipient and specify the assignment recipient and the e-mail template to assign the hardware installation to the Help Desk staff.
  14. Click the Validate button and make sure no more comments remain in the Validation panel.
  15. Save the workflow.

Step 5: Start the event listener

With the workflow design, e-mail templates, and event listener configured, you are ready to automate the process by starting the event listener.

  1. Click Configure | Event listeners .
  2. Select Hardware request e-mail listener from the list.
  3. Click Edit.
  4. Click the Details tab.
  5. Click Start listener.
  6. Click OK to close the Event listener dialog box.
  7. Click Close.

The e-mail listener will now monitor the designated Inbox and kick off the Hardware request workflow when a qualifying e-mail arrives.

Does it work?

To test the workflow and make sure it is working, send an e-mail to the e-mail account you will be monitoring. Make sure it matches the expected content criteria you set up in the event listener. If everything has been set up correctly, the workflow should be initiated by the e-mail you sent. To confirm, check to see whether the designated approver received the approval request.