<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.dotnetmafia.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Corey Roth [MVP] : Workflow</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Workflow/default.aspx</link><description>Tags: Workflow</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>What you need to know about copying workflows with Metalogix Migration Manager for SharePoint</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2012/07/19/what-you-need-to-know-about-copying-workflows-with-metalogix-migration-manager-for-sharepoint.aspx</link><pubDate>Fri, 20 Jul 2012 00:39:32 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:5781</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=5781</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2012/07/19/what-you-need-to-know-about-copying-workflows-with-metalogix-migration-manager-for-sharepoint.aspx#comments</comments><description>&lt;p&gt;I was recently doing a SharePoint migration project and one of the tasks I was trying to do was copy SharePoint designer workflows (plus history) to a new SharePoint server.&amp;#160; We weren’t doing a database attach in this case because we were significantly restructuring the site.&amp;#160; When version 5 of Metalogix Migration Manager for SharePoint announced this functionality, I was excited to try it out.&amp;#160; The tool can in fact copy these workflows but there are a lot of asterisks.&amp;#160; These are the things you don’t know until after you try it and have opened up a support case. :)&amp;#160; If you are thinking about migrating workflows in this manner, this post may be of some help to you.&lt;/p&gt;  &lt;p&gt;There are a few things you need to know about migrating workflows:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;You can only copy workflows if you are doing a Full Site migration (no incremental or anything like that).&lt;/li&gt;    &lt;li&gt;You need to activate the SharePoint 2007 Workflows feature on the target site collection.&lt;/li&gt;    &lt;li&gt;Migrated workflow instances cannot be completed.&lt;/li&gt;    &lt;li&gt;You must set the &lt;strong&gt;EnableDBWriting&lt;/strong&gt; element to true in &lt;em&gt;EnvironmentSettings.xml &lt;/em&gt;located at &lt;em&gt;%APPDATA%\Metalogix Software Corp\Migration Manager for SharePoint&lt;/em&gt;.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You probably just read that last bullet point thinking “Is that doing what I think it is?”&amp;#160; The answer is “Yes”.&amp;#160; You can only check the copy workflow instances settings in the Migration Manager if you have this value enabled.&amp;#160; What does it do?&amp;#160; It writes directly to the content database.&amp;#160; Should red flags be going up?&amp;#160; Probably, but when your client is screaming at you to get those workflows migrated at all cost, the option looks better and better.&amp;#160; However, if you have an issue down the road and Microsoft support find out about it, they may be less inclined to help you.&amp;#160; Does it work?&amp;#160; Maybe.&amp;#160; In my tests, I have found that it in fact does successfully attach the workflow to the list or content type you migrated.&amp;#160; However, the running instances count shows as zero.&amp;#160; I am not sure if this is part of the issue with the workflow instances not being able to be completed or it is a bug.&lt;/p&gt;  &lt;p&gt;To actually copy workflows, close migration manager and go edit the &lt;em&gt;EnvironmentSettings.xml &lt;/em&gt;file.&amp;#160; Once you set the EnableDBWriting flag, re-open Migration Manager.&amp;#160; Pick the site you want to copy and use the Copy Site command.&amp;#160; Then use the Paste Site command at the destination.&amp;#160; On the workflow tab, you will see a new section that is no longer disabled.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/MetalogixCopyWorkflow_386607F5.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="MetalogixCopyWorkflow" border="0" alt="MetalogixCopyWorkflow" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/MetalogixCopyWorkflow_thumb_6B55985C.png" width="527" height="402" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You’ll want to check the Preserve checkboxes for List scope or Content type scope depending on where your workflow is.&amp;#160; Then you will want to check the &lt;em&gt;Preserve workflow instance data &lt;/em&gt;checkbox along with &lt;em&gt;Preserve running workflow instance statuses&lt;/em&gt;.&amp;#160; Run the job and when the site is create with luck your workflows will be there.&lt;/p&gt;  &lt;p&gt;I’ll continue testing this as I have time.&amp;#160; If you try it out, let me know how it works for you.&lt;/p&gt;  &lt;p&gt;Follow me on twitter: &lt;a href="http://twitter.com/coreyroth"&gt;@coreyroth&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=5781" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Workflow/default.aspx">Workflow</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint+2010/default.aspx">SharePoint 2010</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Metalogix+Migration+Manager/default.aspx">Metalogix Migration Manager</category></item><item><title>Using LINQ to XML to access the data of a form saved to a form library in a workflow</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/05/06/using-linq-to-xml-to-access-the-data-of-a-form-saved-to-a-form-library-in-a-workflow.aspx</link><pubDate>Wed, 06 May 2009 21:40:37 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:900</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=900</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/05/06/using-linq-to-xml-to-access-the-data-of-a-form-saved-to-a-form-library-in-a-workflow.aspx#comments</comments><description>&lt;p&gt;As I have mention in the past LINQ to XML is a great way to manipulate the XML data out of an &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/04/29/code-samples-from-my-short-talk-about-linq-to-xml.aspx"&gt;InfoPath form&lt;/a&gt;.&amp;#160; I thought I would show how you can also use the same technique to work with the data of a form saved to a form library which launches a workflow (although you could apply this technique to the association or task forms as well).&amp;#160; The first thing we need to do is get the XML of the InfoPath initiation form, before we can work with it.&lt;/p&gt;  &lt;p&gt;For the purpose of my example, my OnWorkflowActivated activity writes to a public SPWorkflowActivationProperties property called &lt;em&gt;workflowProperties&lt;/em&gt;.&amp;#160; In my Invoked event handling method of my OnWorkflowActivated activity, we use the Item object on my workflowProperties to open the file and get the XML.&amp;#160; You can then use the File object along with OpenBinary() to get the raw bytes of the XML.&lt;/p&gt;  &lt;div style="font-family:consolas;background:black;color:white;font-size:13pt;font-weight:bold;"&gt;   &lt;p style="margin:0px;"&gt;&lt;span style="color:#cc7832;"&gt;byte&lt;/span&gt;[] xmlBytes = workflowProperties.Item.File.OpenBinary();&lt;/p&gt; &lt;/div&gt;   &lt;p&gt;You can then takes those bytes and read them into a regular string.&lt;/p&gt;  &lt;div style="font-family:consolas;background:black;color:white;font-size:13pt;font-weight:bold;"&gt;   &lt;p style="margin:0px;"&gt;&lt;span style="color:#cc7832;"&gt;string&lt;/span&gt; xmlString = System.Text.&lt;span style="color:#ffc66d;"&gt;Encoding&lt;/span&gt;&lt;span style="font-weight:normal;"&gt;.UTF8.GetString(xmlBytes);&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:#cc7832;"&gt;if&lt;/span&gt; (xmlString[&lt;span style="color:#6897bb;"&gt;0&lt;/span&gt;] == (&lt;span style="color:#cc7832;"&gt;char&lt;/span&gt;)&lt;span style="color:#6897bb;"&gt;0xfeff&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; xmlString = xmlString.Substring(&lt;span style="color:#6897bb;"&gt;1&lt;/span&gt;);&lt;/p&gt; &lt;/div&gt;   &lt;p&gt;If you are curious about the 0xfeff business that is used to deal with the byte-order mark character in Unicode.&amp;#160; I picked up this trick from another post somewhere, but I can’t remember where currently.&amp;#160; &lt;/p&gt;  &lt;p&gt;Now we need to get the XML string into an XDocument class so that we can query it and manipulate it.&amp;#160; Since we have a string, we will need to create a StringReader to read it.&lt;/p&gt;  &lt;div style="font-family:consolas;background:black;color:white;font-size:13pt;font-weight:bold;"&gt;   &lt;p style="margin:0px;"&gt;&lt;span style="color:#ffc66d;"&gt;XDocument&lt;/span&gt; documentsXml = &lt;span style="color:#ffc66d;"&gt;XDocument&lt;/span&gt;&lt;span style="font-weight:normal;"&gt;.Load(&lt;/span&gt;&lt;span style="color:#cc7832;"&gt;new&lt;/span&gt; System.IO.&lt;span style="color:#ffc66d;"&gt;StringReader&lt;/span&gt;(xmlString));&lt;/p&gt; &lt;/div&gt;   &lt;p&gt;If you wanted to work with the Association form instead of the form that started the workflow, you would use a line like the following.&amp;#160; The &lt;em&gt;InitiationData&lt;/em&gt; property of the SPWorkflowActivationProperties object provides XML that can be loaded into the XDocument class.&lt;/p&gt;  &lt;div style="font-family:consolas;background:black;color:white;font-size:13pt;font-weight:bold;"&gt;   &lt;p style="margin:0px;"&gt;&lt;span style="color:#ffc66d;"&gt;XDocument&lt;/span&gt; documentsXml = &lt;span style="color:#ffc66d;"&gt;XDocument&lt;/span&gt;&lt;span style="font-weight:normal;"&gt;.Load(workflowProperties.InitiationData);&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt; InfoPath documents always have a &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/08/29/using-a-namespace-with-linq-to-xml.aspx"&gt;namespace&lt;/a&gt; defined for my so we need to use the XNamespace object for any future references inside the InfoPath form.&lt;/p&gt;  &lt;div style="font-family:consolas;background:black;color:white;font-size:13pt;font-weight:bold;"&gt;   &lt;p style="margin:0px;"&gt;&lt;span style="color:#ffc66d;"&gt;XNamespace&lt;/span&gt; documentNamespace = &lt;span style="color:#a5c25c;"&gt;&amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2098-05-03T16:48:38&amp;quot;&lt;/span&gt;;&lt;/p&gt; &lt;/div&gt;   &lt;p&gt;At this point you can start using LINQ to XML to get the data you need out of the InfoPath form.&amp;#160; For example, if I had a field called &lt;em&gt;my:FirstName &lt;/em&gt;at the root of the document.&amp;#160; I could use something like the following to get the value.&lt;/p&gt;  &lt;div style="font-family:consolas;background:black;color:white;font-size:13pt;font-weight:bold;"&gt;   &lt;p style="margin:0px;"&gt;&lt;span style="color:#cc7832;"&gt;string&lt;/span&gt; firstName = documentsXml.Root.Element(documentNamespace + &lt;span style="color:#a5c25c;"&gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;).Value;&lt;/p&gt; &lt;/div&gt;   &lt;p&gt;If you are working with other data types, you can always cast it like this.&lt;/p&gt;  &lt;div style="font-family:consolas;background:black;color:white;font-size:13pt;font-weight:bold;"&gt;   &lt;p style="margin:0px;"&gt;&lt;span style="color:#cc7832;"&gt;int&lt;/span&gt; customerId = &lt;span style="color:#cc7832;"&gt;int&lt;/span&gt;&lt;span style="font-weight:normal;"&gt;.Parse(documentsXml.Root.Element(documentNamespace + &lt;/span&gt;&lt;span style="color:#a5c25c;"&gt;&amp;quot;CustomerId&amp;quot;&lt;/span&gt;).Value);&lt;/p&gt; &lt;/div&gt;   &lt;p&gt;In my &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/04/29/code-samples-from-my-short-talk-about-linq-to-xml.aspx"&gt;example&lt;/a&gt; from last week, you saw how you could use LINQ to XML to iterate through a repeating table.&amp;#160; As another example to iterate through a repeating table called &lt;em&gt;Items&lt;/em&gt; with an element of &lt;em&gt;Item&lt;/em&gt;, you could do something like the following:&lt;/p&gt;  &lt;div style="font-family:consolas;background:black;color:white;font-size:13pt;font-weight:bold;"&gt;   &lt;p style="margin:0px;"&gt;&lt;span style="color:#cc7832;"&gt;var&lt;/span&gt; items = &lt;span style="color:#cc7832;"&gt;from&lt;/span&gt; item &lt;span style="color:#cc7832;"&gt;in&lt;/span&gt; documentsXml.Root.Element(&lt;span style="color:#a5c25c;"&gt;&amp;quot;Items&amp;quot;&lt;/span&gt;).Elements(&lt;span style="color:#a5c25c;"&gt;&amp;quot;Item&amp;quot;&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#cc7832;"&gt;select&lt;/span&gt; item;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:#cc7832;"&gt;foreach&lt;/span&gt; (&lt;span style="color:#cc7832;"&gt;var&lt;/span&gt; item &lt;span style="color:#cc7832;"&gt;in&lt;/span&gt; items)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;{&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#ffc66d;"&gt;Console&lt;/span&gt;&lt;span style="font-weight:normal;"&gt;.WriteLine(item.Element(&lt;/span&gt;&lt;span style="color:#a5c25c;"&gt;&amp;quot;Field1&amp;quot;&lt;/span&gt;).Value);&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#ffc66d;"&gt;Console&lt;/span&gt;&lt;span style="font-weight:normal;"&gt;.WriteLine(item.Element(&lt;/span&gt;&lt;span style="color:#a5c25c;"&gt;&amp;quot;Field2&amp;quot;&lt;/span&gt;).Value);&lt;/p&gt;    &lt;p style="margin:0px;"&gt;}&lt;/p&gt; &lt;/div&gt;   &lt;p&gt;In this case, I use LINQ to return an IEnumberable&amp;lt;XElement&amp;gt; representing each repeating item.&amp;#160; I can then use this in a foreach loop to print out the results.&amp;#160; Yes I know you wouldn’t use Console.Writeline in a workflow, but you get the point here.&amp;#160; LINQ to XML really offers a lot of flexibility to manipulate the XML data inside a form.&amp;#160; Hopefully, it will make your experience with InfoPath and workflow a better one.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=900" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/LINQ+to+XML/default.aspx">LINQ to XML</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/InfoPath/default.aspx">InfoPath</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Workflow/default.aspx">Workflow</category></item><item><title>Handling ShortTerm CheckOut Locks in your Records Center Workflow</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/01/29/handling-shortterm-checkout-locks-in-your-records-center-workflow.aspx</link><pubDate>Thu, 29 Jan 2009 20:39:20 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:830</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=830</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/01/29/handling-shortterm-checkout-locks-in-your-records-center-workflow.aspx#comments</comments><description>&lt;p&gt;The other day, I posted about how to write a simple workflow to copy files to the records center whenever they were created or modified.&amp;nbsp; Well the workflow I provided worked in all of the following cases.&lt;/p&gt; &lt;ul&gt; &lt;li class="MsoNormal" style="margin:0in 0in 0pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Tahoma&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;Add new item&lt;/span&gt;&lt;/li&gt; &lt;li class="MsoNormal" style="margin:0in 0in 0pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Tahoma&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;Upload Item&lt;/span&gt;&lt;/li&gt; &lt;li class="MsoNormal" style="margin:0in 0in 0pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Tahoma&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;Upload new version to existing item&lt;/span&gt;&lt;/li&gt; &lt;li class="MsoNormal" style="margin:0in 0in 0pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Tahoma&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;manual check out then check back in (with no changes to the doc.)&lt;/span&gt;&lt;/li&gt; &lt;li class="MsoNormal" style="margin:0in 0in 0pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:&amp;#39;Tahoma&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;Edit document properties (When checkout required is set on the library)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Of course there was one place that I found that it doesn&amp;#39;t work.&amp;nbsp; It is when you use the New Document button or edit an existing document directly with Office 2007.&amp;nbsp; The reason for this is that when you have a document open with Office, it creates a Short Term Check Out for the period of an hour.&amp;nbsp; It also continues to reestablish the lock until you close the Office application (i.e.: Microsoft Word).&amp;nbsp; Records Center will not accept any document that is currently checked out.&amp;nbsp; This presented an interesting challenge on how to deal with this.&amp;nbsp; The first thing I tried was adding code to check in the file (i.e.: SPFile.CheckIn).&amp;nbsp; This method does not work when the CheckOutType is &lt;em&gt;ShortTerm&lt;/em&gt;.&lt;/p&gt; &lt;p&gt;I tried an ItemEventReceiver to see if closing Office would trigger the ItemCheckedIn event, but it in fact does not.&amp;nbsp; This means I can&amp;#39;t handle this scenario that way either.&amp;nbsp; So what I came up with was a hack, but it does in fact get the job done (provided the user eventually closes the Office application).&amp;nbsp; Here is what it looks like.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/WindowsLiveWriter/HandlingShortTermCheckOutLocksinyourReco_CA86/RecordsCenterWorkflow2_2.jpg"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="286" alt="RecordsCenterWorkflow2" src="http://www.dotnetmafia.com/blogs/dotnettipoftheday/WindowsLiveWriter/HandlingShortTermCheckOutLocksinyourReco_CA86/RecordsCenterWorkflow2_thumb.jpg" width="170" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;I did say hack, didn&amp;#39;t I?&amp;nbsp; That&amp;#39;s exactly what it is.&amp;nbsp; The While activity contains the following code condition.&amp;nbsp; All it does it execute the contents of the while activity as long as the &lt;em&gt;CheckOutStatus&lt;/em&gt; is set to &lt;em&gt;ShortTerm&lt;/em&gt; (meaning the user still has Microsoft Word open).&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; IsShortTermCheckedOut(&lt;span style="color:blue;"&gt;object&lt;/span&gt; sender, ConditionalEventArgs e)&lt;/p&gt; &lt;p style="margin:0px;"&gt;{&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.Result = (workflowProperties.Item.File.CheckOutStatus == SPFile.SPCheckOutStatus.ShortTerm);&lt;/p&gt; &lt;p style="margin:0px;"&gt;}&lt;/p&gt;&lt;/div&gt; &lt;p&gt;As you can see there is a Delay activity in there.&amp;nbsp; These actually seem to work now, but you do need to be sure that you have the latest version of the .NET Framework installed as well as all updates applied to SharePoint.&amp;nbsp; Otherwise there is a good chance that your workflow will never wake back up.&amp;nbsp; I have the delay set to 15 minutes.&amp;nbsp; This is because the workflow timer job runs every 15 minutes (by default).&lt;/p&gt; &lt;p&gt;Other than that the code is all the same from the previous post.&amp;nbsp; I&amp;#39;ve ran it through several tests and it seems to work for me.&amp;nbsp; I&amp;#39;d like to think there is a better way to handle this, but I can&amp;#39;t think of anything right now.&amp;nbsp; You might consider adding code to the while activity so that it eventually terminates if the user never closes Office, but that is up to you.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=830" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Workflow/default.aspx">Workflow</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Records+Center/default.aspx">Records Center</category></item><item><title>Workflow doesn't start when accessing SharePoint site via IP address</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/01/29/workflow-doesn-t-start-when-accessing-sharepoint-site-via-ip-address.aspx</link><pubDate>Thu, 29 Jan 2009 18:40:00 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:829</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=829</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/01/29/workflow-doesn-t-start-when-accessing-sharepoint-site-via-ip-address.aspx#comments</comments><description>&lt;p&gt;Now, I have always known there are some oddities when accessing a SharePoint server by IP and as a practice I tend to avoid it.&amp;nbsp; I am sure the issue I am about to describe relates to alternate access paths in some way, but I thought I would tell people about it in case someone else runs into it.&amp;nbsp; The scenario I have is quite simple.&amp;nbsp; I have a custom workflow attached to a document library that executes whenever a file is created or modified.&amp;nbsp; What I discovered was that when I was accessing the site on my virtual machine by name, the workflow was executing.&amp;nbsp; When I tried to reach it from the host machine by IP address, it did not execute.&amp;nbsp; It didn&amp;#39;t give an error or anything.&amp;nbsp; It simply did not start.&amp;nbsp; The reason I was accessing by IP to begin with is because the server name wasn&amp;#39;t resolving on my host machine and I was being too lazy to fix it.&amp;nbsp; Next time, I won&amp;#39;t make this mistake.&amp;nbsp; Workflows will not automatically start when you specify the server by IP address in your browser.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=829" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Workflow/default.aspx">Workflow</category></item><item><title>InfoPath Task Form: An error occurred accessing a data source.</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/12/15/infopath-task-form-an-error-occurred-accessing-a-data-source.aspx</link><pubDate>Mon, 15 Dec 2008 18:18:45 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:804</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=804</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/12/15/infopath-task-form-an-error-occurred-accessing-a-data-source.aspx#comments</comments><description>&lt;p&gt;After building a workflow recently, I noticed I was getting the following error whenever I opened the task form.&lt;/p&gt; &lt;p&gt;&lt;em&gt;An error occurred accessing a data source.&lt;/em&gt; &lt;p&gt;I have seen the error in the past when trying to connect to an external web service when it was down, but this form was much simpler than that.&amp;nbsp; The only data source it had was ItemMetadata.xml.&amp;nbsp; The weird thing was everything on the form was working.&amp;nbsp; At this point, I decided to hit the LOGS folder and see if I could figure out what was going on.&amp;nbsp; The error wasn&amp;#39;t in there, but I found entries for my form along with an error stating that it could not read the ItemMetadata.xml file from the file system. &lt;p&gt;At this point, the answer was obvious to me.&amp;nbsp; When I configured the secondary datasource, I somehow didn&amp;#39;t set the option &lt;em&gt;&amp;quot;Include this file as a resource in the form template or template part&amp;quot;&lt;/em&gt;.&amp;nbsp; I selected this option, republished my form, and then reinstalled the workflow.&amp;nbsp; To no surprise, I saw that the error went away.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=804" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/InfoPath/default.aspx">InfoPath</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Workflow/default.aspx">Workflow</category></item></channel></rss>