Skip to main content

Blogging about SharePoint

Home
Blogging about SharePoint
SPField
  

Michael Blumenthal's BlumenthalIT.NET > Blogging about SharePoint
This is the blog where I discuss tips and tricks and lessons learned in my work with SharePoint.
Version Management Based on Risk Mitigation

Our current version management approach is based on fear and risk mitigation.

The versioning I’ve been dealing with is for Features for workflow solutions.

For example, we produce V1 of a workflow. It has GUIDs all over – for the solution, the feature, custom site columns, content types, and more.

We now produce V2. We need to replace every GUID because we want this to be a totally separate version. If we don’t change all the GUIDs, we may get warnings or errors about whichever item already being in use. Also, if V1 should later be uninstalled, we don’t want it removing anything that V2 relies on. So V1 and V2 are designed to be as independent as possible. This means that although we could share references to site columns between V1 and V2 solutions, we are afraid to because we don’t want removal of V1 to break v2. We also don’t want to have to install v1-v34 when we want to install v35.

The lists that are used in our workflow (a “request list” and a task list) are NOT deployed by Feature for this reason, but rather by list template and tedious manual update . We do this manually because we don’t want the list definitions to go away when a feature is removed. A list is likely to be a set-it-up-once kind of thing (even with occasional tweaking), whereas the workflow will likely be revised over time. We would not remove a list when we remove a workflow, and removing a feature that defines a list may break any list that was created using that list definition. Another reason to make two versions of the same workflow completely independent is that they can both execute at the same time.  That is, you can leave the old version running until it is no longer used.

Also, if we have a shared components, like a DLL that is used by more than one workflow, we do not deploy it as part of our Feature because that would tie it to our workflow. We don’t want to risk removing the shared DLL when we remove a Feature.

Is there a better way?

Michael

Interesting experience with Infrastructure Update

This is reported by my friend Ralph.  He and I are working at the same client right now, and he is responsible for MOSS Farm Administration there.  Monday and Tuesday of last week we installed the Infrastructure Updates in a 32-bit virtual machine.  Not that they took very long, but we did the WSS update on Monday afternoon and  the MOSS update on Tuesday morning.  The new Search admin pages are nice! The upgrade was uneventful.  More recently however, Ralph installed the same updates in two 64 bit virtual machines (each its own farm) with quite unexpected results. 

Ralph's experience was this: The WSS Infrastructure Update install went fine but the the MOSS Infrastructure Update install errored out.  I don't have exact details of the error message yet, but will update this post when I get them.  All I know at this time is that the installation failed - I think during the PSConfig session - and that after that, one of the user-facing web applications didn't work. In one case, it was the intranet portal site, while in another case it was the My Sites.  Ralph indicated that this KB article was helpful in resolving the matter:

http://support.microsoft.com/kb/944267.

Ralph called Microsoft's Premier Support Services to get the issue resolved in a timely manner.  I have asked Ralph to send me the incident log as time permits.

Installation in  a third 64 bit VM did not experience this issue and was successful.  All VMs here are VMWare VMs, not MS Virtual Server VMs.

Michael

SPBookReport: English Curry SharePoint Best Practices, Chapter 10

I just got a copy of "Microsoft Office SharePoint Server 2007 Best Practices" by "Ben Curry and Bill English, with the Microsoft SharePoint Teams".  Last night (7/30/2008) I perused the table of contents and read all of Chapter 10, "Business Processes and Workflows".  The book is, of course, available from Amazon here: MOSS 2007 Best Practices

The table of contents is quite appealing as the book covers a number of topics that I am interested in other than workflow - including branding and information architecture.

However, I've only read chapter 10, so here is my assessment of it, section by section:

P263-268 - Review of the workflow capabilities, with a little bit of discussion of requirements analysis.  This feels like little more than product documentation.  In the boxed text on p269 is the first real advice on workflow: a risk of a serial approval process is that it can get hung up indefinitely if one of the approvers is unresponsive (e.g. on vacation or leaves the company).  Here's another good point: parallel approvers should have equal authority and respect within the approval process. In other words, it doesn't usually make sense to give Johnny the intern and Bob the CEO equal approving authority while requiring both of them to be involved in the process.

