<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Alex Sarafian as Developer &#187; WWF</title>
	<atom:link href="http://sarafianalex.wordpress.com/category/net-c/wwf/feed/" rel="self" type="application/rss+xml" />
	<link>http://sarafianalex.wordpress.com</link>
	<description>Adventures in C# Land and some SQL</description>
	<lastBuildDate>Fri, 04 Sep 2009 11:27:50 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='sarafianalex.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/ea38bb69738d229a89ab00b82aad64b7?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Alex Sarafian as Developer &#187; WWF</title>
		<link>http://sarafianalex.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sarafianalex.wordpress.com/osd.xml" title="Alex Sarafian as Developer" />
		<item>
		<title>Persisted Worklow won&#8217;t resume</title>
		<link>http://sarafianalex.wordpress.com/2009/02/02/persisted-worklow-wont-resume/</link>
		<comments>http://sarafianalex.wordpress.com/2009/02/02/persisted-worklow-wont-resume/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 08:29:40 +0000</pubDate>
		<dc:creator>Sarafian Alex</dc:creator>
				<category><![CDATA[.NET C#]]></category>
		<category><![CDATA[WWF]]></category>

		<guid isPermaLink="false">http://sarafianalex.wordpress.com/2009/02/02/persisted-worklow-wont-resume/</guid>
		<description><![CDATA[Lately I have been assigned to work with the Windows Workflow Foundation.
My feelings about it are mixed. There was a bug, that hold me for one day and I want to share with you, a troubleshooting technique that helped me.
First of all, out runtime service need to be persisted. In order to test persistance with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarafianalex.wordpress.com&blog=2367780&post=60&subd=sarafianalex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p align="justify">Lately I have been assigned to work with the Windows Workflow Foundation.</p>
<p align="justify">My feelings about it are mixed. There was a bug, that hold me for one day and I want to share with you, a troubleshooting technique that helped me.</p>
<p align="justify">First of all, out runtime service need to be persisted. In order to test persistance with Workflow out of the box activities, just create a while (true) activitiy with a seqeunce activity with a delay and something that can be debugged. I have create a Debug Activity.</p>
<p align="justify">The runtime is initialized with an sql persistance service like this </p>
<pre class="code"><span style="color:#2b91af;">NameValueCollection </span>persistenceParams = <span style="color:blue;">new </span><span style="color:#2b91af;">NameValueCollection</span>();
persistenceParams.Add(<span style="color:#a31515;">&quot;ConnectionString&quot;</span>, ConnectionString);
persistenceParams.Add(<span style="color:#a31515;">&quot;UnloadOnIdle&quot;</span>, <span style="color:#2b91af;">Convert</span>.ToString(<span style="color:blue;">true</span>));
persistenceParams.Add(<span style="color:#a31515;">&quot;LoadIntervalSeconds&quot;</span>, <span style="color:#a31515;">&quot;5&quot;</span>);

<span style="color:blue;">this</span>.runtime.AddService(<span style="color:blue;">new </span><span style="color:#2b91af;">SqlWorkflowPersistenceService</span>(persistenceParams));</pre>
<pre class="code">Every time a delay or a timer is reached because of UnloadOnIdle, it will be persisted.</pre>
<pre class="code">My problem was that the workflow never resumed although, the entries in the database were correct.</pre>
<pre class="code">I monitored its flow, by capturing these events</pre>
<ul>
<li>
<pre class="code">WorkflowIdled</pre>
</li>
<li>
<pre class="code">WorkflowSuspended</pre>
</li>
<li>
<pre class="code">WorkflowUnloaded</pre>
</li>
<li>
<pre class="code">WorkflowPersisted</pre>
</li>
<li>
<pre class="code">WorkflowLoaded</pre>
</li>
</ul>
<p>But WorkflowLoaded never came through. The reason I know it should was because I was actually refactoring I knew the sequence of events that would be fired.</p>
<p>Finally, and after some time I decided to capture ServicesExceptionNotHandled event. It turns out that although you may have declared to capture all exceptions form Visual Studio (Ctrl+Alt+E), if you do not capture that event you will never know what’s wrong.</p>
<p>The event provides a <span style="color:#2b91af;">ServicesExceptionNotHandledEventArgs </span>that basically holds the exception of what wen’t wrong.</p>
<p>In my case the problem was with serialization. The actual problem I will discuss in my next <a href="http://sarafianalex.wordpress.com/2009/02/02/serializing/">post</a>.</p>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p><a href="http://11011.net/software/vspaste">&#160;</a></p>
Posted in .NET C#, WWF  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sarafianalex.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sarafianalex.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sarafianalex.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sarafianalex.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sarafianalex.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sarafianalex.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sarafianalex.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sarafianalex.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sarafianalex.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sarafianalex.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sarafianalex.wordpress.com&blog=2367780&post=60&subd=sarafianalex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://sarafianalex.wordpress.com/2009/02/02/persisted-worklow-wont-resume/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/64f00567ef7dda3ec36dcf0e01043d11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sarafian</media:title>
		</media:content>
	</item>
	</channel>
</rss>