Using Content Types and SharePoint Designer Workflows to Automate the Management of Renewal Events

Using Content Types and SharePoint Designer Workflows to Automate the Management of Renewal Events This solution is particularly elegant and valuable....
0 downloads 0 Views 677KB Size
Using Content Types and SharePoint Designer Workflows to Automate the Management of Renewal Events This solution is particularly elegant and valuable. Every organization has a requirement to track and manage renewal events, such as Domain Name registrations, licenses, leases and subscriptions. The preparation for, efforts involved, and the responsible parties responsible for managing these renewal events are very different. Renewing a Domain Name may require ten minutes of IT manager’s time while renewing a property lease may require four to six months of preparation by a Facilities Manager, an Attorney, and a Real Estate Broker. An organization may have dozens if not hundreds of renewal events that need to be tracked and managed so it is not a trivial matter and it should be handled in a formal organized manner. Conveniently, a very versatile and elegant solution to this requirement can be created easily using SharePoint Content Types and two SharePoint Designer workflows. This solution also serves as an object lesson in the value and use of Content Types. We are going to create the following:  

A generic renewal event Content Type Content Types for specific renewal events (Domain Name registration, Property Lease, License, etc.) that inherit from the generic renewal Content Type  A workflow that generates a reminder date for each specific renewal event  A workflow that triggers on the reminder dates of the specific renewal events, to notify the responsible parties of the upcoming renewal event What is very important to know about this solution is that we can’t create a trigger workflow that starts now, immediately pauses for a long period of time (longer than a week) and then wakes up to do its work. This is a type of long-running workflow that SharePoint does not support. A dormant workflow is still running and takes up processing cycles. Having many of these running will degrade the overall performance of SharePoint; consequently these are either manually or automatically turned off. So one of the really nice things about this solution is the work around for this based on a Content Type’s Retention settings. The first order of business is to create the Custom Site Columns to be used by the Content Types in SharePoint Designer. These are the following:           

Expiry Date Renewal Reminder Date Responsible Party (Person or Group) Domain Name Registrar License Location (Choice values of Municipal, State, Federal) License Type (Choice values of Annual Registration, Blue Sky Registration, Requires Examination) Property Address Lessor Vehicle Description VIN (Vehicle Identification Number)

Now create the following Content Types with their respective Site Columns. Important – Create the specific renewal Content Types from the Generic Renewal Event      

Generic Renewal Event (Title, Expiry Date, Renewal Reminder Date, Responsible Party) Note Domain Name Renewal (Title, Expiry Date, Renewal Reminder Date, Responsible Party, Domain Name, Registrar) License Renewal (Title, Expiry Date, Renewal Reminder Date, Responsible Party, License Location, License Type) Property Lease Renewal (Title, Expiry Date, Renewal Reminder Date, Responsible Party, Property Address, Lessor) Vehicle Lease Renewal (Title, Expiry Date, Renewal Reminder Date, Responsible Party, Vehicle Description, VIN)

1

Now we will create a generic custom Renewal Events list and add these specific event Content Types to the list as shown in Illustration 1 below:

Illustration 1

Note that the Allow management of content types check box must be enabled in order to add the Content Types to the list. Illustration 2 below shows the Renewal Events list with a number of renewal events already created. Note that separate views for each renewal event Content Type can easily be created or filtered from the column headings.

Illustration 2

2

The next step in building this solution is to create the workflow that generates the Renewal Reminder Date automatically. The workflow settings page for this workflow is shown in Illustration 3 below.

Illustration 3

The completed workflow is shown in Illustration 4 below. Note that the Start Options for the workflow are set on the Settings page above. The settings for this workflow should be Start workflow automatically when an item is created and Start workflow automatically when an item is changed.

Illustration 4

3

What we are doing in this workflow is identifying each instance of a renewal event type using a Conditional Statement; adding a negative amount of time to its Expiry Date that is written to a variable that represents it’s specific Renewal Reminder date; and then writing that variable value to the actual Renewal Reminder date field in the record. Below is the step-by-step walkthrough for creating the condition and actions for the Domain Name renewal event. A Step will automatically be created in the SharePoint 2010 workflow. Add an If current item field equals value Condition as shown in Illustration 5 below.

Illustration 5

Click on the field variable in the conditional statement and using the drop down selection box pick Content Type ID as shown in Illustration 6 below.

Illustration 6

Click on value in the conditional statement and the Content Type values (those added to the list) will display as shown in Illustration 7 below. Select Domain Name Renewal.

Illustration 7

4

