Waltzing with WSDL

Waltzing with WSDL

One of my immediate goals for MockingBird is to have the “Configurator” UI done where you can just pick a WSDL on file or point to a URL and have the tool shred it and generate sample request and response messages into the correct folders (and generate theHandler Configuration)after which the user can then do […]

The Road to WF 4.0 (Part 1)

The topic of 4.0 migrations has come up several times over the past week – in e-mail conversations with a few authors and meetings with customers, on a couple articles (e.g., Kathleen Dollard; Aaron Skonnard), and a cross-blog conversation. As such, it seemed a good time to post a couple blog entries on the topic. There will be more specifics coming out on this topic in the near term, but I’ll touch on that at the end of this entry.

As any of the links above will tell you, we announced at PDC that Windows Workflow Foundation (WF) will introduce a new WF workflow model in the upcoming 4.0 release of the .NET Framework, while continuing to carry forward and support the WF 3.0 model. Initially, this was met with great surprise by many folks – on blog entries, on Twitter, and on many a Facebook status update. In the PDC lounge and in the halls at PDC, we had the opportunity to discuss this topic at length – and the direction was also met with understanding and excitement after developers heard why we did it, and what this meant for them going forward.

In this blog entry, I would like to pull from some of those PDC conversations and highlight a few of the reasons why we made this decision to implement a new WF model, and what this means for you as a WF developer. My assumption is that you are familiar with WF 3.x today, and are wondering what this new version means to you. My next entry (probably next week) will highlight the scenarios that open up with WF 4.0 – what becomes possible with WF that had been very difficult in the prior release. I then intend to dive into some of these topics a bit deeper, hopefully drawing out a couple WF program managers to weigh in.

Why was this done?

First, some quick context to set the stage – WF was first released as part of the .NET Framework 3.0. It was released as a set of next-generation .NET namespaces (along with Windows Communication Foundation (WCF) and Windows Presentation Foundation (WPF)) that enabled Windows Vista, Office 2007, and a range of customer solutions to do some amazing things. WF capabilities were extended in 3.5 to enable a more natural integration with WCF and to allow workflows to be service-oriented in a much more natural fashion. The goal of 3.0 was to create a single foundational technology that Microsoft products could build upon, and to ship this technology in the .NET Framework so that ISVs and customers could build upon it as well. This would provide customers with a unifying technology that would allow them to encapsulate and express business logic. And, in this, I think WF 3.0 was tremendously successful – today customers can build activities, and host them in custom WF workflow code, or in SharePoint or Dynamics or Office Communications Server or a variety of third-party ISV applications. And this next year will see even more products betting on the WF platform.

As we were designing WF 4.0, we wanted to address the feedback and pain points that we have gathered over the past few years from the community (via the Connect site, the forum, and discussions at with you at our events and deep dives) and implemented the following improvements:

  1. Explicit Activities Data Model: We are providing an explicit, system provided data model for WF 4.0 activities. The activity data model lets you reason about and manipulate workflow data using variables (for storage) and arguments to manage how data flows into and out of activities (for those interested, Matt Winkler did a great PDC session discussing activities in WF 4.0).
  2. Fully declarative authoring model: WF 4.0 provides XAML-based workflow capability to provide you with flexibility across deployment, versioning, and tooling – allowing your workflows to express what your business process or application is doing, and allowing your custom activities to handle how the work is actually accomplished.
    In 4.0, workflows can now be written and executed using no-code (for those interested, there was a great PDC session by Kenny Wolf demonstrating this), and this also improves the ability for tooling to read and write WF workflows.
  3. Increased performance: Performance was a strong thread in the feedback we received. In the new 4.0 model, we focused on greatly simplifying system demands by the architecture during workflow creation, serialization, and runtime. Performance was increased by factors of 10-100 over our WF 3.0 performance numbers.
  4. Deep WCF integration: The next release also provides a rich out of the box hosting environment for WCF workflow services. As we released 3.0, customer feedback highlighted the natural partnership between WCF and WF. The new architecture focuses on making it easier for you to model complex communication patterns in a fully-declarative fashion, providing sophisticated message correlation, the ability to flow transactions, and improved exception handling.

As we expanded WF, it became clear that the WF 3.x architecture just wasn’t created with the above in mind. And while we could incrementally build on top of the existing platform, it would provide a less than optimal experience for developers, and might feel more like death by a thousand cuts. And, given a strong view by the average developer that the technology was already overly complicated, we made the hard choice to rewrite the WF framework and take advantage of what the other WinFX technologies provided.

What does this mean to you?

So that gives you an idea of why we went and ripped up the garden, so to speak. You’re now asking – so do I have to rewrite my applications? The answer is it depends on whether you’re content with what you have now, or if you want to take advantage of the new WF 4.0 capabilities.

If you’re happy with your WF 3.0 workflows today, you do NOT have to rewrite your WF code, they will absolutely continue to work – even if you want to use Visual Studio 2010 and other features of .NET 4.0. We are shipping the 3.x designers and namespaces with .NET 4.0; you can continue to support and develop 3.5 workflows in Visual Studio 2010.

