<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>A.Bekiaris's .Net / XAF Blog</title><link>http://apobekiaris.blogspot.com/</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AbekiarisBlog" /><description>Download &lt;a href="http://expandframework.com/download.html"&gt;eXpand&lt;/a&gt;--&amp;gt;First Real World Open Source framework&lt;br&gt;&lt;a href="http://expandframework.com/contributors.html"&gt;How to support eXpand Framework&lt;/a&gt;&lt;br&gt;
eXpand is an open source extension framework for DevExpress eXpressApp Framework.&lt;br&gt; XAF and can be &lt;a href="https://www.devexpress.com/ClientCenter/Downloads"&gt;evaluated&lt;/a&gt; free of charge (30 day trial)&lt;br&gt;
&lt;b&gt;&lt;a href="http://www.expandframework.com"&gt;www.expandframework.com&lt;/a&gt;&lt;/b&gt;</description><language>en</language><managingEditor>noreply@blogger.com (Apostolis Bekiaris)</managingEditor><lastBuildDate>Fri, 03 Feb 2012 07:52:03 PST</lastBuildDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">143</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">25</openSearch:itemsPerPage><feedburner:info uri="abekiarisblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><itunes:explicit>no</itunes:explicit><itunes:subtitle>Download eXpand--&amp;gt;First Real World Open Source framework How to support eXpand Framework eXpand is an open source extension framework for DevExpress eXpressApp Framework. XAF and can be evaluated free of charge (30 day trial) www.expandframework.com</itunes:subtitle><itunes:summary>Download eXpand--&amp;gt;First Real World Open Source framework How to support eXpand Framework eXpand is an open source extension framework for DevExpress eXpressApp Framework. XAF and can be evaluated free of charge (30 day trial) www.expandframework.com</itunes:summary><feedburner:emailServiceId>AbekiarisBlog</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><title>January news</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/ZcxM6SqUkI0/january-news.html</link><category>Montly_News</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Mon, 30 Jan 2012 14:36:10 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-4197381947199591357</guid><description>&lt;p&gt;Friends asking me what are you doing man? I usually answer back: busy busy busy. They usually respond with a phrase like: Busy is good it means that you are doing great!&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Latest Collaborations&lt;/strong&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Our MSI package now installs VS New Project Item templates and sources. (Thanks to &lt;a href="http://www.mash2.com/" target="_blank"&gt;Dima Janzen&lt;/a&gt;!) &lt;/li&gt;    &lt;li&gt;Several bugs due to improved Security system support &lt;/li&gt;    &lt;li&gt;SqlDBmapper now support different database schemas (see also &lt;a href="http://goo.gl/qSj4B"&gt;http://goo.gl/qSj4B&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;DomainComponent support for &lt;a href="http://apobekiaris.blogspot.com/search/label/Logic" target="_blank"&gt;Logic Modules&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Bugs in the core modules (LinqCollectionSource, ChooseFromListCollectionEditor) (&lt;a href="http://goo.gl/dqMRG"&gt;http://goo.gl/dqMRG&lt;/a&gt;, &lt;a href="http://goo.gl/q2SFE"&gt;http://goo.gl/q2SFE&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;Middle Tier support for our new custom permissions for the improved security system (&lt;a href="http://goo.gl/k9Gh1"&gt;http://goo.gl/k9Gh1&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;New module release: DBMapper&lt;/strong&gt;  has the same functionality as &lt;a href="http://www.expandframework.com/#mapper" target="_blank"&gt;SqlDbMapper&lt;/a&gt; however is based on the powerful &lt;a href="http://www.devexpress.com/Products/NET/ORM/" target="_blank"&gt;XPO&lt;/a&gt;. Thus this module is capable of transforming into WorldCreator persistent classes the following list of databases: Access, &lt;a href="http://www.sybase.com/products/databasemanagement/advantagedatabaseserver" target="_blank"&gt;Advantage&lt;/a&gt;, &lt;a href="http://www.isug.com/Sybase_FAQ/ASA/index.html" target="_blank"&gt;Adaptive Server Anywhere&lt;/a&gt;, Ase, &lt;a href="http://www-01.ibm.com/software/data/db2/" target="_blank"&gt;DB2&lt;/a&gt;, &lt;a href="http://www.firebirdsql.org/" target="_blank"&gt;FireBird&lt;/a&gt;, &lt;a href="http://www.firebirdsql.org/" target="_blank"&gt;FireBirdSql&lt;/a&gt;, &lt;a href="http://www.microsoft.com/sqlserver/en/us/editions/compact.aspx" target="_blank"&gt;SqlServerCe&lt;/a&gt;, &lt;a href="http://www.microsoft.com/sqlserver/en/us/default.aspx" target="_blank"&gt;SqlServer&lt;/a&gt;, &lt;a href="http://www.oracle.com/technetwork/topics/dotnet/index-085163.html" target="_blank"&gt;ODP&lt;/a&gt;,      &lt;br /&gt;&lt;a href="http://www.oracle.com/index.html" target="_blank"&gt;Oracle&lt;/a&gt;, &lt;a href="http://www.pervasive.com/" target="_blank"&gt;PersasizeSql&lt;/a&gt;, &lt;a href="http://www.postgresql.org/" target="_blank"&gt;PostgreSql&lt;/a&gt;, &lt;a href="http://www.sqlite.org/" target="_blank"&gt;SQLite&lt;/a&gt;, &lt;a href="http://www.vistadb.net/" target="_blank"&gt;VistaDB&lt;/a&gt;          &lt;/li&gt; &lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-4197381947199591357?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AsF_i4LTMBFW5w_fiNIxqxcCMm0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AsF_i4LTMBFW5w_fiNIxqxcCMm0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AsF_i4LTMBFW5w_fiNIxqxcCMm0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AsF_i4LTMBFW5w_fiNIxqxcCMm0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/ZcxM6SqUkI0" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-31T00:36:10.445+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2012/01/january-news.html</feedburner:origLink></item><item><title>December news</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/umAIXbp6YsE/december-news.html</link><category>Montly_News</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Mon, 30 Jan 2012 13:18:11 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-841077709164559040</guid><description>&lt;p&gt;Although a bit outdated its better to publish it now than never. Your eXpand collaborations never stop, so it’s a shame to keep them secret from the rest of the community.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Latest Collaborations&lt;/strong&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Logic modules(&lt;a href="http://www.expandframework.com/#AVC" target="_blank"&gt;AdditionalViewControlsProvider&lt;/a&gt;, &lt;a href="http://www.expandframework.com/#masterdetail" target="_blank"&gt;MasterDetail&lt;/a&gt;, &lt;a href="http://www.expandframework.com/#conditionaldetailsviews" target="_blank"&gt;ConditionalDetailViews&lt;/a&gt;, &lt;a href="http://www.expandframework.com/#modelartifact" target="_blank"&gt;ModelArtifact&lt;/a&gt;) as well as &lt;a href="http://www.expandframework.com/#modeldifference" target="_blank"&gt;ModelDifference&lt;/a&gt;, &lt;a href="http://www.expandframework.com/#pivotchart" target="_blank"&gt;PivotChart&lt;/a&gt; were migrated to the new &lt;a href="http://www.devexpress.com/Products/NET/Application_Framework/" target="_blank"&gt;XAF&lt;/a&gt; security system. The new custom permissions are located under the Security.Improved namespace in each module. &lt;/li&gt;    &lt;li&gt;Out of the box support for support for CachedDataStoreService (see also &lt;a href="http://goo.gl/BtYxw"&gt;http://goo.gl/BtYxw&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;Minor bugs in MasterDetail, PivotChart, ExceptionHandling &lt;/li&gt;    &lt;li&gt;An eXpand based version of SecurityDemo solution added to our sources. &lt;/li&gt;    &lt;li&gt;AdditionalViewsControls now have better support for custom controls (see also &lt;a href="http://goo.gl/SyvOz"&gt;http://goo.gl/SyvOz&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;eXpand has build in support for &lt;a href="http://apobekiaris.blogspot.com/2011/01/easy-sequential-numbers.html" target="_blank"&gt;Sequence objects&lt;/a&gt; and we make it possible to to use a custom one. &lt;/li&gt;    &lt;li&gt;In addition to the big list of &lt;a href="http://community.devexpress.com/blogs/eaf/archive/2011/09/20/expandframework-calculated-members-creation-pros-and-cons.aspx" target="_blank"&gt;runtime member types&lt;/a&gt; we added a new custom member type, which allows to specify an callback which is called in the getter of the member (Thanks to &lt;a href="http://community.devexpress.com/members/Martin-Praxmarer-_5B00_DX_2D00_Squad_5D00_.aspx" target="_blank"&gt;Martin Praxmarer&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;MasterDetail now supports validation of child list view objects (Thanks to &lt;a href="http://community.devexpress.com/members/Martin-Praxmarer-_5B00_DX_2D00_Squad_5D00_.aspx" target="_blank"&gt;Martin Praxmarer&lt;/a&gt;) &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Thank you all for your contributions! Lets work closer together in 2012 and give even more value to our beloved frameworks!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-841077709164559040?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zeUnAsgzdogMG_gqwyeelDqsobo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zeUnAsgzdogMG_gqwyeelDqsobo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zeUnAsgzdogMG_gqwyeelDqsobo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zeUnAsgzdogMG_gqwyeelDqsobo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/umAIXbp6YsE" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-30T23:18:11.300+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2012/01/december-news.html</feedburner:origLink></item><item><title>LINQPad is XPO’s new best friend!</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/1HCExg2VD58/linqpad-is-xpos-new-best-friend.html</link><category>DX</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Tue, 27 Dec 2011 10:22:12 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-8331900490866265361</guid><description>&lt;p&gt;LINQ is &lt;a href="http://msdn.microsoft.com/en-us/library/bb308959.aspx" target="_blank"&gt;.NET Language-Integrated Query&lt;/a&gt;. It's included in .NET Framework 3.5 and you can use it in Visual Studio 2008 projects. XPO has officially supported LINQ since v7.3 and since then we have continued to improve and support it. Nowadays &lt;a href="http://www.devexpress.com/Support/Center/kb/p/K18051.aspx" target="_blank"&gt;LINQ to XPO&lt;/a&gt; is very mature, extendable (&lt;a href="http://documentation.devexpress.com/#XPO/CustomDocument9948" target="_blank"&gt;How to: Implement Custom Functions and Criteria in LINQ to XPO&lt;/a&gt;) and powerful (&lt;a href="http://documentation.devexpress.com/#XPO/CustomDocument8130" target="_blank"&gt;Free Joins&lt;/a&gt;). In the latest version we make it even easier to use LINQ to XPO since we only distribute one assembly, DevExpress.XPO.dll, which includes everything! (custom providers as well).&lt;/p&gt;  &lt;p&gt;XPO can talk transparently to a large &lt;a href="http://documentation.devexpress.com/#XPO/CustomDocument2114" target="_blank"&gt;list of database systems&lt;/a&gt;. It was already possible to make complex queries using our &lt;a href="http://documentation.devexpress.com/#XPO/CustomDocument2047" target="_blank"&gt;standard criteria syntax&lt;/a&gt;, however using LINQ offers some great advantages. &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;No magic strings, like you have in standard criteria syntax, &lt;/li&gt;    &lt;li&gt;Intellisense support making it easier and faster to construct your queries, &lt;/li&gt;    &lt;li&gt;Compile time checking, &lt;/li&gt;    &lt;li&gt;Learning to write LINQ queries/lambdas is a must learn for .NET developers, &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;The benefits are clear, however there is a caveat when using LINQ. It is not possible to use Edit and Continue and with even the smallest change you need to restart your debugging session. As a result your development speed is decreased dramatically.&lt;/p&gt;  &lt;p&gt;The solution as always is to use the right tool and in this case the right tool is &lt;a href="http://www.linqpad.net/" target="_blank"&gt;LINQPad&lt;/a&gt;. It provides a flexible UI allowing you to use LINQ in various ways. &lt;/p&gt;  &lt;p&gt;In our latest version our team released an XPO context driver for LINQPad. Let’s see how to configure it.&lt;/p&gt;  &lt;p&gt;Firstly we need to install the driver found at C:\DevExpress 2011.2\Components\Tools\DXperience\XPOContextDriver.lpx. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-QT0gx9A1f54/TvoMoXuZFlI/AAAAAAAABOM/RDK3maiiqes/s1600-h/image%25255B4%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-27GEiUUgHaE/TvoMpEuAl8I/AAAAAAAABOU/Sse0If-3Uo0/image_thumb%25255B2%25255D.png?imgmax=800" width="502" height="460" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Secondly we need to setup a new connection.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-9rWfQxQ44vw/TvoMqTjXe0I/AAAAAAAABOc/sEWtFiDwfKI/s1600-h/image%25255B9%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-dtVN-Pdv4DE/TvoMq9vQgRI/AAAAAAAABOg/BV7gz9YgVbM/image_thumb%25255B5%25255D.png?imgmax=800" width="595" height="474" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In this example we are going to use the MainDemo assembly containing the business objects.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-4Qmhqik4c70/TvoMrosLyHI/AAAAAAAABOs/jVaPw8ogNr0/s1600-h/image%25255B14%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-8RO1Cy_azQU/TvoMshSVbJI/AAAAAAAABOw/5lklXyEw8-M/image_thumb%25255B8%25255D.png?imgmax=800" width="519" height="357" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;LINQPad populated the domain in a hierarchical treelist. This allows us to enjoy using drag &amp;amp; drop plus intellisence in its expression editor to form the LINQ queries. Furthermore it is possible to use your style of language as demonstrated below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-WbcBybHdyzk/TvoMuIDNQVI/AAAAAAAABO8/5nDfOGZ_AW0/s1600-h/image%25255B20%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-Tv7PfYciD28/TvoMvLedv4I/AAAAAAAABPE/Xh7rfs-2j3U/image_thumb%25255B12%25255D.png?imgmax=800" width="640" height="397" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The cool part is that LINQPad, written by the great &lt;a href="http://www.albahari.com/" target="_blank"&gt;Joe Albahari&lt;/a&gt;, is available for free. It is strongly recommended as a great way to learn LINQ.&lt;/p&gt;  &lt;p&gt;Now for the fun part, let’s see it in action. Imagine we have the following code in our VS.&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;var&lt;/span&gt; queryable = &lt;span style="color: blue"&gt;from&lt;/span&gt; c &lt;span style="color: blue"&gt;in&lt;/span&gt; contacts&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;let&lt;/span&gt; tasks = c.&lt;span style="color: purple"&gt;Tasks&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Where&lt;/span&gt;(t =&amp;gt; t.&lt;span style="color: purple"&gt;ActualWork&lt;/span&gt; &amp;lt; 0)&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;where&lt;/span&gt; tasks.&lt;span style="color: #008b8b"&gt;Any&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;orderby&lt;/span&gt; c.&lt;span style="color: purple"&gt;LastName&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;select&lt;/span&gt; &lt;span style="color: blue"&gt;new&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; c.&lt;span style="color: purple"&gt;LastName&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&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: purple"&gt;Orders&lt;/span&gt; = tasks.&lt;span style="color: #008b8b"&gt;Count&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; };&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;We wish to see the results of queryable variable ,the best way to achieve this is to set a breakpoint then hit F5. Next we wait for our app to load and navigate to the action that will hit the breakpoint. Finally we must select the queryable variable and hit Shift+F9 to invoke the debugger window and examine the result set. Now we can try to make our requirements more complex. Lets say we also want to examine the result set when ActualWork&amp;gt;10. The solution is really easy when using LINQPad, we simply need to copy paste the code from VS to LINQPad the expression editor like this,&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-a_glQndNg6A/TvoMv3R_nsI/AAAAAAAABPM/TQhfrdOzZws/s1600-h/image%25255B30%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-wYep5vrbS0E/TvoMwmwZbbI/AAAAAAAABPU/VuBmVfjZUjA/image_thumb%25255B18%25255D.png?imgmax=800" width="699" height="660" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;After this we can quickly and easily form queries as we wish and examine their result sets instantly. Using the excellent and cheap &lt;a href="http://www.linqpad.net/Purchase.aspx" target="_blank"&gt;LINQPad Autocompletion&lt;/a&gt; it is possible to use VS like intelligence to further speed up your development.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-00fgcY76AmY/TvoMxt8rJaI/AAAAAAAABPY/UUR4JdfcNq8/s1600-h/image%25255B35%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-wPcgrfWjixA/TvoMyKu7VYI/AAAAAAAABPg/YlxnL9ASAbc/image_thumb%25255B21%25255D.png?imgmax=800" width="657" height="384" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;PS: eXpandFrameWork contributors are already using the Autocompletion feature since LINQPad offered a license for its contributors.&lt;/p&gt;  &lt;p&gt;We would appreciate your feedback on this post. Has it been useful to you? Feel free to contact us with any further questions&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-8331900490866265361?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hJKWjH5CRHqSLsWyguTOAKEasBc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hJKWjH5CRHqSLsWyguTOAKEasBc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hJKWjH5CRHqSLsWyguTOAKEasBc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hJKWjH5CRHqSLsWyguTOAKEasBc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/1HCExg2VD58" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-27T20:22:12.617+02:00</app:edited><media:thumbnail url="http://lh3.ggpht.com/-27GEiUUgHaE/TvoMpEuAl8I/AAAAAAAABOU/Sse0If-3Uo0/s72-c/image_thumb%25255B2%25255D.png?imgmax=800" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/12/linqpad-is-xpos-new-best-friend.html</feedburner:origLink></item><item><title>An eXpansive Christmas!</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/LtAhML3oRVc/expansive-christmas.html</link><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Sun, 25 Dec 2011 06:26:09 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-3789646884460202013</guid><description>&lt;p&gt;Just a quick post to wish all of you out there in the community a very Merry Christmas and a Happy New Year! I thought I had better take some time out from all the usual revelry to thank you all for making our framework what it is right now. Now is the season of generosity and goodwill so it's a good time to reflect on what has been achieved at eXpand through the giving of ideas. Of course &lt;i&gt;my &lt;/i&gt;biggest Christmas wish is that communication and collaboration between us all in the online community is increased a thousand times more! Let's all make a New Year's resolution to work together and take &lt;i&gt;our&lt;/i&gt; framework to the roof!     &lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;MERRY XMAS!&lt;/b&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-3789646884460202013?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lYDa0jAAnkdRguhsCkTfoMnxCDg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lYDa0jAAnkdRguhsCkTfoMnxCDg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lYDa0jAAnkdRguhsCkTfoMnxCDg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lYDa0jAAnkdRguhsCkTfoMnxCDg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/LtAhML3oRVc" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-25T16:26:09.242+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/12/expansive-christmas.html</feedburner:origLink></item><item><title>Hey Mom we are on the Hanselminutes show!</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/R1eHd0rGADk/hey-mom-we-are-on-hanselminutes-show.html</link><category>DX</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Wed, 14 Dec 2011 15:32:33 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-6357618073505409477</guid><description>&lt;p&gt;At 11.00 PST on Thursday 15th December I will be appearing live on &lt;a href="http://www.hanselman.com" target="_blank"&gt;Scott Hanselman&lt;/a&gt;’s podcast &lt;a href="http://hanselminutes.com/" target="_blank"&gt;Hanselminutes&lt;/a&gt;. During the course of the show Scott and I will be discussing eXpand framework and its relationship with &lt;a href="http://www.devexpress.com/Products/NET/Application_Framework/" target="_blank"&gt;XAF&lt;/a&gt;. Please tune in and show some support for your favorite frameworks! We built this thing together guys and this is an exciting event for all of us.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-6357618073505409477?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Tyl-hcAtjDNhcRtM83pwWZ4_Oi0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Tyl-hcAtjDNhcRtM83pwWZ4_Oi0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Tyl-hcAtjDNhcRtM83pwWZ4_Oi0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Tyl-hcAtjDNhcRtM83pwWZ4_Oi0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/R1eHd0rGADk" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-15T01:32:33.525+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/12/hey-mom-we-are-on-hanselminutes-show.html</feedburner:origLink></item><item><title>You have changes? I have Workflow!</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/uPdCVtgjKk8/you-have-changes-i-have-workflow.html</link><category>XpandWF</category><category>DX</category><category>WF</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Mon, 30 Jan 2012 07:31:13 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-1700412243453996193</guid><description>&lt;p&gt;WF4 uses a service oriented architecture and as a result any problem can be decoupled into smaller, easily solvable and testable services. XAF uses MVC architecture which, in a sense, is very similar to that used by WF4. We can compare XAF’s controllers to WF4 services. Moreover XAF’s Application does the same job as the WF4 server. The upshot of all this is that users should be able to get the feel of WF4 in no time at all. The XAF workflow module introduces a new layer that makes the already decoupled services aware of our business classes.  After this the sky is the limit and over the next few posts I aim to demonstrate some of what can be achieved. For example the next post will focus on creating an event driven workflow initialization engine.&lt;/p&gt;  &lt;p&gt;To get back to today’s post, we will discuss an implementation that is very decoupled and as a result it has very limited dependencies on other modules. It is worth noting that all XAF’s features are decoupled, persistent objects take on the role of domain mappers.&lt;/p&gt;  &lt;p&gt;Take these requirements; &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;an end user needs to be able to input an object type (and or) a property name, &lt;/li&gt;    &lt;li&gt;an object change needs to start the workflow either at client or at sever, &lt;/li&gt;    &lt;li&gt;workflows need to be aware of the object that has changed, its PropertyName and its property OldValue. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;u&gt;&lt;strong&gt;The custom workflow definition&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;We cannot use the default &lt;a href="http://www.devexpress.com/Products/NET/Application_Framework/" target="_blank"&gt;XAF&lt;/a&gt; XpoWorkFlowDefinition class in any way.  This is because there are no fields to store the PropertyName and its OldValue. We should not even derive from the default XpoWorkFlowDefinition because we may face difficulties as this class is used by our workflow server. To cope with this issue it is necessary to create a custom ObjectChangedWorkflow definition as shown.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-23TphhEIRw8/Ttdf5PjygOI/AAAAAAAABNY/xmOhaX-KRRg/s1600-h/image5.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-Ntee52DYg_A/Ttdf76txjCI/AAAAAAAABNg/e6ewxxsLuY8/image_thumb3.png?imgmax=800" width="839" height="518" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;While we are doing this we also need to modify the default xaml of the workflow and add the two more arguments (propertyName, oldValue) as per our requirements.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-sH5F3EimCBU/Ttdf8hxYgYI/AAAAAAAABNk/Me9oGvF9Sjk/s1600-h/image10.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-4cF6XNMDHno/Ttdf9flfb4I/AAAAAAAABNs/GJc-pROqnUQ/image_thumb6.png?imgmax=800" width="519" height="210" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Below you can see the UI of this custom workflow definition,&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-l1rjITyoyvI/Ttdf-3hEHUI/AAAAAAAABN4/o42SYlwrVUE/s1600-h/image51.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-fzH7SBbNnlI/TtdgB8oQJMI/AAAAAAAABOA/vGR6KQYiuIY/image_thumb2.png?imgmax=800" width="786" height="541" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Up to here XAF has made things very straightforward for us. We have designed a normal persistent class to store our data and we have used attributes (&lt;em&gt;PropertyEditorType, DataStourceProperty, TypeConverter etc&lt;/em&gt;) to configure the UI.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;strong&gt;Registration of custom workflow definition&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;The next step is to register this custom workflow definition. To help with this task, eXpand, provides the &lt;a href="https://github.com/expand/eXpand/blob/master/Xpand/Xpand.ExpressApp.Modules/Workflow/WorkflowStartService.cs" target="_blank"&gt;WorkflowStartService&amp;lt;T&amp;gt;&lt;/a&gt; where T is the type of workflow. Furthermore for &lt;a href="https://github.com/expand/eXpand/blob/master/Xpand/Xpand.ExpressApp.Modules/Workflow/ObjectChangedWorkflows/ObjectChangedWorkflow.cs" target="_blank"&gt;ObjectChangeWorkflow&lt;/a&gt; definitions the implementation is rather easy since there are no further requirements.&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;ObjectChangedWorkflowStartService&lt;/span&gt; : &lt;span style="color: #00008b"&gt;WorkflowStartService&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ObjectChangedWorkflow&lt;/span&gt;&amp;gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;ObjectChangedWorkflowStartService&lt;/span&gt;()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        : &lt;span style="color: #00008b"&gt;base&lt;/span&gt;(&lt;span style="color: #00008b"&gt;TimeSpan&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;FromMinutes&lt;/span&gt;(1)) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;ObjectChangedWorkflowStartService&lt;/span&gt;(&lt;span style="color: #00008b"&gt;TimeSpan&lt;/span&gt; requestsDetectionPeriod) : &lt;span style="color: #00008b"&gt;base&lt;/span&gt;(requestsDetectionPeriod) { }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: #008b8b"&gt;NeedToStartWorkflow&lt;/span&gt;(&lt;span style="color: #00008b"&gt;IObjectSpace&lt;/span&gt; objectSpace, &lt;span style="color: #00008b"&gt;ObjectChangedWorkflow&lt;/span&gt; workflow) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;true&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;AfterWorkFlowStarted&lt;/span&gt;(&lt;span style="color: #00008b"&gt;IObjectSpace&lt;/span&gt; objectSpace, &lt;span style="color: #00008b"&gt;ObjectChangedWorkflow&lt;/span&gt; workflow, &lt;span style="color: #00008b"&gt;Guid&lt;/span&gt; startWorkflow) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;u&gt;&lt;strong&gt;Start workflow - Track Object Changes&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;    &lt;p&gt;Now, when I have registered workflows on the server, it's time to return to my task: start a workflow when a property has been changed.     &lt;br /&gt;In XAF, I can track changes with the help of the ObjectSpace.Committing and ObjectSpace.ObjectChanged events. However because we need to create only one request per object change, it is advisable to collect the changes in an array.&lt;/p&gt;    &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;     &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;StartWorkflowOnObjectChangeController&lt;/span&gt; : &lt;span style="color: #00008b"&gt;ViewController&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ObjectView&lt;/span&gt;&amp;gt; {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;OnActivated&lt;/span&gt;() {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;OnActivated&lt;/span&gt;();&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (&lt;span style="color: #008b8b"&gt;TypeHasWorkflows&lt;/span&gt;()) {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;            &lt;span style="color: purple"&gt;ObjectSpace&lt;/span&gt;.&lt;span style="color: fuchsia"&gt;ObjectChanged&lt;/span&gt; &lt;span style="color: #008b8b"&gt;+=&lt;/span&gt; &lt;span style="color: #008b8b"&gt;PopulateObjectChangedEventArgs&lt;/span&gt;;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;            &lt;span style="color: purple"&gt;ObjectSpace&lt;/span&gt;.&lt;span style="color: fuchsia"&gt;Committing&lt;/span&gt; &lt;span style="color: #008b8b"&gt;+=&lt;/span&gt; &lt;span style="color: #008b8b"&gt;StartWorkFlows&lt;/span&gt;;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;PopulateObjectChangedEventArgs&lt;/span&gt;(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #00008b"&gt;ObjectChangedEventArgs&lt;/span&gt; objectChangedEventArgs) {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (!&lt;span style="color: blue"&gt;string&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;IsNullOrEmpty&lt;/span&gt;(objectChangedEventArgs.&lt;span style="color: purple"&gt;PropertyName&lt;/span&gt;)) {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;var&lt;/span&gt; changedEventArgs = &lt;span style="color: purple"&gt;_objectChangedEventArgses&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;FirstOrDefault&lt;/span&gt;(args =&amp;gt; args.&lt;span style="color: purple"&gt;Object&lt;/span&gt; == objectChangedEventArgs.&lt;span style="color: purple"&gt;Object&lt;/span&gt; &amp;amp;&amp;amp; args.&lt;span style="color: purple"&gt;PropertyName&lt;/span&gt; == objectChangedEventArgs.&lt;span style="color: purple"&gt;PropertyName&lt;/span&gt;);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;if&lt;/span&gt; (changedEventArgs != &lt;span style="color: blue"&gt;null&lt;/span&gt;) {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;                &lt;span style="color: purple"&gt;_objectChangedEventArgses&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Remove&lt;/span&gt;(changedEventArgs);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;                &lt;span style="color: purple"&gt;_objectChangedEventArgses&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Add&lt;/span&gt;(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;ObjectChangedEventArgs&lt;/span&gt;(changedEventArgs.&lt;span style="color: purple"&gt;Object&lt;/span&gt;, changedEventArgs.&lt;span style="color: purple"&gt;PropertyName&lt;/span&gt;, changedEventArgs.&lt;span style="color: purple"&gt;OldValue&lt;/span&gt;, objectChangedEventArgs.&lt;span style="color: purple"&gt;NewValue&lt;/span&gt;));&lt;/p&gt;      &lt;p style="margin: 0px"&gt;            } &lt;span style="color: blue"&gt;else&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;                &lt;span style="color: purple"&gt;_objectChangedEventArgses&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Add&lt;/span&gt;(objectChangedEventArgs);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;      &lt;p style="margin: 0px"&gt; &lt;/p&gt;      &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;StartWorkFlow&lt;/span&gt;(&lt;span style="color: #00008b"&gt;ObjectChangedEventArgs&lt;/span&gt; objectChangedEventArgs, &lt;span style="color: #00008b"&gt;ObjectChangedWorkflow&lt;/span&gt; objectChangedWorkflow) {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;var&lt;/span&gt; o = objectChangedEventArgs.&lt;span style="color: purple"&gt;Object&lt;/span&gt;;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: #00008b"&gt;ITypeInfo&lt;/span&gt; typeInfo = &lt;span style="color: #00008b"&gt;XafTypesInfo&lt;/span&gt;.&lt;span style="color: purple"&gt;Instance&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;FindTypeInfo&lt;/span&gt;(o.&lt;span style="color: #008b8b"&gt;GetType&lt;/span&gt;());&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;object&lt;/span&gt; targetObjectKey = typeInfo.&lt;span style="color: purple"&gt;KeyMember&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;GetValue&lt;/span&gt;(o);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (objectChangedWorkflow.&lt;span style="color: purple"&gt;ExecutionDomain&lt;/span&gt; == &lt;span style="color: #00008b"&gt;ExecutionDomain&lt;/span&gt;.&lt;span style="color: purple; font-weight: bold"&gt;Server&lt;/span&gt;) {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;            &lt;span style="color: #008b8b"&gt;CreateServerRequest&lt;/span&gt;(objectChangedEventArgs, objectChangedWorkflow, targetObjectKey, typeInfo);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        } &lt;span style="color: blue"&gt;else&lt;/span&gt; {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;            &lt;span style="color: #008b8b"&gt;InvokeOnClient&lt;/span&gt;(objectChangedEventArgs, objectChangedWorkflow, targetObjectKey);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;   &lt;/div&gt;    &lt;p&gt;As you will have noticed we have not used the default VS naming for ObjectSpace event handlers. This is because the names that have chosen give a more specific idea of how each method works.&lt;/p&gt;    &lt;p&gt;The ObjectChanged event occurs each time a property is changed and the changes are collected in the objectChangedEventArgses array. The Committing event occurs once changes are ready to be sent to the server and workflows start for each entry. We have introduced two options for starting and executing workflows;&lt;/p&gt;    &lt;ol&gt;     &lt;li&gt;Execute synchronously and locally, &lt;/li&gt;      &lt;li&gt;Send a request to the server and execute at the server asynchronously       &lt;br /&gt;&lt;/li&gt;   &lt;/ol&gt;    &lt;p&gt;&lt;strong&gt;&lt;u&gt;Execute a workflow synchronously on the client&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;The next stage is to create activities at the client then on ObjectSpace CommitChanges from appropriate WorkflowDefinition and execute them immediatelly&lt;/p&gt;    &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;     &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;StartWorkflowOnObjectChangeController&lt;/span&gt; : &lt;span style="color: #00008b"&gt;ViewController&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ObjectView&lt;/span&gt;&amp;gt; {&lt;/p&gt;      &lt;p style="margin: 0px"&gt; &lt;/p&gt;      &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;InvokeOnClient&lt;/span&gt;(&lt;span style="color: #00008b"&gt;ObjectChangedEventArgs&lt;/span&gt; objectChangedEventArgs, &lt;span style="color: #00008b"&gt;ObjectChangedWorkflow&lt;/span&gt; objectChangedWorkflow, &lt;span style="color: blue"&gt;object&lt;/span&gt; targetObjectKey) {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: #00008b"&gt;Activity&lt;/span&gt; activity = &lt;span style="color: #00008b"&gt;ActivityXamlServices&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Load&lt;/span&gt;(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;StringReader&lt;/span&gt;(objectChangedWorkflow.&lt;span style="color: purple"&gt;Xaml&lt;/span&gt;));&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;var&lt;/span&gt; dictionary = &lt;span style="color: #00008b"&gt;ObjectChangedStartWorkflowService&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Dictionary&lt;/span&gt;(targetObjectKey, objectChangedEventArgs.&lt;span style="color: purple"&gt;PropertyName&lt;/span&gt;, objectChangedEventArgs.&lt;span style="color: purple"&gt;OldValue&lt;/span&gt;);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: #00008b"&gt;WorkflowInvoker&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Invoke&lt;/span&gt;(activity, dictionary);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;   &lt;/div&gt;   &lt;br /&gt;This is a simple code which can be found in nearly any WF4 example at &lt;a href="http://www.microsoft.com/download/en/details.aspx?id=21459"&gt;http://www.microsoft.com/download/en/details.aspx?id=21459&lt;/a&gt;.    &lt;br /&gt;&lt;/div&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Send a request to start workflow on the server&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The second of our two methods involves starting the workflow at the server. Now we need to notify the server of the values of those arguments as well. In the &lt;a href="http://community.devexpress.com/blogs/eaf/archive/2011/07/19/manually-starting-workflows.aspx" target="_blank"&gt;manually starting workflows&lt;/a&gt; post we learnt that XAF does this by using XpoStartWorkflowRequest. This class has a different design however, and may create issues since it is used by XAF default services. Therefore instead of deriving from XpoStartWorkflowRequest we need to design a similar custom class.&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;     &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;ObjectChangedXpoStartWorkflowRequest&lt;/span&gt; : &lt;span style="color: #00008b"&gt;WFBaseObject&lt;/span&gt;, &lt;span style="color: #00008b"&gt;IObjectChangedWorkflowRequest&lt;/span&gt; {&lt;/p&gt;      &lt;p style="margin: 0px"&gt; &lt;/p&gt;      &lt;p style="margin: 0px"&gt;    [&lt;span style="color: #00008b"&gt;TypeConverter&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;StringToTypeConverter&lt;/span&gt;))]&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;Type&lt;/span&gt; &lt;span style="color: purple"&gt;TargetObjectType&lt;/span&gt; {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: purple"&gt;_targetObjectType&lt;/span&gt;; } &lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"TargetObjectType"&lt;/span&gt;, &lt;span style="color: blue"&gt;ref&lt;/span&gt; &lt;span style="color: purple"&gt;_targetObjectType&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;    #region&lt;/span&gt; IDCStartWorkflowRequest Members&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;TargetWorkflowUniqueId&lt;/span&gt; {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"TargetWorkflowUniqueId"&lt;/span&gt;); } &lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"TargetWorkflowUniqueId"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;      &lt;p style="margin: 0px"&gt; &lt;/p&gt;      &lt;p style="margin: 0px"&gt;    [&lt;span style="color: #00008b"&gt;ValueConverter&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;KeyConverter&lt;/span&gt;))]&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; &lt;span style="color: purple"&gt;TargetObjectKey&lt;/span&gt; {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"TargetObjectKey"&lt;/span&gt;); } &lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"TargetObjectKey"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;    #endregion&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;    #region&lt;/span&gt; IObjectChangedWorkflowRequest Members&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;PropertyName&lt;/span&gt; {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: purple"&gt;_propertyName&lt;/span&gt;; } &lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"PropertyName"&lt;/span&gt;, &lt;span style="color: blue"&gt;ref&lt;/span&gt; &lt;span style="color: purple"&gt;_propertyName&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;      &lt;p style="margin: 0px"&gt; &lt;/p&gt;      &lt;p style="margin: 0px"&gt;    [&lt;span style="color: #00008b"&gt;ValueConverter&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;SerializableObjectConverter&lt;/span&gt;))]&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    [&lt;span style="color: #00008b"&gt;Size&lt;/span&gt;(&lt;span style="color: #00008b"&gt;SizeAttribute&lt;/span&gt;.&lt;span style="color: purple; font-weight: bold"&gt;Unlimited&lt;/span&gt;)]&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; &lt;span style="color: purple"&gt;OldValue&lt;/span&gt; {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: purple"&gt;_oldValue&lt;/span&gt;; }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"OldValue"&lt;/span&gt;, &lt;span style="color: blue"&gt;ref&lt;/span&gt; &lt;span style="color: purple"&gt;_oldValue&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;This is a very simple class, its only role is to store values in the database. Now instead of invoking workflows locally we only need to create ObjectChangedXpoStartWorkflowRequest objects. &lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;StartWorkflowOnObjectChangeController&lt;/span&gt; : &lt;span style="color: #00008b"&gt;ViewController&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ObjectView&lt;/span&gt;&amp;gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;CreateServerRequest&lt;/span&gt;(&lt;span style="color: #00008b"&gt;ObjectChangedEventArgs&lt;/span&gt; objectChangedEventArgs, &lt;span style="color: #00008b"&gt;ObjectChangedWorkflow&lt;/span&gt; objectChangedWorkflow, &lt;span style="color: blue"&gt;object&lt;/span&gt; targetObjectKey, &lt;span style="color: #00008b"&gt;ITypeInfo&lt;/span&gt; typeInfo) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;var&lt;/span&gt; request = &lt;span style="color: purple"&gt;ObjectSpace&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;CreateObject&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ObjectChangedXpoStartWorkflowRequest&lt;/span&gt;&amp;gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        request.&lt;span style="color: purple"&gt;TargetWorkflowUniqueId&lt;/span&gt; = objectChangedWorkflow.&lt;span style="color: #008b8b"&gt;GetUniqueId&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        request.&lt;span style="color: purple"&gt;TargetObjectType&lt;/span&gt; = typeInfo.&lt;span style="color: purple"&gt;Type&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        request.&lt;span style="color: purple"&gt;TargetObjectKey&lt;/span&gt; = targetObjectKey;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        request.&lt;span style="color: purple"&gt;PropertyName&lt;/span&gt; = objectChangedEventArgs.&lt;span style="color: purple"&gt;PropertyName&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        request.&lt;span style="color: purple"&gt;OldValue&lt;/span&gt; = &lt;span style="color: #008b8b"&gt;GetOldValue&lt;/span&gt;(objectChangedEventArgs);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;In the next step we are going to create a service to consume these values from the server and start a workflow,&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;StartWorkflowOnObjectChangeService&lt;/span&gt; : &lt;span style="color: #00008b"&gt;BaseTimerService&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;OnTimer&lt;/span&gt;() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;using&lt;/span&gt; (&lt;span style="color: blue"&gt;var&lt;/span&gt; objectSpace = &lt;span style="color: purple"&gt;ObjectSpaceProvider&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;CreateObjectSpace&lt;/span&gt;()) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="color: green"&gt;//get all requests from the database&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: blue"&gt;var&lt;/span&gt; &lt;span style="font-weight: bold"&gt;request&lt;/span&gt; &lt;span style="color: blue"&gt;in&lt;/span&gt; objectSpace.&lt;span style="color: #008b8b"&gt;GetObjects&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ObjectChangedXpoStartWorkflowRequest&lt;/span&gt;&amp;gt;()) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                &lt;span style="color: green"&gt;//find workflow&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                &lt;span style="color: blue"&gt;var&lt;/span&gt; definition = &lt;span style="color: #008b8b"&gt;GetService&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;IWorkflowDefinitionProvider&lt;/span&gt;&amp;gt;().&lt;span style="color: #008b8b"&gt;FindDefinition&lt;/span&gt;(&lt;span style="font-weight: bold"&gt;request&lt;/span&gt;.&lt;span style="color: purple"&gt;TargetWorkflowUniqueId&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                &lt;span style="color: blue"&gt;if&lt;/span&gt; (definition != &lt;span style="color: blue"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; definition.&lt;span style="color: purple"&gt;CanOpenHost&lt;/span&gt;) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                    &lt;span style="color: green"&gt;//Start the workflow passing in PropertyName &amp;amp;&amp;amp; OldValue&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                    &lt;span style="color: blue"&gt;if&lt;/span&gt; (&lt;span style="color: #008b8b"&gt;GetService&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ObjectChangedStartWorkflowService&lt;/span&gt;&amp;gt;().&lt;span style="color: #008b8b"&gt;StartWorkflow&lt;/span&gt;(definition.&lt;span style="color: purple"&gt;Name&lt;/span&gt;, &lt;/p&gt;    &lt;p style="margin: 0px"&gt;                        &lt;span style="font-weight: bold"&gt;request&lt;/span&gt;.&lt;span style="color: purple"&gt;TargetWorkflowUniqueId&lt;/span&gt;, &lt;span style="font-weight: bold"&gt;request&lt;/span&gt;.&lt;span style="color: purple"&gt;TargetObjectKey&lt;/span&gt;, &lt;span style="font-weight: bold"&gt;request&lt;/span&gt;.&lt;span style="color: purple"&gt;PropertyName&lt;/span&gt;, &lt;span style="font-weight: bold"&gt;request&lt;/span&gt;.&lt;span style="color: purple"&gt;OldValue&lt;/span&gt;)) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                        objectSpace.&lt;span style="color: #008b8b"&gt;Delete&lt;/span&gt;(&lt;span style="font-weight: bold"&gt;request&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                        objectSpace.&lt;span style="color: #008b8b"&gt;CommitChanges&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;            }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;At this point our server has all the information it needs to start workflows with arguments taken from persistent &lt;a href="https://github.com/expand/eXpand/blob/master/Xpand/Xpand.ExpressApp.Modules/Workflow/ObjectChangedWorkflows/ObjectChangedXpoStartWorkflowRequest.cs" target="_blank"&gt;ObjectChangeXpoStartWorkFlowRequest&lt;/a&gt; objects. &lt;/p&gt;  &lt;p&gt;I must admit that I have fully enjoyed preparing this post. The decoupled development experienced offered by the WF service oriented model is something that really appeals to me. At the same time XAF’s workflow module implementation made modeling the requirements a simple and enjoyable process. As usual it was possible to work directly on the problem and leave the hard work to non XAF developers. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-1700412243453996193?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FJXrA3kDPWj4qBz7quV0qLjf2fA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FJXrA3kDPWj4qBz7quV0qLjf2fA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FJXrA3kDPWj4qBz7quV0qLjf2fA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FJXrA3kDPWj4qBz7quV0qLjf2fA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/uPdCVtgjKk8" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-30T17:31:13.071+02:00</app:edited><media:thumbnail url="http://lh4.ggpht.com/-Ntee52DYg_A/Ttdf76txjCI/AAAAAAAABNg/e6ewxxsLuY8/s72-c/image_thumb3.png?imgmax=800" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/12/you-have-changes-i-have-workflow.html</feedburner:origLink></item><item><title>November news</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/_DXHPzT6Ehc/november-news.html</link><category>Montly_News</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Mon, 30 Jan 2012 08:31:35 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-4138837407328278471</guid><description>&lt;p&gt; &lt;/p&gt;  &lt;p&gt;The last few months have been exciting here at eXpand. First and foremost the number of you that are contributing to the project has shot up which is great news for all of us! Also (as some of you may have noticed) we have earned ourselves a place in the DevExpress start menu. There has been a flurry of activity on the development side too, as a result we are pleased to offer a host of innovative new features. Finally eXpand is now registered at &lt;a title="http://nuget.org/" href="http://nuget.org/"&gt;http://nuget.org/&lt;/a&gt; so it can be accessed via Visual Studio.&lt;/p&gt;  &lt;h4&gt;&lt;span &gt;Contributors!&lt;/span&gt;&lt;/h4&gt;  &lt;p&gt;First of all we must all say a big thank you to everybody that has been contributing to eXpand in any way. We appreciate your continuing love and support whether in the form of forum posts, code submissions, user suggestions or simply spreading the good word about eXpand! Our community is very healthy right now, I am proud of the fact that eXpand users are collaborating more than ever and sharing their ideas and stories.&lt;/p&gt;  &lt;p&gt;Of course at the same time we must thank DevExpress for their steady support and the trust that they have placed in eXpand. By allowing eXpand a place in their start menu it’s not even easier for us to share our framework with other &lt;a href="http://www.devexpress.com/Products/NET/Application_Framework/" target="_blank"&gt;XAF&lt;/a&gt; developers.&lt;/p&gt;  &lt;p&gt;To all those who are ready to take the leap and start contributing to our framework I can promise that being part of our community means a full share in all of the benefits. Of course the more we all contribute the more benefits there will be!&lt;/p&gt;  &lt;h4&gt;Latest Collaborations&lt;/h4&gt;  &lt;p&gt;I could talk about new features here, however I have deliberately chosen the word ‘collaborations’ in recognition of the fact that these developments are a direct result of your contributions to eXpand. It is clear that to list all of our collaborations here would take too long, but lets take a look at some of the most successful so far;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Masterdetail       &lt;br /&gt;      &lt;br /&gt;&lt;/strong&gt;Offers support for actions state synchronization between master detail frames.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;LayoutViewGridListEditor       &lt;br /&gt;      &lt;br /&gt;&lt;/strong&gt;Enables LayoutView mode in the GridControl in List Views as in &lt;a href="http://www.devexpress.com/Support/Center/p/E1486.aspx" target="_blank"&gt;E1486&lt;/a&gt;.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Setup version&lt;/strong&gt;      &lt;br /&gt;    &lt;br /&gt;In order to make distinguishing between versions easier we have used a version dedicated name for our setup.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Wizard       &lt;br /&gt;      &lt;br /&gt;&lt;/strong&gt;Offers support for domain components.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Caching support       &lt;br /&gt;      &lt;br /&gt;&lt;/strong&gt;Enables caching at client and server by using a setting in the application config file.  &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Toolbox       &lt;br /&gt;      &lt;br /&gt;&lt;/strong&gt;When compiling our sources all eXpand assemblies will be auto registered to VS toolbox. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;strong&gt;What's next?&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;More modules that will prove the simplicity and power of XAF from dedicated coders. In addition we are redesigning our site in order to establish better collaboration with all of you. We see this as an opportunity through XAF modularized architecture to share our experiences in order to give our business more relaxed weekends. We believe that with your help our job will become much easier, especially since DX is also here to guide us!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-4138837407328278471?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yKzc70uEJUIC24WWakZj2ibVZrA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yKzc70uEJUIC24WWakZj2ibVZrA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yKzc70uEJUIC24WWakZj2ibVZrA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yKzc70uEJUIC24WWakZj2ibVZrA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/_DXHPzT6Ehc" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-30T18:31:35.131+02:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/11/november-news.html</feedburner:origLink></item><item><title>Creating a State Machine module for eXpand Framework–Part 2</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/8ZCNSKGYLiY/creating-state-machine-module-for.html</link><category>Xaf</category><category>statemachine</category><category>DX</category><category>Xpandstatemachine</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Mon, 30 Jan 2012 07:57:06 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-6075732674129446103</guid><description>&lt;p&gt;&lt;u&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/u&gt;    &lt;br /&gt;&lt;a href="http://community.devexpress.com/blogs/eaf/archive/2011/08/08/creating-a-state-machine-module-for-expandframework-part-1.aspx" target="_blank"&gt;Part 1&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In this post we are going to enhance the State Machine module UI. Remember that along with all the usual &lt;a href="http://www.devexpress.com/Products/NET/Application_Framework/" target="_blank"&gt;XAF&lt;/a&gt; goodies we can now use Xpand code base which gives us a lot more options. Our StateMachineTransitionPermission has 2 lookups, StateMachineName and StateMachine. Our goal is to populate both of these cascading lookups without creating a platform specific module.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;StateMachineNames&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;Creating lookups is a common scenario for which Xpand provides a set of property editors and controllers. By contrast with other business frameworks XAF allows maximum flexibility. Therefore in most cases we are able to code in such a generic way that everything could live in separate frameworks such as eXpand. Now, in order to populate the StateMachine name I am going to derive a new controller from a specialized abstract controller which is Xpand.ExpressApp.SystemModule.PopulateController&amp;lt;T&amp;gt;. This controller uses the &lt;a href="http://documentation.devexpress.com/#Xaf/DevExpressExpressAppModelIModelCommonMemberViewItem_PredefinedValuestopic" target="_blank"&gt;PredefinedValues&lt;/a&gt; attribute of the XAF model. When filling the attribute with a set of values separated by semicolons XAF will create a lookup with these values targeting each supported platform.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-oByvB7j2soU/Tnw6zE55mHI/AAAAAAAABNE/HLyCfhAViiw/s1600-h/image4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-thBGm2vIRT0/Tnw6z8v-jzI/AAAAAAAABNI/xOgqLAr6qlQ/image_thumb2.png?imgmax=800" width="637" height="192" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;However, if at runtime we set the value of the PredefinedValues attribute this will be written at model’s lastlayer and it will make it dirty. We want to avoid this because we want to leave the lastlayer intact.. To cater for this need the populate controller uses a hack. First it stores the lastlayer in a variable then removes it from the model’s layers collection. As a result it is possible to modify the new lastlayer as shown in the Populate method and then return the clean old one to its place. Now the model has all the necessary information with a clean userdiffs layer and while XAF is creating a new view can get the PredefinedValues string from it and create the lookups. &lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;abstract&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;PopulateController&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;T&lt;/span&gt;&amp;gt; : &lt;span style="color: #00008b"&gt;ViewController&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ObjectView&lt;/span&gt;&amp;gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;…&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;    …&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt; &lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&lt;/span&gt;&lt;/p&gt;    &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;     &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;    protected&lt;/span&gt; &lt;span style="color: blue"&gt;virtual&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;Populate&lt;/span&gt;(&lt;span style="color: #00008b"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;IModelMember&lt;/span&gt;, &lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; collect) {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;var&lt;/span&gt; name = &lt;span style="color: purple"&gt;PropertyName&lt;/span&gt;;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (name != &lt;span style="color: blue"&gt;null&lt;/span&gt;) {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;var&lt;/span&gt; model = ((&lt;span style="color: #00008b"&gt;ModelApplicationBase&lt;/span&gt;)&lt;span style="color: purple"&gt;Application&lt;/span&gt;.&lt;span style="color: purple"&gt;Model&lt;/span&gt;);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;var&lt;/span&gt; lastLayer = model.&lt;span style="color: purple"&gt;LastLayer&lt;/span&gt;;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;            model.&lt;span style="color: #008b8b"&gt;RemoveLayer&lt;/span&gt;(lastLayer);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;            &lt;span style="color: #008b8b"&gt;PopulateCore&lt;/span&gt;(collect, name);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;            model.&lt;span style="color: #008b8b"&gt;AddLayer&lt;/span&gt;(lastLayer);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;       }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;   }&lt;/p&gt;      &lt;p style="margin: 0px"&gt; &lt;/p&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; &lt;span style="color: #008b8b"&gt;PopulateCore&lt;/span&gt;(&lt;span style="color: #00008b"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;IModelMember&lt;/span&gt;, &lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; collect, &lt;span style="color: blue"&gt;string&lt;/span&gt; propertyName) {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: #00008b"&gt;IModelMember&lt;/span&gt; modelMember = &lt;span style="color: purple"&gt;View&lt;/span&gt;.&lt;span style="color: purple"&gt;Model&lt;/span&gt;.&lt;span style="color: purple"&gt;ModelClass&lt;/span&gt;.&lt;span style="color: purple"&gt;AllMembers&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;FirstOrDefault&lt;/span&gt;(member =&amp;gt; member.&lt;span style="color: purple"&gt;Name&lt;/span&gt; == propertyName);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (modelMember != &lt;span style="color: blue"&gt;null&lt;/span&gt;) {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;            modelMember.&lt;span style="color: purple"&gt;PredefinedValues&lt;/span&gt; = collect.&lt;span style="color: #008b8b"&gt;Invoke&lt;/span&gt;(modelMember);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/div&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;    …&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;    …&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;   }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt; Although this seems like a complicated explanation users need not be intimidated! The implementation of our controller that will populate all StateMachineNames is as simple as this,     &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;     &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;StateMachinePopulateController&lt;/span&gt; : &lt;span style="color: #00008b"&gt;PopulateController&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;StateMachineTransitionPermission&lt;/span&gt;&amp;gt; {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPredefinedValues&lt;/span&gt;(&lt;span style="color: #00008b"&gt;IModelMember&lt;/span&gt; wrapper) {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: #00008b"&gt;IList&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;XpoStateMachine&lt;/span&gt;&amp;gt; xpoStateMachines = &lt;span style="color: purple"&gt;ObjectSpace&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;GetObjects&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;XpoStateMachine&lt;/span&gt;&amp;gt;(&lt;span style="color: blue"&gt;null&lt;/span&gt;);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; xpoStateMachines.&lt;span style="color: #008b8b"&gt;Select&lt;/span&gt;(machine =&amp;gt; machine.&lt;span style="color: purple"&gt;Name&lt;/span&gt;).&lt;span style="color: #008b8b"&gt;AggregateWith&lt;/span&gt;(&lt;span style="color: #a31515"&gt;";"&lt;/span&gt;);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;      &lt;p style="margin: 0px"&gt; &lt;/p&gt;      &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: #00008b"&gt;Expression&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;StateMachineTransitionPermission&lt;/span&gt;, &lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;&amp;gt; &lt;span style="color: #008b8b"&gt;GetPropertyName&lt;/span&gt;() {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; permission =&amp;gt; permission.&lt;span style="color: purple"&gt;StateMachineName&lt;/span&gt;;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;}&lt;/p&gt;      &lt;p style="margin: 0px"&gt; &lt;/p&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;The first thing we did was to provide the propertyName in the GetPropertyName method. Then using the GetPredifinedalues method we return the semincolon delimited string with the machine names. This very simple controller is capable of populating the statemachine lookup for win and web platforms!.&lt;/div&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt; &lt;/div&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;&lt;u&gt;StateCaptions&lt;/u&gt;&lt;/div&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;&lt;u&gt;&lt;/u&gt;&lt;u&gt;&lt;/u&gt;&lt;/div&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;&lt;u&gt;&lt;/u&gt;&lt;/div&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;This is a cascading lookup and as a result when the current StateMachineName changes it needs to provide a list of all its StateCaptions. To this end we are going to use a specialized property editor, Xpand’s StringLookupEditor. This supports the &lt;a href="http://documentation.devexpress.com/#Xaf/clsDevExpressPersistentBaseDataSourcePropertyAttributetopic" target="_blank"&gt;DataSourceProperty&lt;/a&gt; XAF attribute which will be used to provide the StateCaption collection. Moreover when using Xpand it is possible to mark editors with an interface and host it in a transparent module. We can then use the Xpand PropertyEditor attribute with the type of the interface as parameter to tell XAF which propertyeditor will be created at runtime. Finally we need to apply all these along with an ImmediatePostData to the StateMachineName property. The permission will look like this,&lt;/div&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt; &lt;/div&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;     &lt;p style="margin: 0px"&gt;[&lt;span style="color: #00008b"&gt;ImmediatePostData&lt;/span&gt;]&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;StateMachineName&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;get&lt;/span&gt;; &lt;span style="color: #008b8b"&gt;set&lt;/span&gt;; }&lt;/p&gt;      &lt;p style="margin: 0px"&gt; &lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;//IStringLookupPropertyEditor lives in Xpand.ExpressApp assembly&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;//Xpand.ExpressApp.Web.PropertyEditors.StringLookupPropertyEditor, Xpand.ExpressApp.Win.PropertyEditors.StringLookupPropertyEditor inherit from IStringLookupPropertyEditor&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;[&lt;span style="color: #00008b"&gt;PropertyEditor&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;IStringLookupPropertyEditor&lt;/span&gt;))]&lt;/p&gt;      &lt;p style="margin: 0px"&gt;[&lt;span style="color: #00008b"&gt;DataSourceProperty&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"StateCaptions"&lt;/span&gt;)]&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;StateCaption&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;get&lt;/span&gt;; &lt;span style="color: #008b8b"&gt;set&lt;/span&gt;; }&lt;/p&gt;      &lt;p style="margin: 0px"&gt; &lt;/p&gt;      &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;       &lt;p style="margin: 0px"&gt;&lt;span style="color: #00008b"&gt;IList&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; &lt;span style="color: purple"&gt;_stateCaptions&lt;/span&gt; = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;();&lt;/p&gt;        &lt;p style="margin: 0px"&gt;[&lt;span style="color: #00008b"&gt;Browsable&lt;/span&gt;(&lt;span style="color: blue"&gt;false&lt;/span&gt;)]&lt;/p&gt;        &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;IList&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; &lt;span style="color: purple"&gt;StateCaptions&lt;/span&gt; {&lt;span style="color: #008b8b"&gt;get&lt;/span&gt; {&lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: purple"&gt;_stateCaptions&lt;/span&gt;;}}&lt;/p&gt;     &lt;/div&gt;   &lt;/div&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;If you look carefully at this code however you may notice that _&lt;span style="color: purple"&gt;_stateCaptions &lt;/span&gt;count is always zero. Let me remind you here that the StateMachineTransitionPermission is a non persistent sessionless object. This means that the object is not handled by an ObjectSpace therefore a call like ObjectSpace.FindObjectSpaceByObject(this) will always return null. In addition the permission does not implement INotifyPropertyChanged so we need to synchronize the class just before the &lt;span style="color: purple"&gt;StateCaptions&lt;/span&gt; are requested. Below you can see a modified version of the StateMachinePopulateController,&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;     &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;       &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;StateMachinePopulateController&lt;/span&gt; : &lt;span style="color: #00008b"&gt;PopulateController&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;StateMachineTransitionPermission&lt;/span&gt;&amp;gt; {&lt;/p&gt;        &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;OnViewControlsCreated&lt;/span&gt;() {&lt;/p&gt;        &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;OnViewControlsCreated&lt;/span&gt;();&lt;/p&gt;        &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;var&lt;/span&gt; stringLookupPropertyEditor = &lt;span style="color: #008b8b"&gt;GetPropertyEditor&lt;/span&gt;(permission =&amp;gt; permission.&lt;span style="color: purple"&gt;StateCaption&lt;/span&gt;) &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: #00008b"&gt;IStringLookupPropertyEditor&lt;/span&gt;;&lt;/p&gt;        &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (stringLookupPropertyEditor != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/p&gt;        &lt;p style="margin: 0px"&gt;            stringLookupPropertyEditor.&lt;span style="color: fuchsia"&gt;ItemsCalculating&lt;/span&gt; &lt;span style="color: #008b8b"&gt;+=&lt;/span&gt; &lt;span style="color: #008b8b"&gt;StringLookupPropertyEditorOnItemsCalculating&lt;/span&gt;;&lt;/p&gt;        &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;        &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;StringLookupPropertyEditorOnItemsCalculating&lt;/span&gt;(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #00008b"&gt;HandledEventArgs&lt;/span&gt; handledEventArgs) {&lt;/p&gt;        &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;var&lt;/span&gt; propertyEditor = &lt;span style="color: #008b8b"&gt;GetPropertyEditor&lt;/span&gt;(permission =&amp;gt; permission.&lt;span style="color: purple"&gt;StateMachineName&lt;/span&gt;);&lt;/p&gt;        &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (propertyEditor != &lt;span style="color: blue"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; &lt;span style="color: purple"&gt;View&lt;/span&gt;.&lt;span style="color: purple"&gt;IsControlCreated&lt;/span&gt;) {&lt;/p&gt;        &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;var&lt;/span&gt; stateMachineTransitionPermission = ((&lt;span style="color: #00008b"&gt;StateMachineTransitionPermission&lt;/span&gt;)&lt;span style="color: purple"&gt;View&lt;/span&gt;.&lt;span style="color: purple"&gt;CurrentObject&lt;/span&gt;);&lt;/p&gt;        &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;var&lt;/span&gt; readOnlyCollection = &lt;span style="color: #008b8b"&gt;GetStateCaptions&lt;/span&gt;(propertyEditor);&lt;/p&gt;        &lt;p style="margin: 0px"&gt;            stateMachineTransitionPermission.&lt;span style="color: #008b8b"&gt;SyncStateCaptions&lt;/span&gt;(readOnlyCollection, propertyEditor.&lt;span style="color: purple"&gt;ControlValue&lt;/span&gt; &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt;);&lt;/p&gt;        &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;        &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;        &lt;p style="margin: 0px"&gt; &lt;/p&gt;        &lt;p style="margin: 0px"&gt;    &lt;span style="color: #00008b"&gt;ReadOnlyCollection&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; &lt;span style="color: #008b8b"&gt;GetStateCaptions&lt;/span&gt;(&lt;span style="color: #00008b"&gt;PropertyEditor&lt;/span&gt; propertyEditor) {&lt;/p&gt;        &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;var&lt;/span&gt; stateMachineName = propertyEditor.&lt;span style="color: purple"&gt;ControlValue&lt;/span&gt; &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt;;&lt;/p&gt;        &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: purple"&gt;ObjectSpace&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;GetObjects&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;XpoState&lt;/span&gt;&amp;gt;(state =&amp;gt; state.&lt;span style="color: purple"&gt;StateMachine&lt;/span&gt;.&lt;span style="color: purple"&gt;Name&lt;/span&gt; == stateMachineName).&lt;span style="color: #008b8b"&gt;Select&lt;/span&gt;(&lt;/p&gt;        &lt;p style="margin: 0px"&gt;                state =&amp;gt; state.&lt;span style="color: purple"&gt;Caption&lt;/span&gt;).&lt;span style="color: #008b8b"&gt;ToList&lt;/span&gt;().&lt;span style="color: #008b8b"&gt;AsReadOnly&lt;/span&gt;();&lt;/p&gt;        &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;     &lt;/div&gt;   &lt;/div&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;Finally we add the new &lt;span style="color: #008b8b"&gt;SyncStateCaptions &lt;/span&gt;method and the full version of the permission will be,&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;     &lt;p style="margin: 0px"&gt;[&lt;span style="color: #00008b"&gt;NonPersistent&lt;/span&gt;]&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;StateMachineTransitionPermission&lt;/span&gt; : &lt;span style="color: #00008b"&gt;PermissionBase&lt;/span&gt; {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;    …&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;    …&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt; &lt;/p&gt;      &lt;p style="margin: 0px"&gt;    [&lt;span style="color: #00008b"&gt;ImmediatePostData&lt;/span&gt;]&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;StateMachineName&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;get&lt;/span&gt;; &lt;span style="color: #008b8b"&gt;set&lt;/span&gt;; }&lt;/p&gt;      &lt;p style="margin: 0px"&gt; &lt;/p&gt;      &lt;p style="margin: 0px"&gt;    [&lt;span style="color: #00008b"&gt;PropertyEditor&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;IStringLookupPropertyEditor&lt;/span&gt;))]&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    [&lt;span style="color: #00008b"&gt;DataSourceProperty&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"StateCaptions"&lt;/span&gt;)]&lt;/p&gt;      &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;StateCaption&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;get&lt;/span&gt;; &lt;span style="color: #008b8b"&gt;set&lt;/span&gt;; }&lt;/p&gt;      &lt;p style="margin: 0px"&gt; &lt;/p&gt;      &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;       &lt;p style="margin: 0px"&gt;&lt;span style="color: #00008b"&gt;    IList&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; &lt;span style="color: purple"&gt;_stateCaptions&lt;/span&gt; = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;();&lt;/p&gt;        &lt;p style="margin: 0px"&gt;    [&lt;span style="color: #00008b"&gt;Browsable&lt;/span&gt;(&lt;span style="color: blue"&gt;false&lt;/span&gt;)]&lt;/p&gt;        &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;    public&lt;/span&gt; &lt;span style="color: #00008b"&gt;IList&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; &lt;span style="color: purple"&gt;StateCaptions&lt;/span&gt; {&lt;span style="color: #008b8b"&gt;get&lt;/span&gt; {&lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: purple"&gt;_stateCaptions&lt;/span&gt;;}}&lt;/p&gt;        &lt;p style="margin: 0px"&gt; &lt;/p&gt;        &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;    public&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;SyncStateCaptions&lt;/span&gt;(&lt;span style="color: #00008b"&gt;IList&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; stateCaptions, &lt;span style="color: blue"&gt;string&lt;/span&gt; machineName) {&lt;/p&gt;        &lt;p style="margin: 0px"&gt;        &lt;span style="color: purple"&gt;StateMachineName&lt;/span&gt; = machineName;&lt;/p&gt;        &lt;p style="margin: 0px"&gt;       &lt;span style="color: purple"&gt;_stateCaptions&lt;/span&gt; = stateCaptions;&lt;/p&gt;        &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;     &lt;/div&gt;      &lt;p style="margin: 0px"&gt;}&lt;/p&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;To support platform independent cascading lookups we wrote only about 10 lines of code! This is proof of how much XAF architecture cuts down on development costs. The module can be downloaded from the Xpand &lt;a href="http://www.blogger.com/expandframework.com/downloads/download.html" target="_blank"&gt;download page&lt;/a&gt;   and we are happy to hear your feedback. Remember that your questions are the best candidates for future posts!&lt;/p&gt;  &lt;p&gt;&lt;iframe style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" height="360" src="http://tv.devexpress.com/embed.aspx?friendlyId=XAFStateMachineModule&amp;amp;autostart=false" frameborder="0" width="640" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-6075732674129446103?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mnIy8AaSiwVh4Ose41OKkPR3lEY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mnIy8AaSiwVh4Ose41OKkPR3lEY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mnIy8AaSiwVh4Ose41OKkPR3lEY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mnIy8AaSiwVh4Ose41OKkPR3lEY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/8ZCNSKGYLiY" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-30T17:57:06.459+02:00</app:edited><media:thumbnail url="http://lh6.ggpht.com/-thBGm2vIRT0/Tnw6z8v-jzI/AAAAAAAABNI/xOgqLAr6qlQ/s72-c/image_thumb2.png?imgmax=800" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/09/creating-state-machine-module-for.html</feedburner:origLink></item><item><title>Calculated members creation—Pros and Cons</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/yJ-4kQMm8xA/calculated-members-creationpros-and.html</link><category>DX</category><category>Runtime Members</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Tue, 20 Sep 2011 13:45:30 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-7021560579692033735</guid><description>&lt;p&gt;As promised in the previous post I will now attempt to provide a concise yet comprehensive look at the 5 possibilities that Xpand gives us when we want to create a calculated member. I will also provide discussion of the relative advantages and disadvantages of each approach. We can see all of them in action in Xpand FeatureCenter application. Remember it is only thanks to the fact that XAF/XPO have such a strong and flexible architecture that this is possible! We must also acknowledge that these approaches have evolved as a direct result of contributions from the XAF team and community.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-huIrT7gotOk/Tnj7O2s0v7I/AAAAAAAABMM/EEKO19AJ-hM/s1600-h/image_thumb11%25255B2%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image_thumb11" border="0" alt="image_thumb11" src="http://lh4.ggpht.com/-L7HKbL861U8/Tnj7QPYD4UI/AAAAAAAABMQ/8AIzBGPzooo/image_thumb11_thumb.png?imgmax=800" width="194" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;1. &lt;u&gt;The XPO way –&amp;gt;Using Code &lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Take a look at the CreateCalculabeMember extension method in the code below,&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;CreateRuntimeCalculatedFieldController&lt;/span&gt; : &lt;span style="color: #00008b"&gt;ViewController&lt;/span&gt; {&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;CustomizeTypesInfo&lt;/span&gt;(&lt;span style="color: #00008b"&gt;DevExpress&lt;/span&gt;.&lt;span style="color: #00008b"&gt;ExpressApp&lt;/span&gt;.&lt;span style="color: #00008b"&gt;DC&lt;/span&gt;.&lt;span style="color: #00008b"&gt;ITypesInfo&lt;/span&gt; typesInfo) {&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;CustomizeTypesInfo&lt;/span&gt;(typesInfo);&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&lt;span style="color: #00008b"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XPClassInfo&lt;/span&gt; classInfo = &lt;span style="color: #00008b"&gt;XafTypesInfo&lt;/span&gt;.&lt;span style="color: purple"&gt;XpoTypeInfoSource&lt;/span&gt;.&lt;span style="color: purple"&gt;XPDictionary&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;GetClassInfo&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;Customer&lt;/span&gt;));&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if&lt;/span&gt; (classInfo.&lt;span style="color: #008b8b"&gt;FindMember&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;SumOfOrderTotals&amp;quot;&lt;/span&gt;)==&lt;span style="color: blue"&gt;null&lt;/span&gt;) {&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var&lt;/span&gt; attributes = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;Attribute&lt;/span&gt;[] {&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;PersistentAliasAttribute&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Orders.Sum(Total)&amp;quot;&lt;/span&gt;)};&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&lt;span style="color: #00008b"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; XPCustomMemberInfo&lt;/span&gt; calculabeMember = classInfo.&lt;span style="color: #008b8b"&gt;CreateCalculabeMember&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;SumOfOrderTotals&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: blue"&gt;float&lt;/span&gt;), attributes);&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; typesInfo.&lt;span style="color: #008b8b"&gt;RefreshInfo&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;Customer&lt;/span&gt;));&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;}&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&lt;font color="#000000" size="2" face="Consolas"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;XPO has a &lt;a href="http://documentation.devexpress.com/#XPO/clsDevExpressXpoMetadataReflectionDictionarytopic" target="_blank"&gt;dictionary&lt;/a&gt; of domain metadata. The metadata of each persistent object is stored in &lt;a href="http://documentation.devexpress.com/#XPO/clsDevExpressXpoMetadataXPClassInfotopic" target="_blank"&gt;XPClassInfo&lt;/a&gt; classes and the metadata of their properties is stored in &lt;a href="http://documentation.devexpress.com/#XPO/clsDevExpressXpoMetadataXPMemberInfotopic" target="_blank"&gt;XPMemberInfo&lt;/a&gt; classes. One of the main advantages of this approach is that it&amp;#160; adds a new member to the XPO dictionary and therefore follows XAF to the letter. This is because in order to form the model XAF first queries the XPO dictionary and finally in order to configure the views it queries the model. Since we have worked in the data layer our calculated values will be sent to any data bound enabled control for rendering. The other benefit is that if we code there are no restrictions on what we can do, for example we can create members calling a WCF service. The sky’s the limit!&lt;/p&gt;  &lt;p&gt;On the other hand each time we write new code we need to spend time testing and distributing it. Furthermore in certain scenarios problems can occur due to the fact that we add a new member to the object. For each new member we add to an object we are forced to deal with long properties lists in our model which can be somewhat unwieldy – imagine an&amp;#160; object with 200 properties.&lt;/p&gt;  &lt;p&gt;Note; XAF is smart enough to manage all of this without even breaking a sweat. This means that its performance does not suffer in any way. It is simply that this approach can leave the user with a bit of a headache! &lt;/p&gt;  &lt;p style="margin: 0px" align="justify"&gt;&lt;strong&gt;2. &lt;u&gt;Using the model&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p style="margin: 0px" align="justify"&gt;&lt;strong&gt;&lt;u&gt;&lt;font color="#000000"&gt;&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p style="margin: 0px" align="justify"&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p style="margin: 0px" align="justify"&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p style="margin: 0px" align="justify"&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p style="margin: 0px" align="justify"&gt;We have extended our model in order to describe all types of calculated and runtime properties. &lt;/p&gt;  &lt;p style="margin: 0px" align="justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="margin: 0px" align="justify"&gt;&lt;/p&gt;  &lt;p style="margin: 0px" align="justify"&gt;&lt;a href="http://lh5.ggpht.com/-Hyq7o5BE3MI/Tnj7Q64FAzI/AAAAAAAABMU/wpuTS57_3g0/s1600-h/image_thumb14_thumb%25255B2%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image_thumb14_thumb" border="0" alt="image_thumb14_thumb" src="http://lh6.ggpht.com/-G3912644cvU/Tnj7R35mQ9I/AAAAAAAABMY/tpIp0T9Mhyo/image_thumb14_thumb_thumb.png?imgmax=800" width="244" height="95" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p style="margin: 0px" align="justify"&gt;&lt;/p&gt;  &lt;p style="margin: 0px" align="justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="margin: 0px" align="justify"&gt;Having done this makes it pretty easy to utilize the powerful XPO and add members in its dictionary as with the previous approach. This means this method shares some of the benefits we mentioned above. However as we are not writing code we can’t enjoy the same level of flexibility unless we utilize &lt;a href="http://documentation.devexpress.com/#Xaf/CustomDocument3315" target="_blank"&gt;ModelUpdaters&lt;/a&gt;. Also as the columns can only be created using model editor they are only useful in situations when we have permission to modify the model. Finally we could end up with a huge number of properties here too for the same reason we identified previously.&lt;/p&gt;  &lt;p style="margin: 0px" align="justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="margin: 0px" align="justify"&gt;All this is not to say that this approach doesn’t have its own unique advantages. For example the model difference can be stored in a database or xml file making it easy to distribute. To this end we can use the build in API or a specialized module like &lt;a href="http://www.expandframework.com/#IO" target="_blank"&gt;IO&lt;/a&gt;. Moreover it is possible to develop on site (client). Of course working at the model level allows us to use a model manager module like &lt;a href="http://www.expandframework.com/#modeldifference" target="_blank"&gt;ModelDifference&lt;/a&gt; which is a great aid. It can be used to distribute the unbound columns to users, roles and even to other applications. In addition since ModelDifference supports both platforms it is possible to create calculated members without restarting the application or IIS.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;3.&lt;/strong&gt;&lt;u&gt;&lt;strong&gt;WorldCreator extended members&lt;/strong&gt; &lt;/u&gt;&lt;/p&gt;  &lt;p align="justify"&gt;This module maps the structure of the &lt;a href="http://documentation.devexpress.com/#XPO/clsDevExpressXpoMetadataXPMemberInfotopic" target="_blank"&gt;XPMemberInfo&lt;/a&gt; class to a persistent object. This approach is again similar to model approach (and once again has similar benefits) however there is a crucial difference. Instead of using the model to gather data to form the calculated members we use the input taken from the UI. &lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh4.ggpht.com/-4ByhwegYf7w/Tnj7S6CwzTI/AAAAAAAABMc/uJqO1sCFmMY/s1600-h/image_thumb17_thumb%25255B2%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image_thumb17_thumb" border="0" alt="image_thumb17_thumb" src="http://lh6.ggpht.com/-jQ7yiXYwZTA/Tnj7TitHpUI/AAAAAAAABMg/ArvYXDBfjto/image_thumb17_thumb_thumb.png?imgmax=800" width="244" height="172" /&gt;&lt;/a&gt;&lt;a href="http://lh3.ggpht.com/-CXpDgyF5Q7Q/Tnj7UM2CjiI/AAAAAAAABMk/wsdkaCDRBr0/s1600-h/image_thumb20_thumb%25255B2%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image_thumb20_thumb" border="0" alt="image_thumb20_thumb" src="http://lh5.ggpht.com/-WbBDoajd7Ao/Tnj7VZnrtXI/AAAAAAAABMo/WcbQhETlo8I/image_thumb20_thumb_thumb.png?imgmax=800" width="244" height="223" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Using the UI is simplicity itself! It requires no technical knowledge whatsoever as the user is only required to choose from a set of basic options. We can still code if we wish, this time by creating persistent objects and then leaving eXpand to take care of the rest. That being said the real beauty of this approach is that the product can be developed on site without the user having to write a single line of code or using a sophisticated tool like &lt;a href="http://documentation.devexpress.com/#Xaf/CustomDocument2830" target="_blank"&gt;Model Editor&lt;/a&gt;. Moreover we can enjoy ease of distribution due to the fact that our objects are stored in the database. As the metadata is now in the form of persistent objects locating it and working with it is as easy as ever. &lt;/p&gt;  &lt;p align="justify"&gt;By now it should be clear that as we are still relying on XPO we are faced with the same old problem regarding multiple views.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;4.&lt;/strong&gt; &lt;u&gt;&lt;strong&gt;Using a WordCreator Dynamic Assembly&lt;/strong&gt; &lt;/u&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Our fourth approach uses the same module to create dynamic persistent assemblies using code generation templates. &lt;a href="http://www.devexpress.com/Products/NET/Application_Framework/" target="_blank"&gt;XAF&lt;/a&gt; is the best framework to describe domains which is evidenced by the way that&amp;#160; WorldCreator maps the Assembly structure to persistent objects and auto generates a flexible UI.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh4.ggpht.com/-Wo3hClz0Gak/Tnj7Ws9hXkI/AAAAAAAABMs/dBkVMxKsk1c/s1600-h/image_thumb23_thumb%25255B2%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image_thumb23_thumb" border="0" alt="image_thumb23_thumb" src="http://lh5.ggpht.com/-nQ6LSQUbUwg/Tnj7XrbSEEI/AAAAAAAABMw/ybvN1vNhYd0/image_thumb23_thumb_thumb.png?imgmax=800" width="192" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Using the templates will create a dynamic assembly with exactly the same code and structure as if we had taken the time to design it ourselves inside VS. Distribution is still easy since is everything is in the database. The fact that we script at runtime means that our options are almost unlimited when taking this approach.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;5. &lt;u&gt;The Unbound Column&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Extending the model with an Unbound column node as shown makes it possible to create Unbound grid columns and set their unbound expressions.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh4.ggpht.com/-XM4m4bDzif4/Tnj7YLFvK9I/AAAAAAAABM0/BCXW1Q2asGo/s1600-h/image_thumb2%25255B2%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image_thumb2" border="0" alt="image_thumb2" src="http://lh5.ggpht.com/-H7VEUa5_ktQ/Tnj7Yz_JWQI/AAAAAAAABM4/sJE_TdfIW0M/image_thumb2_thumb.png?imgmax=800" width="244" height="50" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh6.ggpht.com/-_AJrr1d5jhw/Tnj7ZUIsTlI/AAAAAAAABM8/BR826DfQBbA/s1600-h/image_thumb5%25255B2%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image_thumb5" border="0" alt="image_thumb5" src="http://lh6.ggpht.com/-XSZNdLyUSdA/Tnj7aE-ZSEI/AAAAAAAABNA/t3a6VNeFmtM/image_thumb5_thumb.png?imgmax=800" width="244" height="75" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;This is the only approach that allows us to work directly on views without utilizing XPO. This means that we gain the maximum level of flexibility since it is possible to have different columns for the same object views. Therefore we can work on this column independently. At the same time the end user can change the UnboundExpression at runtime using &lt;a href="http://documentation.devexpress.com/#WindowsForms/CustomDocument6212" target="_blank"&gt;expression editor&lt;/a&gt; (windows only). When it comes to distribution we find the same advantages as we do whenever we deal with the model.&lt;/p&gt;  &lt;p align="justify"&gt;As with the second approach we lose some flexibility because we are not writing code but again we can get round this using &lt;a href="http://documentation.devexpress.com/#Xaf/CustomDocument3315" target="_blank"&gt;ModelUpdaters&lt;/a&gt;. In addition our columns still cannot be used when we do not have permission to modify the model. Another disadvantage concerns the fact that XAF is designed to make all calculations in the data layer and send the values to controls by applying an MVC pattern. A few years after XAF was released, Microsoft built Silverlight featuring very similar architecture. Taking into account the various factors this has been recognized as the optimal approach. Although using Unbound columns allows us to work in a different way we need to write extra code to support each control (Tree, Pivot etc) because the calculations are performed in the UI.&lt;/p&gt;  &lt;p align="justify"&gt;   &lt;br /&gt;We are happy to read your feedback about this!. Remember that your questions are the best candidates for future posts.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-7021560579692033735?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mKl0oWmW-kYfRDqyi17ZXXMvkO4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mKl0oWmW-kYfRDqyi17ZXXMvkO4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mKl0oWmW-kYfRDqyi17ZXXMvkO4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mKl0oWmW-kYfRDqyi17ZXXMvkO4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/yJ-4kQMm8xA" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-20T23:45:30.598+03:00</app:edited><media:thumbnail url="http://lh4.ggpht.com/-L7HKbL861U8/Tnj7QPYD4UI/AAAAAAAABMQ/8AIzBGPzooo/s72-c/image_thumb11_thumb.png?imgmax=800" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/09/calculated-members-creationpros-and.html</feedburner:origLink></item><item><title>eXpandFrameWork Supporting Unbound Columns</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/j0Uip8vavJg/expandframework-supporting-unbound.html</link><category>Xaf</category><category>DX</category><category>Runtime Members</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Fri, 16 Sep 2011 06:46:55 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-1134080336222333020</guid><description>&lt;p align="justify"&gt;Recently in Xpand forums &lt;a href="http://www.expandframework.com/forum/profile/userid-338.html" target="_blank"&gt;Dionisis Soldatos&lt;/a&gt; raised a question about how unbound columns can be implemented with &lt;a href="http://www.devexpress.com/Products/NET/Application_Framework/" target="_blank"&gt;XAF&lt;/a&gt;. Unbound columns along with their &lt;a href="http://documentation.devexpress.com/#WindowsForms/DevExpressXtraGridColumnsGridColumn_UnboundExpressiontopic" target="_blank"&gt;UnboundExpression&lt;/a&gt; can be used for creating calculated fields even at runtime. Since we are talking about unbound grid columns it should be obvious that we will operate at the UI level by modifying the grid control columns. However lets do a deep dive inside XAF model to extend it as needed!&lt;/p&gt;  &lt;p align="justify"&gt;&lt;u&gt;The Model&lt;/u&gt;&lt;/p&gt;  &lt;p align="justify"&gt;By now we are all used to XAF providing us with excellent out of the box solutions which negate the need for us to write hundredths of lines of code. This of course means money saved during developing and ultimately your product hits the market faster. Why spend time reinventing the wheel when the XAF team have already done the hard work for you?&lt;/p&gt;  &lt;p align="justify"&gt;XAF creates the model by reading the metadata of our classes, this model has 3 types of view. One of these is the ListView which can be displayed with data source enabled controls like Grid controls. ListView has columns which correspond to existing object properties metadata and when XAF creates a Grid at runtime it queries model’s ListView columns. It then creates and configures Grid columns from their attributes. These stages are well tested and it is preferable to use them in our solution and override the unnecessary stages. For example we could create a normal model column node using XAF default Add/Column menu. After the Grid column is created it we simply need a few lines of code to make it unbound and set its &lt;a href="http://documentation.devexpress.com/#WindowsForms/DevExpressXtraGridColumnsGridColumn_UnboundExpressiontopic" target="_blank"&gt;Unbound Expression&lt;/a&gt;.&lt;/p&gt;  &lt;p align="justify"&gt; &lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh4.ggpht.com/-ZYYoV-6ZpE0/TnNJ3YXbh0I/AAAAAAAABLs/OJrN-YLv_1c/s1600-h/image4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-RSqpggGcWto/TnNJ3-L2nEI/AAAAAAAABLw/8YBcCGrDr0A/image_thumb2.png?imgmax=800" width="429" height="92" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt; &lt;/p&gt;  &lt;p align="justify"&gt;In order to store this expression we still need to extend model’s ListView with an attribute. The model can be extended either by registering an interface at &lt;a href="http://documentation.devexpress.com/#Xaf/CustomDocument2785" target="_blank"&gt;ModuleBase.ExtendModelInterfaces&lt;/a&gt; or by deriving it from an already registered interface. I am going to take the latter options by deriving from &lt;a href="http://documentation.devexpress.com/#Xaf/clsDevExpressExpressAppModelIModelColumntopic" target="_blank"&gt;IModelColumn&lt;/a&gt; interface which I will explain as we go. &lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;interface&lt;/span&gt; &lt;span style="color: #00008b"&gt;IModelColumnUnbound&lt;/span&gt; : &lt;span style="color: #00008b"&gt;IModelColumn&lt;/span&gt; {&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt; &lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;    [&lt;span style="color: #00008b"&gt;Category&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"eXpand"&lt;/span&gt;)]&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;    &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: purple"&gt;ShowUnboundExpressionMenu&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;get&lt;/span&gt;; &lt;span style="color: #008b8b"&gt;set&lt;/span&gt;; }&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt; &lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;    [&lt;span style="color: #00008b"&gt;Category&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"eXpand"&lt;/span&gt;)]&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;    [&lt;span style="color: #00008b"&gt;Required&lt;/span&gt;]&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;    &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;UnboundExpression&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;get&lt;/span&gt;; &lt;span style="color: #008b8b"&gt;set&lt;/span&gt;; }&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;}&lt;/p&gt;  &lt;p align="justify"&gt;XAF &lt;a href="http://documentation.devexpress.com/#Xaf/CustomDocument2830" target="_blank"&gt;model editor&lt;/a&gt; is a highly sophisticated tool which has the capability to recognize that we extended the model. It then takes care of the vital step of adding an entry to the Add menu for creating Unbound columns.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh6.ggpht.com/-83_gQGo5I14/TnNJ4l1I5QI/AAAAAAAABL0/wGqZ5FDn-Ng/s1600-h/image9.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-NKSvdlSqcuk/TnNJ5L-6R-I/AAAAAAAABL4/gU05ttb8xWc/image_thumb5.png?imgmax=800" width="526" height="101" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Now it is possible to create a new type of column with 2 extra attributes as shown,&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh6.ggpht.com/-B2s8mcpPc5s/TnNJ59x_LQI/AAAAAAAABL8/-A-_KIPbF5s/s1600-h/image15.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-05wKYAuci-Q/TnNJ6l76tFI/AAAAAAAABMA/E6PiKl4PPIg/image_thumb8.png?imgmax=800" width="558" height="165" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Moving on we need to set the mandatory PropertyName attribute shown above to an always existing object property name. Remember XAF requires this in order to behave as designed. To this end we are going to set as PropertyName the object’s key property name using this simple &lt;a href="http://documentation.devexpress.com/#Xaf/CustomDocument3169/5" target="_blank"&gt;DomainLogic&lt;/a&gt; class,&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;[&lt;span style="color: #00008b"&gt;DomainLogic&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;IModelColumnUnbound&lt;/span&gt;))]&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;IModelColumnUnboundLogic&lt;/span&gt; {&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: #008b8b"&gt;Get_PropertyName&lt;/span&gt;(&lt;span style="color: #00008b"&gt;IModelColumnUnbound&lt;/span&gt; columnUnbound) {&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; ((&lt;span style="color: #00008b"&gt;IModelListView&lt;/span&gt;)columnUnbound.&lt;span style="color: purple"&gt;Parent&lt;/span&gt;.&lt;span style="color: purple"&gt;Parent&lt;/span&gt;).&lt;span style="color: purple"&gt;ModelClass&lt;/span&gt;.&lt;span style="color: purple"&gt;KeyProperty&lt;/span&gt;;&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;    }&lt;/p&gt;  &lt;p align="justify"&gt;As a result (PropertyName, PropertyEditorType and Caption) attributes will be populated the next time we create a ColumnUnbound Node. However these will be fixed values and it is preferable to hide them from the end user. At the same time we need to mark Caption attribute as required and remove its default value. To do all of this we just need to extend our IModelColumnUnbound interface like this,&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh3.ggpht.com/-SpoBsIxV2-s/TnNJ7KU_avI/AAAAAAAABME/CkT8QPBOUSk/s1600-h/image20.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-XXyyHvB2w4A/TnNJ7_dJ7hI/AAAAAAAABMI/skhnXmg49Js/image_thumb11.png?imgmax=800" width="646" height="324" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Note; Although PropertyName and Caption belong to &lt;a href="http://documentation.devexpress.com/#Xaf/clsDevExpressExpressAppModelIModelColumntopic" target="_blank"&gt;IModelColumn&lt;/a&gt; using the new operator it is possible to override them!&lt;/p&gt;  &lt;p align="justify"&gt;We have now finished with the model modifications and for our ColumnUnbound nodes XAF by design will create a new column pointing back to object’s key property metadata.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;u&gt;The UI&lt;/u&gt;&lt;/p&gt;  &lt;p align="justify"&gt;A key benefit of XAF’s commitment to design patterns, specifically to the &lt;a href="http://tv.devexpress.com/#SingleResponsibilityPrinciple" target="_blank"&gt;Single responsibility principle&lt;/a&gt;, is that it provides us with the model’s synchronizer classes. These can be used to synchronize our model with the control and vice versa. It is only necessary to derive from the abstract ModelSyncroniser&amp;lt;T,V&amp;gt; and implement ApplyModeCore method to synchronize the control and from SynchronizeModel to do the same with the model.&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span class="Apple-style-span" style="color: rgb(0, 0, 139); "&gt;UnboundColumnSynchronizer&lt;/span&gt;: &lt;span style="color: #00008b"&gt;ModelSynchronizer&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;GridListEditor&lt;/span&gt;, &lt;span style="color: #00008b"&gt;IModelListView&lt;/span&gt;&amp;gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;UnboundColumnSynchronizer&lt;/span&gt;(&lt;span style="color: #00008b"&gt;GridListEditor&lt;/span&gt; control, &lt;span style="color: #00008b"&gt;IModelListView&lt;/span&gt; model)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        : &lt;span style="color: #00008b"&gt;base&lt;/span&gt;(control, model) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;ApplyModelCore&lt;/span&gt;() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;var&lt;/span&gt; xafGridColumns = &lt;span style="color: #008b8b"&gt;GetXafGridColumns&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: blue"&gt;var&lt;/span&gt; &lt;span style="font-weight: bold"&gt;column&lt;/span&gt; &lt;span style="color: blue"&gt;in&lt;/span&gt; xafGridColumns) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;var&lt;/span&gt; modelColumnUnbound = (&lt;span style="color: #00008b"&gt;IModelColumnUnbound&lt;/span&gt;)&lt;span style="font-weight: bold"&gt;column&lt;/span&gt;.&lt;span style="color: purple"&gt;Model&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="font-weight: bold"&gt;column&lt;/span&gt;.&lt;span style="color: purple"&gt;FieldName&lt;/span&gt; = modelColumnUnbound.&lt;span style="color: purple"&gt;Id&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="font-weight: bold"&gt;column&lt;/span&gt;.&lt;span style="color: purple"&gt;UnboundType&lt;/span&gt; = &lt;span style="color: #00008b"&gt;UnboundColumnType&lt;/span&gt;.&lt;span style="color: purple; font-weight: bold"&gt;Object&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="font-weight: bold"&gt;column&lt;/span&gt;.&lt;span style="color: purple"&gt;OptionsColumn&lt;/span&gt;.&lt;span style="color: purple"&gt;AllowEdit&lt;/span&gt; = &lt;span style="color: blue"&gt;false&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="font-weight: bold"&gt;column&lt;/span&gt;.&lt;span style="color: purple"&gt;ShowUnboundExpressionMenu&lt;/span&gt; = modelColumnUnbound.&lt;span style="color: purple"&gt;ShowUnboundExpressionMenu&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="font-weight: bold"&gt;column&lt;/span&gt;.&lt;span style="color: purple"&gt;UnboundExpression&lt;/span&gt; = modelColumnUnbound.&lt;span style="color: purple"&gt;UnboundExpression&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: #00008b"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;XafGridColumn&lt;/span&gt;&amp;gt; &lt;span style="color: #008b8b"&gt;GetXafGridColumns&lt;/span&gt;() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #00008b"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;XafGridColumn&lt;/span&gt;&amp;gt; xafGridColumns =&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="color: purple"&gt;Model&lt;/span&gt;.&lt;span style="color: purple"&gt;Columns&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;OfType&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;IModelColumnUnbound&lt;/span&gt;&amp;gt;().&lt;span style="color: #008b8b"&gt;Select&lt;/span&gt;(&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                unbound =&amp;gt; &lt;span style="color: purple"&gt;Control&lt;/span&gt;.&lt;span style="color: purple"&gt;GridView&lt;/span&gt;.&lt;span style="color: purple"&gt;Columns&lt;/span&gt;[unbound.&lt;span style="color: purple"&gt;PropertyName&lt;/span&gt;] &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: #00008b"&gt;XafGridColumn&lt;/span&gt;).&lt;span style="color: #008b8b"&gt;Where&lt;/span&gt;(column =&amp;gt; column != &lt;span style="color: blue"&gt;null&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; xafGridColumns;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;SynchronizeModel&lt;/span&gt;() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;var&lt;/span&gt; xafGridColumns = &lt;span style="color: #008b8b"&gt;GetXafGridColumns&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: blue"&gt;var&lt;/span&gt; &lt;span style="font-weight: bold"&gt;xafGridColumn&lt;/span&gt; &lt;span style="color: blue"&gt;in&lt;/span&gt; xafGridColumns) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            ((&lt;span style="color: #00008b"&gt;IModelColumnUnbound&lt;/span&gt;) &lt;span style="font-weight: bold"&gt;xafGridColumn&lt;/span&gt;.&lt;span style="color: purple"&gt;Model&lt;/span&gt;).&lt;span style="color: purple"&gt;UnboundExpression&lt;/span&gt; = &lt;span style="font-weight: bold"&gt;xafGridColumn&lt;/span&gt;.&lt;span style="color: purple"&gt;UnboundExpression&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt; &lt;/div&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt; &lt;/p&gt;  &lt;p align="justify"&gt;&lt;/p&gt;  &lt;p align="justify"&gt;The above code uses the GetXafGridColumns method to return the grid columns that correspond to IModelColumnUnbound nodes. The web implementation is very similar and can be found &lt;a href="https://github.com/expand/eXpand/blob/master/Xpand/Xpand.ExpressApp/Xpand.ExpressApp.Web/SystemModule/UnboundColumnController.cs" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p align="justify"&gt;All that is left is to register our UnboundColumnSynchronizer like this,&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;UnboundColumnController&lt;/span&gt; : &lt;span style="color: #00008b"&gt;ViewController&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ListView&lt;/span&gt;&amp;gt; {&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;    &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;OnActivated&lt;/span&gt;() {&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;        &lt;span style="color: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;OnActivated&lt;/span&gt;();&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;        &lt;span style="color: blue"&gt;var&lt;/span&gt; gridListEditor = &lt;span style="color: purple"&gt;View&lt;/span&gt;.&lt;span style="color: purple"&gt;Editor&lt;/span&gt; &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: #00008b"&gt;GridListEditor&lt;/span&gt;;&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (gridListEditor != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;            gridListEditor.&lt;span style="color: fuchsia"&gt;CreateCustomModelSynchronizer&lt;/span&gt; &lt;span style="color: #008b8b"&gt;+=&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GridListEditorOnCreateCustomModelSynchronizer&lt;/span&gt;;&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;    }&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt; &lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;    &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GridListEditorOnCreateCustomModelSynchronizer&lt;/span&gt;(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #00008b"&gt;CreateCustomModelSynchronizerEventArgs&lt;/span&gt; createCustomModelSynchronizerEventArgs) {&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;        createCustomModelSynchronizerEventArgs.&lt;span style="color: purple"&gt;ModelSynchronizer&lt;/span&gt; = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;UnboundColumnSynchronizer&lt;/span&gt;((&lt;span style="color: #00008b"&gt;GridListEditor&lt;/span&gt;)sender, &lt;span style="color: purple"&gt;View&lt;/span&gt;.&lt;span style="color: purple"&gt;Model&lt;/span&gt;);&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;    }&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt;}&lt;/p&gt;  &lt;p style="margin: 0px; font-family: consolas; background: white; color: black; font-size: 10pt" align="justify"&gt; &lt;/p&gt;  &lt;p align="justify"&gt;Note; Setting ShowUnboundExpressionMenu to true is only supported by Windows platform. There, an end user can modify the UnBoundExpression by invoking Grid’s &lt;a href="http://documentation.devexpress.com/#WindowsForms/CustomDocument6212" target="_blank"&gt;expression editor&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Together with the unbound column Xpand allows for up to 5 different approaches to creating calculated fields. In the next post we will discuss the pros and cons of each approach so stay tuned!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-1134080336222333020?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FqC5C0RJGLOd3V1rpbC1VADRbAY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FqC5C0RJGLOd3V1rpbC1VADRbAY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FqC5C0RJGLOd3V1rpbC1VADRbAY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FqC5C0RJGLOd3V1rpbC1VADRbAY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/j0Uip8vavJg" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-16T16:46:55.438+03:00</app:edited><media:thumbnail url="http://lh5.ggpht.com/-RSqpggGcWto/TnNJ3-L2nEI/AAAAAAAABLw/8YBcCGrDr0A/s72-c/image_thumb2.png?imgmax=800" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/09/expandframework-supporting-unbound.html</feedburner:origLink></item><item><title>DevExpress Workflow Instance Store</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/v01RPCJABg4/devexpress-workflow-instance-store.html</link><category>DX</category><category>WF</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Tue, 06 Sep 2011 07:16:49 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-1945755265183148053</guid><description>&lt;p&gt;In version 11.1.7 our team now provides workflow instance support outside &lt;a href="http://www.devexpress.com/Products/NET/Application_Framework/" target="_blank"&gt;XAF&lt;/a&gt; borders! With a few lines of code, it is now possible to store our workflows in any of the 14 database systems described in this &lt;a href="http://community.devexpress.com/blogs/eaf/archive/2011/08/24/xaf-workflow-persistence-storage.aspx" target="_blank"&gt;post&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Durability is a key benefit of the Workflow Foundation and it is based on the ability to store a running workflow instance on the fly at almost any time.&amp;#160; &lt;br /&gt;To this end Microsoft workflow team implemented the SqlWokflowInstanceStore class. Using this class and a few lines is possible to store workflow instances in SQL Server as shown,&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;// Define SqlWorkflowInstanceStoreBehavior:&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;//&amp;#160;&amp;#160; Set interval to renew instance lock to 5 seconds.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;//&amp;#160;&amp;#160; Set interval to check for runnable instances to 2 seconds.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;//&amp;#160;&amp;#160; Instance Store does not keep instances after it is completed.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;//&amp;#160;&amp;#160; Select exponential back-off algorithm when retrying to load a locked instance.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;//&amp;#160;&amp;#160; Instance state information is compressed using the GZip compressing algorithm. &lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #00008b"&gt;SqlWorkflowInstanceStoreBehavior&lt;/span&gt; instanceStoreBehavior = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;SqlWorkflowInstanceStoreBehavior&lt;/span&gt;(&lt;span style="color: purple; font-weight: bold"&gt;connectionString&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;instanceStoreBehavior.&lt;span style="color: purple"&gt;HostLockRenewalPeriod&lt;/span&gt; = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;TimeSpan&lt;/span&gt;(0, 0, 5);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;instanceStoreBehavior.&lt;span style="color: purple"&gt;RunnableInstancesDetectionPeriod&lt;/span&gt; = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;TimeSpan&lt;/span&gt;(0, 0, 2);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;instanceStoreBehavior.&lt;span style="color: purple"&gt;InstanceCompletionAction&lt;/span&gt; = &lt;span style="color: #00008b"&gt;InstanceCompletionAction&lt;/span&gt;.&lt;span style="color: purple; font-weight: bold"&gt;DeleteAll&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;instanceStoreBehavior.&lt;span style="color: purple"&gt;InstanceLockedExceptionAction&lt;/span&gt; = &lt;span style="color: #00008b"&gt;InstanceLockedExceptionAction&lt;/span&gt;.&lt;span style="color: purple; font-weight: bold"&gt;AggressiveRetry&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;instanceStoreBehavior.&lt;span style="color: purple"&gt;InstanceEncodingOption&lt;/span&gt; = &lt;span style="color: #00008b"&gt;InstanceEncodingOption&lt;/span&gt;.&lt;span style="color: purple; font-weight: bold"&gt;GZip&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;host.&lt;span style="color: purple"&gt;Description&lt;/span&gt;.&lt;span style="color: purple"&gt;Behaviors&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Add&lt;/span&gt;(instanceStoreBehavior);&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;The above code was copied from the &amp;quot;BuiltInConfiguration&amp;quot; demo, &amp;quot;InstanceStore1&amp;quot; project. This demo is described at &amp;quot;Built-in Configuration&amp;quot;        &lt;br /&gt;(&lt;/em&gt;&lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee622978.aspx"&gt;&lt;font size="1"&gt;&lt;em&gt;http://msdn.microsoft.com/en-us/library/ee622978.aspx)&lt;/em&gt;&lt;/font&gt;&lt;/a&gt;&lt;font size="1"&gt;&lt;em&gt;. You can download full sources of this demo and many others at &amp;quot;WCF and WF Samples for .NET Framework 4&amp;quot;        &lt;br /&gt;(&lt;/em&gt;&lt;/font&gt;&lt;a href="http://www.microsoft.com/download/en/details.aspx?id=21459"&gt;&lt;font size="1"&gt;&lt;em&gt;http://www.microsoft.com/download/en/details.aspx?id=21459)&lt;/em&gt;&lt;/font&gt;&lt;/a&gt;&lt;font size="1"&gt;&lt;em&gt;.&lt;/em&gt; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Following the same architecture our team implemented the DX WorkFlow Instance Store. &lt;a href="http://www.devexpress.com/Products/NET/ORM/" target="_blank"&gt;eXpress Persistent Objects (XPO)&lt;/a&gt; is used for common objects storage and is fully capable of working transparently with &lt;a href="http://documentation.devexpress.com/#XPO/CustomDocument2559" target="_blank"&gt;14 different database systems&lt;/a&gt;. For example to provide support for an Oracle database we could write,&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;&lt;/div&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;//We create or connect to a database by setting the connectionstring &lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;//&lt;span style="color: green"&gt;This code will create 2 tables (XpoWorkflowInstance, XpoInstanceKeyc) in the database &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;using&lt;/span&gt; (&lt;span style="color: blue"&gt;var&lt;/span&gt; session = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;Session&lt;/span&gt;()) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; session.&lt;span style="color: purple"&gt;ConnectionString&lt;/span&gt; = &lt;span style="color: #a31515"&gt;&amp;quot;Data Source=DevExpressInstanceStore;User Id=myUsername;Password=myPassword&amp;quot;&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; session.&lt;span style="color: #008b8b"&gt;UpdateSchema&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;XpoWorkflowInstance&lt;/span&gt;), &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;XpoInstanceKey&lt;/span&gt;));&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; session.&lt;span style="color: #008b8b"&gt;CreateObjectTypeRecords&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;XpoWorkflowInstance&lt;/span&gt;), &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;XpoInstanceKey&lt;/span&gt;));&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;// Define WorkflowInstanceStoreBehavior:&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;var&lt;/span&gt; dxInstanceStoreBehavior = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;WorkflowInstanceStoreBehavior&lt;/span&gt;(&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;XpoWorkflowInstance&lt;/span&gt;), &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;XpoInstanceKey&lt;/span&gt;), &lt;span style="color: purple; font-weight: bold"&gt;DevExpressConnectionString&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;host.&lt;span style="color: purple"&gt;Description&lt;/span&gt;.&lt;span style="color: purple"&gt;Behaviors&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Add&lt;/span&gt;(dxInstanceStoreBehavior);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;dxInstanceStoreBehavior.&lt;span style="color: purple"&gt;RunnableInstancesDetectionPeriod&lt;/span&gt; = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;TimeSpan&lt;/span&gt;(0, 0, 2);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;dxInstanceStoreBehavior.&lt;span style="color: purple"&gt;InstanceCompletionAction&lt;/span&gt; = &lt;span style="color: #00008b"&gt;InstanceCompletionAction&lt;/span&gt;.&lt;span style="color: purple; font-weight: bold"&gt;DeleteAll&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;You can download a modified version of the “BuiltInConfiguration” solution &lt;a href="http://community.devexpress.com/blogs/eaf/DX_WF_InstanceStore.zip" target="_blank"&gt;here&lt;/a&gt;. The console application starts a long running workflow that implements a counting service. Once the service’s start method is invoked, the service counts from 0 to 59. The counter is incremented every 2 seconds. After each count the workflow persists so you can close the application at any time and when you start it next time it will continue. A new one will be started from '0' value in addition to the loaded instances. The second project “InstanceStore2” in the solution provides the same functionality, however it is configured using the app.config file as shown,&lt;/p&gt;  &lt;p style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;system.serviceModel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;extensions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;behaviorExtensions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;add&lt;/span&gt;&lt;span style="color: blue"&gt; &lt;/span&gt;&lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;DevExpressWorkflowInstanceStore&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt; &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;DevExpress.Workflow.Store.WorkflowInstanceStoreElement, DevExpress.Workflow.Activities.v11.1&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;behaviorExtensions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;extensions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;services&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;service&lt;/span&gt;&lt;span style="color: blue"&gt; &lt;/span&gt;&lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;CountingWorkflow&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt; &lt;/span&gt;&lt;span style="color: red"&gt;behaviorConfiguration&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;service&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;services&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;behaviors&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;serviceBehaviors&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;behavior&lt;/span&gt;&lt;span style="color: blue"&gt; &lt;/span&gt;&lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;!--&lt;/span&gt;&lt;span style="color: green"&gt;&amp;lt;sqlWorkflowInstanceStore&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; connectionString=&amp;quot;Data Source=.\SQLEXPRESS;Initial Catalog=InstanceStore;Integrated Security=True;Asynchronous Processing=True&amp;quot;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; hostLockRenewalPeriod=&amp;quot;00:00:05&amp;quot; runnableInstancesDetectionPeriod=&amp;quot;00:00:02&amp;quot; instanceCompletionAction=&amp;quot;DeleteAll&amp;quot;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; instanceLockedExceptionAction=&amp;quot;AggressiveRetry&amp;quot; instanceEncodingOption=&amp;quot;GZip&amp;quot;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; /&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;--&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;DevExpressWorkflowInstanceStore&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: red"&gt;connectionString&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Data Source=DevExpressInstanceStore;User Id=myUsername;Password=myPassword&lt;/span&gt;&amp;quot;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: red"&gt;runnableInstancesDetectionPeriod&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;00:00:02&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt; &lt;/span&gt;&lt;span style="color: red"&gt;instanceCompletionAction&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;DeleteAll&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;behavior&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;serviceBehaviors&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;behaviors&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;system.serviceModel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&lt;font color="#131313" face="Verdana"&gt;Note; All we need to do to use these code snippets in our code is to reference 'DevExpress.ExpressApp.v11.1.dll' and 'DevExpress.Workflow.Activities.v11.1.dl assemblies. Even though these assemblies are part of our eXpressApp framework they can also be used to support any other type of .NET application!&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;We are waiting to read your feedback about this. Remember that your questions are the best candidates for future posts.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;strong&gt;Related Links&lt;/strong&gt; &lt;/u&gt;    &lt;br /&gt;&lt;a href="http://community.devexpress.com/blogs/eaf/archive/tags/WF/default.aspx" target="_blank"&gt;Blog posts&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://documentation.devexpress.com/#Xaf/CustomDocument3343" target="_blank"&gt;Online documentation&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://tv.devexpress.com/#;WorkFlow.tag;1" target="_blank"&gt;Videos&lt;/a&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;&lt;font color="#131313" face="Verdana"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-1945755265183148053?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/COCWJDIKRKcJrppKZfqwCIYxNdo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/COCWJDIKRKcJrppKZfqwCIYxNdo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/COCWJDIKRKcJrppKZfqwCIYxNdo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/COCWJDIKRKcJrppKZfqwCIYxNdo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/v01RPCJABg4" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-06T17:16:49.752+03:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><media:content url="http://feedproxy.google.com/~r/AbekiarisBlog/~5/hB4_85AQFUU/DX_WF_InstanceStore.zip" fileSize="11092" type="application/x-zip-compressed" /><itunes:explicit>no</itunes:explicit><itunes:subtitle> In version 11.1.7 our team now provides workflow instance support outside XAF borders! With a few lines of code, it is now possible to store our workflows in any of the 14 database systems described in this post. Durability is a key benefit of the Workfl</itunes:subtitle><itunes:author>noreply@blogger.com (Apostolis Bekiaris)</itunes:author><itunes:summary> In version 11.1.7 our team now provides workflow instance support outside XAF borders! With a few lines of code, it is now possible to store our workflows in any of the 14 database systems described in this post. Durability is a key benefit of the Workflow Foundation and it is based on the ability to store a running workflow instance on the fly at almost any time.&amp;#160; To this end Microsoft workflow team implemented the SqlWokflowInstanceStore class. Using this class and a few lines is possible to store workflow instances in SQL Server as shown, // Define SqlWorkflowInstanceStoreBehavior: //&amp;#160;&amp;#160; Set interval to renew instance lock to 5 seconds. //&amp;#160;&amp;#160; Set interval to check for runnable instances to 2 seconds. //&amp;#160;&amp;#160; Instance Store does not keep instances after it is completed. //&amp;#160;&amp;#160; Select exponential back-off algorithm when retrying to load a locked instance. //&amp;#160;&amp;#160; Instance state information is compressed using the GZip compressing algorithm. SqlWorkflowInstanceStoreBehavior instanceStoreBehavior = new SqlWorkflowInstanceStoreBehavior(connectionString); instanceStoreBehavior.HostLockRenewalPeriod = new TimeSpan(0, 0, 5); instanceStoreBehavior.RunnableInstancesDetectionPeriod = new TimeSpan(0, 0, 2); instanceStoreBehavior.InstanceCompletionAction = InstanceCompletionAction.DeleteAll; instanceStoreBehavior.InstanceLockedExceptionAction = InstanceLockedExceptionAction.AggressiveRetry; instanceStoreBehavior.InstanceEncodingOption = InstanceEncodingOption.GZip; host.Description.Behaviors.Add(instanceStoreBehavior); The above code was copied from the &amp;quot;BuiltInConfiguration&amp;quot; demo, &amp;quot;InstanceStore1&amp;quot; project. This demo is described at &amp;quot;Built-in Configuration&amp;quot; (http://msdn.microsoft.com/en-us/library/ee622978.aspx). You can download full sources of this demo and many others at &amp;quot;WCF and WF Samples for .NET Framework 4&amp;quot; (http://www.microsoft.com/download/en/details.aspx?id=21459). Following the same architecture our team implemented the DX WorkFlow Instance Store. eXpress Persistent Objects (XPO) is used for common objects storage and is fully capable of working transparently with 14 different database systems. For example to provide support for an Oracle database we could write, //We create or connect to a database by setting the connectionstring //This code will create 2 tables (XpoWorkflowInstance, XpoInstanceKeyc) in the database using (var session = new Session()) { &amp;#160;&amp;#160;&amp;#160; session.ConnectionString = &amp;quot;Data Source=DevExpressInstanceStore;User Id=myUsername;Password=myPassword&amp;quot;; &amp;#160;&amp;#160;&amp;#160; session.UpdateSchema(typeof(XpoWorkflowInstance), typeof(XpoInstanceKey)); &amp;#160;&amp;#160;&amp;#160; session.CreateObjectTypeRecords(typeof(XpoWorkflowInstance), typeof(XpoInstanceKey)); } &amp;#160; // Define WorkflowInstanceStoreBehavior: var dxInstanceStoreBehavior = new WorkflowInstanceStoreBehavior( &amp;#160;&amp;#160;&amp;#160; typeof(XpoWorkflowInstance), typeof(XpoInstanceKey), DevExpressConnectionString); host.Description.Behaviors.Add(dxInstanceStoreBehavior); dxInstanceStoreBehavior.RunnableInstancesDetectionPeriod = new TimeSpan(0, 0, 2); dxInstanceStoreBehavior.InstanceCompletionAction = InstanceCompletionAction.DeleteAll; &amp;#160; You can download a modified version of the “BuiltInConfiguration” solution here. The console application starts a long running workflow that implements a counting service. Once the service’s start method is invoked, the service counts from 0 to 59. The counter is incremented every 2 seconds. After each count the workflow persists so you can close the application at any time and when you start it next time it will continue. A new one will be started from '0' value in addition to the loaded instances. The second project “InstanceStore2” in the solution provides the same functionality, however it is configured using the app.config file as shown, &amp;lt;system.serviceModel&amp;gt; &amp;#160; &amp;lt;extensions&amp;gt; &amp;#160;&amp;#160;&amp;#160; &amp;lt;behav</itunes:summary><itunes:keywords>DX, WF</itunes:keywords><feedburner:origLink>http://apobekiaris.blogspot.com/2011/09/devexpress-workflow-instance-store.html</feedburner:origLink><enclosure url="http://feedproxy.google.com/~r/AbekiarisBlog/~5/hB4_85AQFUU/DX_WF_InstanceStore.zip" length="11092" type="application/x-zip-compressed" /><feedburner:origEnclosureLink>http://community.devexpress.com/blogs/eaf/DX_WF_InstanceStore.zip</feedburner:origEnclosureLink></item><item><title>Scheduling workflows in eXpandFrameWork</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/YNeMo81ufQs/scheduling-workflows-in-expandframework.html</link><category>XpandWF</category><category>DX</category><category>WF</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Mon, 30 Jan 2012 07:32:01 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-7939028022882283507</guid><description>&lt;p&gt;In this post we are going to extend the functionality of the &lt;a href="http://documentation.devexpress.com/#Xaf/CustomDocument3343" target="_blank"&gt;workflow module&lt;/a&gt;. to create a UI that will help us to schedule workflows. Some of you may recall that we looked at using a Delay inside a While activity in &lt;a href="http://community.devexpress.com/blogs/eaf/archive/2011/06/14/working-with-crud-activities-short-transactions.aspx" target="_blank"&gt;Working with CRUD activities – Short Transactions.&lt;/a&gt; Recently, DX-Squad member &lt;a href="http://community.devexpress.com/members/Martin-Praxmarer-_5B00_DX_2D00_Squad_5D00_.aspx" target="_blank"&gt;Martin Praxmarer&lt;/a&gt; raised an interesting question relating to this topic: &lt;/p&gt;  &lt;p&gt;&lt;em&gt;I have the requirement to do a workflow which starts each day on 6 clock - searches for orderdocuments where a specific date is less then X days. I know I will do an do while loop, but workflow definition has 2 options, start when new object, start when criteria, so when do i start this Workflow?&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;In order to achieve this we will use the WorkFlow demo that ships with our framework. The first thing is to design our custom ScheduledWorkflow persistent object by implementing IWorkflowDefinition. We didn’t derive it from the existing WorkFlowDefinition object because it has properties like TargetObjectType and start up conditions. &lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;enum&lt;/span&gt; &lt;span style="color: #00008b"&gt;StartMode&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: purple; font-weight: bold"&gt;OneTime&lt;/span&gt;,&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: purple; font-weight: bold"&gt;Daily&lt;/span&gt;,&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: purple; font-weight: bold"&gt;Weekly&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;[&lt;span style="color: #00008b"&gt;DefaultClassOptions&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;[&lt;span style="color: #00008b"&gt;Appearance&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"WeekDays"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"StartMode &amp;lt;&amp;gt; 'Weekly'"&lt;/span&gt;,&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: purple"&gt;TargetItems&lt;/span&gt; = &lt;span style="color: #a31515"&gt;"RecurEveryWeeks;Moday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday"&lt;/span&gt;,&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: purple"&gt;Visibility&lt;/span&gt; = &lt;span style="color: #00008b"&gt;ViewItemVisibility&lt;/span&gt;.&lt;span style="color: purple; font-weight: bold"&gt;Hide&lt;/span&gt;)]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;ScheduledWorkflow&lt;/span&gt; : &lt;span style="color: #00008b"&gt;BaseObject&lt;/span&gt;, &lt;span style="color: #00008b"&gt;IWorkflowDefinition&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;ScheduledWorkflow&lt;/span&gt;(&lt;span style="color: #00008b"&gt;Session&lt;/span&gt; session)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        : &lt;span style="color: #00008b"&gt;base&lt;/span&gt;(session) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: purple"&gt;IsActive&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"IsActive"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"IsActive"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: purple"&gt;RuntASAPIfScheduledStartIsMissed&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"RuntASAPIfScheduledStartIsMissed"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"RuntASAPIfScheduledStartIsMissed"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    [&lt;span style="color: #00008b"&gt;Association&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;XPCollection&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ScheduledWorkflowLaunchHistory&lt;/span&gt;&amp;gt; &lt;span style="color: purple"&gt;LaunchHistoryItems&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetCollection&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ScheduledWorkflowLaunchHistory&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"LaunchHistoryItems"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    [&lt;span style="color: #00008b"&gt;ImmediatePostData&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;StartMode&lt;/span&gt; &lt;span style="color: purple"&gt;StartMode&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;StartMode&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"StartMode"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"StartMode"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;TimeSpan&lt;/span&gt; &lt;span style="color: purple"&gt;StartTime&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;TimeSpan&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"StartTime"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"StartTime"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    [&lt;span style="color: #00008b"&gt;Appearance&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"RecurEveryDays"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"StartMode &amp;lt;&amp;gt; 'Daily'"&lt;/span&gt;, &lt;span style="color: purple"&gt;Visibility&lt;/span&gt; = &lt;span style="color: #00008b"&gt;ViewItemVisibility&lt;/span&gt;.&lt;span style="color: purple; font-weight: bold"&gt;Hide&lt;/span&gt;)]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;int&lt;/span&gt; &lt;span style="color: purple"&gt;RecurEveryDays&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"RecurEveryDays"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"RecurEveryDays"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;int&lt;/span&gt; &lt;span style="color: purple"&gt;RecurEveryWeeks&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"RecurEveryWeeks"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"RecurEveryWeeks"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: purple"&gt;Moday&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"Moday"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Moday"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: purple"&gt;Tuesday&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"Tuesday"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Tuesday"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: purple"&gt;Wednesday&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"Wednesday"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Wednesday"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: purple"&gt;Thursday&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"Thursday"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Thursday"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: purple"&gt;Friday&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"Friday"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Friday"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: purple"&gt;Saturday&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"Moday"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Saturday"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: purple"&gt;Sunday&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"Sunday"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Sunday"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;    #region&lt;/span&gt; IWorkflowDefinition Members&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetActivityTypeName&lt;/span&gt;() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetUniqueId&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;IList&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;IStartWorkflowCondition&lt;/span&gt;&amp;gt; &lt;span style="color: #008b8b"&gt;GetConditions&lt;/span&gt;() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;IStartWorkflowCondition&lt;/span&gt;[0];&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetUniqueId&lt;/span&gt;() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (&lt;span style="color: purple"&gt;Session&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;IsNewObject&lt;/span&gt;(&lt;span style="color: blue"&gt;this&lt;/span&gt;)) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;throw&lt;/span&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;InvalidOperationException&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #a31515"&gt;"ScheduledWorkflow"&lt;/span&gt; + &lt;span style="color: purple"&gt;Oid&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;ToString&lt;/span&gt;().&lt;span style="color: #008b8b"&gt;ToUpper&lt;/span&gt;().&lt;span style="color: #008b8b"&gt;Replace&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"-"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"_"&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    [&lt;span style="color: #00008b"&gt;Browsable&lt;/span&gt;(&lt;span style="color: blue"&gt;false&lt;/span&gt;)]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: purple"&gt;CanCompile&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;false&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    [&lt;span style="color: #00008b"&gt;Browsable&lt;/span&gt;(&lt;span style="color: blue"&gt;false&lt;/span&gt;)]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: purple"&gt;CanOpenHost&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: purple"&gt;IsActive&lt;/span&gt; &amp;amp;&amp;amp; !&lt;span style="color: blue"&gt;string&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;IsNullOrEmpty&lt;/span&gt;(&lt;span style="color: purple"&gt;Name&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;Name&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"Name"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Name"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    [&lt;span style="color: #00008b"&gt;Size&lt;/span&gt;(&lt;span style="color: #00008b"&gt;SizeAttribute&lt;/span&gt;.&lt;span style="color: purple; font-weight: bold"&gt;Unlimited&lt;/span&gt;)]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;Xaml&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"Xaml"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Xaml"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;    #endregion&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;AfterConstruction&lt;/span&gt;() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;AfterConstruction&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: purple"&gt;Xaml&lt;/span&gt; = &lt;span style="color: #00008b"&gt;DCWorkflowDefinitionLogic&lt;/span&gt;.&lt;span style="color: purple; font-weight: bold"&gt;InitialXaml&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt; &lt;/div&gt;  &lt;p&gt;In the above class we have added some scheduled specific properties such as &lt;span style="color: purple"&gt;StartMode, &lt;span style="color: purple"&gt;StartTime, &lt;span style="color: purple"&gt;RecurEveryDays &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;etc. The class has been decorated with the &lt;span style="color: #00008b"&gt;Appearance &lt;/span&gt;attribute to control the visibility of the Day properties. This means when StartMode &amp;lt;&amp;gt; 'Weekly these properties will be hidden. &lt;/p&gt;  &lt;p&gt;Moreover there is a collection &lt;span style="color: purple"&gt;LaunchHistoryItems &lt;/span&gt;of &lt;span style="color: #00008b"&gt;ScheduledWorkflowLaunchHistory &lt;/span&gt;objects, which will be used later to check if the workflow has been launched.&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;ScheduledWorkflowLaunchHistory&lt;/span&gt; : &lt;span style="color: #00008b"&gt;BaseObject&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;ScheduledWorkflowLaunchHistory&lt;/span&gt;(&lt;span style="color: #00008b"&gt;Session&lt;/span&gt; session) : &lt;span style="color: #00008b"&gt;base&lt;/span&gt;(session) {}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;DateTime&lt;/span&gt; &lt;span style="color: purple"&gt;LaunchedOn&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;DateTime&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"LaunchedOn"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;DateTime&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"LaunchedOn"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    [&lt;span style="color: #00008b"&gt;Association&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;ScheduledWorkflow&lt;/span&gt; &lt;span style="color: purple"&gt;Workflow&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ScheduledWorkflow&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"Workflow"&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ScheduledWorkflow&lt;/span&gt;&amp;gt;(&lt;span style="color: #a31515"&gt;"Workflow"&lt;/span&gt;, &lt;span style="color: blue"&gt;value&lt;/span&gt;); }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt; &lt;/div&gt;  &lt;p&gt;After designing these classes, we now have all the required input in order to schedule our workflows.&lt;/p&gt;  &lt;p&gt;The next step is to load our custom workflows by extending the workflow provider service as shown,&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;ScheduledWorkflowDefinitionProvider&lt;/span&gt; : &lt;span style="color: #00008b"&gt;WorkflowDefinitionProvider&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;ScheduledWorkflowDefinitionProvider&lt;/span&gt;(&lt;span style="color: #00008b"&gt;Type&lt;/span&gt; workflowDefinitionType) : &lt;span style="color: #00008b"&gt;base&lt;/span&gt;(workflowDefinitionType) { }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;ScheduledWorkflowDefinitionProvider&lt;/span&gt;(&lt;span style="color: #00008b"&gt;Type&lt;/span&gt; workflowDefinitionType, &lt;span style="color: #00008b"&gt;IObjectSpaceProvider&lt;/span&gt; objectSpaceProvider) : &lt;span style="color: #00008b"&gt;base&lt;/span&gt;(workflowDefinitionType, objectSpaceProvider) { }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: #00008b"&gt;IList&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;IWorkflowDefinition&lt;/span&gt;&amp;gt; &lt;span style="color: #008b8b"&gt;GetDefinitions&lt;/span&gt;() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #00008b"&gt;IList&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;IWorkflowDefinition&lt;/span&gt;&amp;gt; result = &lt;span style="color: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;GetDefinitions&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #00008b"&gt;IObjectSpace&lt;/span&gt; objectSpace = &lt;span style="color: purple"&gt;ObjectSpaceProvider&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;CreateObjectSpace&lt;/span&gt;(); &lt;span style="color: green"&gt;//don't dispose immediately&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;foreach&lt;/span&gt;(&lt;span style="color: #00008b"&gt;ScheduledWorkflow&lt;/span&gt; &lt;span style="font-weight: bold"&gt;workflow&lt;/span&gt; &lt;span style="color: blue"&gt;in&lt;/span&gt; objectSpace.&lt;span style="color: #008b8b"&gt;GetObjects&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ScheduledWorkflow&lt;/span&gt;&amp;gt;()) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            result.&lt;span style="color: #008b8b"&gt;Add&lt;/span&gt;(&lt;span style="font-weight: bold"&gt;workflow&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; result;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt; &lt;/div&gt;  &lt;p&gt;After this we are ready to implement our final service that will schedule our workflows,&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;ScheduledWorkflowStartService&lt;/span&gt; : &lt;span style="color: #00008b"&gt;BaseTimerService&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: #008b8b"&gt;NeedToStartWorkflow&lt;/span&gt;(&lt;span style="color: #00008b"&gt;IObjectSpace&lt;/span&gt; objectSpace, &lt;span style="color: #00008b"&gt;ScheduledWorkflow&lt;/span&gt; workflow) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (workflow.&lt;span style="color: purple"&gt;StartMode&lt;/span&gt; == &lt;span style="color: #00008b"&gt;StartMode&lt;/span&gt;.&lt;span style="color: purple; font-weight: bold"&gt;OneTime&lt;/span&gt;) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;if&lt;/span&gt; (workflow.&lt;span style="color: purple"&gt;LaunchHistoryItems&lt;/span&gt;.&lt;span style="color: purple"&gt;Count&lt;/span&gt; == 0) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;true&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        } &lt;span style="color: blue"&gt;else&lt;/span&gt; &lt;span style="color: blue"&gt;if&lt;/span&gt; (workflow.&lt;span style="color: purple"&gt;StartMode&lt;/span&gt; == &lt;span style="color: #00008b"&gt;StartMode&lt;/span&gt;.&lt;span style="color: purple; font-weight: bold"&gt;Daily&lt;/span&gt;) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;var&lt;/span&gt; historyItem = objectSpace.&lt;span style="color: #008b8b"&gt;FindObject&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ScheduledWorkflowLaunchHistory&lt;/span&gt;&amp;gt;(&lt;span style="color: #00008b"&gt;CriteriaOperator&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Parse&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"GetDate(LaunchedOn) = ?"&lt;/span&gt;, &lt;span style="color: #00008b"&gt;DateTime&lt;/span&gt;.&lt;span style="color: purple"&gt;Today&lt;/span&gt;));&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;if&lt;/span&gt; (historyItem == &lt;span style="color: blue"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; &lt;span style="color: #00008b"&gt;DateTime&lt;/span&gt;.&lt;span style="color: purple"&gt;Now&lt;/span&gt;.&lt;span style="color: purple"&gt;TimeOfDay&lt;/span&gt; &lt;span style="color: #008b8b"&gt;&amp;gt;&lt;/span&gt; workflow.&lt;span style="color: purple"&gt;StartTime&lt;/span&gt;) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;true&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        } &lt;span style="color: blue"&gt;else&lt;/span&gt; &lt;span style="color: blue"&gt;if&lt;/span&gt; (workflow.&lt;span style="color: purple"&gt;StartMode&lt;/span&gt; == &lt;span style="color: #00008b"&gt;StartMode&lt;/span&gt;.&lt;span style="color: purple; font-weight: bold"&gt;Weekly&lt;/span&gt;) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;throw&lt;/span&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;NotImplementedException&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;false&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;ScheduledWorkflowStartService&lt;/span&gt;()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        : &lt;span style="color: #00008b"&gt;base&lt;/span&gt;(&lt;span style="color: #00008b"&gt;TimeSpan&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;FromMinutes&lt;/span&gt;(1)) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;ScheduledWorkflowStartService&lt;/span&gt;(&lt;span style="color: #00008b"&gt;TimeSpan&lt;/span&gt; requestsDetectionPeriod) : &lt;span style="color: #00008b"&gt;base&lt;/span&gt;(requestsDetectionPeriod) { }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;OnTimer&lt;/span&gt;() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;using&lt;/span&gt; (&lt;span style="color: #00008b"&gt;IObjectSpace&lt;/span&gt; objectSpace = &lt;span style="color: purple"&gt;ObjectSpaceProvider&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;CreateObjectSpace&lt;/span&gt;()) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: #00008b"&gt;ScheduledWorkflow&lt;/span&gt; &lt;span style="font-weight: bold"&gt;workflow&lt;/span&gt; &lt;span style="color: blue"&gt;in&lt;/span&gt; objectSpace.&lt;span style="color: #008b8b"&gt;GetObjects&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ScheduledWorkflow&lt;/span&gt;&amp;gt;(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;BinaryOperator&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"IsActive"&lt;/span&gt;, &lt;span style="color: blue"&gt;true&lt;/span&gt;))) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                &lt;span style="color: #00008b"&gt;WorkflowHost&lt;/span&gt; host;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                &lt;span style="color: blue"&gt;if&lt;/span&gt; (&lt;span style="color: purple"&gt;HostManager&lt;/span&gt;.&lt;span style="color: purple"&gt;Hosts&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;TryGetValue&lt;/span&gt;(&lt;span style="font-weight: bold"&gt;workflow&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;GetUniqueId&lt;/span&gt;(), &lt;span style="color: blue"&gt;out&lt;/span&gt; host)) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                    &lt;span style="color: blue"&gt;if&lt;/span&gt; (&lt;span style="color: #008b8b"&gt;NeedToStartWorkflow&lt;/span&gt;(objectSpace, &lt;span style="font-weight: bold"&gt;workflow&lt;/span&gt;)) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                        host.&lt;span style="color: #008b8b"&gt;StartWorkflow&lt;/span&gt;(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;, &lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;());&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                        &lt;span style="color: blue"&gt;var&lt;/span&gt; historyItem = objectSpace.&lt;span style="color: #008b8b"&gt;CreateObject&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ScheduledWorkflowLaunchHistory&lt;/span&gt;&amp;gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                        historyItem.&lt;span style="color: purple"&gt;Workflow&lt;/span&gt; = &lt;span style="font-weight: bold"&gt;workflow&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                        historyItem.&lt;span style="color: purple"&gt;LaunchedOn&lt;/span&gt; = &lt;span style="color: #00008b"&gt;DateTime&lt;/span&gt;.&lt;span style="color: purple"&gt;Now&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                        objectSpace.&lt;span style="color: #008b8b"&gt;CommitChanges&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;em&gt;Note; the service is not fully implemented, however its very easy to continue from this point. This code will live in the new Xpand.ExpressApp.Workflow module. Now, for&lt;/em&gt;&lt;em&gt; the rest of the implementation I would like to ask the help of our community. Anyone that wants to finish it contribute it is most welcome! &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Finally we modify the WorkflowServerStarter class and add this service,&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&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; &lt;span style="color: #008b8b"&gt;Start_&lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt; connectionString, &lt;span style="color: blue"&gt;string&lt;/span&gt; applicationName) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: #00008b"&gt;ServerApplication&lt;/span&gt; serverApplication = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;ServerApplication&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    serverApplication.&lt;span style="color: purple"&gt;ApplicationName&lt;/span&gt; = applicationName;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    serverApplication.&lt;span style="color: purple"&gt;Modules&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Add&lt;/span&gt;(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;WorkflowDemoModule&lt;/span&gt;());&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    serverApplication.&lt;span style="color: purple"&gt;ConnectionString&lt;/span&gt; = connectionString;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    serverApplication.&lt;span style="color: purple"&gt;Security&lt;/span&gt; = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;SecurityComplex&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;User&lt;/span&gt;, &lt;span style="color: #00008b"&gt;Role&lt;/span&gt;&amp;gt;(&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;WorkflowServerAuthentication&lt;/span&gt;(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;BinaryOperator&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"UserName"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"WorkflowService"&lt;/span&gt;)));&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    serverApplication.&lt;span style="color: #008b8b"&gt;Setup&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    serverApplication.&lt;span style="color: #008b8b"&gt;Logon&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: #00008b"&gt;IObjectSpaceProvider&lt;/span&gt; objectSpaceProvider = serverApplication.&lt;span style="color: purple"&gt;ObjectSpaceProvider&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: purple"&gt;server&lt;/span&gt; = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;WorkflowServer&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"http://localhost:46232"&lt;/span&gt;, objectSpaceProvider, objectSpaceProvider);&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: purple"&gt;server&lt;/span&gt;.&lt;span style="color: purple"&gt;WorkflowDefinitionProvider&lt;/span&gt; = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;ScheduledWorkflowDefinitionProvider&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;XpoWorkflowDefinition&lt;/span&gt;));&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: green"&gt;//Add the service            &lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: purple"&gt;server&lt;/span&gt;.&lt;span style="color: purple"&gt;ServiceProvider&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;AddService&lt;/span&gt;(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;ScheduledWorkflowStartService&lt;/span&gt;());&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;We are now ready to go!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-xn77Tg-kdmk/TmSIBRM8k9I/AAAAAAAABLc/jJnl8TrBmdI/s1600-h/4-9-2011%25252012-50-05%252520%2525C2%2525BC%2525C2%2525BC%25255B5%25255D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="4-9-2011 12-50-05 μμ" border="0" alt="4-9-2011 12-50-05 μμ" src="http://lh4.ggpht.com/-1xrkUwaRMuo/TmSICfb-mvI/AAAAAAAABLg/EjRYzI7FOtQ/4-9-2011%25252012-50-05%252520%2525C2%2525BC%2525C2%2525BC_thumb%25255B3%25255D.png?imgmax=800" width="760" height="557" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;strong&gt;Related Links&lt;/strong&gt; &lt;/u&gt;   &lt;br /&gt;&lt;a href="http://community.devexpress.com/blogs/eaf/archive/tags/WF/default.aspx" target="_blank"&gt;Blog posts&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://documentation.devexpress.com/#Xaf/CustomDocument3343" target="_blank"&gt;Online documentation&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://tv.devexpress.com/#;WorkFlow.tag;1" target="_blank"&gt;Videos&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-7939028022882283507?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yDvVvZG3vWtK9RTsCTigr8qkmW8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yDvVvZG3vWtK9RTsCTigr8qkmW8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yDvVvZG3vWtK9RTsCTigr8qkmW8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yDvVvZG3vWtK9RTsCTigr8qkmW8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/YNeMo81ufQs" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-30T17:32:01.468+02:00</app:edited><media:thumbnail url="http://lh4.ggpht.com/-1xrkUwaRMuo/TmSICfb-mvI/AAAAAAAABLg/EjRYzI7FOtQ/s72-c/4-9-2011%25252012-50-05%252520%2525C2%2525BC%2525C2%2525BC_thumb%25255B3%25255D.png?imgmax=800" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/09/scheduling-workflows-in-expandframework.html</feedburner:origLink></item><item><title>Profiling medium trust web applications</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/M9i3Q5XcM9o/profiling-medium-trust-web-applications.html</link><category>DX</category><category>Xpo</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Mon, 29 Aug 2011 07:07:59 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-685682814430930166</guid><description>&lt;p align="justify"&gt;Our profiler uses WCF in order to communicate with the client application. One of the benefits of the XPOProfiler is that it supports 2 binding types. Both binding types have their advantages however in this situation only one allows us the flexibility we require.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;u&gt;NetTcpBinding&lt;/u&gt;&lt;/p&gt;  &lt;p align="justify"&gt;This option provides a secure and reliable binding environment for .Net to .Net cross machine communication. By default it creates a communication stack using WS-ReliableMessaging protocol, TCP for message delivery and windows security for message and authentication at run time. &lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh5.ggpht.com/-MqHRp-5jn7A/TludHP85eAI/AAAAAAAABKs/puMAq7ZpKXg/s1600-h/image4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-aRdW15aiLM8/TludIqQuzrI/AAAAAAAABKw/CvDAkuKoclg/image_thumb2.png?imgmax=800" width="349" height="216" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;One drawback is that in shared host environments there is no way to open a port neither to use &lt;a href="http://msdn.microsoft.com/en-us/library/system.threading.mutex.aspx" target="_blank"&gt;Mutexes&lt;/a&gt;. Our second option allows us to overcome this by creating a WCF service and hosting it with our web application.&amp;#160; &lt;/p&gt;  &lt;p align="justify"&gt;&lt;u&gt;WSHttpBinding&lt;/u&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="justify"&gt;Defines a secure, reliable, interoperable binding suitable for non-duplex service contracts,&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Supports WS-* functionality and distributed transactions with reliable and secure sessions using SOAP security,&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Uses HTTP and HTTPS transport for communication,&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Reliable sessions are disabled by default&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh6.ggpht.com/-tBPM5ounQkc/TludJuO8CrI/AAAAAAAABK0/f9HNrqVj8fo/s1600-h/image14.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-yZsGOlNkr98/TludKE5_A6I/AAAAAAAABK4/MNeHrt0aB8c/image_thumb8.png?imgmax=800" width="318" height="223" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;We have already identified limitations when profiling medium trust web applications, now we must look at modifying our application in order to overcome them.&lt;/p&gt;  &lt;p align="justify"&gt;The first step is to add the new service using VS add new Item context menu.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh5.ggpht.com/-7RxDiPo920I/TludKz7CltI/AAAAAAAABK8/4RmRs7HDHds/s1600-h/image19.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-LZp11XOI5HY/TludLn7nfwI/AAAAAAAABLA/DEA4QC7YCGU/image_thumb11.png?imgmax=800" width="556" height="422" /&gt;&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;This action will add the following items to the project;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="justify"&gt;IMyLogService.cs - the communication interface description,&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;MyLogService.svc.cs - the communication service class declaration&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p align="justify"&gt;Furthermore the Web.config file will be modified by adding &amp;lt;system.serviceModel&amp;gt; section. I am using .NET3.5 right now, be aware that this step may vary according to the .NET version you are using.&lt;/p&gt;  &lt;p align="justify"&gt;The next step is to remove the IMyLogService.cs from the project.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh5.ggpht.com/-vHgr9wvvOKc/TludMOUBEyI/AAAAAAAABLE/QpA4gbM5eGk/s1600-h/image2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-z5nijrFHemM/TludMnCIPPI/AAAAAAAABLI/zPWt0QS_e1M/image_thumb1.png?imgmax=800" width="243" height="235" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;/p&gt;  &lt;p&gt;Then we are going to modify the MyLogService.svc.cs as&amp;#160; follows;&lt;/p&gt;  &lt;p&gt;[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]    &lt;br /&gt;public class MyLogService : LogService {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public MyLogService()     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; : base(Logger) {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (Logger != null) LogManager.SetTransport(Logger);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; private static LoggerBase Logger {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; get { return new LoggerBase(); }     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;}&lt;/p&gt;  &lt;p&gt;The final step is to change the name of the communication contract in &amp;lt;system.serviceModel&amp;gt; section of Web.config file from WebApplicationToProfile.IMyLogService to DevExpress.Xpo.Logger.Transport.ILogSource.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-hYnezjoJGgI/TludNM--1-I/AAAAAAAABLM/W4cZbCSNQz4/s1600-h/image32.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-HfhERtdAYTY/TludNywu6oI/AAAAAAAABLQ/4iLuelSFLfo/image_thumb18.png?imgmax=800" width="878" height="203" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;After that we are ready to run the XPOProfiler and create a new connection to our medium hosted XPO web application.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-BoEtk2yujZU/TludOjkiqII/AAAAAAAABLU/mkO5SAkr-wA/s1600-h/image37.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-xIPxZnlSBzg/TludPf1Fu5I/AAAAAAAABLY/YK_B8WVAtSM/image_thumb21.png?imgmax=800" width="585" height="294" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Note: Version 11.2 will allow us to carry out all the above processes.&lt;/p&gt;  &lt;p&gt;Happy profiling!&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;strong&gt;Related Links&lt;/strong&gt; &lt;/u&gt;    &lt;br /&gt;&lt;a href="http://community.devexpress.com/blogs/xpo/archive/tags/profiling+tool/default.aspx" target="_blank"&gt;Blog posts&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://documentation.devexpress.com/#Xaf/CustomDocument3343" target="_blank"&gt;Videos&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-685682814430930166?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JNLBySAi3w-NutTi_oFFRnaxLhE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JNLBySAi3w-NutTi_oFFRnaxLhE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JNLBySAi3w-NutTi_oFFRnaxLhE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JNLBySAi3w-NutTi_oFFRnaxLhE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/M9i3Q5XcM9o" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-29T17:07:59.035+03:00</app:edited><media:thumbnail url="http://lh4.ggpht.com/-aRdW15aiLM8/TludIqQuzrI/AAAAAAAABKw/CvDAkuKoclg/s72-c/image_thumb2.png?imgmax=800" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/08/profiling-medium-trust-web-applications.html</feedburner:origLink></item><item><title>XAF Workflow persistence storage</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/XlOSU2DKRTA/xaf-workflow-persistence-storage.html</link><category>Xaf</category><category>DX</category><category>WF</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Thu, 25 Aug 2011 04:30:30 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-8226318203070889217</guid><description>&lt;p&gt;The .NET Framework 4 ships with the SQL Workflow Instance Store which allows workflows to persist state information about workflow instances in a SQL Server 2005 or SQL Server 2008 database. However its implementation is based on stored procedures which can be a bit scary if you are not familiar with them. In addition our customers may follow different standards (Oracle, Firebird, VistaDB, MySQL, PostgreSQL etc.) and it’s unrealistic to hire more people to support SQL Server infrastructure.&lt;/p&gt;  &lt;p&gt;Usually when dealing with these issues the first thing we do is to carry out a Google search for storage solutions. Surprisingly there is no such solution out there! Moreover there is very little useful code or samples available. Luckily XAF provides us with an easier route!&lt;/p&gt;  &lt;p&gt;XAF is the perfect workflow modeling environment. It provides a ready made solution for creating and deploying a server that will execute workflows as described &lt;a href="http://documentation.devexpress.com/#Xaf/CustomDocument3343" target="_blank"&gt;here&lt;/a&gt;.&amp;#160; In order to start modeling workflows we can use VS design time along with our re-hosted runtime &lt;a href="http://community.devexpress.com/blogs/eaf/archive/2011/05/24/xaf-workflow-visual-designer.aspx" target="_blank"&gt;Workflow designer and custom WF4 activities&lt;/a&gt;. XAF also gives us increased control over our workflows for example through the ability to &lt;a href="http://community.devexpress.com/blogs/eaf/archive/2011/07/19/manually-starting-workflows.aspx" target="_blank"&gt;manually start workflows&lt;/a&gt;. Finally since &lt;a href="http://www.devexpress.com/Products/NET/Application_Framework/" target="_blank"&gt;XAF&lt;/a&gt; uses &lt;a href="http://www.devexpress.com/Products/NET/ORM/" target="_blank"&gt;XPO&lt;/a&gt; to access data we can easily support 16 different database systems simply by providing a connection string!&lt;/p&gt;  &lt;div class="tablediv"&gt;   &lt;table class="dtTABLE" cellspacing="0"&gt;&lt;tbody&gt;       &lt;tr valign="top"&gt;         &lt;th&gt;XPO Data Store Adapter&lt;/th&gt;          &lt;th&gt;XPO Data Store Adapter's Assembly Name&lt;/th&gt;          &lt;th&gt;Database Provider Assembly&lt;/th&gt;       &lt;/tr&gt;        &lt;tr valign="top"&gt;         &lt;td&gt;&lt;a href="/XPO/clsDevExpressXpoDBAccessConnectionProvidertopic.aspx"&gt;AccessConnectionProvider&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;DevExpress.Xpo.vXXX&lt;/td&gt;          &lt;td&gt;System.Data.dll&lt;/td&gt;       &lt;/tr&gt;        &lt;tr valign="top"&gt;         &lt;td&gt;AdvantageConnectionProvider&lt;/td&gt;          &lt;td&gt;DevExpress.Xpo.vXXX.Providers&lt;/td&gt;          &lt;td&gt;Advantage.Data.Provider.dll 9.10.2.0&lt;/td&gt;       &lt;/tr&gt;        &lt;tr valign="top"&gt;         &lt;td&gt;AsaConnectionProvider&lt;/td&gt;          &lt;td&gt;DevExpress.Xpo.vXXX.Providers&lt;/td&gt;          &lt;td&gt;iAnywhere.Data.SQLAnywhere.dll 11.0.0.12642&lt;/td&gt;       &lt;/tr&gt;        &lt;tr valign="top"&gt;         &lt;td&gt;AseConnectionProvider&lt;/td&gt;          &lt;td&gt;DevExpress.Xpo.vXXX.Providers&lt;/td&gt;          &lt;td&gt;Sybase.Data.AseClient.dll 1.15.50.0&lt;/td&gt;       &lt;/tr&gt;        &lt;tr valign="top"&gt;         &lt;td&gt;DB2ConnectionProvider&lt;/td&gt;          &lt;td&gt;DevExpress.Xpo.vXXX.Providers&lt;/td&gt;          &lt;td&gt;IBM.Data.DB2.dll 9.5.2.2&lt;/td&gt;       &lt;/tr&gt;        &lt;tr valign="top"&gt;         &lt;td&gt;FirebirdConnectionProvider&lt;/td&gt;          &lt;td&gt;DevExpress.Xpo.vXXX.Providers&lt;/td&gt;          &lt;td&gt;FirebirdSql.Data.Firebird.dll 1.7.1.0            &lt;br /&gt;FirebirdSql.Data.FirebirdClient.dll 2.5.1.0 &lt;/td&gt;       &lt;/tr&gt;        &lt;tr valign="top"&gt;         &lt;td&gt;&lt;a href="/XPO/clsDevExpressXpoDBMSSqlConnectionProvidertopic.aspx"&gt;MSSqlConnectionProvider&lt;/a&gt;&lt;/td&gt;          &lt;td&gt;DevExpress.Xpo.vXXX&lt;/td&gt;          &lt;td&gt;System.Data.dll&lt;/td&gt;       &lt;/tr&gt;        &lt;tr valign="top"&gt;         &lt;td&gt;MSSqlCEConnectionProvider&lt;/td&gt;          &lt;td&gt;DevExpress.Xpo.vXXX.Providers&lt;/td&gt;          &lt;td&gt;System.Data.SqlServerCe.dll 3.5.0            &lt;br /&gt;System.Data.SqlServerCe.dll 4.0.8482.1 &lt;/td&gt;       &lt;/tr&gt;        &lt;tr valign="top"&gt;         &lt;td&gt;MySqlConnectionProvider&lt;/td&gt;          &lt;td&gt;DevExpress.Xpo.vXXX.Providers&lt;/td&gt;          &lt;td&gt;MySql.Data.dll 5.2.5.0&lt;/td&gt;       &lt;/tr&gt;        &lt;tr valign="top"&gt;         &lt;td&gt;OracleConnectionProvider&lt;/td&gt;          &lt;td&gt;DevExpress.Xpo.vXXX.Providers&lt;/td&gt;          &lt;td&gt;System.Data.OracleClient.dll 2.0.0.0            &lt;br /&gt;Oracle.DataAccess.dll 9.2.0.700 &lt;/td&gt;       &lt;/tr&gt;        &lt;tr valign="top"&gt;         &lt;td&gt;ODPConnectionProvider&lt;/td&gt;          &lt;td&gt;DevExpress.Xpo.vXXX.Providers&lt;/td&gt;          &lt;td&gt;Oracle.DataAccess.dll 10.1.0.200&lt;/td&gt;       &lt;/tr&gt;        &lt;tr valign="top"&gt;         &lt;td&gt;PervasiveSqlConnectionProvider&lt;/td&gt;          &lt;td&gt;DevExpress.Xpo.vXXX.Providers&lt;/td&gt;          &lt;td&gt;Pervasive.Data.SqlClient.dll 2.10.0.15&lt;/td&gt;       &lt;/tr&gt;        &lt;tr valign="top"&gt;         &lt;td&gt;PostgreSqlConnectionProvider&lt;/td&gt;          &lt;td&gt;DevExpress.Xpo.vXXX.Providers&lt;/td&gt;          &lt;td&gt;Npgsql.dll 2.0.11.0&lt;/td&gt;       &lt;/tr&gt;        &lt;tr valign="top"&gt;         &lt;td&gt;SQLiteConnectionProvider&lt;/td&gt;          &lt;td&gt;DevExpress.Xpo.vXXX.Providers&lt;/td&gt;          &lt;td&gt;System.Data.SQLite.dll 1.0.61.0&lt;/td&gt;       &lt;/tr&gt;        &lt;tr valign="top"&gt;         &lt;td&gt;VistaDBConnectionProvider&lt;/td&gt;          &lt;td&gt;DevExpress.Xpo.vXXX.Providers&lt;/td&gt;          &lt;td&gt;VistaDB.4.dll 4.0.0.0&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;  &lt;p&gt;More info @ &lt;a href="http://documentation.devexpress.com/#XPO/CustomDocument2114" target="_blank"&gt;Database Systems Supported by XPO&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This is only one example of what XAF can do for us. XAF provides a comprehensive set of solutions that allow you to outsource all of the mundane programming tasks leaving you to focus purely on your business needs. For more info consult our docs, blogs, code central and &lt;a href="http://www.devexpress.com/Support/Center/" target="_blank"&gt;support center&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Happy Workflowing!&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;strong&gt;Related Links&lt;/strong&gt; &lt;/u&gt;    &lt;br /&gt;&lt;a href="http://community.devexpress.com/blogs/eaf/archive/tags/WF/default.aspx" target="_blank"&gt;Blog posts&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://documentation.devexpress.com/#Xaf/CustomDocument3343" target="_blank"&gt;Online documentation&lt;/a&gt;     &lt;br /&gt;&lt;/p&gt; &lt;a href="http://tv.devexpress.com/#;WorkFlow.tag;1" target="_blank"&gt;Videos&lt;/a&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-8226318203070889217?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/x_wgbiXFLO5QyOyQxzE9c3ibJUQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/x_wgbiXFLO5QyOyQxzE9c3ibJUQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/x_wgbiXFLO5QyOyQxzE9c3ibJUQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/x_wgbiXFLO5QyOyQxzE9c3ibJUQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/XlOSU2DKRTA" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-25T14:30:30.040+03:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/08/xaf-workflow-persistence-storage.html</feedburner:origLink></item><item><title>Creating a State Machine module for eXpandFramework – Part 1</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/2-pTRSdQlD4/creating-state-machine-module-for.html</link><category>Xaf</category><category>statemachine</category><category>DX</category><category>Xpandstatemachine</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Mon, 30 Jan 2012 07:57:34 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-7281003524172772371</guid><description>&lt;p&gt;&lt;em&gt;&lt;span &gt;Let me describe for a moment how we at DX work. We build and sell software which means that we only sell and provide support for products that have been built and tested by us! However I am here as a framework evangelist and huge XAF fan. This makes it my duty to spread the word as much as I can and make XAF even bigger. To this end through collaboration within the XAF community, we have been building and supporting &lt;/span&gt;&lt;/em&gt;&lt;a href="http://www.expandframework.com/"&gt;&lt;em&gt;&lt;span &gt;eXpand&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;span &gt;. This framework follows XAF to the letter and takes things even further. &lt;a href="http://www.expandframework.com/"&gt;&lt;em&gt;&lt;span &gt;eXpand&lt;/span&gt;&lt;/em&gt;&lt;/a&gt; gets its inspiration from real life situations and bases itself on examples from DX &lt;a href="http://www.devexpress.com/Support/Center/" target="_blank"&gt;SUPPORT CENTER&lt;/a&gt;. &lt;a href="http://www.expandframework.com/"&gt;&lt;em&gt;&lt;span &gt;eXpand&lt;/span&gt;&lt;/em&gt;&lt;/a&gt; is the first open source project based on the &lt;a href="http://devexpress.com/Products/NET/Application_Framework/" target="_blank"&gt;DevExpress eXpressApp Framework (XAF)&lt;/a&gt;. More info is available at &lt;/span&gt;&lt;/em&gt;&lt;a href="http://www.expandframework.com/"&gt;&lt;em&gt;&lt;span &gt;www.expandframework.com&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;span &gt; and our very existence relies on your efforts! Anyone is welcome to contribute and enjoy the rewards. It is not necessary to be a XAF guru, we can all manage to create a behavior taken from &lt;a href="http://search.devexpress.com/?q=XPO+OR+XAF&amp;amp;p=T4|P2|0&amp;amp;d=16" target="_blank"&gt;DevExpress code central&lt;/a&gt;. Let’s work together to enhance our beloved XAF!&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Today we are going to deal with creating a reusable module for eXpandFramework. This new module will host State Machine logic therefore we are going to name it Xpand.ExpressApp.StateMachine. A Security logic similar to &lt;a href="http://community.devexpress.com/blogs/eaf/archive/2011/07/22/applying-security-to-state-machine-module.aspx" target="_blank"&gt;this&lt;/a&gt; is going to be the first resident however we are going to use permissions rather than manually writing the custom function criteria operator to the &lt;em&gt;TargetObjectCriteria. &lt;/em&gt;This module can be used as a standalone without the need of eXpandFramwork for the moment. However keeping it under the eXpand umbrella will help us to share features/processes within the framework in the future.&lt;/p&gt;  &lt;p&gt;First we need to create a new VS project that shares characteristics with the rest of the eXpand modules. Currently eXpand only provides a new Solution VS template. This means that we need to do things the old fashioned way, i.e. copying and pasting an existing module. Our behavior is platform independent thus it’s a good idea to choose a module that is also platform independent such as Xpand.ExpressApp.ViewVariants.&lt;/p&gt;  &lt;p&gt;The next step is to open the cloned project, rename it and set its references to those shown in the pic below. It is important to leave all Xpand core references as they are. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-LvAUCr5hEsM/TkA2ixT9LYI/AAAAAAAABKM/8Zr8eqispxA/s1600-h/image7.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-mvXEodC0qp0/TkA2j29T79I/AAAAAAAABKQ/v2Y4Pzz9Jvo/image_thumb4.png?imgmax=800" width="295" height="335" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It is advisable to register the original StateMachine module to avoid having to register it later.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-wVrsGpC6zck/TkA2kxFHtOI/AAAAAAAABKU/0b7txVIHNYY/s1600-h/image4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-JjTN3sFaD74/TkA2lvhZM4I/AAAAAAAABKY/Bw3NKAu0egs/image_thumb2.png?imgmax=800" width="442" height="369" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;XpandSystemModule&lt;/em&gt; is already registered since we used the &lt;em&gt;Xpand.ExpressApp.ViewVarians&lt;/em&gt; project as a template. &lt;/p&gt;  &lt;p&gt;We want (with the help of the existing XAF Security permissions system) to be able to assign special types of permissions to a role. We can then use these permissions to control the transition to certain states. The State Machine module uses &lt;em&gt;XpoStateMachine &lt;/em&gt;and &lt;em&gt;XpoState &lt;/em&gt;persistent classes. These classes can be linked to a permission by name. As a result a permission having 2 properties &lt;em&gt;StateMachineName and StateName &lt;/em&gt;would be sufficient.&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;[&lt;span style="color: #00008b"&gt;NonPersistent&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;StateMachineTransitionPermission&lt;/span&gt; : &lt;span style="color: #00008b"&gt;PermissionBase&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: #00008b"&gt;IPermission&lt;/span&gt; &lt;span style="color: #008b8b"&gt;Copy&lt;/span&gt;() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;StateMachineTransitionPermission&lt;/span&gt;(&lt;span style="color: purple"&gt;Modifier&lt;/span&gt;, &lt;span style="color: purple"&gt;StateCaption&lt;/span&gt;, &lt;span style="color: purple"&gt;StateMachineName&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;StateMachineTransitionPermission&lt;/span&gt;() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: #00008b"&gt;SecurityElement&lt;/span&gt; &lt;span style="color: #008b8b"&gt;ToXml&lt;/span&gt;() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: #00008b"&gt;SecurityElement&lt;/span&gt; result = &lt;span style="color: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;ToXml&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        result.&lt;span style="color: #008b8b"&gt;AddAttribute&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"modifier"&lt;/span&gt;, &lt;span style="color: purple"&gt;Modifier&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;ToString&lt;/span&gt;());&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        result.&lt;span style="color: #008b8b"&gt;AddAttribute&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"stateMachineName"&lt;/span&gt;, &lt;span style="color: purple"&gt;StateMachineName&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        result.&lt;span style="color: #008b8b"&gt;AddAttribute&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"stateCaption"&lt;/span&gt;, &lt;span style="color: purple"&gt;StateCaption&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; result;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;FromXml&lt;/span&gt;(&lt;span style="color: #00008b"&gt;SecurityElement&lt;/span&gt; e) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;FromXml&lt;/span&gt;(e);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: purple"&gt;Modifier&lt;/span&gt; =&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            (&lt;span style="color: #00008b"&gt;StateMachineTransitionModifier&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="color: #00008b"&gt;Enum&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Parse&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;StateMachineTransitionModifier&lt;/span&gt;), e.&lt;span style="color: purple"&gt;Attributes&lt;/span&gt;[&lt;span style="color: #a31515"&gt;"modifier"&lt;/span&gt;].&lt;span style="color: #008b8b"&gt;ToString&lt;/span&gt;());&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: purple"&gt;StateCaption&lt;/span&gt; = e.&lt;span style="color: purple"&gt;Attributes&lt;/span&gt;[&lt;span style="color: #a31515"&gt;"stateCaption"&lt;/span&gt;].&lt;span style="color: #008b8b"&gt;ToString&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: purple"&gt;StateMachineName&lt;/span&gt; = e.&lt;span style="color: purple"&gt;Attributes&lt;/span&gt;[&lt;span style="color: #a31515"&gt;"stateMachineName"&lt;/span&gt;].&lt;span style="color: #008b8b"&gt;ToString&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;StateMachineTransitionPermission&lt;/span&gt;(&lt;span style="color: #00008b"&gt;StateMachineTransitionModifier&lt;/span&gt; modifier, &lt;span style="color: blue"&gt;string&lt;/span&gt; stateCaption, &lt;span style="color: blue"&gt;string&lt;/span&gt; stateMachineName) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: purple"&gt;Modifier&lt;/span&gt; = modifier;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: purple"&gt;StateCaption&lt;/span&gt; = stateCaption;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: purple"&gt;StateMachineName&lt;/span&gt; = stateMachineName;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: #008b8b"&gt;IsSubsetOf&lt;/span&gt;(&lt;span style="color: #00008b"&gt;IPermission&lt;/span&gt; target) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;var&lt;/span&gt; isSubsetOf = &lt;span style="color: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;IsSubsetOf&lt;/span&gt;(target);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (isSubsetOf) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;var&lt;/span&gt; stateMachineTransitionPermission = ((&lt;span style="color: #00008b"&gt;StateMachineTransitionPermission&lt;/span&gt;)target);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;return&lt;/span&gt; stateMachineTransitionPermission.&lt;span style="color: purple"&gt;StateCaption&lt;/span&gt; == &lt;span style="color: purple"&gt;StateCaption&lt;/span&gt; &amp;amp;&amp;amp;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                   stateMachineTransitionPermission.&lt;span style="color: purple"&gt;StateMachineName&lt;/span&gt; == &lt;span style="color: purple"&gt;StateMachineName&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;false&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;StateMachineTransitionModifier&lt;/span&gt; &lt;span style="color: purple"&gt;Modifier&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;get&lt;/span&gt;; &lt;span style="color: #008b8b"&gt;set&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;StateMachineName&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;get&lt;/span&gt;; &lt;span style="color: #008b8b"&gt;set&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;StateCaption&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;get&lt;/span&gt;; &lt;span style="color: #008b8b"&gt;set&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt; &lt;/div&gt;  &lt;p&gt;A  Modifier property can be used to disable our permission, moreover the SecuritySystem is going to grant the permission by calling the &lt;span style="color: #008b8b"&gt;IsSubsetOf &lt;/span&gt;method. &lt;/p&gt;  &lt;p&gt;Finally, we are going to create a controller and check if a permission with the same state and statemachine name has been granted to our system. If not we are going to throw an &lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;exception&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;StatePermissionController&lt;/span&gt; : &lt;span style="color: #00008b"&gt;ViewController&lt;/span&gt;, &lt;span style="color: #00008b"&gt;IModelExtender&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #00008b"&gt;IModelExtender&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;ExtendModelInterfaces&lt;/span&gt;(&lt;span style="color: #00008b"&gt;ModelInterfaceExtenders&lt;/span&gt; extenders) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        extenders.&lt;span style="color: #008b8b"&gt;Add&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;IModelOptions&lt;/span&gt;, &lt;span style="color: #00008b"&gt;IModelOptionsStateMachine&lt;/span&gt;&amp;gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;OnActivated&lt;/span&gt;() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;OnActivated&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;var&lt;/span&gt; stateMachineController = &lt;span style="color: purple"&gt;Frame&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;GetController&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;StateMachineController&lt;/span&gt;&amp;gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        stateMachineController.&lt;span style="color: fuchsia"&gt;TransitionExecuting&lt;/span&gt; &lt;span style="color: #008b8b"&gt;+=&lt;/span&gt; &lt;span style="color: #008b8b"&gt;OnTransitionExecuting&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;OnTransitionExecuting&lt;/span&gt;(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #00008b"&gt;ExecuteTransitionEventArgs&lt;/span&gt; executeTransitionEventArgs) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;var&lt;/span&gt; states = executeTransitionEventArgs.&lt;span style="color: purple"&gt;StateMachine&lt;/span&gt;.&lt;span style="color: purple"&gt;States&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;OfType&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;XpoState&lt;/span&gt;&amp;gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: blue"&gt;var&lt;/span&gt; &lt;span style="font-weight: bold"&gt;state&lt;/span&gt; &lt;span style="color: blue"&gt;in&lt;/span&gt; states) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;            &lt;span style="color: blue"&gt;if&lt;/span&gt; (&lt;span style="color: #008b8b"&gt;IsNotGranted&lt;/span&gt;(&lt;span style="font-weight: bold"&gt;state&lt;/span&gt;))&lt;/p&gt;    &lt;p style="margin: 0px"&gt;                &lt;span style="color: blue"&gt;throw&lt;/span&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;UserFriendlyException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Permissions are not granted for transitioning to the "&lt;/span&gt; + &lt;span style="font-weight: bold"&gt;state&lt;/span&gt;.&lt;span style="color: purple"&gt;Caption&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: #008b8b"&gt;IsNotGranted&lt;/span&gt;(&lt;span style="color: #00008b"&gt;XpoState&lt;/span&gt; state) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: #008b8b"&gt;IsNotGranted&lt;/span&gt;(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;StateMachineTransitionPermission&lt;/span&gt;(&lt;span style="color: #00008b"&gt;StateMachineTransitionModifier&lt;/span&gt;.&lt;span style="color: purple; font-weight: bold"&gt;Deny&lt;/span&gt;, state.&lt;span style="color: purple"&gt;Caption&lt;/span&gt;, state.&lt;span style="color: purple"&gt;StateMachine&lt;/span&gt;.&lt;span style="color: purple"&gt;Name&lt;/span&gt;));&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;    &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; &lt;span style="color: #008b8b"&gt;IsNotGranted&lt;/span&gt;(&lt;span style="color: #00008b"&gt;IPermission&lt;/span&gt; permission) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;var&lt;/span&gt; securityComplex = ((&lt;span style="color: #00008b"&gt;SecurityBase&lt;/span&gt;)&lt;span style="color: #00008b"&gt;SecuritySystem&lt;/span&gt;.&lt;span style="color: purple"&gt;Instance&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;bool&lt;/span&gt; isGrantedForNonExistentPermission = securityComplex.&lt;span style="color: purple"&gt;IsGrantedForNonExistentPermission&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        securityComplex.&lt;span style="color: purple"&gt;IsGrantedForNonExistentPermission&lt;/span&gt; = &lt;span style="color: blue"&gt;true&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;bool&lt;/span&gt; granted = &lt;span style="color: #00008b"&gt;SecuritySystem&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;IsGranted&lt;/span&gt;(permission);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        securityComplex.&lt;span style="color: purple"&gt;IsGrantedForNonExistentPermission&lt;/span&gt; = isGrantedForNonExistentPermission;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;        &lt;span style="color: blue"&gt;return&lt;/span&gt; granted;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;During the writing of this post &lt;a href="http://community.devexpress.com/user/Profile.aspx?UserID=24781" target="_blank"&gt;M. Brekhof&lt;/a&gt; asked if it is possible to hide the transition in the UI if there are no permissions. This is a certainly a useful feature to include in the new module. To implement it we can subscribe to the &lt;em&gt;ItemsChanged&lt;/em&gt; event of the &lt;em&gt;ChangeStateAction &lt;/em&gt;and use the &lt;span style="color: #008b8b"&gt;IsGranted &lt;/span&gt;method there.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-R6eHYVrCIm8/TkA2ma7hVfI/AAAAAAAABKc/FISomJJIhac/s1600-h/image9.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-plcAPGsOzWs/TkA2nLmCBHI/AAAAAAAABKg/ZP9IBdtYVTw/image_thumb5.png?imgmax=800" width="978" height="314" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Using the model to control the above allows us more flexibility as we can choose whether to include these improvements or not. In order to do so we need to define and register a model extender.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-bLeimy-s7xw/TkA2nxu9v5I/AAAAAAAABKk/loTprdBq-a4/s1600-h/image14.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-hU4j9nTerY4/TkA2orTdFdI/AAAAAAAABKo/b7DTBrqPu80/image_thumb8.png?imgmax=800" width="815" height="255" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It should be clear that this is a rapid development! In a few short minutes we have created a module which can be used as often as necessary to enhance the functionality of our applications. This is another fine example of getting the job done the XAF way!&lt;/p&gt;  &lt;p&gt;So far we have not discussed how to create lookups for our &lt;span style="color: #00008b"&gt;StateMachineTransitionPermission&lt;/span&gt; StateMachineName,StateName properties. Don’t worry all of this will be featured in part 2. In the meantime if any of you need any other information please let me know so that I can cover it too.&lt;/p&gt;  &lt;p&gt;Happy eXpanding!&lt;/p&gt;  &lt;p&gt;eXpand is the first open source project based on the DevExpress eXpressApp Framework (XAF). More info is available at &lt;a href="http://www.expandframework.com/"&gt;www.expandframework.com&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-7281003524172772371?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CbCivvzYcdL4cwXcxR4ZR03ev10/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CbCivvzYcdL4cwXcxR4ZR03ev10/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CbCivvzYcdL4cwXcxR4ZR03ev10/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CbCivvzYcdL4cwXcxR4ZR03ev10/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/2-pTRSdQlD4" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-30T17:57:34.617+02:00</app:edited><media:thumbnail url="http://lh3.ggpht.com/-mvXEodC0qp0/TkA2j29T79I/AAAAAAAABKQ/v2Y4Pzz9Jvo/s72-c/image_thumb4.png?imgmax=800" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/08/creating-state-machine-module-for.html</feedburner:origLink></item><item><title>Manually starting workflows – the best choice</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/RplZsrU4bMg/manually-starting-workflows-best-choice.html</link><category>Xaf</category><category>DX</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Wed, 03 Aug 2011 04:57:36 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-6476930808729582930</guid><description>&lt;p&gt;&lt;u&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;       &lt;br /&gt;&lt;/u&gt;&lt;a href="http://community.devexpress.com/blogs/eaf/archive/2011/07/19/manually-starting-workflows.aspx" target="_blank"&gt;Manually starting workflows&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In the first &lt;a href="http://community.devexpress.com/blogs/eaf/archive/2011/07/19/manually-starting-workflows.aspx" target="_blank"&gt;post&lt;/a&gt; of the series we saw how to start a workflow using a WCF service. Furthermore we also discussed doing this using the module’s out of the box mechanisms. So far however, we haven’t had time to analyze the reasons for choosing one method or the other. This post aims to clarify the situation.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;WCF Solution&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;As &lt;a href="http://community.devexpress.com/members/Dennis-_2800_DevExpress-Support_2900_.aspx" target="_blank"&gt;Dennis&lt;/a&gt; likes to say, “There is no need to light a cigar with a nuclear reactor”. This is certainly true when it comes to the WCF solution as it can be somewhat unwieldy. In addition we have to come to terms with more technology as it requires configuration for even the smallest task. For example, the client always needs to know the WCF service address. It is also very difficult to work with WF instances because in order to accomplish common tasks (view, track status, generate reports, measure client service reply time) we need to introduce a system of persistent classes which will help to simulate the out of the box behavior. A third issue arises when modifying the solution because there is often a need for changes to occur in many places at the same time. For example when introducing additional properties we have to change client code and Receive contracts.&lt;/p&gt;  &lt;p&gt;This option is only recommended when we have a large system (&amp;gt;10000 WF instances). Only then will we notice a gain in performance. This is because one WCF request can start a workflow which costs nothing compared to multiple Sql Queries. In all other cases we are fortunate that XAF allows us to take the easy road as usual!&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Out of the box&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;Take our usual product ordering task; a client simply creates a new &lt;em&gt;OrderRequest &lt;/em&gt;business object and fills the necessary members. A workflow with&amp;#160; &lt;em&gt;an AutoStartWhenObjectIsCreated&lt;/em&gt; condition will start when the object is saved. After that we can access all the information in the workflow algorithm. This method allows us to,&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Track &lt;em&gt;OrderRequest&lt;/em&gt; objects since they are just business objects &lt;/li&gt;    &lt;li&gt;Measure client activities using Charts or KPI &lt;/li&gt;    &lt;li&gt;Track sale stages &lt;a title="http://it.toolbox.com/blogs/original-thinking/mashup-technology-sales-23755" href="http://it.toolbox.com/blogs/original-thinking/mashup-technology-sales-23755"&gt;http://it.toolbox.com/blogs/original-thinking/mashup-technology-sales-23755&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Access all the XAF benefits! &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Note that a similar process is described in &lt;a href="http://community.devexpress.com/blogs/eaf/archive/2011/06/14/working-with-crud-activities-short-transactions.aspx" target="_blank"&gt;Working with CRUD activities – Short Transactions&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;We would appreciate your feedback on this post. Has it been useful to you? Feel free to contact us&amp;#160; with any further questions&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;strong&gt;Related Links&lt;/strong&gt; &lt;/u&gt;    &lt;br /&gt;&lt;a href="http://community.devexpress.com/blogs/eaf/archive/tags/WF/default.aspx" target="_blank"&gt;Blog posts&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://documentation.devexpress.com/#Xaf/CustomDocument3343" target="_blank"&gt;Online documentation&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-6476930808729582930?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JbUhJ500StvrjIB2UPEmYxHNO_0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JbUhJ500StvrjIB2UPEmYxHNO_0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JbUhJ500StvrjIB2UPEmYxHNO_0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JbUhJ500StvrjIB2UPEmYxHNO_0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/RplZsrU4bMg" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-03T14:57:36.448+03:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/08/manually-starting-workflows-best-choice.html</feedburner:origLink></item><item><title>How to use an eXpand module with an existing XAF application</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/SnZE2kyrD_E/how-to-use-expand-module-with-existing.html</link><category>Xaf</category><category>eXpand</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Mon, 01 Aug 2011 09:33:09 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-2268913375094887601</guid><description>&lt;p&gt;&lt;em&gt;&lt;font size="1"&gt;Let me describe for a moment how we at DX work. We build and sell software which means that we only sell and provide support for products that have been built and tested by us! However I am here as a framework evangelist and huge XAF fan. This makes it my duty to spread the word as much as I can and make XAF even bigger. To this end through collaboration within the XAF community, we have been building and supporting &lt;/font&gt;&lt;/em&gt;&lt;a href="http://www.expandframework.com"&gt;&lt;em&gt;&lt;font size="1"&gt;eXpand&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font size="1"&gt;. This framework follows XAF to the letter and takes things even further. &lt;a href="http://www.expandframework.com"&gt;&lt;em&gt;&lt;font size="1"&gt;eXpand&lt;/font&gt;&lt;/em&gt;&lt;/a&gt; gets its inspiration from real life situations and bases itself on examples from DX &lt;a href="http://www.devexpress.com/Support/Center/" target="_blank"&gt;SUPPORT CENTER&lt;/a&gt;. &lt;a href="http://www.expandframework.com"&gt;&lt;em&gt;&lt;font size="1"&gt;eXpand&lt;/font&gt;&lt;/em&gt;&lt;/a&gt; is the first open source project based on the &lt;a href="http://devexpress.com/Products/NET/Application_Framework/" target="_blank"&gt;DevExpress eXpressApp Framework (XAF)&lt;/a&gt;. More info is available at &lt;/font&gt;&lt;/em&gt;&lt;a href="http://www.expandframework.com"&gt;&lt;em&gt;&lt;font size="1"&gt;www.expandframework.com&lt;/font&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;font size="1"&gt; and our very existence relies on your efforts! Anyone is welcome to contribute and enjoy the rewards. It is not necessary to be a XAF guru, we can all manage to create a behavior taken from &lt;a href="http://search.devexpress.com/?q=XPO+OR+XAF&amp;amp;p=T4|P2|0&amp;amp;d=16" target="_blank"&gt;DevExpress code central&lt;/a&gt;. Let’s work together to enhance our beloved XAF!&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Using an eXpand module with an existing XAF application is an issue that is being raised a lot recently and I am sure it deserves a post and a place in &lt;a href="http://www.expandframework.com/support/help.html" target="_blank"&gt;Xpand Wiki&lt;/a&gt;. The following information applies to any Xpand module. Note that installing an Xpand module is almost as easy as using a XAF one.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;u&gt;Introduction&lt;/u&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Firstly, as a base type for our application components it is imperative to use XpandWinApplication or XpandWebApplication. Therefore we need to reference Xpand.ExpressApp.Win or Xpand.ExpressApp.Web assemblies from our application projects and replace their components’ base types accordingly,&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh5.ggpht.com/-RhFXBoyaMOc/TjbTV0zjdTI/AAAAAAAABJs/bdgHE3Qr_pw/s1600-h/image22.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-Rwdo0fip1Dc/TjbTWih4kgI/AAAAAAAABJw/euVaGNX13-s/image_thumb14.png?imgmax=800" width="714" height="155" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Additionally we need to reference Xpand.Persistent.BaseImpl. Having similar architecture with XAF, eXpand modules use interfaces and their implementations are hosted in the BaseImpl assembly. Xpand modules know how to locate the Business Objects they require so this is all we need to do at this point. &lt;/p&gt;  &lt;p align="justify"&gt;Note; BaseImpl assembly has no references to DX BaseImpl and it is possible to use a replace it with a custom one .&lt;/p&gt;  &lt;p align="justify"&gt;&lt;u&gt;Registering in Toolbox&lt;/u&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Now, unless we are a XAF guru, we have to register the assemblies in the VS toolbox. I suggest creating the toolbox items within a new Xpand Tab as shown. At this point we don’t have the resources to create our own ToolBoxCreator utility. If any VS IDE guru wants to contribute such a tool, we owe him one!&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="500"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="250"&gt;&lt;a href="http://lh6.ggpht.com/-4cfS9-yfmbU/TjbTXUDW7XI/AAAAAAAABJ0/IX2ZqcocFcQ/s1600-h/image6.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-Vi4GX6yO5HM/TjbTYg9YrBI/AAAAAAAABJ4/Ge1B-9vOzLM/image_thumb4.png?imgmax=800" width="298" height="480" /&gt;&lt;/a&gt;&lt;/td&gt;        &lt;td valign="top" width="250"&gt;&lt;a href="http://lh4.ggpht.com/-6qvBYNJQ9kI/TjbTZbeAfzI/AAAAAAAABJ8/YQ-Ywr0luUw/s1600-h/image1.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-cg6kIAqZ4Ck/TjbTaYtb-qI/AAAAAAAABKA/0zD6UM8Ws-k/image_thumb1.png?imgmax=800" width="448" height="312" /&gt;&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p align="justify"&gt;&lt;u&gt;Registration&lt;/u&gt;&lt;/p&gt;  &lt;p align="justify"&gt;Registering and using a module is as easy as dragging and dropping it into the &lt;a href="http://documentation.devexpress.com/#Xaf/CustomDocument2827" target="_blank"&gt;Application Designer&lt;/a&gt;. The designer will then add all required references and modules for us.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://lh3.ggpht.com/-u9LhvJlKT88/TjbTbT4rCXI/AAAAAAAABKE/H1fOT5Ut3Jc/s1600-h/image16.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/-ZmTbA3N0Jdc/TjbTc8pvi5I/AAAAAAAABKI/ueI6GBN5wiE/image_thumb10.png?imgmax=800" width="522" height="480" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Give us your feedback&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;Was this post useful to you? Do you want to learn more about Xpand framework? We would love to hear your feedback!&lt;/p&gt;  &lt;p&gt;Happy eXpanding!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-2268913375094887601?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lmmU8lD563QqCtitH9PuqJua2hQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lmmU8lD563QqCtitH9PuqJua2hQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lmmU8lD563QqCtitH9PuqJua2hQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lmmU8lD563QqCtitH9PuqJua2hQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/SnZE2kyrD_E" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-01T19:33:09.767+03:00</app:edited><media:thumbnail url="http://lh5.ggpht.com/-Rwdo0fip1Dc/TjbTWih4kgI/AAAAAAAABJw/euVaGNX13-s/s72-c/image_thumb14.png?imgmax=800" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/08/how-to-use-expand-module-with-existing.html</feedburner:origLink></item><item><title>New ImportWizard on eXpand v11</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/x_BHzr6xCck/new-importwizard-on-expand-v11.html</link><category>IO</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Thu, 09 Jun 2011 07:00:03 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-7811728365878011649</guid><description>&lt;p&gt;I am very happy to announce the release of eXpandFramwework v11. Our team has already tested the framework in production. However any feedback or discussions on the new version are most welcome. Please you our &lt;a href="http://www.expandframework.com/forum.html" target="_blank"&gt;forums&lt;/a&gt; for better collaboration.&lt;/p&gt;  &lt;p&gt;In addition we most welcome &lt;a href="http://mdworkstuff.blogspot.com/" target="_blank"&gt;Martynas Dauciunas&lt;/a&gt; as the newest eXpandframework member. Martys joined our team along with his ImportWizard module. The module can map and import Excel files! &lt;/p&gt;  &lt;p&gt;You can read more about it and see the demo video in our &lt;a href="http://www.expandframework.com/blog.html" target="_blank"&gt;blog&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As always eXpandFramework is available for download &lt;a href="http://www.expandframework.com/downloads/download.html" target="_blank"&gt;here&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-7811728365878011649?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9y3lcPJzs2EugTgdqgRAzleuQNU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9y3lcPJzs2EugTgdqgRAzleuQNU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9y3lcPJzs2EugTgdqgRAzleuQNU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9y3lcPJzs2EugTgdqgRAzleuQNU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/x_BHzr6xCck" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-09T17:00:03.996+03:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/06/new-importwizard-on-expand-v11.html</feedburner:origLink></item><item><title>Evangelizing XAF,XPO and leading eXpand framework</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/Hj48l2YIapI/evangelizing-xafxpo-and-leading-expand.html</link><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Mon, 04 Apr 2011 10:01:13 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-8547123987792703822</guid><description>&lt;p&gt;I am very very happy to announce that I have joined DevExpress as technical evangelist for the Frameworks Team. I believe that it’s not a coincidence that my first name “Apostolos” has a very similar meaning to Evangelist!&lt;/p&gt;  &lt;p&gt;I promise to myself and to all of you very exciting times to come&amp;#160; I will do my best to honor this great opportunity and evangelize &lt;a href="http://www.devexpress.com/xaf/" target="_blank"&gt;XAF&lt;/a&gt; through out the universe, because its the greatest framework I ever came across.&lt;/p&gt;  &lt;p&gt;I am completely overwhelmed and let this movie clip be an expression of my feelings.&lt;/p&gt;  &lt;p&gt;&lt;iframe title="YouTube video player" src="http://www.youtube.com/embed/aWL6R1rQLqY" frameborder="0" width="640" height="390" allowfullscreen="allowfullscreen"&gt;&lt;/iframe&gt;&lt;/p&gt;  &lt;p&gt;My new responsibilities will include posting to XAF and XPO blogs and publish videos for DevExpress TV. I will be than more happy to discuss any problems, questions, and ideas you have and these can easily end up as blog posts or webcasts. I will also be attending lots of meetings around the world so I hope I am able to shake hands with many of you and soon enough.&lt;/p&gt;  &lt;p&gt;You can also be sure that I will continue to lead and support &lt;a href="http://github.com/eXpand" target="_blank"&gt;eXpand&lt;/a&gt; Framework and this blog will remain devoted to it.&lt;/p&gt;  &lt;p&gt;I am already in LA to catch up with The Team,and would be absolutely delighted to have a beer or two with anybody who is around. I am can now be reached at &lt;a href="mailto:apostolis.bekiaris@devexpress.com"&gt;apostolis.bekiaris@devexpress.com&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And for those of you that wanted to see a picture of the headquarters. here is a nice one&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_5YPm4JGkfwE/TZn5Vbjg9_I/AAAAAAAABI4/uoC05X0OjH8/s1600-h/dx-headquarters%5B3%5D.jpg"&gt;&lt;img title="dx-headquarters" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="290" alt="dx-headquarters" src="http://lh4.ggpht.com/_5YPm4JGkfwE/TZn5WLD61yI/AAAAAAAABI8/MuZDNHC-j-o/dx-headquarters_thumb%5B1%5D.jpg?imgmax=800" width="378" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Happy DXing to all of you!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-8547123987792703822?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Zt5vf6kIaJJLMw5HW5SgTIbC1uI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Zt5vf6kIaJJLMw5HW5SgTIbC1uI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Zt5vf6kIaJJLMw5HW5SgTIbC1uI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Zt5vf6kIaJJLMw5HW5SgTIbC1uI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/Hj48l2YIapI" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-04T20:01:13.289+03:00</app:edited><media:thumbnail url="http://img.youtube.com/vi/aWL6R1rQLqY/default.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/04/evangelizing-xafxpo-and-leading-expand.html</feedburner:origLink></item><item><title>XAF - Quartz JobScheduler module</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/7jvdK8gOxEU/xaf-quartz-jobscheduler-module.html</link><category>JobSceduler</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Fri, 29 Apr 2011 07:38:49 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-1727442212921444014</guid><description>&lt;p&gt;In the past few weeks I have been working on creating a &lt;a href="http://www.devexpress.com/xaf/" target="_blank"&gt;XAF&lt;/a&gt; wrapper module for &lt;a href="http://quartznet.sourceforge.net/" target="_blank"&gt;Quartz.Net&lt;/a&gt; v2 which is is a full-featured, open source job scheduling system that can be used from smallest apps to large scale enterprise systems.&lt;/p&gt;  &lt;p&gt;For those who are not familiar with concept of job scheduling, here is some &lt;a href="http://en.wikipedia.org/wiki/Job_scheduler" target="_blank"&gt;background information&lt;/a&gt;. Also, there great &lt;a href="http://quartznet.sourceforge.net/tutorial/index.html" target="_blank"&gt;tutorial&lt;/a&gt; for Quartz, which will give you a good and necessary introduction&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Quartz default implementation&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Quartz supports several datastores (sqlserver,ce,mysql,imemory etc) that you can utilize by providing an appropriate connection string, same as XPO.&lt;/p&gt;  &lt;p&gt;It has a decoupled architecture with just 2 basic entities (JobDetails and Triggers) which are related by Group property. For instance you can create a number of JobDetails, set its Group to “LongRunning”, than create a Trigger with the same Group property. When the trigger is executed, all jobs for that group will run. &lt;/p&gt;  &lt;p&gt;There is also a JobDataMap which represents a dictionary that holds serialized values and is used for jobs-triggers communication. You fill it with data when you create a trigger or a job and when they are executed you get that values back for further use. &lt;/p&gt;  &lt;p&gt;JobDetails holds a reference of the Type that implements the Quartz.IJob interface where you put the code specific to your job. Quartz instantiates that type using reflection and runs its Execute method using the context parameter that passes all available information (Scheduler instance, JobDataMaps, etc.)&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;namespace&lt;/span&gt; &lt;span style="color: #00008b"&gt;Quartz&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; public&lt;/span&gt; &lt;span style="color: blue"&gt;interface&lt;/span&gt; &lt;span style="color: #00008b"&gt;IJob&lt;/span&gt; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;Execute&lt;/span&gt;(&lt;span style="color: #00008b"&gt;IJobExecutionContext&lt;/span&gt; context);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;That was a description of how Quartz works by default. Now we would want to put a nice-looking and functional UI on top, and we have XAF (+Xpand) to come for the rescue. To provide as much decoupling as possible from the original Quartz implementation I resorted to creating persistent classes with the same set of properties as Quartz ones. I also needed to have a set of controllers to call Quartz API when the Xpand classes are changed. This allows me to be able to design any XAF domain and use the API to interface with Quartz datastore.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Xpand JobScheduler Domain description&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;First of all we have the same basic entities XpandJobDetail, XpandJobTrigger. A JobSchedulerGroup was introduced to achieve the default quartz relationship as shown below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_5YPm4JGkfwE/TZW20nimm-I/AAAAAAAABIU/FhQ1qK3Wl8A/s1600-h/image4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_5YPm4JGkfwE/TZW21d3VjiI/AAAAAAAABIY/mVgOoSjjUTM/image_thumb2.png?imgmax=800" width="612" height="318" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Additionally a many to many relationship between XpandJobDetail and XpandJobTrigger has been added allowing you to associate triggers, and jobs (even if they not belong to any group).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_5YPm4JGkfwE/TZW21wImmBI/AAAAAAAABIc/RQRm3o1BdsY/s1600-h/image9.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_5YPm4JGkfwE/TZW22QSgDMI/AAAAAAAABIg/JircDAPoFLM/image_thumb5.png?imgmax=800" width="557" height="274" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;A new type of trigger the JobListenerTrigger was introduced in order to be able to trigger a job after an event of another job was executed&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_5YPm4JGkfwE/TZW220uHAMI/AAAAAAAABIk/CP0etdrAD78/s1600-h/image13.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_5YPm4JGkfwE/TZW23k4Hf7I/AAAAAAAABIo/kXITrKk7XOk/image_thumb7.png?imgmax=800" width="472" height="344" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now our XpandJobDetail stores a reference to the Quartz.IJob interface using the Persistent XpandJob object (the same way Quarz does). However, one would have to decorate this class with JobDetailDataMapType or JobDataMapType attribute in order to tell XAF which XpandJobDataMap to associate with the XpandJobDetail or XpandJob And, as you already guessed, JobDataMap, that is dictionary instance for Quartz, is populated from XAF persistent classes. &lt;/p&gt;  &lt;p&gt;Bellow you see the sample ThresholdCalculationJob provided by Xpand.ExpressApp.JobScheduler.Jobs assembly:&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;     &lt;p style="margin: 0px"&gt;[&lt;span style="color: #00008b"&gt;System&lt;/span&gt;.&lt;span style="color: #00008b"&gt;ComponentModel&lt;/span&gt;.&lt;span style="color: #00008b"&gt;DisplayName&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;ThresholdJob&amp;quot;&lt;/span&gt;)]&lt;/p&gt;      &lt;p style="margin: 0px"&gt;[&lt;span style="color: #00008b"&gt;JobDetailDataMapType&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;ThresholdJobDetailDataMap&lt;/span&gt;))]&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;ThresholdCalculationJob&lt;/span&gt; : &lt;span style="color: #00008b"&gt;IJob&lt;/span&gt; {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; public&lt;/span&gt; &lt;span style="color: blue"&gt;const&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple; font-weight: bold"&gt;ThresholdCalcCount&lt;/span&gt; = &lt;span style="color: #a31515"&gt;&amp;quot;ThresholdCalcCount&amp;quot;&lt;/span&gt;;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; readonly&lt;/span&gt; &lt;span style="color: #00008b"&gt;ILog&lt;/span&gt; &lt;span style="color: purple"&gt;log&lt;/span&gt; = &lt;span style="color: #00008b"&gt;LogManager&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;GetLogger&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;ThresholdCalculationJob&lt;/span&gt;));&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; public&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;Execute&lt;/span&gt;(&lt;span style="color: #00008b"&gt;IJobExecutionContext&lt;/span&gt; context) {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: purple"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; log&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Info&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;EXECUTING:ThresholdCalculationJob&amp;quot;&lt;/span&gt;);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var&lt;/span&gt; application = ((&lt;span style="color: #00008b"&gt;IXpandScheduler&lt;/span&gt;)context.&lt;span style="color: purple"&gt;Scheduler&lt;/span&gt;).&lt;span style="color: purple"&gt;Application&lt;/span&gt;;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var&lt;/span&gt; objectSpaceProvider = application.&lt;span style="color: purple"&gt;ObjectSpaceProvider&lt;/span&gt;;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var&lt;/span&gt; jobDataMap = context.&lt;span style="color: purple"&gt;JobDetail&lt;/span&gt;.&lt;span style="color: purple"&gt;JobDataMap&lt;/span&gt;;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var&lt;/span&gt; typeInfo = objectSpaceProvider.&lt;span style="color: purple"&gt;TypesInfo&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;FindTypeInfo&lt;/span&gt;((&lt;span style="color: #00008b"&gt;Type&lt;/span&gt;)jobDataMap.&lt;span style="color: #008b8b"&gt;Get&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ThresholdJobDetailDataMap&lt;/span&gt;&amp;gt;(map =&amp;gt; map.&lt;span style="color: purple"&gt;DataType&lt;/span&gt;));&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; object&lt;/span&gt; count;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; using&lt;/span&gt; (&lt;span style="color: blue"&gt;var&lt;/span&gt; unitOfWork = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;UnitOfWork&lt;/span&gt;(((&lt;span style="color: #00008b"&gt;ObjectSpaceProvider&lt;/span&gt;)objectSpaceProvider).&lt;span style="color: purple"&gt;WorkingDataLayer&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; count = unitOfWork.&lt;span style="color: #008b8b"&gt;GetCount&lt;/span&gt;(typeInfo.&lt;span style="color: purple"&gt;Type&lt;/span&gt;, &lt;span style="color: #00008b"&gt;CriteriaOperator&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Parse&lt;/span&gt;(jobDataMap.&lt;span style="color: #008b8b"&gt;GetString&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ThresholdJobDetailDataMap&lt;/span&gt;&amp;gt;(map =&amp;gt; map.&lt;span style="color: purple"&gt;Criteria&lt;/span&gt;)));&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; jobDataMap.&lt;span style="color: #008b8b"&gt;Put&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ThresholdJobDetailDataMap&lt;/span&gt;&amp;gt;(&lt;span style="color: purple; font-weight: bold"&gt;ThresholdCalcCount&lt;/span&gt;, count);&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;}&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;/p&gt;   &lt;/div&gt;    &lt;p style="margin: 0px"&gt;Viola! We get a XafApplication instance and off we go using our usual XAF routines!&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;/p&gt; &lt;/div&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;Apart from the XafApplication instance, the above code has some other interesting details, e.g.&lt;/div&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;&lt;/div&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;&lt;span style="color: blue"&gt;var&lt;/span&gt; typeInfo = objectSpaceProvider.&lt;span style="color: purple"&gt;TypesInfo&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;FindTypeInfo&lt;/span&gt;((&lt;span style="color: #00008b"&gt;Type&lt;/span&gt;)jobDataMap.&lt;span style="color: #008b8b"&gt;Get&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;ThresholdJobDetailDataMap&lt;/span&gt;&amp;gt;(map =&amp;gt; map.&lt;span style="color: purple"&gt;DataType&lt;/span&gt;));&lt;/div&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;Here we are requesting the DataType property value from &lt;span style="color: #00008b"&gt;ThresholdJobDetailDataMap&lt;/span&gt; object (didn’t I already tell you that our XpandJobDetails have JobDataMaps are simply XAF persistent objects?).&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;strong&gt;The server&lt;/strong&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;Xpand provides a very easy way to configure Xpand.Quartz.Server assembly. Server is built with the &lt;a href="http://topshelf-project.com/" target="_blank"&gt;TopShelf&lt;/a&gt; framework, that means you can either run it as a console app or as a windows service (using –install as parameter) . Server is responsible of executig all jobs (classes that implement that Quartz.IJob interface). &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;em&gt;One thing you have to remember is that, since Server instantiates XafApplication, the configuration file on the server has to be synchronized with the one on the client.&lt;/em&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;In order for the server to know which XafAppliation to create the following change is needed:&lt;a href="http://lh4.ggpht.com/_5YPm4JGkfwE/TZW24PCqSwI/AAAAAAAABIs/_V-aGiOjUMg/s1600-h/image17.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_5YPm4JGkfwE/TZW24nHtr7I/AAAAAAAABIw/QptCmvL9FQ0/image_thumb9.png?imgmax=800" width="725" height="74" /&gt;&lt;/a&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;strong&gt;The Demo&lt;/strong&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Xpand FeatureCenter has a special assembly (Xpand.ExpressApp.JobScheduler.Jobs) that provides 2 sample job, the ThresholdCalculationJob that you saw already and SendThresholdCalculationEmailJob. Also there is a new EmailTemplateEngine that has been build in order to support the SendThresholdCalculationEmailJob which is naturally based on persistent objects and that can be configured runtime.&lt;/p&gt;  &lt;p&gt;The scripts that create a Quartz database can be found in &lt;a href="http://github.com/eXpand" target="_blank"&gt;eXpand&lt;/a&gt; sources under Resource/Quartz folder. Quartz database has to be created in order to run the demo from FeatureCenter.&lt;/p&gt;  &lt;p&gt;To give you a better idea about above mentioned functionality and to show what the sample application (Feature Center in this case) that uses JobScheduler module may look like, here is a short screen cast:&lt;/p&gt;  &lt;p&gt;&lt;embed src="http://blip.tv/play/AYKv6AkA" type="application/x-shockwave-flash" width="900" height="500" allowscriptaccess="always" allowfullscreen="true"&gt;&lt;/embed&gt;&lt;/p&gt;  &lt;p&gt;You can d/l eXpand Framework latest version from &lt;a href="http://expandframework.com/downloads"&gt;http://expandframework.com/downloads&lt;/a&gt; and sent use your feed back at our &lt;a href="http://expandframework.com/forum.html" target="_blank"&gt;forums&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-1727442212921444014?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/TqdWZjKuzvT47CTX9azBWv4Zoz8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TqdWZjKuzvT47CTX9azBWv4Zoz8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/TqdWZjKuzvT47CTX9azBWv4Zoz8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TqdWZjKuzvT47CTX9azBWv4Zoz8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/7jvdK8gOxEU" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-29T17:38:49.516+03:00</app:edited><media:thumbnail url="http://lh4.ggpht.com/_5YPm4JGkfwE/TZW21d3VjiI/AAAAAAAABIY/mVgOoSjjUTM/s72-c/image_thumb2.png?imgmax=800" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><media:content url="http://feedproxy.google.com/~r/AbekiarisBlog/~5/WVgwErhp81o/AYKv6AkA" fileSize="352724" type="application/x-shockwave-flash" /><itunes:explicit>no</itunes:explicit><itunes:subtitle> In the past few weeks I have been working on creating a XAF wrapper module for Quartz.Net v2 which is is a full-featured, open source job scheduling system that can be used from smallest apps to large scale enterprise systems. For those who are not famil</itunes:subtitle><itunes:author>noreply@blogger.com (Apostolis Bekiaris)</itunes:author><itunes:summary> In the past few weeks I have been working on creating a XAF wrapper module for Quartz.Net v2 which is is a full-featured, open source job scheduling system that can be used from smallest apps to large scale enterprise systems. For those who are not familiar with concept of job scheduling, here is some background information. Also, there great tutorial for Quartz, which will give you a good and necessary introduction Quartz default implementation Quartz supports several datastores (sqlserver,ce,mysql,imemory etc) that you can utilize by providing an appropriate connection string, same as XPO. It has a decoupled architecture with just 2 basic entities (JobDetails and Triggers) which are related by Group property. For instance you can create a number of JobDetails, set its Group to “LongRunning”, than create a Trigger with the same Group property. When the trigger is executed, all jobs for that group will run. There is also a JobDataMap which represents a dictionary that holds serialized values and is used for jobs-triggers communication. You fill it with data when you create a trigger or a job and when they are executed you get that values back for further use. JobDetails holds a reference of the Type that implements the Quartz.IJob interface where you put the code specific to your job. Quartz instantiates that type using reflection and runs its Execute method using the context parameter that passes all available information (Scheduler instance, JobDataMaps, etc.) namespace Quartz { &amp;#160;&amp;#160;&amp;#160; public interface IJob { &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; void Execute(IJobExecutionContext context); &amp;#160;&amp;#160;&amp;#160; } } That was a description of how Quartz works by default. Now we would want to put a nice-looking and functional UI on top, and we have XAF (+Xpand) to come for the rescue. To provide as much decoupling as possible from the original Quartz implementation I resorted to creating persistent classes with the same set of properties as Quartz ones. I also needed to have a set of controllers to call Quartz API when the Xpand classes are changed. This allows me to be able to design any XAF domain and use the API to interface with Quartz datastore. Xpand JobScheduler Domain description First of all we have the same basic entities XpandJobDetail, XpandJobTrigger. A JobSchedulerGroup was introduced to achieve the default quartz relationship as shown below: Additionally a many to many relationship between XpandJobDetail and XpandJobTrigger has been added allowing you to associate triggers, and jobs (even if they not belong to any group). A new type of trigger the JobListenerTrigger was introduced in order to be able to trigger a job after an event of another job was executed Now our XpandJobDetail stores a reference to the Quartz.IJob interface using the Persistent XpandJob object (the same way Quarz does). However, one would have to decorate this class with JobDetailDataMapType or JobDataMapType attribute in order to tell XAF which XpandJobDataMap to associate with the XpandJobDetail or XpandJob And, as you already guessed, JobDataMap, that is dictionary instance for Quartz, is populated from XAF persistent classes. Bellow you see the sample ThresholdCalculationJob provided by Xpand.ExpressApp.JobScheduler.Jobs assembly: [System.ComponentModel.DisplayName(&amp;quot;ThresholdJob&amp;quot;)] [JobDetailDataMapType(typeof(ThresholdJobDetailDataMap))] public class ThresholdCalculationJob : IJob { &amp;#160;&amp;#160;&amp;#160; public const string ThresholdCalcCount = &amp;quot;ThresholdCalcCount&amp;quot;; &amp;#160;&amp;#160;&amp;#160; readonly ILog log = LogManager.GetLogger(typeof(ThresholdCalculationJob)); &amp;#160;&amp;#160;&amp;#160; public void Execute(IJobExecutionContext context) { &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; log.Info(&amp;quot;EXECUTING:ThresholdCalculationJob&amp;quot;); &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var application = ((IXpandScheduler)context.Scheduler).Application; &amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var objectSpaceProvider = ap</itunes:summary><itunes:keywords>JobSceduler</itunes:keywords><feedburner:origLink>http://apobekiaris.blogspot.com/2011/04/xaf-quartz-jobscheduler-module.html</feedburner:origLink><enclosure url="http://feedproxy.google.com/~r/AbekiarisBlog/~5/WVgwErhp81o/AYKv6AkA" length="352724" type="application/x-shockwave-flash" /><feedburner:origEnclosureLink>http://blip.tv/play/AYKv6AkA</feedburner:origEnclosureLink></item><item><title>eXpand moves to Interactive development</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/_kkk6dQ4eyg/expand-moves-to-interactive-development.html</link><category>eXpand</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Tue, 29 Mar 2011 10:34:20 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-2814434194264016597</guid><description>&lt;p&gt;For the past two years we concentrated on working with real world projects. We also worked with SC and forum issues from DevExpress. All this we used to gather requirements for eXpand Framework. It was a good starting point and we need your active input to move further. In order to build a proper road map for &lt;a href="http://github.com/eXpand" target="_blank"&gt;eXpand&lt;/a&gt; we have created several ways which we can use to work together.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The voting system&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;First off is a voting system based on &lt;a href="https://expandframework.uservoice.com/" target="_blank"&gt;UserVoice&lt;/a&gt; that has been in operation for some time now. Follow the link and you can see the most popular suggestions and you don’t even need to login to cast your votes.&lt;/p&gt;  &lt;p&gt;For some time now a voting system based on &lt;a href="https://expandframework.uservoice.com/" target="_blank"&gt;UserVoice&lt;/a&gt; is functional for our site.There you see the most popular suggestions.     &lt;br /&gt;But how it works? You just click on Cast your votes &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_5YPm4JGkfwE/TZHHwG4rQCI/AAAAAAAABHc/O0MnqcOkEsU/s1600-h/image%5B10%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="584" alt="image" src="http://lh5.ggpht.com/_5YPm4JGkfwE/TZHHxl8BZwI/AAAAAAAABHg/22SbtmwTAJ0/image_thumb%5B6%5D.png?imgmax=800" width="749" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Searching for an idea is always preferred before posting a new suggestion :) &lt;/li&gt;    &lt;li&gt;Remember that you only have 10 votes for all the suggestions in the list. But you get those back if the suggestion you voted for gets implemented. So, vote carefully. Top right frame gives you the summary of the suggestions you voted for. &lt;/li&gt;    &lt;li&gt;To stay on top of the changes to the suggestions you can subscribe to the General activity feed &lt;/li&gt;    &lt;li&gt;The most important feature is the discussion that we would ideally have about each suggestion. And this is in your own benefit. You have to convince others of the importance of any given suggestion and have then cast their precious votes. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;You can also see top 3 suggestions straight from eXpand’s home page:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_5YPm4JGkfwE/TZHHypUrgkI/AAAAAAAABHk/NL4rrvgrQpA/s1600-h/image%5B3%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="400" alt="image" src="http://lh5.ggpht.com/_5YPm4JGkfwE/TZHHzc8OuJI/AAAAAAAABHo/1apEHBhRIsg/image_thumb%5B1%5D.png?imgmax=800" width="392" border="0" /&gt;&lt;/a&gt;&amp;#160; &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The project management system&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In the first picture (top of this page) at the right frame the first suggestion is “&lt;em&gt;Provide what's new, changed, fixed&lt;/em&gt;”. We agree with you that this one should be taken very seriously - users should have a good reason to download latest revision. This suggestion is already assigned to our web master and CI expert &lt;a href="http://www.mash2.com/" target="_blank"&gt;Dima Janzen&lt;/a&gt; and as far as I know he is considering &lt;a href="http://www.redmine.org/"&gt;http://www.redmine.org/&lt;/a&gt; pas a project management system for our web site and he might speak about it when the time comes. We think that Redmine is an excellent and mature system, but do have a look at their web site (which is built on… Redmine!) and contribute to the discussion (&lt;a href="https://expandframework.uservoice.com/forums/95335-general/suggestions/1478633-provide-a-what-s-new-changed-fixed?ref=title"&gt;Provide a what's new, changed, fixed&lt;/a&gt;) if you have a comment or an alternative to suggest.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The blog&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Big thanks go to our irreplaceable Dima again who takes care of the web site and who just announced that our blog can republish YOUR blog (it is already republishing mine).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_5YPm4JGkfwE/TZHH0J7V4VI/AAAAAAAABHs/N4l4ZkV2df4/s1600-h/image%5B15%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="377" alt="image" src="http://lh3.ggpht.com/_5YPm4JGkfwE/TZHH2IBR9QI/AAAAAAAABHw/1twUPAAs_BQ/image_thumb%5B9%5D.png?imgmax=800" width="494" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Do you have a blog?    &lt;br /&gt;Do you blog about &lt;a href="http://www.devexpress.com/xaf/" target="_blank"&gt;XAF&lt;/a&gt; / eXpandFramework ?     &lt;br /&gt;Do you want us to host your article on our blog?     &lt;br /&gt;    &lt;br /&gt;Please email &lt;a href="mailto:expand@expandframework.com" target="_blank"&gt;expand@expandframework.com&lt;/a&gt;, and we are more than happy to republish your articles on our site.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-2814434194264016597?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MCo60-C74XHDAWxgDK86wBSS78Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MCo60-C74XHDAWxgDK86wBSS78Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MCo60-C74XHDAWxgDK86wBSS78Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MCo60-C74XHDAWxgDK86wBSS78Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/_kkk6dQ4eyg" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-29T20:34:20.358+03:00</app:edited><media:thumbnail url="http://lh5.ggpht.com/_5YPm4JGkfwE/TZHHxl8BZwI/AAAAAAAABHg/22SbtmwTAJ0/s72-c/image_thumb%5B6%5D.png?imgmax=800" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/03/expand-moves-to-interactive-development.html</feedburner:origLink></item><item><title>NCarousel for XAF</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/re5ZdHxu-JM/ncarousel-for-xaf.html</link><category>Core.Web</category><category>NCaousel</category><category>Thumbnails</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Thu, 24 Feb 2011 04:32:10 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-3248548732162556097</guid><description>&lt;p&gt;&lt;a href="http://sorgalla.com/jcarousel/" target="_blank"&gt;jCarousel&lt;/a&gt; is a well known carousel build using JQuery by &lt;a href="http://sorgalla.com"&gt;Jan Sorgalla&lt;/a&gt;. I have port the &lt;a href="http://sorgalla.com/projects/jcarousel/examples/dynamic_javascript.html"&gt;Carousel with dynamic content loading via JavaScript&lt;/a&gt; to .Net and created NCarousel which is basically a classic asp.net server control that a developer can configure using c# . &lt;/p&gt;  &lt;p&gt;A list editor and added to &lt;a href="http://github.com/eXpand" target="_blank"&gt;eXpand&lt;/a&gt; (NCarouselListEdior) and all NCarousel control properties are also in the model so you can configure it from there. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_5YPm4JGkfwE/TWZPiPDxvFI/AAAAAAAABGU/NNV6HZF3WOw/s1600-h/image19.png" target="_blank"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="318" alt="image" src="http://lh3.ggpht.com/_5YPm4JGkfwE/TWZPjDxcP4I/AAAAAAAABGY/s4i6oIA31t0/image_thumb13.png?imgmax=800" width="659" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_5YPm4JGkfwE/TWZPj5Kk-pI/AAAAAAAABGc/v4Hl5rCUjxs/s1600-h/image18.png" target="_blank"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="368" alt="image" src="http://lh6.ggpht.com/_5YPm4JGkfwE/TWZPk0YgTqI/AAAAAAAABGg/qqWqt8pYiDA/image_thumb12.png?imgmax=800" width="658" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;A special interface IPictureItem should be implemented by your BO object in order editor to work.    &lt;br /&gt;&lt;/p&gt;  &lt;div style="border-right: #cccccc 1pt solid; padding-right: 1pt; border-top: #cccccc 1pt solid; padding-left: 1pt; font-size: 10pt; background: #f5f5f5; padding-bottom: 1pt; overflow: auto; border-left: #cccccc 1pt solid; width: 100%; color: black; padding-top: 1pt; border-bottom: #cccccc 1pt solid; font-family: courier new"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;interface&lt;/span&gt; &lt;span style="color: #2b91af"&gt;IPictureItem&lt;/span&gt;&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: blue"&gt;string&lt;/span&gt; ID { &lt;span style="color: blue"&gt;get&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;Image&lt;/span&gt; Image { &lt;span style="color: blue"&gt;get&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;string&lt;/span&gt; ImagePath { &lt;span style="color: blue"&gt;get&lt;/span&gt;;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;At least one of Image, ImagePath peoperties should have values&lt;/p&gt;  &lt;p&gt;To make the design of NCarousel skin design fast without having to go back to the model many times I have added the AllowOverride attribute at model, which basically does not inject any specific to view css, thus allowing the skin to be overridden by adding a ling to a css file in your default.aspx. &lt;/p&gt;  &lt;p&gt;You can get the default skin css either from eXpand feature center application or from &lt;a href="http://sorgalla.com/jcarousel/" target="_blank"&gt;JCarousel&lt;/a&gt; original files&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_5YPm4JGkfwE/TWZPncWvfAI/AAAAAAAABGk/9-mDuWVdShM/s1600-h/image%5B4%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="424" alt="image" src="http://lh6.ggpht.com/_5YPm4JGkfwE/TWZPrmEdEaI/AAAAAAAABGo/JF-Bz1B4BKg/image_thumb%5B1%5D.png?imgmax=800" width="664" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;That way you modify only the css with dimensions, colors what ever you fill like and then set the attribute back to false and copy your css modifications back to the model so they can be inject as specific to view css.&lt;/p&gt;  &lt;p&gt;A normal thumbnail list editor that will display all images in one go similar to the one available at DevExpress Extend demo has been added as well&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_5YPm4JGkfwE/TWZPsf3j3dI/AAAAAAAABGs/KzlZFHLEvUg/s1600-h/image17.png" target="_blank"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="296" alt="image" src="http://lh3.ggpht.com/_5YPm4JGkfwE/TWZPtb8n6iI/AAAAAAAABGw/ts4PW5Ch0yk/image_thumb11.png?imgmax=800" width="617" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The image bellow demo the use of multiple editors as nested listview editors,&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_5YPm4JGkfwE/TWZPvxxOmiI/AAAAAAAABG0/shqQZyo1TPI/s1600-h/image26.png" target="_blank"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="479" alt="image" src="http://lh5.ggpht.com/_5YPm4JGkfwE/TWZPyfgpNfI/AAAAAAAABG4/Z-pc5dcliFs/image_thumb18.png?imgmax=800" width="725" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;ps:as text bellow image will concatenate all visible properties of the listview. Samples of those editors can be found at Xpand Feacturecenter web application&lt;/p&gt;  &lt;p&gt;&lt;a title="http://expandframework.com/downloads/download.html" href="http://expandframework.com/downloads/download.html"&gt;http://expandframework.com/downloads/download.html&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-3248548732162556097?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6cWaE33g7Ocdos22MWd21ftFO5s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6cWaE33g7Ocdos22MWd21ftFO5s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6cWaE33g7Ocdos22MWd21ftFO5s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6cWaE33g7Ocdos22MWd21ftFO5s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/re5ZdHxu-JM" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-24T14:32:10.225+02:00</app:edited><media:thumbnail url="http://lh3.ggpht.com/_5YPm4JGkfwE/TWZPjDxcP4I/AAAAAAAABGY/s4i6oIA31t0/s72-c/image_thumb13.png?imgmax=800" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/02/ncarousel-for-xaf.html</feedburner:origLink></item><item><title>eXpand framework web version release</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/O-nMZxxgYmo/expand-framework-web-version-release.html</link><category>releasev10</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Thu, 10 Feb 2011 02:21:26 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-829599187534761449</guid><description>&lt;p&gt;I know that many of you were using &lt;a href="http://github.com/eXpand" target="_blank"&gt;eXpand&lt;/a&gt; modules for your &lt;a href="http://www.devexpress.com/xaf/" target="_blank"&gt;XAF&lt;/a&gt; web applications for some time now and I want to thank you on behalf of the team for your feedback. However since now there wasn’t any official release for them from our team. We are happy to announce the release of the web version of our framework today.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;We have publish VS project item templates for web for both c# and vb.net. Also a web version of our featurecenter application comes along. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_5YPm4JGkfwE/TVO78VK9RNI/AAAAAAAABFU/rrnP2hLAghs/s1600-h/image3.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="307" alt="image" src="http://lh6.ggpht.com/_5YPm4JGkfwE/TVO79T5NB6I/AAAAAAAABFY/6JZA1bThZ1E/image_thumb1.png?imgmax=800" width="529" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As you see in the above image there is a Whats New section now for tracking new features. &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://expandframework.com" target="_blank"&gt;expandframework.com&lt;/a&gt; modules list has been enhanced with platform images so you can tell what platform each module supports &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_5YPm4JGkfwE/TVO7-90a0GI/AAAAAAAABFc/XGyEKRd4eNE/s1600-h/image20.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="440" alt="image" src="http://lh3.ggpht.com/_5YPm4JGkfwE/TVO8AWjuwzI/AAAAAAAABFg/X2xKQXIWIaY/image_thumb12.png?imgmax=800" width="636" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;2 more web specific modules have been added (18. NCarousel, 19. Thumbnail), but to keep this blog short i am going to post later on them &lt;/li&gt;    &lt;li&gt;Control navigation menu options through model for both platforms      &lt;br /&gt;      &lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_5YPm4JGkfwE/TVO8A69hxeI/AAAAAAAABFk/R6sjYJ2Yzo8/s1600-h/image28.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="306" alt="image" src="http://lh5.ggpht.com/_5YPm4JGkfwE/TVO8B47aoxI/AAAAAAAABFo/UZyvB-UiKx8/image_thumb16.png?imgmax=800" width="456" border="0" /&gt;&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Remember me feature for both platforms      &lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_5YPm4JGkfwE/TVO8CWP49QI/AAAAAAAABFs/xAN1CVqqtj4/s1600-h/image32.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="180" alt="image" src="http://lh6.ggpht.com/_5YPm4JGkfwE/TVO8C-Jb5qI/AAAAAAAABFw/eIBuDbrqajk/image_thumb18.png?imgmax=800" width="356" border="0" /&gt;&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Control nested collections web visibility according to listview ViewEditMode model attribute &lt;/li&gt;    &lt;li&gt;How to auto-select the first item, when changing the group in the navigation control      &lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_5YPm4JGkfwE/TVO8DkJkWVI/AAAAAAAABF0/qTLSp013f0s/s1600-h/image36.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="205" alt="image" src="http://lh3.ggpht.com/_5YPm4JGkfwE/TVO8EtFpt0I/AAAAAAAABF4/goSASm-ZAxk/image_thumb20.png?imgmax=800" width="387" border="0" /&gt;&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;How to prompt when the user is about to exit the application.      &lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_5YPm4JGkfwE/TVO8FFECruI/AAAAAAAABF8/2019urmvlUE/s1600-h/image40.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="184" alt="image" src="http://lh4.ggpht.com/_5YPm4JGkfwE/TVO8GBHcPII/AAAAAAAABGA/USdaYYeLjmQ/image_thumb22.png?imgmax=800" width="398" border="0" /&gt;&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Google as default translation provider &lt;/li&gt;    &lt;li&gt;When you have deep object hierarchies (eg you may have a lot of permissions in your app) then you will end up with a new object create menu like the one bellow      &lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_5YPm4JGkfwE/TVO8Gl_WnGI/AAAAAAAABGE/-B3U9MAyxOg/s1600-h/image45.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="403" alt="image" src="http://lh4.ggpht.com/_5YPm4JGkfwE/TVO8HnFOxII/AAAAAAAABGI/kp69v_SCGWw/image_thumb25.png?imgmax=800" width="352" border="0" /&gt;&lt;/a&gt;&amp;#160; &lt;br /&gt;there is sure a need for some easy way of grouping those objects. You can decorate your objects like       &lt;br /&gt;      &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;       &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #00008b"&gt;NewObjectCreateGroup&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Conditional&amp;quot;&lt;/span&gt;)]&lt;/p&gt;        &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;AdditionalViewControlsPermission&lt;/span&gt; : &lt;span style="color: #00008b"&gt;ConditionalLogicRulePermission&lt;/span&gt; {&lt;/p&gt;        &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;        &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;         &lt;p style="margin: 0px"&gt;[&lt;span style="color: #00008b"&gt;NewObjectCreateGroup&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Conditional&amp;quot;&lt;/span&gt;)]&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;MasterDetailPermission&lt;/span&gt; : &lt;span style="color: #00008b"&gt;ConditionalLogicRulePermission&lt;/span&gt; {&lt;/p&gt;       &lt;/div&gt;        &lt;p style="margin: 0px"&gt;or even better write a controller that will do that automatically in case you forgot&lt;/p&gt;        &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;        &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;         &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;CustomizeTypesInfo&lt;/span&gt;(&lt;span style="color: #00008b"&gt;DevExpress&lt;/span&gt;.&lt;span style="color: #00008b"&gt;ExpressApp&lt;/span&gt;.&lt;span style="color: #00008b"&gt;DC&lt;/span&gt;.&lt;span style="color: #00008b"&gt;ITypesInfo&lt;/span&gt; typesInfo) {&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: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;CustomizeTypesInfo&lt;/span&gt;(typesInfo);&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: blue"&gt;var&lt;/span&gt; typeDescendants = &lt;span style="color: #00008b"&gt;ReflectionHelper&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;FindTypeDescendants&lt;/span&gt;(typesInfo.&lt;span style="color: #008b8b"&gt;FindTypeInfo&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;ConditionalLogicRulePermission&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: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: blue"&gt;var&lt;/span&gt; &lt;span style="font-weight: bold"&gt;typeInfo&lt;/span&gt; &lt;span style="color: blue"&gt;in&lt;/span&gt; typeDescendants) {&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="font-weight: bold"&gt;typeInfo&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;AddAttribute&lt;/span&gt;(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;NewObjectCreateGroupAttribute&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Conditional&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;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;       &lt;/div&gt;        &lt;p style="margin: 0px"&gt;         &lt;br /&gt;and the result will look like           &lt;br /&gt;&lt;a href="http://lh4.ggpht.com/_5YPm4JGkfwE/TVO8IaJ7gAI/AAAAAAAABGM/zea0ZeDa7Bs/s1600-h/image4.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="254" alt="image" src="http://lh3.ggpht.com/_5YPm4JGkfwE/TVO8JJAneoI/AAAAAAAABGQ/g0jS7nww6C0/image_thumb1%5B1%5D.png?imgmax=800" width="385" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;     &lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You can download expandframework from &lt;a title="http://expandframework.com/downloads/download.html" href="http://expandframework.com/downloads/download.html"&gt;http://expandframework.com/downloads/download.html&lt;/a&gt; explore our featurecenter and sent us your feedback at our forums &lt;a title="http://expandframework.com/forum.html" href="http://expandframework.com/forum.html"&gt;http://expandframework.com/forum.html&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-829599187534761449?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/kQ3nAnOr23ehTO3l4623bCUl50c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kQ3nAnOr23ehTO3l4623bCUl50c/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/kQ3nAnOr23ehTO3l4623bCUl50c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kQ3nAnOr23ehTO3l4623bCUl50c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/O-nMZxxgYmo" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-10T12:21:26.143+02:00</app:edited><media:thumbnail url="http://lh6.ggpht.com/_5YPm4JGkfwE/TVO79T5NB6I/AAAAAAAABFY/6JZA1bThZ1E/s72-c/image_thumb1.png?imgmax=800" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/02/expand-framework-web-version-release.html</feedburner:origLink></item><item><title>XAF Pessimistic Locking</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/OuCDNrweRa8/xaf-pessimistic-locking.html</link><category>Core.Web</category><category>Xaf Tips</category><category>Core.Win</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Mon, 31 Jan 2011 01:27:58 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-4797231402349679374</guid><description>&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What Locking is all about &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Transactional isolation is usually implemented by locking whatever is accessed in a transaction. There are two different approaches to transactional locking: Pessimistic locking and optimistic locking. &lt;/p&gt;  &lt;p&gt;The disadvantage of pessimistic locking is that a resource is locked from the time it is first accessed in a transaction until the transaction is finished, making it inaccessible to other transactions during that time. If most transactions simply look at the resource and never change it, an exclusive lock may be overkill as it may cause lock contention, and optimistic locking may be a better approach. With pessimistic locking, locks are applied in a fail-safe way. In the banking application example, an account is locked as soon as it is accessed in a transaction. Attempts to use the account in other transactions while it is locked will either result in the other process being delayed until the account lock is released, or that the process transaction will be rolled back. The lock exists until the transaction has either been committed or rolled back. &lt;/p&gt;  &lt;p&gt;With optimistic locking, a resource is not actually locked when it is first is accessed by a transaction. Instead, the state of the resource at the time when it would have been locked with the pessimistic locking approach is saved. Other transactions are able to concurrently access to the resource and the possibility of conflicting changes is possible. At commit time, when the resource is about to be updated in persistent storage, the state of the resource is read from storage again and compared to the state that was saved when the resource was first accessed in the transaction. If the two states differ, a conflicting update was made, and the transaction will be rolled back. &lt;/p&gt;  &lt;p&gt;In the banking application example, the amount of an account is saved when the account is first accessed in a transaction. If the transaction changes the account amount, the amount is read from the store again just before the amount is about to be updated. If the amount has changed since the transaction began, the transaction will fail itself, otherwise the new amount is written to persistent storage.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;XAF Build in locking mechanism&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.devexpress.com/xaf/" target="_blank"&gt;XAF&lt;/a&gt;’s datalayer is based on XPO , which already has an optimistic locking implementation on its core. It is enabled by default for all objects that inherit XPBaseObjet and can be disabled by using the OptimisticLocking attribute . &lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #00008b"&gt;OptimisticLocking&lt;/span&gt;(&lt;span style="color: blue"&gt;false&lt;/span&gt;)]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;Client&lt;/span&gt;:&lt;span style="color: #00008b"&gt;XPBaseObject&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; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;Client&lt;/span&gt;(&lt;span style="color: #00008b"&gt;Session&lt;/span&gt; session) : &lt;span style="color: #00008b"&gt;base&lt;/span&gt;(session) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;For objects that have that attribute XPO is going to create an extra service field, the OptimisticLockingField to store that state of the object.&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;To see the locking mechanism in action you can perform the following steps&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt; &lt;/div&gt;  &lt;table cellspacing="0" cellpadding="2" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top"&gt;&lt;strong&gt;User 1&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top"&gt;&lt;strong&gt;User 2&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;         &lt;p&gt;1. Run application &lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;1. Run application &lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;         &lt;p&gt;2. Go to Client object detail view &lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;2. Go to Client object detail view &lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;3. XPO reads the value from the optimistic field value (initial value is zero) and stores it to memory &lt;/td&gt;        &lt;td valign="top"&gt;3. XPO reads the value from the optimistic field value (initial value is zero) and stores it to memory &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;         &lt;p&gt;4. User is making a change and tries to save the object&lt;/p&gt;          &lt;ol&gt;           &lt;li&gt;XPO queries the the optimisticfield value and compares it with the one in memory &lt;/li&gt;            &lt;li&gt;2 values are equal so transaction is commited and optimisticlocking fields is raized by one &lt;/li&gt;         &lt;/ol&gt;       &lt;/td&gt;        &lt;td valign="top"&gt;         &lt;p&gt;4. User is making a change and tries to save the object&lt;/p&gt;          &lt;ol&gt;           &lt;li&gt;XPO queries the the optimisticfield value (now its one cause user 1 has save the record) and compares it with the one in memory &lt;/li&gt;            &lt;li&gt;2 values are not equal so a locking exception is thrown by XPO giving information about the locked object &lt;/li&gt;         &lt;/ol&gt;          &lt;p&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;&amp;#160;&lt;/td&gt;        &lt;td valign="top"&gt;5. User reloads the object from the database, new optimisticlocking field value is store in memory (one), user makes changes and is able to save the record&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;a href="http://github.com/eXpand" target="_blank"&gt;&lt;strong&gt;eXpand&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; Pessimistic locking&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;XPO has no means to determine any information about users, but we are in XAF context and XAF has a build in security system and we know the current user. Lets try to implement a pessimistic locking feature for our XAF applications.&lt;/p&gt;  &lt;p&gt;By carefully looking at “3. XPO reads the value from the optimistic field value (initial value is zero) and stores it to memory “ , we can see that there is a place to minimize the locking conflicts. What if we display the detailview in “ViewMode” and add an “Edit” action? And when the Edit action is executed the object will be reloaded from the db, also when is saved the DetailView will return is View mode.&lt;/p&gt;  &lt;p&gt;I think we are going to gain something from that even if we use the default Xpo optimistic locking. Lucky us eXpand has already the ViewEditMode attribute that can do that job for us.&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top"&gt;&lt;a href="http://lh5.ggpht.com/_5YPm4JGkfwE/TUaAfpYUgXI/AAAAAAAABEk/IPA3DI9Z6pM/s1600-h/image%5B6%5D.png" target="_blank"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="121" alt="image" src="http://lh5.ggpht.com/_5YPm4JGkfwE/TUaAgSzJesI/AAAAAAAABEo/lYHQTVcFJ4U/image_thumb%5B2%5D.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;/td&gt;        &lt;td valign="top"&gt;&lt;a href="http://lh3.ggpht.com/_5YPm4JGkfwE/TUaAg1B5a1I/AAAAAAAABEs/dlehPrWySlo/s1600-h/image%5B7%5D.png" target="_blank"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="164" alt="image" src="http://lh5.ggpht.com/_5YPm4JGkfwE/TUaAhrFIBmI/AAAAAAAABEw/wKTsEavrGHU/image_thumb%5B3%5D.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt; Now from the Pessimistic locking definition (&lt;em&gt;when it is first is accessed by a transaction). &lt;/em&gt;We have to decide what that means in our case. A good idea would be to lock the object at the time that is changed by a user. Of course we can enhance that in the future upon your requests. We also need a special field that will store the user that locked the record and a special attribute to mark the object for using our pessimistic locking attribute. Finally its a good idea to disable default OptimisticLocking mechanism.&lt;/p&gt;  &lt;p&gt;All the above should be transparent to the user of our feature, we need to spent zero time when using it in future projects&lt;/p&gt;  &lt;p&gt;   &lt;p&gt;&lt;/p&gt;    &lt;p&gt;Customizing XAF types is very easy as you know , just some lines of code and can do the trick.&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;CustomizeTypesInfo&lt;/span&gt;(&lt;span style="color: #00008b"&gt;DevExpress&lt;/span&gt;.&lt;span style="color: #00008b"&gt;ExpressApp&lt;/span&gt;.&lt;span style="color: #00008b"&gt;DC&lt;/span&gt;.&lt;span style="color: #00008b"&gt;ITypesInfo&lt;/span&gt; typesInfo) {&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&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: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;CustomizeTypesInfo&lt;/span&gt;(typesInfo);&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&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: blue"&gt;var&lt;/span&gt; typeInfos = typesInfo.&lt;span style="color: purple"&gt;PersistentTypes&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Where&lt;/span&gt;(info =&amp;gt; info.&lt;span style="color: #008b8b"&gt;FindAttribute&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;PessimisticLockingAttribute&lt;/span&gt;&amp;gt;() != &lt;span style="color: blue"&gt;null&lt;/span&gt;);&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&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: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: blue"&gt;var&lt;/span&gt; &lt;span style="font-weight: bold"&gt;typeInfo&lt;/span&gt; &lt;span style="color: blue"&gt;in&lt;/span&gt; typeInfos) {&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&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="font-weight: bold"&gt;typeInfo&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;AddAttribute&lt;/span&gt;(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;OptimisticLockingAttribute&lt;/span&gt;(&lt;span style="color: blue"&gt;false&lt;/span&gt;));&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&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: blue"&gt;var&lt;/span&gt; &lt;span style="font-weight: bold"&gt;memberInfo&lt;/span&gt; = &lt;span style="font-weight: bold"&gt;typeInfo&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;FindMember&lt;/span&gt;(&lt;span style="font-weight: bold; color: purple"&gt;LockedUser&lt;/span&gt;);&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&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: blue"&gt;if&lt;/span&gt; (&lt;span style="font-weight: bold"&gt;memberInfo&lt;/span&gt; == &lt;span style="color: blue"&gt;null&lt;/span&gt;) {&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&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="font-weight: bold"&gt;memberInfo&lt;/span&gt; = &lt;span style="font-weight: bold"&gt;typeInfo&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;CreateMember&lt;/span&gt;(&lt;span style="font-weight: bold; color: purple"&gt;LockedUser&lt;/span&gt;, &lt;span style="color: #00008b"&gt;SecuritySystem&lt;/span&gt;.&lt;span style="color: purple"&gt;UserType&lt;/span&gt;);&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&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="font-weight: bold"&gt;memberInfo&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;AddAttribute&lt;/span&gt;(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;BrowsableAttribute&lt;/span&gt;(&lt;span style="color: blue"&gt;false&lt;/span&gt;));&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;Great! Now we need to define our specifications. Remember we are dealing with data now and with a complex feature that may evolve from fellow developers request. For those cases at eXpand we use a BDD approach, and &lt;a href="http://apobekiaris.blogspot.com/search/label/MSpec" target="_blank"&gt;MSpec&lt;/a&gt; as our BDD framework.&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;Here are some specs&lt;/p&gt;    &lt;p&gt;PessimisticLockingViewController, When Object Change     &lt;br /&gt;» should lock the object &lt;/p&gt;    &lt;p&gt;PessimisticLockingViewController, When objectspace rollback     &lt;br /&gt;» should unlock object &lt;/p&gt;    &lt;p&gt;PessimisticLockingViewController, When ospace commited     &lt;br /&gt;» should unlock object &lt;/p&gt;    &lt;p&gt;PessimisticLockingViewController, When View CurrentObject Changing     &lt;br /&gt;» should unlock object &lt;/p&gt;    &lt;p&gt;PessimisticLockingViewController, When View Is closing     &lt;br /&gt;» should unlock object &lt;/p&gt;    &lt;p&gt;PessimisticLocker, When object is about to be unlocked     &lt;br /&gt;» should not unlock if current user does not match locked user &lt;/p&gt;    &lt;p&gt;PessimisticLockingViewController, When a locked object is open by a second user     &lt;br /&gt;» should not allowedit on view &lt;/p&gt;    &lt;p&gt;PessimisticLockingViewController, When 2 users open the same object and both try to change it     &lt;br /&gt;» should mark as readonly last user view &lt;/p&gt;    &lt;p&gt;PessimisticLockingViewController, When editing a locked detailview     &lt;br /&gt;» should allow edit for the pessimistic locking context &lt;/p&gt;    &lt;p&gt;PessimisticLocker, When unlocking new object     &lt;br /&gt;» should do nothing &lt;/p&gt;    &lt;p&gt;PessimisticLocker, When locking new object     &lt;br /&gt;» should do nothing &lt;/p&gt;    &lt;p&gt;PessimisticLocker, When new object locking state is queried     &lt;br /&gt;» should return unlocked&lt;/p&gt;    &lt;p style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;&lt;font color="#000000"&gt;and in this file you can see the implementation of them&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="https://github.com/expand/eXpand/blob/master/Xpand/Xpand.Tests/Xpand.Tests/Xpand.ExpressApp/PessimisticLockingSpecs.cs"&gt;https://github.com/expand/eXpand/blob/master/Xpand/Xpand.Tests/Xpand.Tests/Xpand.ExpressApp/PessimisticLockingSpecs.cs&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000"&gt;As you see from the specifications when an object is locked the detailview will be read only for a PessimisticLocking context. But real world is strange we have to cover exceptions as well. What will happen if an object was locked and our application was terminated abnormally? We need an action that will force unlock the object.&lt;/font&gt;&lt;/p&gt;  &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&lt;a href="http://lh6.ggpht.com/_5YPm4JGkfwE/TUaAiOTDkYI/AAAAAAAABE0/kEESY66j0tE/s1600-h/image%5B11%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="263" alt="image" src="http://lh6.ggpht.com/_5YPm4JGkfwE/TUaAiwC43PI/AAAAAAAABE4/fSfOvHbhQLQ/image_thumb%5B5%5D.png?imgmax=800" width="371" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;Maybe there is a need for some timeout implementation there but I do not have strong ideas on this, better wait for some feedback from out there first before spending any more resources. Anyway we are very close now. What we are missing is a message that will tell which user has locked an object when it is locked.&lt;/p&gt;  &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;To display the message I think we can utilize our &lt;a href="http://apobekiaris.blogspot.com/search/label/AdditionalViewControlsProvider" target="_blank"&gt;AdditionalViewControlsProvider&lt;/a&gt; module. That module allows to conditionally display (When our LockingUser field is different for the current user) a message. Also allows us to conditionalize/localize the message it self. Lets see how&lt;/p&gt;  &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;First step will be to use the AdditionalViewControlsRule to display the message as bellow&lt;/p&gt;  &lt;p style="font-size: 10pt; background: white; margin: 0px; color: black; font-family: consolas"&gt;&amp;#160;&lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #00008b"&gt;PessimisticLocking&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #00008b"&gt;Custom&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;ViewEditMode&amp;quot;&lt;/span&gt;,&lt;span style="color: #a31515"&gt;&amp;quot;View&amp;quot;&lt;/span&gt;)]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #00008b"&gt;AdditionalViewControlsRule&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;teee&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;LockedUser!='@CurrentUserID' AND LockedUser Is Not Null&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;1=0&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;Record is locked by user {0}&amp;quot;&lt;/span&gt;, &lt;span style="color: #00008b"&gt;Position&lt;/span&gt;.&lt;span style="font-weight: bold; color: purple"&gt;Top&lt;/span&gt;, &lt;span style="color: purple"&gt;MessageProperty&lt;/span&gt; = &lt;span style="color: #a31515"&gt;&amp;quot;LockedUserMessage&amp;quot;&lt;/span&gt;)]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;Client&lt;/span&gt; : &lt;span style="color: #00008b"&gt;BaseObject&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; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;Client&lt;/span&gt;(&lt;span style="color: #00008b"&gt;Session&lt;/span&gt; session)&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: #00008b"&gt;base&lt;/span&gt;(session) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;_lockedUserMessage&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; [&lt;span style="color: #00008b"&gt;NonPersistent&lt;/span&gt;][&lt;span style="color: #00008b"&gt;Browsable&lt;/span&gt;(&lt;span style="color: blue"&gt;false&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; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;LockedUserMessage&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: #008b8b"&gt;get&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; memberValue = &lt;span style="color: #008b8b"&gt;GetMemberValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;LockedUser&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;if&lt;/span&gt; (&lt;span style="color: purple"&gt;_lockedUserMessage&lt;/span&gt; != &lt;span style="color: blue"&gt;null&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; memberValue != &lt;span style="color: blue"&gt;null&lt;/span&gt; ? &lt;span style="color: blue"&gt;string&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Format&lt;/span&gt;(&lt;span style="color: purple"&gt;_lockedUserMessage&lt;/span&gt;, memberValue) : &lt;span style="color: blue"&gt;null&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;null&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;/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: #008b8b"&gt;set&lt;/span&gt; { &lt;span style="color: purple"&gt;_lockedUserMessage&lt;/span&gt; = &lt;span style="color: blue"&gt;value&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; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;that will create a rule at our model like the following.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_5YPm4JGkfwE/TUaAj7vtJyI/AAAAAAAABE8/555Ygi1r0Tw/s1600-h/image%5B16%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="256" alt="image" src="http://lh3.ggpht.com/_5YPm4JGkfwE/TUaAkxOJ1qI/AAAAAAAABFA/f4v8Wlp6w3I/image_thumb%5B8%5D.png?imgmax=800" width="490" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;and will display the message&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_5YPm4JGkfwE/TUaAmQeYf_I/AAAAAAAABFE/Y46GB88HmZw/s1600-h/image%5B22%5D.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="228" alt="image" src="http://lh5.ggpht.com/_5YPm4JGkfwE/TUaAnJ9eCTI/AAAAAAAABFI/7Qo-dsu6FNU/image_thumb%5B10%5D.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;2nd step is to refactor the attribute to something easier to use like&lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;PessimisticLockingMessageAttribute&lt;/span&gt; : &lt;span style="color: #00008b"&gt;AdditionalViewControlsRuleAttribute&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; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;PessimisticLockingMessageAttribute&lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt; id)&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: #00008b"&gt;base&lt;/span&gt;(id, &lt;span style="color: #a31515"&gt;&amp;quot;LockedUser!='@CurrentUserID' AND LockedUser Is Not Null&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;1=0&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;Record is locked by user {0}&amp;quot;&lt;/span&gt;, &lt;span style="color: #00008b"&gt;Position&lt;/span&gt;.&lt;span style="font-weight: bold; color: purple"&gt;Top&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: purple"&gt;MessageProperty&lt;/span&gt; = &lt;span style="color: #a31515"&gt;&amp;quot;LockedUserMessage&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; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;and 3rd step is to refactor the LockedUserMessage property. We have seen already that dynamically adding a property is a piece of cake, but how can we dynamically add a property that has behavior such as the LockedUserMessage property?&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Easy as always :), we just have to create our Custom memberinfo like&lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;LockedUserMessageXpMemberInfo&lt;/span&gt; : &lt;span style="color: #00008b"&gt;XPCustomMemberInfo&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; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;_theValue&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;LockedUserMessageXpMemberInfo&lt;/span&gt;(&lt;span style="color: #00008b"&gt;XPClassInfo&lt;/span&gt; owner)&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: #00008b"&gt;base&lt;/span&gt;(owner, &lt;span style="color: #a31515"&gt;&amp;quot;LockedUserMessage&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt;), &lt;span style="color: blue"&gt;null&lt;/span&gt;, &lt;span style="color: blue"&gt;true&lt;/span&gt;, &lt;span style="color: blue"&gt;false&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; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; &lt;span style="color: #008b8b"&gt;GetValue&lt;/span&gt;(&lt;span style="color: blue"&gt;object&lt;/span&gt; theObject) {&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: blue"&gt;var&lt;/span&gt; typeInfo = &lt;span style="color: #00008b"&gt;XafTypesInfo&lt;/span&gt;.&lt;span style="color: purple"&gt;Instance&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;FindTypeInfo&lt;/span&gt;(theObject.&lt;span style="color: #008b8b"&gt;GetType&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: blue"&gt;var&lt;/span&gt; memberValue = typeInfo.&lt;span style="color: #008b8b"&gt;FindMember&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;LockedUser&amp;quot;&lt;/span&gt;).&lt;span style="color: #008b8b"&gt;GetValue&lt;/span&gt;(theObject);&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: blue"&gt;if&lt;/span&gt; (&lt;span style="color: purple"&gt;_theValue&lt;/span&gt; != &lt;span style="color: blue"&gt;null&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; memberValue != &lt;span style="color: blue"&gt;null&lt;/span&gt; ? &lt;span style="color: blue"&gt;string&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Format&lt;/span&gt;(&lt;span style="color: purple"&gt;_theValue&lt;/span&gt;, memberValue) : &lt;span style="color: blue"&gt;null&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;/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: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;null&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; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;SetValue&lt;/span&gt;(&lt;span style="color: blue"&gt;object&lt;/span&gt; theObject, &lt;span style="color: blue"&gt;object&lt;/span&gt; theValue) {&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: purple"&gt;_theValue&lt;/span&gt; = theValue &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: blue"&gt;string&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: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;SetValue&lt;/span&gt;(theObject, theValue);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;and register it on the system.&lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;CustomizeTypesInfo&lt;/span&gt;(&lt;span style="color: #00008b"&gt;DevExpress&lt;/span&gt;.&lt;span style="color: #00008b"&gt;ExpressApp&lt;/span&gt;.&lt;span style="color: #00008b"&gt;DC&lt;/span&gt;.&lt;span style="color: #00008b"&gt;ITypesInfo&lt;/span&gt; typesInfo) {&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: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;CustomizeTypesInfo&lt;/span&gt;(typesInfo);&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: blue"&gt;var&lt;/span&gt; typeInfos = typesInfo.&lt;span style="color: purple"&gt;PersistentTypes&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;Where&lt;/span&gt;(info =&amp;gt; info.&lt;span style="color: #008b8b"&gt;FindAttribute&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;PessimisticLockingMessageAttribute&lt;/span&gt;&amp;gt;() != &lt;span style="color: blue"&gt;null&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: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: blue"&gt;var&lt;/span&gt; &lt;span style="font-weight: bold"&gt;typeInfo&lt;/span&gt; &lt;span style="color: blue"&gt;in&lt;/span&gt; typeInfos) {&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; memberInfo = &lt;span style="font-weight: bold"&gt;typeInfo&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;FindMember&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;LockedUserMessage&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;if&lt;/span&gt; (memberInfo == &lt;span style="color: blue"&gt;null&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; xpClassInfo = &lt;span style="color: #00008b"&gt;XafTypesInfo&lt;/span&gt;.&lt;span style="color: purple"&gt;XpoTypeInfoSource&lt;/span&gt;.&lt;span style="color: purple"&gt;XPDictionary&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;GetClassInfo&lt;/span&gt;(&lt;span style="font-weight: bold"&gt;typeInfo&lt;/span&gt;.&lt;span style="color: purple"&gt;Type&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; lockedUserMessageXpMemberInfo = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;LockedUserMessageXpMemberInfo&lt;/span&gt;(xpClassInfo);&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lockedUserMessageXpMemberInfo.&lt;span style="color: #008b8b"&gt;AddAttribute&lt;/span&gt;(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;BrowsableAttribute&lt;/span&gt;(&lt;span style="color: blue"&gt;false&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #00008b"&gt;XafTypesInfo&lt;/span&gt;.&lt;span style="color: purple"&gt;Instance&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;RefreshInfo&lt;/span&gt;(&lt;span style="font-weight: bold"&gt;typeInfo&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&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;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;That was a long post but the result i believe is great. All the above are implemented in eXpand framework. Next time you want to use the pessimistic lock approach presented in this blog you only have to decorate your class with 3 attributes&lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #00008b"&gt;PessimisticLocking&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #00008b"&gt;Custom&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;ViewEditMode&amp;quot;&lt;/span&gt;,&lt;span style="color: #a31515"&gt;&amp;quot;View&amp;quot;&lt;/span&gt;)]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #00008b"&gt;PessimisticLockingMessageAttribute&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;AnId&amp;quot;&lt;/span&gt;)]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;Client&lt;/span&gt; : &lt;span style="color: #00008b"&gt;BaseObject&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; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;Client&lt;/span&gt;(&lt;span style="color: #00008b"&gt;Session&lt;/span&gt; session)&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: #00008b"&gt;base&lt;/span&gt;(session) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;_name&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; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;Name&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: #008b8b"&gt;get&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: purple"&gt;_name&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;/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: #008b8b"&gt;set&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;ref&lt;/span&gt; &lt;span style="color: purple"&gt;_name&lt;/span&gt;, &lt;span style="color: blue"&gt;value&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;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Download expand from &lt;a title="http://expandframework.com/downloads/download.html" href="http://expandframework.com/downloads/download.html"&gt;http://expandframework.com/downloads/download.html&lt;/a&gt; and sent use your feedback or report any problems you find at our forums &lt;a title="http://expandframework.com/forum.html" href="http://expandframework.com/forum.html"&gt;http://expandframework.com/forum.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;eXpand FeatureCenter implementation contains a demo of this bolg under the Miscallenous/Pessimistic locking navigation menu&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-4797231402349679374?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8hV1ajwQ1cSUQb-lWwPTZMVfAdI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8hV1ajwQ1cSUQb-lWwPTZMVfAdI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8hV1ajwQ1cSUQb-lWwPTZMVfAdI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8hV1ajwQ1cSUQb-lWwPTZMVfAdI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/OuCDNrweRa8" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-31T11:27:58.612+02:00</app:edited><media:thumbnail url="http://lh5.ggpht.com/_5YPm4JGkfwE/TUaAgSzJesI/AAAAAAAABEo/lYHQTVcFJ4U/s72-c/image_thumb%5B2%5D.png?imgmax=800" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/01/xaf-pessimistic-locking.html</feedburner:origLink></item><item><title>Easy Sequential numbers</title><link>http://feedproxy.google.com/~r/AbekiarisBlog/~3/wKFQsO3ZQG4/easy-sequential-numbers.html</link><category>Core.Web</category><category>Xaf Tips</category><category>Core.Win</category><author>noreply@blogger.com (Apostolis Bekiaris)</author><pubDate>Wed, 26 Jan 2011 16:08:33 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-3509234234245012858.post-183521399114942549</guid><description>&lt;p&gt;Where they can be used?? In many places sequential for example invoices, sales orders etc.&lt;/p&gt;  &lt;p align="right"&gt;One could tell that this is an easy task and maybe that assumption is right but let me write down some real world requirements that can prove the opposite to you.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Invoices Number Uniqueness should be quarantine in a multi user environment &lt;/li&gt;    &lt;li&gt;Number number should be sequential &lt;/li&gt;    &lt;li&gt;Invoices numbers may have series (eg AB-1001 for invoices coming from store sales , EP-1001 for invoices coming from patient treatment) &lt;/li&gt;    &lt;li&gt;Starting number must be configurable. (eg need to start numbering at 5000 this year, and next year start at 7000) &lt;/li&gt;    &lt;li&gt;There should be a way to reuse numbers of deleted invoices &lt;/li&gt;    &lt;li&gt;Storage (table schema) of invoice numbers should be controlled by the user &lt;/li&gt;    &lt;li&gt;End user API should be very flexible and easy &lt;/li&gt;    &lt;li&gt;Of course whatever you build has to be available in both win and web platforms &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Now what you think? How much time do you need to build that?&lt;/p&gt;  &lt;p&gt;If you have some &lt;a href="http://www.devexpress.com/xaf/" target="_blank"&gt;XAF&lt;/a&gt; experience it will be about only some hrs work to create a reusable code that fellow devs and future projects can utilize. So in this post i am going to go through the process step by step&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step1: Check Devexpress support center&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;SC has samples for thousand of cases so before building anything it is most advisable to check there. &lt;/p&gt;  &lt;p&gt;Searching revealed this one    &lt;br /&gt;&lt;a href="http://www.devexpress.com/Support/Center/e/E2829.aspx"&gt;How to generate and assign a sequential number for a business object within a database transaction, while being a part of a successful saving process (XAF)&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;That sample is using ExcplicitUnitOfWork (in other words explicit sql transaction) and that can guarantee requirement 1,2&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step2: Refactor the sample to fit your needs&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Although the sample can be used as is in real world, has some requirements that are making it less flexible. It requires to inherit from a special BasePersistentObject class. &lt;/p&gt;  &lt;p&gt;To overcome that we can introduce an interface instead and push all depended code to our SequenceGenerator class&lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;interface&lt;/span&gt; &lt;span style="color: #00008b"&gt;ISupportSequenceObject&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; &lt;span style="color: blue"&gt;long&lt;/span&gt; &lt;span style="color: purple"&gt;Sequence&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;get&lt;/span&gt;; &lt;span style="color: #008b8b"&gt;set&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;a href="http://lh5.ggpht.com/_5YPm4JGkfwE/TT1UWK8bAdI/AAAAAAAABEE/A_UU43F_gx0/s1600-h/image4.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="309" alt="image" src="http://lh6.ggpht.com/_5YPm4JGkfwE/TT1UXCtINJI/AAAAAAAABEI/FAbh_XrHkeM/image_thumb2.png?imgmax=800" width="515" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;Now we can inherit from any object as you see in the above code and we only have to write the code that is inside the OnSaving method! . &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;table cellspacing="0" cellpadding="2" border="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top"&gt;The best part is that we do not even spent one minute to think about the validity of the generating seq numbers code. That is Devexpress job and they are best in doing it. What we could do is just track the issue for changes (maybe bugs will raise from other users in future )            &lt;br /&gt;            &lt;br /&gt;I am happy with this refactoring so lets move on to the other requirements.&lt;/td&gt;          &lt;td valign="top"&gt;&lt;a href="http://lh6.ggpht.com/_5YPm4JGkfwE/TT1UX-XZwcI/AAAAAAAABEM/wNyRlhaahaE/s1600-h/image7.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="214" alt="image" src="http://lh5.ggpht.com/_5YPm4JGkfwE/TT1UYdaeheI/AAAAAAAABEQ/GuqPRGBYDPo/image_thumb3.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt;    &lt;p style="margin: 0px"&gt;&lt;font color="#ff0000"&gt;Time spent 1.5hrs&lt;/font&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;strong&gt;Invoices numbers may have series&lt;/strong&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;How about it?? Should be very easy if we understand what are SequenceGenerator does. It saves a number for a specific type in the database. So instead of a specific type we can refactor it to save a specific type and a series string. We can do that by introducing a new Prefix property to our&amp;#160; ISupportSequenceObject interface and refactor our SequenceGenerator to save that prefix as well .&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;     &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;interface&lt;/span&gt; &lt;span style="color: #00008b"&gt;ISupportSequenceObject&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; &lt;span style="color: blue"&gt;long&lt;/span&gt; &lt;span style="color: purple"&gt;Sequence&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;get&lt;/span&gt;; &lt;span style="color: #008b8b"&gt;set&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; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;Prefix&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;get&lt;/span&gt;; }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;our previous front end API was left as simple as it was b4 as you see bellow&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&lt;a href="http://lh4.ggpht.com/_5YPm4JGkfwE/TT1UZTuVq0I/AAAAAAAABEU/PCRhaLJf-sI/s1600-h/image13.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="469" alt="image" src="http://lh3.ggpht.com/_5YPm4JGkfwE/TT1UawNiVqI/AAAAAAAABEY/LY3biEsSwD8/image_thumb7.png?imgmax=800" width="506" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Starting number must be configurable. (eg need to start numbering at 5000 this year, and next year start at 7000) &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Ok that sounds very similar to our previous req. In essence the year is just a serie, so we could just change our class to &lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: #00008b"&gt;ISupportSequenceObject&lt;/span&gt;.&lt;span style="color: purple"&gt;Prefix&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: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: purple"&gt;Serie&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;ToString&lt;/span&gt;()+&lt;span style="color: #00008b"&gt;DateTime&lt;/span&gt;.&lt;span style="color: purple"&gt;Today&lt;/span&gt;.&lt;span style="color: purple"&gt;Year&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; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;and now our numbers are unique per serier+year!. And how can we control the starting number?&lt;/p&gt;    &lt;p style="margin: 0px"&gt;Very easy as everything in XAF!. Sequence numbers are saved using a persistent object, so the thing we need to do is just create a new Sequence number manual and the other numbers will follow since they are sequential.&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt; &lt;/div&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&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: blue"&gt;var&lt;/span&gt; unitOfWork = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;UnitOfWork&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: blue"&gt;var&lt;/span&gt; sequenceObjects = &lt;span style="color: #00008b"&gt;Enum&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;GetValues&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt; (&lt;span style="color: #00008b"&gt;SerieEnum&lt;/span&gt;)).&lt;span style="color: #008b8b"&gt;Cast&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;SerieEnum&lt;/span&gt;&amp;gt;().&lt;span style="color: #008b8b"&gt;Select&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; serie =&amp;gt; &lt;span style="color: #00008b"&gt;SequenceGenerator&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;CreateSequenceObject&lt;/span&gt;(serie.&lt;span style="color: #008b8b"&gt;ToString&lt;/span&gt;() + 2012, unitOfWork));&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: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: blue"&gt;var&lt;/span&gt; &lt;span style="font-weight: bold"&gt;sequenceObject&lt;/span&gt; &lt;span style="color: blue"&gt;in&lt;/span&gt; sequenceObjects) {&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="font-weight: bold"&gt;sequenceObject&lt;/span&gt;.&lt;span style="color: purple"&gt;NextSequence&lt;/span&gt; = 7000;&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;/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; unitOfWork.&lt;span style="color: #008b8b"&gt;CommitChanges&lt;/span&gt;();&lt;/p&gt; &lt;/div&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&lt;font color="#ff0000"&gt;Time spent 30min&lt;/font&gt;&amp;#160;&lt;/p&gt; &lt;/div&gt;  &lt;p style="margin: 0px"&gt;&lt;strong&gt;There should be a way to reuse numbers of deleted invoices &lt;/strong&gt;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;What does that mean? When an object that supports sequences (ISupportSequence object) is deleted we need to store the deleted sequence number and allow end user through UI to reuse it at a later time.&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="margin: 0px"&gt;We already have an SequenceObject that stores the sequence number what we miss is an one to many relation with an object that stores deleted numbers. The following class will do the job&lt;/p&gt;  &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;SequenceReleasedObject&lt;/span&gt; : &lt;span style="color: #00008b"&gt;XpandBaseCustomObject&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; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;SequenceReleasedObject&lt;/span&gt;(&lt;span style="color: #00008b"&gt;Session&lt;/span&gt; session)&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: #00008b"&gt;base&lt;/span&gt;(session) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: #00008b"&gt;SequenceObject&lt;/span&gt; &lt;span style="color: purple"&gt;_sequenceObject&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; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;SequenceObject&lt;/span&gt; &lt;span style="color: purple"&gt;SequenceObject&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: #008b8b"&gt;get&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: purple"&gt;_sequenceObject&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;/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: #008b8b"&gt;set&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;SequenceObject&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;ref&lt;/span&gt; &lt;span style="color: purple"&gt;_sequenceObject&lt;/span&gt;, &lt;span style="color: blue"&gt;value&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;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;long&lt;/span&gt; &lt;span style="color: purple"&gt;_sequence&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; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;long&lt;/span&gt; &lt;span style="color: purple"&gt;Sequence&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: #008b8b"&gt;get&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: purple"&gt;_sequence&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;/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: #008b8b"&gt;set&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Sequence&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;ref&lt;/span&gt; &lt;span style="color: purple"&gt;_sequence&lt;/span&gt;, &lt;span style="color: blue"&gt;value&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;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;Having the storage object we then need to grad the deleted ISupportSequence object and create a new &lt;span style="color: #00008b"&gt;SequenceReleasedObject&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;     &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;Invoice&lt;/span&gt; : &lt;span style="color: #00008b"&gt;BaseObject&lt;/span&gt;, &lt;span style="color: #00008b"&gt;ISupportSequenceObject&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; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;Invoice&lt;/span&gt;(&lt;span style="color: #00008b"&gt;Session&lt;/span&gt; session) : &lt;span style="color: #00008b"&gt;base&lt;/span&gt;(session) {&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;OnDeleted&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: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;OnDeleted&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: #00008b"&gt;SequenceGenerator&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;ReleaseSequence&lt;/span&gt;(&lt;span style="color: blue"&gt;this&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; }&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;Now that we have our data stored in the database, we are going to use XAF to allow user to restore a deleted number.&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;I am thinking of a control (PropertyEditor in XAF terms) that could be used to render the sequence property of the ISupportSequence object. Also that control should have a button to the right, that on click is going to display a &lt;span style="color: #00008b"&gt;SequenceReleasedObject&lt;/span&gt; list . User will select something from the list and when the transaction is committed the &lt;span style="color: #00008b"&gt;SequenceReleasedObject&lt;/span&gt; value will replace ISupportSequenceObject value and will be deleted.&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;Sounds hard to you? In fact it is not so much. You have to remember to use the tools that XAF provides for you. Here is what I mean . XAF already has a similar property editor to render aggregated object properties&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&lt;a href="http://lh6.ggpht.com/_5YPm4JGkfwE/TT1UbRTHXFI/AAAAAAAABEc/ACrajXMx9Bg/s1600-h/image17.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="116" alt="image" src="http://lh4.ggpht.com/_5YPm4JGkfwE/TT1Ub4oXChI/AAAAAAAABEg/cRlO9QH29EY/image_thumb9.png?imgmax=800" width="370" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;      &lt;p style="margin: 0px"&gt;When editor's button is clicked then a detailview of the aggregated object is shown. We could just use the same editor and replace that part. Instead of displaying a detailview we could just display a listview of SequenceReleaseObjects. Exactly the same process we could follow for the web platform.&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;Now we have our property editors, but lets make dev job even more easier. Lets create a platform independent marker attribute that will handle the property editor type assignment.&lt;/p&gt;      &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;      &lt;p style="margin: 0px"&gt;First we create a marker attribute like&lt;/p&gt;      &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;       &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #00008b"&gt;AttributeUsage&lt;/span&gt;(&lt;span style="color: #00008b"&gt;AttributeTargets&lt;/span&gt;.&lt;span style="font-weight: bold; color: purple"&gt;Property&lt;/span&gt;)]&lt;/p&gt;        &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;SequencePropertyAttribute&lt;/span&gt; : &lt;span style="color: #00008b"&gt;Attribute&lt;/span&gt; {&lt;/p&gt;        &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;        &lt;p style="margin: 0px"&gt;and a marker interface that will be implemented by both our editors&lt;/p&gt;        &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;         &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;interface&lt;/span&gt; &lt;span style="color: #00008b"&gt;IReleasedSequencePropertyEditor&lt;/span&gt; {&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;          &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;       &lt;/div&gt; write a simple controller that will do the assignment as&lt;/div&gt;      &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;       &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;CustomAttibutesController&lt;/span&gt; : &lt;span style="color: #00008b"&gt;WindowController&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; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;CustomizeTypesInfo&lt;/span&gt;(&lt;span style="color: #00008b"&gt;ITypesInfo&lt;/span&gt; typesInfo) {&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: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;CustomizeTypesInfo&lt;/span&gt;(typesInfo);&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: blue"&gt;var&lt;/span&gt; memberInfos = typesInfo.&lt;span style="color: purple"&gt;PersistentTypes&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;SelectMany&lt;/span&gt;(info =&amp;gt; info.&lt;span style="color: purple"&gt;OwnMembers&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: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: blue"&gt;var&lt;/span&gt; &lt;span style="font-weight: bold"&gt;memberInfo&lt;/span&gt; &lt;span style="color: blue"&gt;in&lt;/span&gt; memberInfos) {&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #008b8b"&gt;HandleSequencePropertyAttribute&lt;/span&gt;(&lt;span style="font-weight: bold"&gt;memberInfo&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;/p&gt;        &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;        &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;        &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;HandleSequencePropertyAttribute&lt;/span&gt;(&lt;span style="color: #00008b"&gt;IMemberInfo&lt;/span&gt; memberInfo) {&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: blue"&gt;var&lt;/span&gt; sequencePropertyAttribute = memberInfo.&lt;span style="color: #008b8b"&gt;FindAttribute&lt;/span&gt;&amp;lt;&lt;span style="color: #00008b"&gt;SequencePropertyAttribute&lt;/span&gt;&amp;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: blue"&gt;if&lt;/span&gt; (sequencePropertyAttribute != &lt;span style="color: blue"&gt;null&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; typeInfo = &lt;span style="color: #00008b"&gt;ReflectionHelper&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;FindTypeDescendants&lt;/span&gt;(&lt;span style="color: #00008b"&gt;XafTypesInfo&lt;/span&gt;.&lt;span style="color: purple"&gt;Instance&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;FindTypeInfo&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #00008b"&gt;IReleasedSequencePropertyEditor&lt;/span&gt;))).&lt;span style="color: #008b8b"&gt;Single&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; memberInfo.&lt;span style="color: #008b8b"&gt;AddAttribute&lt;/span&gt;(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #00008b"&gt;CustomAttribute&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;PropertyEditorType&amp;quot;&lt;/span&gt;, typeInfo.&lt;span style="color: purple"&gt;FullName&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;/p&gt;        &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;        &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;        &lt;p style="margin: 0px"&gt;and of course decorate our property&lt;/p&gt;        &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;     &lt;/div&gt;      &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;       &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;long&lt;/span&gt; &lt;span style="color: purple"&gt;_sequence&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; [&lt;span style="color: #00008b"&gt;SequenceProperty&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; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;long&lt;/span&gt; &lt;span style="color: purple"&gt;Sequence&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: #008b8b"&gt;get&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: purple"&gt;_sequence&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;/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: #008b8b"&gt;set&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Sequence&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;ref&lt;/span&gt; &lt;span style="color: purple"&gt;_sequence&lt;/span&gt;, &lt;span style="color: blue"&gt;value&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;/p&gt;        &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;     &lt;/div&gt;      &lt;p style="margin: 0px"&gt;&lt;font color="#ff0000"&gt;Time spent 3hr&lt;/font&gt;&lt;/p&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&lt;strong&gt;Storage (table schema) of invoice numbers should be controlled by the user &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Does the above remind you anything? It sure does to me. Reminds me the exact same problem we have with the Devexpress support center sample . It was not based on interfaces so if we extract an interface from our Sequence class (the one that store the numbers in the db) like&lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;interface&lt;/span&gt; &lt;span style="color: #00008b"&gt;ISequenceObject&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; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: purple"&gt;TypeName&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;get&lt;/span&gt;; &lt;span style="color: #008b8b"&gt;set&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; &lt;span style="color: blue"&gt;long&lt;/span&gt; &lt;span style="color: purple"&gt;NextSequence&lt;/span&gt; { &lt;span style="color: #008b8b"&gt;get&lt;/span&gt;; &lt;span style="color: #008b8b"&gt;set&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;and refactor again our SequenceGenerator to replace our references to SequenceObject persistent class with the new interface. Now the end user can control the schema of the table cause the only thing he has to do is implement the &lt;span style="color: #00008b"&gt;ISequenceObject&lt;/span&gt; to any object he wants.&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;font color="#ff0000"&gt;Time spent 1hr&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;We have spent almost 6 hrs to implement all requirements but nothing was in vain. Cause the effort produce something very reusable. Bellow is our final, very easy to use and flexible approach.&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #00008b"&gt;Invoice&lt;/span&gt; : &lt;span style="color: #00008b"&gt;BaseObject&lt;/span&gt;, &lt;span style="color: #00008b"&gt;ISupportSequenceObject&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; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;Invoice&lt;/span&gt;(&lt;span style="color: #00008b"&gt;Session&lt;/span&gt; session) : &lt;span style="color: #00008b"&gt;base&lt;/span&gt;(session) {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;OnDeleting&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: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;OnDeleting&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: #00008b"&gt;SequenceGenerator&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;ReleaseSequence&lt;/span&gt;(&lt;span style="color: blue"&gt;this&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; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;span style="color: #008b8b"&gt;OnSaving&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: blue"&gt;base&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;OnSaving&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: blue"&gt;if&lt;/span&gt; (&lt;span style="color: purple"&gt;Session&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;IsNewObject&lt;/span&gt;(&lt;span style="color: blue"&gt;this&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #00008b"&gt;SequenceGenerator&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;GenerateSequence&lt;/span&gt;(&lt;span style="color: blue"&gt;this&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;long&lt;/span&gt; &lt;span style="color: purple"&gt;_sequence&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; [&lt;span style="color: #00008b"&gt;SequenceProperty&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; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;long&lt;/span&gt; &lt;span style="color: purple"&gt;Sequence&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: #008b8b"&gt;get&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: purple"&gt;_sequence&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;/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: #008b8b"&gt;set&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Sequence&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;ref&lt;/span&gt; &lt;span style="color: purple"&gt;_sequence&lt;/span&gt;, &lt;span style="color: blue"&gt;value&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;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: #00008b"&gt;SerieEnum&lt;/span&gt; &lt;span style="color: purple"&gt;_serie&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; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #00008b"&gt;SerieEnum&lt;/span&gt; &lt;span style="color: purple"&gt;Serie&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: #008b8b"&gt;get&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: purple"&gt;_serie&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;/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: #008b8b"&gt;set&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;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #008b8b"&gt;SetPropertyValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Serie&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;ref&lt;/span&gt; &lt;span style="color: purple"&gt;_serie&lt;/span&gt;, &lt;span style="color: blue"&gt;value&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;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;string&lt;/span&gt; &lt;span style="color: #00008b"&gt;ISupportSequenceObject&lt;/span&gt;.&lt;span style="color: purple"&gt;Prefix&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: #008b8b"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: purple"&gt;Serie&lt;/span&gt;.&lt;span style="color: #008b8b"&gt;ToString&lt;/span&gt;()+&lt;span style="color: #00008b"&gt;DateTime&lt;/span&gt;.&lt;span style="color: purple"&gt;Today&lt;/span&gt;.&lt;span style="color: purple"&gt;Year&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; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;that is the power of XAF! everything else should live in a reusable framework, like &lt;a href="http://www.expandframework.com" target="_blank"&gt;eXpand&lt;/a&gt; !&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;PS: If you have more ideas that can enhance the current approach or eXpandFramework in general please drop us a mail or post to &lt;a href="http://github.com/eXpand" target="_blank"&gt;expand&lt;/a&gt; forums &lt;a title="http://expandframework.com/forum.html" href="http://expandframework.com/forum.html"&gt;http://expandframework.com/forum.html&lt;/a&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;You can find a working example of this blog at expand featurecenter application. Download it from &lt;a title="http://expandframework.com/downloads/download.html" href="http://expandframework.com/downloads/download.html"&gt;http://expandframework.com/downloads/download.html&lt;/a&gt;&lt;/p&gt; &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3509234234245012858-183521399114942549?l=apobekiaris.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6R6MdV38S6zH53tZu0JvWFADjwc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6R6MdV38S6zH53tZu0JvWFADjwc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6R6MdV38S6zH53tZu0JvWFADjwc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6R6MdV38S6zH53tZu0JvWFADjwc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AbekiarisBlog/~4/wKFQsO3ZQG4" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-27T02:08:33.891+02:00</app:edited><media:thumbnail url="http://lh6.ggpht.com/_5YPm4JGkfwE/TT1UXCtINJI/AAAAAAAABEI/FAbh_XrHkeM/s72-c/image_thumb2.png?imgmax=800" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://apobekiaris.blogspot.com/2011/01/easy-sequential-numbers.html</feedburner:origLink></item><media:rating>nonadult</media:rating></channel></rss>

