Archive: SharePoint Designer 2010 Advanced Settings

This article was originally written in Aprile 2012.  It is being reposted here as an archive.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I’ve recently spent a lot of time on SharePoint 2010 workflows.  I made a ton of errors and learned a lot about the new Task Process in 2010.  It may look easy, but there are a lot of things that can go wrong.

I’m currently working on putting together a SharePoint Saturday session on the Task Process.  I will be writing a few “Lessons Learned” articles to help me organize my thoughts to prepare for this session (not yet determined when or where).  I will cover the following topics in more details in upcoming articles: Association and Initiation Forms, Change the behavior of a single task, Change the behavior of the overall task process, Change the completion conditions for this task process, the difference between assigning tasks and starting a task process.

This article is specifically about the Task Process “Advanced Properties”.

It is not immediately noticeable that a task process has advanced properties.  If you click on the name of the task, you are taken to a Task Settings page that allows you to change certain settings.  However, there are certain settings that you may not know to set since you do not see it anywhere except for in the task’s Advanced Properties.  I will notate these as I go through each one below.  Many of the issues I encountered were because these settings had changed or disappeared through the course of my iterations of the workflows.

These settings apply to the three Task Processes that can be added from “Action, Task Actions” and include the word “Process” – Start Approval Process, Start Custom Task Process, Start Feedback Process.

WFA-Image1

I highly recommend completely setting up your task process and reviewing these settings at the end.  Many of these options will be blank when you first set up your task process and will be automatically populated in the course of customizing your workflow.

To view the advanced properties, click on the task process row and click on the drop down button that appears on the right.  Then Select Properties, which will show you some settings and variables that are specific to that task process.

WFAImage2

WFAImage3

Here is a list of all the Properties available.  These are the same for all three task processes.

Note: you will see that some items are “Variables” and some items are “Parameters”

o   Variables are hidden from end users, but the workflow needs to function

o   Parameters  may be included on a form or setting for user input

General Property Variables:

  1. Content Type ID – this is a read only field, you cannot set the Task Content Type here.  If you need to assign a custom content type to a task process, click here for instructions:  Assign a Custom Content Type to Task Process in a SharePoint Designer 2010 workflow
  2. Allow Change Request –will prevent or allow the assigned user to request a change to the page or document being reviewed.

o   This option can be changed from the Task General Settings page (see print screen below)

o   This option will generate a button on the form and a corresponding outcome

o   Selecting this option will mark the current task as complete, assign a new task to the person a change is requested from.  Once that task is marked as complete, a new task will be created to the person that requested the change to review the change and complete the task process.

  1. Allow Reassign – will allow the assigned user to reassign a new task to someone else.  This will mark the current task as complete with an outcome of delegated to:  new person.

o   This option can be changed from the Task General Settings page (see print screen below)

o   This option will generate a button on the form and a corresponding outcome

o   Selecting this option will mark the current task as complete and assign a new task you want to reassign the task to.

WFAImage4

  1. Delete Tasks on Complete – Setting this to “Yes” will delete the task once it has been completed or canceled.

o    You may want to consider this if you will be generating a large number of tasks with workflows.

o   If you are collecting data in the workflow task that you need to retain and you need to delete your tasks, you should include steps in your workflow to place that data somewhere else; in your page or document the process is acting on, for example.

  1. Expand Groups – This setting only applies if you are assigning tasks to SharePoint User Groups.

o   Yes means that each person in the group will get an individual task assigned

o   No means that one task will be created and a member of the group will have the option of claiming the task, which will reassign the task from the group to the individual.

o   This default can be set with the Initiation Form Parameters

WFAImage5

o   You can also leave this option on your workflow initiation form and allow the workflow initiator to select the appropriate option.

  1. Permission Set – This is asking if you want to use the permissions of the task list (default) or set permissions for these tasks so that only people that are assigned to a task, workflow initiators and admins can see tasks.

o   This is set to “Default” by default.

o   This can be set on the Task Settings page.  If you check the box to “Only allow task recipients and process owners to read and edit workflow tasks SharePoint will set this variable to “AssignedTo”

WFAImage6

  1. Task Deleted Outcome – This is asking what the task outcome should be logged as if someone deleted a task.  By default this is blank.   You can enter “Deleted” or “Cancelled” or something that will let someone reviewing the workflow history know what happened to the task.
  2. Task Process Owner – Lists who owns this task process.  If you change the permissions of the task “PermissionSet” then this user or group will have access to all the tasks as the owner.

o   This can be an individual or a SharePoint group.

o   You can set this in the Task Information section of the task general settings page.