Another interesting tidbit from the boxed text on p269 is that a serial approval workflow probably maxes out at 1000 participants, though I suspect few processes would actually involve more than 10 participants, be they people or groups.

Additional Best practices on page 269:

  1. Minimize serialization, using additional workflows instead.  Hmm, I'll have to think about that.  I don't see how additional workflows help, but rather I can see having workflow logic that moves the process forward in some way (e.g. escalate a task) if the current task is not completed in a defined amount of time.
  2. The originator [the person that causes the workflow to kick off] (and often others in the process) need to stay informed of the progress of the process.  Sometimes alerts in email are sufficient to do this.  Other times, the workflow itself should generate emails to the appropriate parties. 
    • An example of this in my current project is that a user uses a Line of Business (LOB) web app to submit a request.  The LOB web app drops a list item in a MOSS list, and an approver then gets an alert in email that a new request has arrived and requires attention.  When the approver reviews the request and changes the status of it, the workflow then puts together an email to the requestor's department's e-mail distribution list, and calls a web service to update the LOB web app.

The rest of page 269 is on the Workflow History list, which continues through the top of page 272.  Although neither a good nor bad practice, but rather just a fact, the workflow history list does not show up in the normal places in the UI - e.g. Quick Launch nor View All Site Content pages.  You primarily see it through the workflow status page, although you can guess the URL to get to the default view of that list.

On page 270 there are some best practice statements about when to use a new history list for each workflow vs when to combine them.  One of the things to take into account is if users will sync the task list with Outlook.

    • In my recent experience, I have created two workflows around two business processes that are part of an existing LOB web app.  The web app runs outside of MOSS on a separate web server, but tosses list items into a MOSS site via calls to MOSS's web services.  In this situation, we have a site collection for use by the web app, with a site for each business process.  In this situation, each workflow has its own site and so it has its own history list too.  We haven't encouraged the users to sync the tasks with Outlook. 
      • In fact, I have an issue where if the user edits the custom task by arriving at the task's application page directly from the Edit Task link in outlook, the redirect statement that I use when they click the Task Completed button on the application page causes an error.  But that's not related to syncing with outlook, just related to task notifications in Outlook.

Page 270-271. If you move a document to another library, its workflow history will not move with it.

Page 271, boxed text, talks about how workflow history isn't appropriate for auditing. This is one of Robert Bogue's blog posts.  Good stuff, but since I read Rob's blog, it feels a bit like filler here.

Middle of page 272-top of page 273 is on Publishing workflows and to me reads more as product documentation than best practice guidance.

Middle of Page 273-top of 275.  A discussion of how various workflow options can be used to meet various business requirements.  Not "Best Practices" advice, but good solution design information.  For example, you can control use of custom workflows at the web app level and (via permissions) at the site level.  Workflows are a very empowering feature, but a real world reason to turn them off would be that you haven't had a chance to train users on them yet.

Sidebar, page 275.  Now here's a nugget I like.  This is a blog post I hadn't seen before, and will be looking into more closely due to my interest in site provisioning solutions (I am giving a presentation on site provisioning solutions, as well as one on getting started with MOSS administration, and one on information architecture at SharePoint Connections in Vegas in November).

Page 276-279.  Discussion of SharePoint Designer workflows.  Frankly, I'm not that excited about SharePoint Designer workflows.  This may be a personal bias, as most of the work I do is for IT departments and therefore it's highly likely that my customer will have a code promotion process (i.e. a migration of custom functionality from a development environment to a staging environment to a production environment.)  Because of this deployment requirement, I've used SharePoint Designer to prototype workflows, but Visual Studio to build them.  And I have not bought into the idea of migrating the workflow definitions from SharePoint Designer to Visual Studio.  I tried that with a fairly complex workflow that I built in SharePoint Designer, and what I got was a huge pile of workflow activities and a complex rule file that was an unintelligible and unmaintainable mess.  All the activities had meaningless auto-generated names and I have come to dislike rule files because you can't put breakpoints in them like you can with code methods.  I found it much more practical to rebuild the workflow in Visual Studio rather than migrate it.  The resulting activity graph was much easier to understand, maintain, and debug.

