Rules In WF4

March 17, 2010

My blog stats show trending topics around searches for “wf4 rule engine” and “wf rule engine” among other variations. If those topics are leading people to this blog, then I might as well address the topic directly.

For those who don’t know what the queries above mean – it means that people are searching for the rule engine feature (named Windows Workflow Foundation Rules Engine aka “WF Rules”) in Microsoft’s Windows Workflow Foundation (aka WF). The feature originally shipped with .NET 3.0, and I have written previously about the feature set especially as it compares to Microsoft’s other rules offering.

With .NET 4.0, the Workflow Foundation is introducing a new workflow model (more details here) – so we now talk about WF in .NET 3.0/3.5 as “WF3″ and WF in .NET 4.0 as “WF4″. However, as mentioned at that link, all of WF3 is still available in .NET 4.0.

Now, to the rule engine question. WF4 does not include a new forward chaining rules engine. To be clear, that does not preclude one being made available in the future. A direct statement from Microsoft on the topic can be seen on the .NET Endpoint blog as follows:

“Two other major WF 4 activities that were discussed at PDC, a new state machine activity and a new forward chaining ruleset activity, will not be available with the VS2010 beta 1 release – and we will cover each of these topics in greater depth in the next month. At this point, a new forward chaining rules engine won’t be ready for the .NET 4 timeframe, and will probably see a CTP release post-VS2010 to gather feedback and to allow customers the opportunity to evaluate the direction we are considering. It’s important to note that we are working to ensure integration with the WF 3 rules engine will be possible in a number of ways, though; one example of integration back to the WF 3 rules engine is the SDK sample activity I mentioned above.”

There is also now some rules-specific migration guidance published here as part of some overall WF3->WF4 migration guidance. See also the WF Migration Kit CTP 1 that I posted about previously.

Finally, if you have interest in rules for WF4 and are willing to provide feedback to Microsoft – I encourage you to do so. Questions about using the WF3 rules with WF4 should most likely be addressed via the forums. Specific feature requests for the future should be provided through Connect (detailed instructions for providing feedback about WF4 through Connect). If you are interested in discussing your rules scenarios and requirements in more detail with someone from Microsoft, you can contact me via the contact form on this blog.


The Future Of Gaming

March 17, 2010

Here’s the video for an interesting speech by Jesse Schell entitled “Design Outside The Box.”

Topics of the speech include:

  • the psychology of games
  • the consumer desire for realism and authenticity
  • technological convergence/divergence and the “pocket exception”
  • the possibility of game achievements improving behavior
  • the fact that there are more FarmVille players on FaceBook than there are Twitter accounts

Achievements are already leaking over to non-games, some items that could have been mentioned:

I have one final thought regarding his example of Amazon potentially tracking on the Kindle if a book has really been read and then rewarding a person for reviewing the book – since they could tell that the book had actually been read. It seems to me that Netflix could roll out something similar to this very quickly based on their streaming service and whether an entire film had been streamed to the customer.

The presentation is nearly 30 minutes in length, but it goes by quickly since Dr. Schell is an engaging speaker.


WF Migration Kit CTP 1 Released

March 8, 2010

The first Community Technology Preview (CTP) for the WF Migration Kit has been released, for migrating to the upcoming new Windows Workflow Foundation.

Consider trying the tool if you are a WF3 user who is looking to migrate your workflows to WF4. Migrators are included for a number of the WF3 out-of-the-box activities. There is also an extensibility point that allows the authoring of custom migrators for handling custom activities.

There is a full announcement on the .NET Endpoint blog.

There is also further WF3 to WF4 migration guidance here.

[I will also point out that since this release is through CodePlex the source code is available as well.]


Microsoft’s Rule Engines

February 5, 2010

I am often asked to describe the rule engines that Microsoft ships. (The first question being: “Microsoft has rule engines?”) This question frequently comes from folks who know rules, but don’t know .NET. This post is specifically written to answer the question. Should the offerings change in the future, I will update this post as needed.

As always, this is not an official Microsoft statement. Questions about the future directions for these products should be directed to Microsoft.

As of this writing, Microsoft is currently shipping two rule engines. They are aimed at somewhat different audiences as described below.

The first rule engine is called the Microsoft Business Rule Engine (sometimes called “MS BRE” or “BRE”) and it has shipped as part of BizTalk Server since early 2004. BRE has shipped in BizTalk Server 2004, BizTalk Server 2006, BizTalk Server 2006 R2, BizTalk Server 2009 and I’m sure it will be included in the upcoming BizTalk Server 2009 R2.