If you want to take advantage of the WF 4.0 capabilities, you can start to move your activities and workflows over as you feel comfortable. We’re including WF 3.x -> WF 4.0 interop capabilities (via a WF Interop activity) with .NET 4.0, which allow your 4.0 workflows to call back to 3.5 workflows and activities. In anticipation of your follow-up question, the Interop activity can only embed 3.x activities in 4.0 workflows; you cannot embed 4.0 activities in 3.x workflows.

So, all of that being said, 3.x WF developers have three options with .NET 4.0:

  • Side by side operation: As I mentioned above, we will be including the namespaces and designers for both WF 3.x and WF 4.0. The team is going through great pains to make sure that WF 3.x developers and customers are not stuck. WF 4.0 uses a different namespace, different [WPF-based] designer, and different persistence schema.
    Doing this delivers on a Framework-wide promise of running prior versions. 3.x workflows can continue to be used, maintained, and supported as long as they need to be. And if your need for 3.x support is defined as ’we will stay on 3.x and use other aspects of .NET 4.0’, well, that’s an option tobut we really think you’ll like what you see in WF 4.0.
  • Interop activity: Current WF customers have created a lot of activity and workflow artifacts. With WF 4.0, we will ship an Interop activity; the purpose of the Interop activity is to enable seamless execution of a 3.x activity/workflow within a 4.0 workflow. As we dive into the design improvements in WF 4.0, it will become clear why you can’t just drop 3.x activities onto a 4.0 workflow, but that’s a much longer discussion for another time.
  • Updating your 3.x code: As you would expect, the third option is that of updating your code to take advantage of all that WF 4.0 has to offer. We will be publishing the initial guidance on this with the release of .NET 4.0 Beta 1. Depending on how you wrote your code and markup today, this could be an easy migration or a difficult one.

To help you with getting your head around this, we are putting a large effort around developing resources for migrating mindsets, skill-sets, and code/markup – authored by those close to the code, MVPs, and early-adopting customers that have been working with WF 4.0 and actually working with their WF 3.x code. This information will start being released along with Beta 1 and continue through and beyond RTM of .NET 4.0. Additionally, folks in the community are writing articles on the topic; for example, Kathleen Dollard did a short write-up on writing WF code today with 4.0 in mind in this month’s Visual Studio Magazine; we can’t highlight her #1 suggestion enough – use custom activities instead of using Code activities (and the code-beside they lead to) in your workflows today.

Perhaps the best assurance I can give you here is that we’ve been working with customers in our early-adopter Technology Adoption Program (TAP) and a variety of externals around our 3.x -> 4.0 options and process. And, while I can’t promise it will be painless, I’m hoping you will be pleasantly surprised with our Beta 1 release.

And, for those who adopted WF as part of the .NET Frameworks 3.0 and 3.5; I want to give you a heart-felt thank you! We are taking great pains to ensure that your current investments in WF (both time and code) will continue to add value in 4.0 and beyond. Even within Microsoft, there are at a few large products (internal customers) will launch over the next couple years on WF 3.5 today as they evaluate and work to adopt 4.0 in a future release – so you better believe that the namespace and designer will continue to be supported and serviced.

We really hope that you’ll take a look at WF 4.0 for yourself and see that we have heard your pains loud and clear; as mentioned above, most of the improvements made can be directly mapped back to customer feedback. I’ve been on a couple teams here at Microsoft, and I am personally amazed at how the CFX team handles the customer feedback they receive – going directly into the team’s bug/enhancement tracking system to be grouped and worked. While this may not be the exact way that you envisioned WF evolving, please withhold your ire until you kick the tires with the betas and/or final release.

Note: Thanks to the Kenny Wolf and Bob Schmidt for their invaluable feedback and help on this entry.

New BizTalk Business Activity Monitoring (BAM) Guidance

Business Activity Monitoring (BAM) is a module in BizTalk that captures business data and process milestones to allows business decision makers to gain insight of their in-flight processes.  Using BI tools to derive up-to-date metrics and key performance indicators from the BAM databases, users can forecast process trends and monitor processes in real-time. BAM also provides a mechanism to alert users to situations that require their intervention to prevent undesirable outcome or to encourage a beneficial result.

We have released last week a new whitepaper and code samples targeted at developers who are developing BAM solutions. The whitepaper titled “Business Activity Monitoring in Depth for Developers” covers the following topics:

  • Business Activity Monitoring Overview – including the BAM observation model and how to define it
  • Using BAM to instrument events from applications – programmatically and declaratively
  • An overview and detailed description of the BAM infrastructure
  • Retrieving BAM data through various BI tools
  • Extending the BAM API with a RESTful services

The paper was authored by Jesus Rodriguez and Joe Klug from Microsoft’s partner Tellago. Jesus has included some more background information and acknowledgments for on his blog.

If you are looking into implementing a BAM solution using the BizTalk Server infrastructure I strongly recommend reading this paper and testing the sample code provided with it. The online version is available on MSDN, however for the full Word version and sample code you may want to download it.