All that aside, there are a few useful tidbits in here: SPD workflow emails have to have subject lines; SPD workflows can't be associated with content types.  The "best practice" in the first box on page 279 is more about good project management practices than about SharePoint.  I'm fortunate to have worked with some very good project managers and engagement managers recently. 

Top of page 280 has a description of how a workflow can be executed by more than one process - first w3wp and then OWStimer, but it's content that is quoted from http://blogs.msdn.com/sharepoint/archive/2008/01/04/issues-with-the-delay-activity-in-sharepoint-workflows-we-need-your-help.aspx

Bottom of 280 to bottom of 282 is again primarily product documentation.  Very bottom of 282 to top of 283 is a section on naming conventions for workflow lists, which is useful.

283 to top of 285 is mostly product documentation again, but 285 starts a section on security concerns that I did find useful.  You may want to give the workflow history list different permissions from the site permissions, so that you can better control who can read or write history entries.  You can also give the document library that has the workflow associations different permissions than the parent site to control who can start a workflow.

And finally, on page 286 a chapter summary followed by a list of four links on page 287. 

 

--Michael

First Look: Installing the Infrastructure Updates for WSS

Here's a visual overview of installing the 32-bit version of the Infrastructure Updates for WSS.  These are a prerequisite for the MOSS Infrastructure Updates of course.

Instructions are here: http://blogs.msdn.com/sharepoint/archive/2008/07/15/announcing-availability-of-infrastructure-updates.aspx

I first backed up my content databases, just in case.

Then I ran the installer that I downloaded from Infrastructure Update for Windows SharePoint Services 3.0 (KB951695).

Note that this was done in a development farm that had only one web front end.

This is what happened next:

clip_image002

The next screen says “Running update detection…” and then changes to “Installing update, please wait.”

clip_image004

Then

clip_image006

Could have canceled out here and ran this just after the MOSS Infrastructure Update is installed too.

clip_image008

image

Server names blotted out to protect the innocent...

clip_image012

clip_image014

Pay careful attention to the above instructions if you have multiple Web Front Ends.

clip_image016

clip_image018

clip_image020

For the above screen, you see a whole bunch of statements flash by as it secures various files and other resources.

clip_image022

Here's another example of what it is securing.

 

clip_image024

clip_image026

clip_image028

clip_image030

Task 9 went so fast I couldn't capture it.

Final Screen

The End.

 

--Michael

That was weird... (Workflow development)