Place your cursor underneath the conditional statement and add the Add Time to Date action from the Core Actions as shown in Illustration 8 below left. Directly after Add enter “-14” and change the duration to days as shown in Illustration 8 below right.

Illustration 8

Click on the date variable as shown in Illustration 8 above right. The Lookup for Date/Time dialogue screen will display as shown in Illustration 9 below.

Illustration 9

With the Data Source set to Current Item use the drop-down selection box to select the Expiry Date as the Field from source as shown in Illustration 9 above. Now click on the Variable:date and using the drop-down selection box select Create a new variable. You will name the new variable “Domain Renewal Reminder Date” and it will be a Date/Time Type as shown in Illustration 10 below.

Illustration 10

Your workflow will now look like Illustration 11 below.

Illustration 11

Now we are going to add the Set Field in Current Item action to the workflow in order to write the Domain Renewal Reminder Date variable to the Renewal Reminder Date field in the record. Insert your cursor underneath the Add Time to Date action and insert the Set Field in Current Item action as shown in Illustration 12 below left. Click on the field variable and select Renewal Reminder Date from the drop-down selection box as shown in Illustration 12 below right.

5

Illustration 12

Click on the value variable and the Lookup for Data and Time dialogue screen will display as shown in Illustration 13 below. Use the drop-down selection box for the Data source to select Workflow Variables and Parameters and for the Field from source select Variable: Domain Renewal Reminder Date as shown in Illustration 13 below.

Illustration 13

That completes the workflow logic for setting the Renewal Reminder Date for a Domain Name Renewal event as shown in Illustration 14 below. Now use Else-If Branches to add the condition and actions for each of the other renewal events so that your completed workflow looks like Illustration 4 above.

Illustration 14

After you complete the workflow you will Save and Publish it and then Associate it with the Renewal Events list, all of which is accomplished from the Workflow Settings ribbon menu as shown in Illustration 15 below.

6

Illustration 15

The next part of building the solution is creating the trigger workflow; that is the workflow that containing the events that will take place on the Renewal Reminder Date in the future. Illustration 16 below shows the completed Trigger Renewal Event Action workflow.

Illustration 16

The structure of this workflow is similar to the Set Renewal Reminder Dates workflow. A conditional statement used to identify the type of renewal event that is triggered and the only action for each renewal event is the generation of an email as shown in Illustration 17 below. The Subject and Body of the email is different for each renewal event.

7

Illustration 17

Clicking the String Builder Button to the right of the Subject line opens the workflow string builder function used to construct the Subject line message as shown in Illustration 18 below. Clicking the Add or Change Lookup Button displays the Lookup dialogue screen which is used to access Current Item or variable information to use in the email.

Illustration 18

Note that there are no Start Options for this workflow. The only reason that Allow this workflow to be manually started is enabled is for testing purposes only. This workflow will be triggered in the future by a Retention Policy event.

8

Illustration 19

One of the powerful aspects of Content Types is the ability to define its lifecycle behavior. An example of this is a Retention Policy. A Retention Policy can be applied to the Master Content Type or to an instance of a Content Type when it is used in a list or library. In this case the Retention Policy is established for the Content Type instances in the Renewal Events list. Click on the List Settings Ribbon Menu of the Renewal Events list to open the Renewal Events Settings Page as shown in Illustration 20 below.

Illustration 20

Note the Content Types that we applied to the Renewal Events list are shown. Clicking on the Information policy settings link on the list settings page as shown in Illustration 20 above will display the Information Management Policy Settings page shown in Illustration 21 below.

9

Illustration 21

Because this list contains Content Types we have the choice to apply a Policy to any or all of the Content Types or to the list itself. In this case we are going to create an identical Retention Policy for each of the renewal events. Click on the Domain Name Renewal Content Type Policy as shown in Illustration 21 above to display the Policy page for this instance of the Content Type. Note that in addition to Retention, a policy and behavior can be set for Auditing and Labels. For the purpose of building this workflow we are only concerned with the Retention. Enable the Enable Retention check box as shown in Illustration 22 below. Then click the Add a retention stage link directly below the check box.

Illustration 22

10

The Stage properties dialogue screen as shown in Illustration 23 below will display. For the Time Period use the drop down selection box to select the Renewal Reminder Date. In the Action drop-down selection box select Start a workflow. The Trigger Renewal Events workflow will display in the Start this workflow drop-down selection box.

Illustration 23

It is the occurrence of the Renewal Reminder Date that triggers the workflow and it is the Retention Policy feature of Content Types that makes this type of long running workflow possible.

11

Suggest Documents