Archive for the 'SharePoint Workflow' Category

08
Sep
11

SharePOint Designer 2010 Workflows Still Process Out of Order

One of the issues with SharePoint 2007 workflows was the actions within a workflow could process out of order due to the asynchronous nature of the workflow processing.  In order to work around these “race” conditions you had to put a checkpoint or commit in your workflow.  This usually means you put a pause in your workflow to make the workflow serialize and de-serialize in the database, thus causing a commit to occur.

The same issue exists with SharePoint Designer 2010 workflows.  I just had an “update list item” action update the incorrect list item, even though it was specified with a unique key.  In many of my workflows I create a name/value pair list that stores values I need to pass around.  In this case I had a “LastMonthProcessed” entry and a “MonthlyControlsListURL” entry.  Each time I updated the “MonthlyControlsListURL” key the value would end up in the “LastMonthProcessed.”  After putting a 1 minute delay (pause for duration) action after the update of the “LastMonthProcessed,” all of the updates occurred correctly.

image

You’d think some clever MS programmer would fix this issue once and for all…or they would a least give you a commit action in SPD.  Arghhhhh!

17
Oct
10

Due to heavy load, the latest workflow operation has been queued. It will attempt to resume at a later time.

I’ve been doing some deep diving into globally reusable workflow creation with SPD 2010 and am beginning to hit a number of errors and "notes."

In this case, I have been attempting to copy and modify the OOTB Publishing Approval workflow.  I’ve added a pair of parallel approval tasks prior to the standard approval task and have modified the start-up form to display my country approval groups in several country drop-downs. 

image

Whenever I start the workflow I tend to get this "note." 

Due to heavy load, the latest workflow operation has been queued. It will attempt to resume at a later time.

image

I can only assume this means it has been serialized in the database and is now subject to the timer jobs.  My biggest problem at the moment is that I’ve been unable to approve either of the tasks that were assigned in parallel.  If I use the task email that was sent, I get this nice error.

An error occurred while retrieving the workflow task details.  This may be caused by:

  • Not having connectivity to the server
  • The task no longer exists
  • You do not have permission to access the task.

I don’t think contacting my system administrator is going to make this any better, so I’ll go directly to the task list.

image

UPDATE:  Found that the SharePoint site needs to be in the Local intranet sites in order for this to work.

image

 

Oops!  That’s an error.  Not really sure what to do about it and I don’t have the time to mess with it at the moment.

image

16
Oct
10

Deleting a Globally Reusable Workflow that was Created by Copy and Paste

Here’s a good thing NOT to do.

  • Open SPD 2010 at the site collection level and go into the workflow assets.
  • Make a copy of the Publishing Approval workflow using copy/paste.
  • Decide that you really didn’t want to do it that way and delete your copy of the workflow.
  • Amazingly, all the Publishing Approval workflows are deleted.
  • Close SPD, thinking that this must be a user interface glitch.
  • Open SPD and verify that the workflows have indeed been deleted.
  • Start working on a way to get the Publishing Approval workflow back.
  • If you don’t have a lot of customized WFs yet, deactivate and reactivate the Publishing Approval workflow.
  • Use "Copy and Modify" in the future.

 

image

 

image

image

05
Oct
10

Getting failed emails to send in SharePoint 2007 custom workflow

We experienced a very frustrating issue with sending emails in SharePoint 2007 custom workflows.  The error we received was

The e-mail message cannot be sent.  Make sure the outgoing e-mail settings for the server are configured correctly.

First, a little background…

We had assigned a number of tasks upon employee  termination, such as “Collect badge”, “Revoke UNIX access”, etc.  There were about a dozen of these tasks assigned when the termination was entered.  When each task was assigned, a separate workflow was initiated to send the email to the person responsible for completing the task.  For example, someone in the Facilities group was responsible for collecting the employee’s badge.  The majority of the time, the email was sent and the logging indicated success.

image

… but sometimes, we received the error and could not determine why.  The issue was sporadic.  Sometimes all 12 emails would be sent successfully.  Other times, maybe 2 or 3 emails would fail – never consistently the same workflow processes.   

clip_image002

Is it possible that with this many emails we had a conflict issue of some sort?  Maybe… but 12 concurrent emails doesn’t seem to be an unreasonable number!

A quick look at the SharePoint logs during the time of the issue did not point us to an obvious problem with the workflow logic or the email settings. 

