<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>.net ready !!! : WF</title><link>http://blogs.msdn.com/maximelamure/archive/tags/WF/default.aspx</link><description>Tags: WF</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Introduction to WF 3.5 / Mettez vous &amp;#224; table avec Workflow Foundation 3.5</title><link>http://blogs.msdn.com/maximelamure/archive/2008/06/29/introduction-to-wf-3-5-mettez-vous-table-avec-workflow-foundation-3-5.aspx</link><pubDate>Sun, 29 Jun 2008 19:51:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8667828</guid><dc:creator>Maxime LAMURE</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/maximelamure/comments/8667828.aspx</comments><wfw:commentRss>http://blogs.msdn.com/maximelamure/commentrss.aspx?PostID=8667828</wfw:commentRss><wfw:comment>http://blogs.msdn.com/maximelamure/rsscomments.aspx?PostID=8667828</wfw:comment><description>&lt;p&gt;&lt;font color="#0000a0"&gt;[English]&lt;/font&gt;  &lt;p&gt;&lt;font color="#0000a0"&gt;The new version of the .net framework (3.5) brings new features: C# 3, VB9, LINQ, extension methods etc. In WF, the main evolution comes with the integration of WCF (Windows Communication Foundation). It means:&lt;/font&gt;  &lt;ul&gt; &lt;li&gt;&lt;font color="#0000a0"&gt;Specific controls to call or export workflow activities in WCF&lt;/font&gt;  &lt;li&gt;&lt;font color="#0000a0"&gt;New hosting library &lt;/font&gt; &lt;li&gt;&lt;font color="#0000a0"&gt;New WF templates in VS 2008&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;font color="#0000a0"&gt;In this article (in French), I am explaining new WF functionalities in .net 3.5. I am illustrating that in implementing a service of recipes to generate chocolate cake’s one.&lt;/font&gt; &lt;/p&gt; &lt;p&gt;[Français]  &lt;p&gt;La version 3.5 du .NET Framework apporte un grand nombre de nouveautés : C# 3, VB9, LINQ, méthodes d’extensions etc. Concernant WF, sa principale évolution tourne autour de l’intégration de WCF (Windows Communications Foundation). Cela se traduit par :  &lt;ul&gt; &lt;li&gt;la présence de contrôles spécifiques pour exporter ou appeler un workflow en WCF,  &lt;li&gt;Une librairie de hosting (hébergement de workflow) spécifique,  &lt;li&gt;Des templates Visual Studio 2008.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;A travers cet article, nous allons étudier les nouvelles fonctionnalités de WF présentes dans la version 3.5 du Framework. Afin de les illustrer, nous mettrons en place un service de recette de cuisine générant celle du gâteau au chocolat.  &lt;p&gt;&amp;nbsp; &lt;iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 66px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-9c20abe60affc115.skydrive.live.com/embedrowdetail.aspx/Public/Programmez|_WF3|_5.doc" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8667828" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/maximelamure/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/maximelamure/archive/tags/WF/default.aspx">WF</category></item><item><title>WF: How to add your own task in the workflow runtime engine batching mechanism ?</title><link>http://blogs.msdn.com/maximelamure/archive/2007/06/22/how-to-add-your-own-task-in-the-workflow-runtime-engine-batching-mechanism.aspx</link><pubDate>Sat, 23 Jun 2007 00:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3468310</guid><dc:creator>Maxime LAMURE</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/maximelamure/comments/3468310.aspx</comments><wfw:commentRss>http://blogs.msdn.com/maximelamure/commentrss.aspx?PostID=3468310</wfw:commentRss><wfw:comment>http://blogs.msdn.com/maximelamure/rsscomments.aspx?PostID=3468310</wfw:comment><description>&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The goal of this post is to describe the mechanism to create and add your own service in the workflow runtime engine. 
&lt;P&gt;Situation: You would like that each time the SqlWorkflowPersistenceService is called by the workflow runtime, it call your own service, in a transactional scope (if your service or the persistence service failed, a rollback is apply). 
&lt;H5&gt;1: You have to create your service: &lt;/H5&gt;
&lt;P&gt;Create a class (in a separate project) wich implements IPendingWork. Add reference of this project in the host and workflow project.&lt;/P&gt;
&lt;P&gt;namespace TransactionalService&lt;BR&gt;{&lt;BR&gt;public class TransactionalService : IPendingWork&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp; void IPendingWork.Commit(System.Transactions.Transaction transaction, ICollection items)&lt;BR&gt;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (MyExternalDataEventArgs request in items)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(request.Commande.Nom);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; bool IPendingWork.MustCommit(ICollection items)&lt;BR&gt;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;&lt;BR&gt;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; void IPendingWork.Complete(bool succeeded, ICollection items)&lt;BR&gt;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(succeeded);&lt;BR&gt;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;}&lt;/P&gt;
&lt;H5&gt;2: Add your service in the workflowruntime&lt;/H5&gt;
&lt;P&gt;In your Host: 
&lt;P&gt;… &lt;BR&gt;workflowRuntime.AddService(new TransactionalService.TransactionalService());&lt;BR&gt;workflowRuntime.StartRuntime(); 
&lt;H5&gt;3: add your pending work items to the current work batch&lt;/H5&gt;
&lt;P&gt;In your Workflow:&lt;/P&gt;
&lt;P&gt;TransactionalService.TransactionalService service = new TransactionalService.TransactionalService(); //Or by the getService() 
&lt;P&gt;WorkflowEnvironment.WorkBatch.Add(service, MyArgs); 
&lt;P&gt;When the runtime engine batching will be executed, he will call all services which implements IPendingWork (SqlTrackingService, SqlWorkflowPersistenceService and you service):&lt;BR&gt;1: MustCommit (check if you want the method Commit will be called) ,&lt;BR&gt;2: if yes, he will call Commit method, &lt;BR&gt;3: The complete method allow us to know the state of the process. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3468310" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/maximelamure/archive/tags/.NET+/default.aspx">.NET </category><category domain="http://blogs.msdn.com/maximelamure/archive/tags/WF/default.aspx">WF</category></item></channel></rss>