Enjoy it,

Ofer

PipelineTesting 1.2.1.0 Released

Last week I spent some time working on a new minor release of my PipelineTesting library
for BizTalk Server 2006/R2. The new release is available in the usual places: Binary
and Source Snapshot, and the Source
Repository
at GitHub.

The new release includes some minor documentation updates, a couple of bug fixes and
a new wrapper for doing basic testing of flat file and xml schemas that provides a
somewhat equivalent functionality to that offered by the TestableSchema class offered
in BizTalk 2009 I’ve talked
about before.

Here’s the documentation and sample for the new functionality.

Testing Schemas

It is possible to target BizTalk schemas in your testing efforts using all versions
of PipelineTesting if you don’t mind doing a little bit of grunt work. This is possible
for both flat file and xml schemas, and is done simply by instantiating a pipeline
(either a compiled pipeline or by creating a new one from scratch) and then running
your instance documents through it and checking the output.

This works particularly well for advanced scenarios involving envelopes or batching/debatching,
but it’s overkill for the simple scenarios.

Beginning with PipelineTesting v1.2.1.0, there’s a new feature for easy testing of
schemas in those simple scenarios. Partially inspired by the new functionality offered
in BizTalk Server 2009, the SchemaTester<T> class allows you to
parse/assemble a document according to a single document schema with a single method
call.

To use SchemaTester<T>, simply provide the type of the BizTalk
schema to use and call one of it’s static methods. The options offered are:

  • ParseFF: Parses a flat file into an XML document

  • ParseXml: Parses an XML document

  • AssembleFF: Assembles an XML document into a new flat file

  • AssembleXml: Assembles an XML document

All method come with overloads that use streams or paths to files. Here’s an example
of how to use it based on one of the unit tests for this feature:

Stream input = DocLoader.LoadStream("CSV_FF_RecvInput.txt");
Stream output = SchemaTester<Schema3_FF>.ParseFF(input);
// Load resulting XML document

XmlDocument doc = new XmlDocument();
doc.Load(output);

If the document cannot be converted, an exception will be raised. Remember that you must consume
the resulting stream (if using the stream-variants of the SchemaTester<T> methods).
You can then check the resulting exception to look into why the parsing/assembling
is failure.

To make it easier to deal with the different parsing exceptions, and how to extract
meaningful information out of it, you can use the ErrorHelper.GetErrorMessage() helper
method.

Silverlight and the 2009 Presidential Inauguration

Silverlight and the 2009 Presidential Inauguration

Tomorrow’s presidential inauguration of Barack Obama will be a truly historic event.

Silverlight is being used as an enabling technology on several sites that will allow those of us who can’t be there in person to share the experience online.

Presidential Inaugural Committee

The Presidential Inaugural Committee has worked with iStreamPlanet to enable live and live and on-demand video streaming of the Inauguration events at the official Presidential Inaugural Committee web site: www.pic2009.org. It streamed its first live video on Saturday, with the train ride that took President-elect Obama from Philadelphia to Washington, D.C. The official Inaugural swearing-in ceremony, speeches and parade will also be streamed live online on Tuesday, January 20.

 

You can read more about the Presidential Inaugural Committee here.

CNN and MSNBC with Photosynth

CNN and MSNBC are both launching Photosynth viewers that will help capture the Oath of Office experience. They will combine pictures takes from professional photographers with pictures uploaded from people in the crowd to create an interactive Photosynth experience of the event using Silverlight’s built-in DeepZoom feature to deliver an amazing 3D viewing of it.

Check out CNN’s and MSNBC’s pages a few hours after viewers send in their pictures of the inauguration crowd, the President-elect’s raised hand, and everything in between.

You can learn more about Photosynth and Silverlight from the Photosynth team blog here.

This week will be an exciting part of history.  Hope you get a chance to enjoy experiencing it with Silverlight!

Scott

Plan now for this year – Get the BizTalk 2009 Documentation (beta)

As my good friend pointed out – Rahul
Garg
, the BizTalk 2009 documentation is available for public download.

Things such as:

  • runtime engine
  • mapping
  • Orchestrations
  • Adapter V1.0 Frameworks
  • BizTalk Applications
  • BizTalk Deployment of Applications

Have all generally (obvious fixes and improvements as needed) stayed the same.

Whereas, a quick summary of things I’d be looking for in the documentation:

  • Incorporating BizTalk Project builds into automated tested suites (TFS etc) – Biztalk
    2009 projects can now be built through MSBUILD as a regular project in the solution.
  • Individual components such as Schemas and Maps can be formally unit tested (previously
    we wrote our own helper classes to make this stuff happen) – although, at the moment
    when testing a schema, I haven’t been getting back details of the error…just a pass/fail.
  • BizTalk Adapter Pack 2.0 (Sql, Oracle x 2, SAP, Siebel…) – based on WCF channel
    stack…very nice! (can be standalone if needed)
  • WS Federated bindings
  • and the list goes on…..

Download a Searchable
BizTalk Help File
– very handy to have when planning your upgrades or migrations.