WFAImage7

  1. Send Default Task Notifications – pay attention to this one.  If you are sending a custom task notification to a user as part of the process, mark this as “No”.  Otherwise it will change the default setting of your task list no notify users when a task is assigned.

o   Personally, I prefer to customize the task notification message, so I mark this as “no”

o   If this is set to “Yes” it will send the automated message below from the Task List this task resides in (the variables in <> below will be populated by the task or item)

WFAImage8

 

Parameters for “[Task Process]”

  1. Task Process Name – This is the name of the Task Process, which may be included in notifications, depending on how yours are set up.  You can also change this setting in the Task General Settings Page under Task Information.

WFAImage9

  1. Overdue Repeat – Set this parameter if you want to send a notification to a user when the task is overdue.  Your options are Off, Daily, Weekly or Monthly.

o   You have the option of customizing the email that is sent in the Task Process.  That will be covered in another post.

WFAImage10

o   The default setting is weekly.

 

  1. Overdue Repeat Times – How many reminders do you want to send to the person or group a task is assigned to?  You can enter a set number, or enter -1 for infinity.  This means SharePoint will keep sending a reminder on the schedule that you listed in the previous parameter until the task is marked as complete, the task process is cancelled or the task is deleted.

WFAImage11

o   The default setting is infinity

 

Parameters for “[this item]”

  1. Item ID – Do not change this option.  It is defaulted to the Item ID that the workflow is running on.

Parameters for “[these users]”

These variables can also be set in the workflow task using the “Set Workflow Variable” action or when you click on the link to start the task process with “these users”

WFAImage12

WFAImage13

  1. CC: – This variable is asking if an individual or group should be copied on emails regarding this task process.

o   Unless you are setting your workflow so that every workflow copies a certain person or group, I would leave this as “Parameter: CC”.

  • You can include this parameter on the initiation form for a person starting the workflow to complete or you can set with workflow actions if the workflow will be started automatically.
  1. Comments – Important:  if “Parameter: Comments” is not listed here, then if your workflow can be manually started and you allow a workflow initiator to enter comments when manually starting the workflow, they will be lost.  They will not be included in the emails or on the “Task Process Consolidated Comments”

o   The alternative is to enter static text here or to enter static text when you are adding a workflow to the list, library or content type

  1. Subject – Default subject of task notifications.

o   I personally do not complete this one because I make each task notification subject different depending on how complex the workflow is.

  • For example, a reassigned or change request task gets a different subject that an original task.  Or a task assigned to a group will have a different subject than a task assigned to an individual.
  1. Duration – the number of days, weeks or months that a person has to complete a task

o   You can set this parameter here, in the overall workflow process itself, or when adding the workflow to the list, library or content type.

o   Make sure this is as least set as “Parameter: Duration” in the advanced.

  1. Duration Unit – days weeks or months

o   You can set this parameter here, in the overall workflow process itself, or when adding the workflow to the list, library or content type.

o   Make sure this is as least set as “Parameter: Duration Unit” in the advanced settings.

  1. Due Date – If you’d rather set an overall due date for the entire task process you can set it here.

o   You can set this parameter here, in the overall workflow process itself, or when adding the workflow to the list, library or content type.

o   Make sure this is as least set as “Parameter: Due Date” in the advanced settings.

An example of the screen when you are assigning a workflow to a list, library or content type is below.

  • Note the parameters that you can set here or in the Task Process’s advanced settings.
  • You can make these fields available to a workflow initiator or hide them.

WFAImage14

 

I would love to hear if this has been helpful for you.   Have a great day!

Archive: Assign a Custom Content Type to Task Process in a SharePoint Designer 2010 workflow

This article was originally written in February 2012.  It is being reposted here as an archive.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SharePoint Designer 2010 has some awesome new features!  Two of my favorites are (1) the ability to copy and modify an out of the box workflow and (2) the custom task processes.

What I don’t love is the way SharePoint assigns names with spacing to these tasks that have “_X0028_” and “_X0029_copy” in it.  It can cause problems with importing the workflow into Visual Studio, referring to the content type in custom web parts, and as an architect, I just don’t like the way it looks too messy.  Plus, if I want to make changes to the task list or roll the task up in a web part, I don’t want to have to guess which task goes with which workflow.

Here is an example of what SPD does when it adds a custom task action to a workflow or when you copy out of the box (OOB) workflow:

SharePoint Designer 2010 Workflow - Custom Content Types

SharePoint Designer 2010 Workflow – Custom Content Types

And this is what I want it to look like:

SharePoint Designer 2010 Workflow - Custom Content Type Desired Name

SharePoint Designer 2010 Workflow – Custom Content Type Desired Name