I was getting some strange behaviors when testing my workflow solution.  This is the third version (but I am calling it v2) of a workflow solution that I had written.  The previous version was just a bugfix release (v1.2) to the original (v1.0).  The particular workflow task that was acting strangely had a few of its own fields.  In each version of the workflow, I gave each field a unique name.  For example, in my task item there is Field X (not it's real name, but bear with me) that holds information that I am copying from the request list item (the list item that triggered the workflow) .  in v1.2 of my workflow, I call this field Field X v1.2.  In v2 of this workflow, I call this field Field X v2.0.  In reality, the version numbers are in the format x.x.x.x, but I am simplifying so I don't have to type as much here.  I give each field its own unique ID and version number so that versions of the workflow are completely independent so that older versions can be uninstalled without fear of removing something used by a newer version.

Anyway, I use a PowerShell script to insert a list item into my request list, which starts the workflow.  A task is created, but it is populating Field X v1.2 instead of Field X v2.0.  WTF?  I check my code, and all my GUIDs are correct, and I am definitely working with the right (v2) field.  I try to step into the debugger by setting some breakpoints and attaching to all instances of W3WP, the WWW worker process.  It doesn't step in - I can step into my aspx pages that my tasks use, but I can't step into the workflow itself.  Strangely enough when I attach to a process, none of the W3P instances say they are workflow processes...but PowerShell does.  PowerShell's not doing workflow, MOSS is.  WTF?  Also, even after my tasks complete, my workflows don't.

Note that at this point, I have been using my PowerShell script rather than the browser to create all my test data.  This is a PowerShell session that I have had running for days.  I don't want to exit it because I am using its command history. 

Later, I do try to attach to the PowerShell process.  It gives me an error, but attaches.  Now I can step into the workflow.  That's unexpected, but helpful.  It now tells me that I have an exception due to a null object in a line where the Watch window tells me it's not null.  WTF?

Eventually, I try creating a list item in my request list first in my PowerShell window and then another in the Browser.  To my surprise, the tasks resulting from the request item I created in the Browser are working just right - writing to Field X v2.0 as I expect.  The tasks resulting from the request item I created in PowerShell are writing to the old field, Field X V1.2. WTF?

I can only surmise that the PowerShell session has an in-memory copy of my site and is running an older build of my workflow.  When I exit my PowerShell session and start a new PowerShell window, things start working as expected.  I determine that I need to exit and restart my PowerShell window every time I do a build.  When I use PowerShell to insert test data into a list, the PowerShell process owns the workflow rather than the W3WP process, so that I need to attach to both of them when I am doing debugging.

--Michael

PowerShell Building Blocks for SharePoint

I've just created a new CodePlex project, PowerShell Building Blocks for SharePoint ("PSBB" for short).  http://www.codeplex.com/PSBB .  This project serves to make widely available a set of PowerShell functions that let you work with SharePoint objects.  This initial release includes 14 PowerShell functions:

image

Enjoy.

These do depend on Zach R's Get-SPWeb function that you can get at  Post.aspx-List=90bbfd11-c9a5-45cf-a77e-19559aae81ae&ID=7.

--Michael

RedDevNews.com Article on SharePoint

I was reading the July 1st, 2008 issue of Redmond Developer News, and it had a front page article on SharePoint. http://reddevnews.com/features/article.aspx?editorialsid=2524.

Key points you may already be familiar with:

  1. The quantity of MOSS deployments are skyrocketing.
  2. The Visual Studio development experience leaves something to be desired.  In particular with developing Application Pages since you have to develop these as class library projects...
  3. Not that many people have deep experience with MOSS.  Certainly the combination of deep and broad is rare - otherwise every MOSS MVP would know the same things, for example.  Your best place to find people that have successfully implemented solid business solutions on MOSS is (IMHO) in the Microsoft Gold Partner community.  I'd personally recommend Magenic.
  4. Michael Desmond, the article author, provides 5 "best practice" points. http://reddevnews.com/listings/list.aspx?id=430
    1. Take the long view.
      1. My commentary: Sure, whenever project funding permits.
    2. Commit to skills building.
      1. My commentary: Of course.  There are lots of good resources available, including Ted Pattison's book, blogs, Microsoft E-Learning courses, webcasts, etc.
    3. Avoid Web.config with SharePoint Farms.
      1. My commentary: For the most part, I agree.  I don't like putting web.config settings in a web.config file that is not for the exclusive use of my application.  Also, making changes here would mean a brief service interruption while the application pool or IIS restart so that you can be sure that the web.config is reread.
      2. My commentary, continued:Alternatives include creating a SharePoint list that has two columns, Name (or Title) and Value. You can then have your SharePoint application query that list to get the configuration information.  Advantage there is that your configuration values list, like any SharePoint list, is easy to access, update, and secure.
    4. Keep and eye on CodePlex.
      1. My commentary:Always a good idea.  Although once you've taken the time to get a working development process together, switching to someone else's development tools can be uninviting.  But it's  a good place to check to see if there is already stuff out there to solve the business problem that you are trying to solve.
    5. Go to the Source.
      1. My commentary:  Of course, you need to be able to recognize "good" code when you see it, which means you are an experienced developer anyway.  I'd trust Microsoft authored code, either that you see via Reflector or via CodePlex before I would trust anyone else's code.  Consider using code quality tools and developer peer code reviews to assess code quality.

--Michael

Yet More PowerShell Scripts for MOSS

I've just started the next version of a workflow solution I am building for a client, and took the time to automate my build and deployment process a bit more.  To this end, I wrote the following PowerShell functions that you can use (as-is, no warranties, etc, etc, blah, blah, blah.)

  1. Clear-Alerts-From-SPWeb -URL <URL>
    • Removes all alerts from a site.  Useful for example if you restore a backup of a production site collection to your dev environment, and you don't want real end users getting alerts from your dev site.
  2. Clear-SPList -ListName <name of list> -URL <URL of parent web>
    • I have a list that I fill with sample data when I do my unit testing, and when I am ready to do another round of testing, this gives me a very quick way to delete all items from the list.  I suppose that makes it a bit dangerous.
  3. Delete-ContentType -ContentTypeName <name> -ListName <name of list> -URL <URL of parent web>
    • Deletes a content type from a list.  Since my deployment package includes three content types, my deployment process deletes the columns added by the content types, deletes the content types from the list, deactivates and removes the feature that defined them, then deploys and activates the new build of the same.
  4. Delete-SPField -FieldName <field name> -ListName <name of list> -URL <URL of parent web>
    • Deletes a column from a list.  Since adding a content type with new fields adds those fields to the list, but the fields don't disappear when you remove the content type, I use this function to remove them.
  5. Add-ContentType-To-List -ContentTypeName <name> -ListName <name of list> -URL <URL of parent web>

 

All of these rely on the Get-SPWeb function from Zach Rosenfield.

 

--Michael

Should Develop MOSS Workflow solutions in a 32 bit environment

I'd been working in a 32 bit VM until a recent hard drive crash.  Now I'm working in a 64 bit VM, and have found some interesting things about the difference between 32 bit and 64 bit development for MOSS Workflow.

If you try creating a new Sequential Workflow in VS2008 in a 64 bit VM, you get two errors.

The first exception message is: "Object reference not set to an instance of an object". The second message is: "SharePoint site location entered is not valid. The SharePoint site at http://<serverpath> could not be found. Verify that you have typed the URL correctly".

These are actually documented in the VS2008 Readme.

You can get past the initial exception, but not the error about you not specifying a valid site for workflow development. The trouble is that that second behavior – VS not recognizing a site as valid – can also show up in a 32 bit environment – if your site does not have certain lists and if you site is not a root site of the site collection, I think.

Also, if you have a MOSS WF project that you created in a 32 bit environment, you can open it in 64 bit environment, and it will bypass those errors, but you have to provide copies of the 32 bit dll’s so you can reference them so you can compile.  That is, you need to copy a handful of MOSS DLLs out of the GAC or the ISAPI directory in the 12 Hive from a 32 bit environment and paste them into a folder in your 64 bit VM, so you can then go and add references to them in VS2008.  If you have references to 64 bit SharePoint DLLs and not 32 bit ones, you will not be able to compile.

Because of this, although the recommendation is to use 64 bit servers for your production environments, I would suggest using a 32 bit VM for MOSS workflow development.  You can develop on a 32bit environment and deploy to a 64 bit environment.  I've done it without a problem.

Michael

Removing a custom Content Type

One of the things I have discovered recently is that when you add a custom content type to a list, any column definitions that are referenced are copied into the list.  To say that another way, if I add MyCustomContentType to a Tasks list, and the definition of MyCustomContentType includes three custom field references (references to site columns), then those columns are added to the Tasks list.  However, when I go to remove the content type, the fields do not disappear when you remove the content type.  You must remove each added column in addition to removing the content type.  Failure to remove the columns when you remove and deactivate the content type leads to messages in the ULS log such as "Unable to locate the xml-definition for FieldName with FieldId 'f73ba117-6303-46d2-bebc-a9dc9d1b478c' ". 

Also, if you remove the feature that implements your content type, but don't remove your content type from the list you've added it to, you will get a similar message "Unable to locate the xml-definition for ContentType with ContentTypeId '<your guid here>' (approximately).

One sign that you may have lingering references to content types, workflows, and site columns is when you deploy your WSP and it says the deployment was successful but it couldn't clean up.  Sometimes using the -force flag with the stsadm commands that permit it can help this.

--Michael

1 - 10 Next

 Recommended Books

Recommended SharePoint Books
SharePoint Connections Fall 2008

 ‭(Hidden)‬ Admin Links