We stumbled upon a work-around quite by accident…

One of our workflows worked a little differently.  We had it set up to pause for some time after the initial email attempt.  It was in this process where we found that if the email was not sent properly, then within 30 minutes or so after the pause, the SharePoint timer job kicked in and took action. The timer job determined there had been an issue and restarted the workflow from the top, rerunning the logic to send the email.  With the delay built in, that workflow never had an issue sending the email.

This prompted us to add a 2 hour delay at the end of all of our email workflows to ensure we had plenty time to get the email sent appropriately.

image

The 2 hours is probably overkill, as it seems to consistently require only 30 minutes or so to eventually send the email (the timer job gets kicked off in our shop every 30 minutes).  Since there is no additional processing after the pause, it doesn’t hurt to include it in the logic.

A simple delay fixed our issue!  Since we have added the delay, all emails have been sent.

image

04
May
10

Setting the URL and Hyperlink Description Simultaneously on a URL Field in a SharePoint Designer Workflow

If you need to update a URL field in a links list (or any other list) from SharePoint Designer, you need to know this little trick.  Create a string that contains the URL and description like this:

 

URL, Description

 

and then update the field with this string.  Notice there is a comma AND A SPACE after the URL.  There are no brackets, curly braces or octothorpes (# signs) involved in the string.

 

Using the string builder, you can see the "input" and the "output" of the workflow.

 

image

 

image

19
Mar
10

The Infamous “Error updating a list item” Error Message on a SharePoint Designer Workflow

I can’t tell you how many times I’ve seen this error message while creating SPD workflows.  Many times it is a permissions problem, as the workflow is generally running under the context of the credentials of the person who initiated it (at least in 2007).  Since the limitation exists in SPD 2007 workflows to not easily change the security context of the running workflow, I usually tighten the security around the lists and libraries I use to insure those participating in the business process workflows only have the security needed to function in their assigned role.

This particular "error updating a list item" problem was due to my overzealousness to log as much info as possible to the workflow history list.  Here’s what I was logging:

clip_image002

It turns out that that is too long!  If you look at the Description field on the Workflow History List you can see that it is defined as a single line of text, i.e. it can accept no more than 255 characters.  My log message exceeded this limit.

If you haven’t looked at the Workflow History List in SharePoint through the browser, you can use SPD to enable it so it shows on the "View all site content" page.  You can find it under the LIsts folder and select the properties sheet and uncheck the "Hide from browser" checkbox.

clip_image002[5]

17
Feb
10

Checking for a NULL Date Field in SharePoint Designer Workflow

Since I originally published this, I’ve found that you can simply store the date in a dynamic string and then test the string to see if it is empty.  Use the “Build Dynamic String” action.

image

image

Testing the variable to see if it is empty.

image

Even easier!

 

Here’s the original post.

I was recently teaching an Advanced SharePoint class in Richardson, TX and a student was expressing his frustration over Microsoft’s apparent oversight within the SharePoint Designer workflow wizard. One of the “IF” conditions is a simple testing of the value of a field…”If this equals that.” He wanted to test a date field in SharePoint to see if it was empty or not. Problem is, when you select a field that is typed as DATE in SharePoint Designer, there is no test for the empty or null condition. You can see this in the first figure.

image

It occurred to me that we might be able to change the type of the field to a string and then be able to perform the comparison. I used the “Build Dynamic String” action.

image

I selected the End Date custom field on my Expense Statements list and stored it in a new variable that was typed as STRING.

image

The results of this were not exactly what I expected, however I was able to determine, through trial and error (sending the values in an email), that the conversion created a string that was filled with question marks (????). Therefore, if you simply test to see if the new string begins with a ?, you can successfully test for an empty date value.

image

Both my student and I were happy with the results.

15
Feb
10

Changing the Group on a Site Column Causes Hidden Fields to Display on a Content Type

I ran into this problem recently.  I had a number of site columns that were hidden on multiple content types and I "recategorized" the site columns into a single group (simply for administrative purposes).  As a result, all my forms began displaying the hidden fields (instead of keeping them hidden).

Here’s the scenario.  I have a content type, Generic Task, that is used as the parent of many other content types.  You can see from my first screen shot that I have a content type (called Badge Access Task) that is inheriting from Generic Task.  When a user interacts with the task list Edit form I only want them to see and update the two fields at the bottom (Badge Access and Badge Access Comments).  All the other fields are hidden and are only used by workflows.  If you haven’t done this before, you can still see the hidden fields in a view, but the New, Display and Edit forms don’t show the hidden fields.

clip_image002[11]

 

Here’s the problem I was having.  After I changed the group that my Generic Task site columns were in, they all started showing up on my Edit forms.

 

clip_image002[13]

 

To correct this problem, I simply went into each site column on each content type and clicked OK.  I didn’t make any changes to any of the information on the form.

 

clip_image002[15]

 

This appears to have had the desired effect.  After performing this procedure on each site column on the content types, all of my fields were again properly hidden.

 

clip_image002

 

As an FYI, this is on an MOSS 2007 farm with SP2 (and patches) applied.

08
Sep
09

Error Updating List Item in SharePoint Designer Workflow – KB932394

A.K.A. – A timer does not resume operation after a workflow is reloaded in Microsoft Windows Workflow Foundation

Here’s something that’s kind of hard for me to believe.

I’ve been working on an SP2 patch-level SharePoint site developing some SharePoint Designer workflows.  Nothing complicated, mind you, but they will be getting much more complicated.  All I have to do is prove you can do what we need to get done with an SPD workflow. 

I’ve got 12 workflows that start automatically on creation of a list item, thus assigning 12 individual tasks.  The workflow(s) I’m creating are very simple.  They look up people based on a role from a SharePoint list.  A variable is set with the person (approver) that is looked up.  They pause until a certain day at a certain time and then each workflow executes the "Collect Data from a User" action.  There is one of these actions for each of the 12 workflows.  This essentially creates 12 tasks (in Workflow Tasks) in response to entering an item in a SharePoint list.  Pretty simple.

There is also a secondary workflow that gets spawned on each task that is created as a result of the “Collect Data from a User” action in the primary workflow.  The secondary workflow (on the Workflow Tasks list) pauses for a certain amount of time and, when the pause is over it inspects the status of the task.  If it is not complete, it updates the assigned to on the task with a backup approver.  Again, not a very complicated workflow.

The problem is that the "Assigned To" field on each of the tasks that are created in the Workflow Tasks list are not being set to the person the task is assigned to.  Many times I get 3 of the tasks that get the "assigned to" set correctly.  Some times more.  It appears to be very inconsistent.  Many times the “assigned to” field is blank (never filled out).  The history list many times shows “error updating a list item.” 

ErrorUpdatingListItemHistoryListEntry

What have I tried to get around this problem?  I’ve tried using the trick of prepending -1;# to the user name per this article.  I originally had all the task assignment actions in a parallel step in a single workflow before breaking them out into multiple workflows.  I’ve tried updating the assigned to in another workflow that is started automatically on the task.  Nothing seems to give consistent results.

Perhaps I’ve stumbled upon the root cause of all my woes.  I was searching the web and ran across this post.  This indicated that I needed the update to the Windows Workflow Foundation described in KB932394.  I know that I had seen a reference to this fix from other posts, but the actual article is from 2007.  I ASSumed, incorrectly, that this fix would be part of one of the SharePoint cumulative updates or, at the very least, a service pack.  Not so!  My original files (after SP2) were version 3.0.4203.2.

image

image

image

After applying this patch, the file versions were 3.0.4203.201. 

image

Now, I know that TECHNICALLY the files are part of the Window Workflow Foundation, but wouldn’t you think they’d be included in a SharePoint service pack?

What other patches do I need to get to insure that declarative SPD workflows will be processed correctly?

 

 

 

06
Sep
09

Great Example of a SharePoint Designer Workflow Solving a Scheduling Problem

Ran across this on Paul Galvin’s site. 

http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!3133.entry

Hey, what do you know, it’s one of my posts!  Thanks for the nice words, Paul!

http://sharepointsolutions.blogspot.com/2009/02/give-blood-to-your-workflow.html




Asif Rehmani’s SharePoint Videos

SharePoint-Videos

Click to access a wealth of SharePoint videos

SharePoint Rx

SharePoint Rx Home

Categories

Posts by Date

February 2012
M T W T F S S
« Sep    
 12345
6789101112
13141516171819
20212223242526
272829  
Support Wikipedia

Follow

Get every new post delivered to your Inbox.