October 21, 2005 spout

I’m starting to speak in numbers

Someone posted an URL to a mailing list I’m on. My response to his post was 404.” I bet you know what I meant w/o thinking about it. He knew and responded as if I’d written in English. This reminds me of the old joke about the guys that’d be around each other so long, they replaced back the same old jokes with numbers and make each other laugh. It’s a funny old world.
October 21, 2005 fun

@ MS, We Share Your Pain

Check out the new feature in Vista that allows MS developers to feel your pain when a crash occurs in a very real way.
October 20, 2005 fun

I’m the “with” @ the Redmond P&P Summit

Sure, sure, Alan Cooper and Anders Hejlsberg are keynoting, but I’m the with” at this year’s Redmond, WA Patterns & Practices Summit 12/13 - 12/15. I don’t yet know what that means, but maybe if I’m enough with it” in Redmond, it’ll lead to with-ness” in Sydney or Oslo (hint, hint… : ).

October 20, 2005 fun

Top 10 List of Top 10 Lists

I decided to go a little meta for this year’s XML DevCon:

10. Top 10 List of Top 10 List of Top 10 List Ideas (a little too meta)

9. Top 10 Reasons that XAML Uses XML (Couldnt figure out a good representation of gradients in EDI)

8. Top 10 Secrets of the CLR (Boxing was almost called Richtering)

7. Top 10 Members of the XML Community Least Likely To Fit In At Burning Man (I don’t want to see Doug Purdy showing up at the ice tent in his thong…)

6. Top 10 Members of the XML Community Most Likely To Fit In At Burning Man (Wasnt Rory born at Burning Man?)

5. Top 10 Similarities Between Team America Characters and XML Community Members (XML: Heck yeah!)

4. Top 10 Reasons That Raw XML Programmers Exhibit More Animal Magnetism Than, Well, Anyone Else (Tim Ewald is really all the evidence we need…)

3. Top 10 New Enterprise Features in Visual Studio Orcas (Clippy: It looks like youre designing an insurance agency schema. Can I help you with that?)

2. Top 10 Reasons Democrats Are More Likely To Be XML Programmers Than Republicans (89% of the angle brackets should not go to the top 1% of programmers!)

1. Top 10 Reasons That The Red Sox Are Going To Kick Butt! (Just pandering to the crowd…)

Chris Sells (with help from Scott Hanselman, Tim Ewald, Matt Powell and Scott Bloom)
Applied XML Developer’s Conference
Friday, October 20th, 2005

October 18, 2005 fun

Retaking the holy land

I just found the most awesome site: http://grouphug.us. So far, this is my favorite.
October 17, 2005 spout

Web Services and Data Binding?

What does it mean to bind to a web service? It’s not hard to think of taking the result of a web service and binding it as input to some set of controls, but what about changes to that data? Should data from web services be read-only, requiring an explicit call to add, remove or update or should their be some standard WS-CRUD standard? What do you nice folks do?
October 16, 2005 spout

More Workflow Communications Spelunking

Here. The one where I take Dennis’s suggestion, try wca.exe with my workflow communications problems, and discover as many more problems as I solve.
October 16, 2005 spout

More Workflow Communciation Spelunking

More Workflow Communciation Spelunking

After complaining about the inability to bind directly to event inputs, Dennis suggested I try the Workflow Communications Activity generator utility (wca.exe). If you point it at an assembly that contains interfaces decorated with the DataExchangeService attribute, it will generate typed invoke method and event sink activities for each method and event in the interface. To support this, I moved the communication interface, IOrderService, and types the interface depends on, i.e. Order and OrderEventArgs, to a separate library project and added the following post-build step:

"C:\Program Files\Microsoft SDks\Windows Workflow Foundation\wca.exe"
  "$(TargetPath)" /o:"$(SolutionDir)\EventSinkAndMethodInvoke2"

The reason I added this as a post-build step in the library project instead of as a pre-build stuff in the actual wf app, is because I want to have the types to program against whenever the library changes. However, either way, to get the new activities to show up on the toolbar, you have to build the application. Once I’d done that, I updated my workflow using the typed activities:

Unfortunately, just as I was capturing that screenshot, the Workflow Designer couldn’t find the activities, so it dropped them from my workflow without so much as a by your leave,” reminding me where much of the early WinForms Designer.

However, two nice things result from these generated types. The first is that my design-time experience, either in the designer or in the XOML, is improved because I don’t have to do a bunch of parameter binding:

<SequentialWorkflow
  x:Class="EventSinkAndMethodInvoke2.Workflow2"
  x:CompileWith="Workflow2.xoml.cs"
  ID="Workflow2"
  xmlns:x="Definition"
  xmlns="Activities">

  <ns0:CreateOrder
customer="Fabrikam"
    orderDescription="42&quot; Plasma TV"
    ID="createOrder1"
    MethodName="CreateOrder"
    InterfaceType="EventSinkAndMethodInvoke2.IOrderService"
    xmlns:ns0="IOrderService_Operations" />

  <ns1:OrderApproved
ID="orderApproved1"
    EventName="OrderApproved"
    InterfaceType="EventSinkAndMethodInvoke2.IOrderService"
    xmlns:ns1="IOrderService_Events" />

  <Code ExecuteCode="code1_ExecuteCode" ID="code1" />

  <Terminate
Error="*d2p1:ActivityBind(ID={orderApproved1};Path=Comment)"
ID="terminate1"
    xmlns:d2p1="ComponentModel" />

</SequentialWorkflow>

The other nice thing is that, because the typed event sink has properties that directly expose the event arguments, i.e. Comment and Order, instead of just via parameter bindings, I can bind to them in the b1 build of WF. This reduces my coupling, because the terminate activity doesn’t know where it’s getting it’s input, and it takes away that global variable” feel I had when I was binding parameters in and out of fields on the workflow itself. If I want to access the event sink’s typed properties directly, I can do so, as shown in the code activity’s handler:

public partial class Workflow2 : SequentialWorkflow {
  void code1_ExecuteCode(object sender, EventArgs e) {
    Console.WriteLine("Order: approved w/ comment= {0}", orderApproved1.Comment);
  }
}

I really like that typed activities are generated for me based on my data exchange service interfaces, but it’s still a manual, multi-stage process today. I’d prefer that it happened automatically, like typed resources and settings in VS05. If that can’t happen, I’d prefer to be able to bind directly to the parameter binding list that the generic event sink activity already knows about. At least that way, if there’s a problem, my workflow doesn’t get destroyed because of it.

The updated VS05b2, WF/WinFXb1 sample code is available for your enjoyment.


← Newer Entries Older Entries →