The second rule engine is part of Windows Workflow Foundation in .NET, it is the Windows Workflow Foundation Rules Engine (sometimes called “Workflow Rules” or “WF Rules”). The WF rule engine originally shipped in late 2006 as part of .NET 3.0. It was also included in .NET 3.5 and will be included in the upcoming .NET 4.0. If you are running Windows 7, Windows Server 2008 R2, Windows Server 2008, or Windows Vista or have installed .NET 3.0 or higher – you already have the WF rule engine on your computer.

Here are some comparisons of these engines written by other folks. Charles Young has written extensively on this topic.

If you asked me to summarize differences for a rules specialist, my comments would be along the following lines:

  • MS BRE is part of a BizTalk Server, which is a business-oriented server package, while WF Rules is part of the free .NET Framework. (MS BRE may be used standalone outside of BizTalk, but is only licensed with BizTalk.) Both engines provide forward chaining evaluation. WF Rules also provides the option for sequential evaluation.
  • MS BRE rules are typically authored in the Rules Composer, while WF Rules are typically authored in Visual Studio. There are partners that provide a more BRMS-like authoring environment. MS BRE has features such as vocabularies and a respository, and is therefore closer to what Gartner defines as a BRMS.
  • MS BRE implements the Rete algorithm, while WF Rules does not. MS BRE implements a greedy evaluation strategy, while WF Rules implements a lazy evaluation strategy. The performance profiles are accordingly different – WF “first hit” execution being faster, for example.
  • WF does not have assert/retract keywords or a Working Memory, while MS BRE does – so WF Rules requires all objects to be reachable from a common root object (this). (In WF Rules, support for multiple instances is achieved through forward chaining.) WF Rules supports “Else”, while MS BRE does not. MS BRE has some known restrictions around negation-as-failure. MS BRE has special handling for XML and DB fact types.

I would be remiss if I did not mention some Microsoft offerings that apply to related areas:

Lastly, I should also point out that the Mono Project is reimplementing Windows Workflow Foundation – including WF Rules.


Datamining Games

February 3, 2010

The rise of the online always-on videogame opens a new world of stat tracking. The recent changes is this area are well beyond simple high score boards or achievements/trophies. For example, consider the article “You Are Being Watched” from a recent issue of the Official Xbox Magazine. The article details the datamining that Bungie is doing for Halo 3 and Halo 3: ODST, that Criterion is doing for Burnout Paradise, and Valve is doing for Team Fortress 2 and Left 4 Dead.

All of these companies are gathering data that shows them how their games are really being played. One usage for this data is to potentially make improvements and bug fixes. In the case of Bungie, players can actually log onto bungie.net and see their own stats and own personal heat maps for the matches they have played. Valve shares some of the overall data, and has recently started adding personalized data (for Steam players only).

For the personalized data, it would be interesting to see some numbers for how many players actually review their stats and whether it has an impact on their playing.

See also:

While I’m clearing out the videogame datamining links…


Have You Implemented Backward Chaining On A Microsoft Rule Engine?

January 11, 2010

Every so often I hear about a “friend of a friend” who has implemented a backward chaining project with one of the Microsoft rule engines (WF Rules, BizTalk MS BRE). However, the details usually fail to materialize. If you have worked on such a system, or know someone who has – please contact me using the contact form on this blog. I’m interested in understanding more about your project and how successfully the backward chaining implementation went.

(As always – this is mainly personal interest, and does not reflect on any future directions of my employer’s products.)


Another .NET Rete Implementation – NRuler

January 7, 2010

I just spotted another .NET implementation of Rete – NRuler. The site shows only 10 downloads, but it seems to have been live less than a month so far. Any of the 10 downloaders care to share their impressions? How does it compare with NxBRE or SRE?

(As an aside, I spotted NRuler because it is linked in the “See also” section of the Wikipedia article on Rete. At best, the link to NRuler should be an “External link” rather than a “See also” – and probably not even that. As an industry, we need to stop spamming this article with promotional product-specific links. Yes, I know that NRuler isn’t a commercial product, but I don’t see any reason for it to be linked there over any other piece of software.)


Another Dormant .NET Rule Engine Project: Simple Rule Engine

January 6, 2010

I recently stumbled across another rule engine for .NET that I hadn’t seen before: Simple Rule Engine (SRE).

Looks dormant, or possibly dead altogether. If any readers have tried it out, I welcome comments about your experiences with it.


NxBRE Project Seems To Have Gone Dormant

September 1, 2009

Not sure why I didn’t spot this before, but it appears that the NxBRE project (a .NET rule engine) has recently gone dormant. Cheers to David for all the work he put in over the years.


Direct3D 11 Compute Shaders

August 4, 2009

In other news, the upcoming Microsoft Direct3D 11 will feature compute shaders. If I read correctly, this is shipping in Windows 7. NVIDIA is already out promoting the compatibility with CUDA. Apparently, this technology is also sometimes called DX Compute.