And it’s not just aesthetics; I have certain fields that I want to be able to store in the task.  I know that I can assign them in the workflow task process, but I don’t want the end user to see them so I want them hidden.

Here are the steps:

  1. Create your custom content type at your parent site (or content hub).
  • Important note:  If you are going to be exporting your workflows to other environment (i.e. local to production) and you do not use a content type hub, I STRONGLY recommend creating these content types and any site columns associated with the workflow with code.  This will ensure that your GUID’s (custom ID’s) are the same across all environments.

–   I worked with a developer to create my site columns and content types for me since we are moving workflows across environments

–   If you do not have access to a developer, then you will need to replicate these steps in each environment to make sure the ID’s are correct for each.

  1. Optional Step: If you want the “Claim Task”, Custom Outcomes functionality, and the ability to Reassign or Request Changes that comes with the out of the box workflow tasks for Enterprise SharePoint, you will need to change the display and edit forms.  If not, you can skip this step.

Example of InfoPath display form vs .aspx display form

SharePoint Designer 2010 Workflow - InfoPath Form vs .aspx form

SharePoint Designer 2010 Workflow – InfoPath Form vs .aspx form

  • If you create the content type in Code, make sure the display and edit form properties include “_layouts/WrkTaskIP.aspx”
  • If you create the content type by hand (or did not assign a display/edit form specification in the code), open the content type in Designer and change the display and edit form to “_layouts/WrkTaskIP.aspx” under “Forms” on the right side of the screen.
SharePoint Designer 2010 Workflow - Forms

SharePoint Designer 2010 Workflow – Forms

  1. Create your workflow
  • Either Copy and Modify an out of the box workflow
  • OR Create a new workflow and add a custom task process – Start Approval Process, Start Custom Task Process or Start Feedback Process

–   (I have not tested this with the other task actions)

SharePoint Designer 2010 Workflow - Task Processes

SharePoint Designer 2010 Workflow – Task Processes

 

  1. Save the workflow, but do not publish it.
  • NOTE: If you have published it and have the odd-named content type, just delete that task form.  We will generate a new task form at the end.

–   This odd-named content type will exist in your Content types library until you delete it from there

  1. Open the custom content type you created in Designer and Copy the ID
SharePoint Designer 2010 Workflow - Task Content Type ID

SharePoint Designer 2010 Workflow – Task Content Type ID

 

  1. Go to All Files, Workflows, <WorkflowName> folder
  • Note: If the “All Files” folder looks empty, click on another folder, such as subsites, and select “All Files” again.
SharePoint Designer 2010 Workflow - Workflow Files

SharePoint Designer 2010 Workflow – Workflow Files

 

  1. Open the file that ends in  “.wfconfig.xml” and replace the following items:
  • Line 2: TaskContentType=”<ID>” with your custom content type
  • Line 4: ContentType Name=”<Name>” with your custom content type name
  • Line 4: ContentTypeID  = “<ID>” with your content type ID you copied from previous step
  • Line 4: WorkflowForm= “Workflows/<workflowname>/<contenttypename.xsn>” with your content type name (just the name of the form, leave the folder name as is)
SharePoint Designer 2010 Workflow - Replace Content Type Code

SharePoint Designer 2010 Workflow – Replace Content Type Code

Here is what it should look like (my content type is “IntakeReviewTask”)

SharePoint Designer 2010 Workflow - Replace Content Type Code

SharePoint Designer 2010 Workflow – Replace Content Type Code Result

*Line 2 not pictured

  1. Save the the xml file and go back to your workflow folder

 

  1. Hover over the file that ends in “.xoml” file and select “Open with”  -> “2. SharePoint Designer (Open as XML)”.

    SharePoint Designer 2010 Workflow - Open as XML

    SharePoint Designer 2010 Workflow – Open as XML

 

  1. Click (Ctrl+F) for Find and enter “ContentType” in the “Find what” box
SharePoint Designer 2010 Workflow - Find and Replace

SharePoint Designer 2010 Workflow – Find and Replace

  1. Replace the ContentTypeID=”ID” with your custom content ID

 

  1. CLOSE SharePoint Designer and re-open it.
  • Refreshing has not worked for me.
  1. Open Designer, open your workflow by clicking on “Workflows” and Save your file.   Click “No” if you receive any messages to replace your file.
SharePoint Designer 2010 Workflow - Do Not Replace

SharePoint Designer 2010 Workflow – Do Not Replace

 

  1. Publish your workflow.  The right side of the picture below shows my workflow after completing this process.
SharePoint Designer 2010 Workflow - Replaced Content Type

SharePoint Designer 2010 Workflow – Replaced Content Type

And Voila, no more messy names and you can use your custom content type for whatever you may need, displayed in a CQWP, for example.