Leave a Reply

5 comments

  1. Niiice! It would be really great if you implement this as generic functionality where the actual ‘functional key’ of the incoming message can be configured using an xpath-query.

    Best place would probably using an attribute on the method-definition in the contract (perhaps there’s already some property on the OperationContractAttribute that can be used?). However, at the point of intercepting the message (IDispathMessageInspector:AfterReceiveRequest), WCF hasn’t mapped the request to a method yet, so you can’t determine which method’s attributes to read. Did you find a solution for that as well, or do you scope the ‘functional-key-definition’ on the contract or even whole service?

    Robert te Kaat Reply

  2. Niiice! It would be really great if you implement this as generic functionality where the actual ‘functional key’ of the incoming message can be configured using an xpath-query.

    Best place would probably using an attribute on the method-definition in the contract (perhaps there’s already some property on the OperationContractAttribute that can be used?). However, at the point of intercepting the message (IDispathMessageInspector:AfterReceiveRequest), WCF hasn’t mapped the request to a method yet, so you can’t determine which method’s attributes to read. Did you find a solution for that as well, or do you scope the ‘functional-key-definition’ on the contract or even whole service?

    robertka Reply

  3. This is something we are still working on, but it’s a two-fold problem. You’ll need to extract the ‘functional key’ from the message and then map that ‘functional key’ to the workflow instance ID. There are several ways of solving this, but we haven’t really decided on which way to go. We were thinking of creating a CorrelationSequenceActivity that you can put in your workflow which adds an attached property to the ReceiveActivity. Combined with a designer you could select the property on the input message that is expected by the ReceiveActivity which could then be mapped to an XPath query. I think Marcel is working on such a solution.

    This still wouldn’t resolve the mapping from the ‘functional key’ to the instance ID though, so we’ll have to think about how to do that.

    Jonathanm Reply

  4. Remember to implement IEventActivity, etc when creating the CorrelationSequenceActivity, otherwise it can’t be used with statemachines. Shouldn’t be too hard, since you can forward all calls those interfaces to the receiveactivity, which implements them as wel.

    Also the ReceiveActivity is a sequence-activity itself. To make sure one doesn’t accidentally add it’s childs to the CorrelationSequenceActivity, instead of the ReceiveActivity, you may want to create a custom activitydesigner for the correlationsequenceactivity as well, which only allows a single ReceiveActivity as child.

    When using guids as functional keys, mapping-logic can be made generic. However, functional keys are hardly ever guids, thus you may need to specify a mapper for the CorrelationSequenceActivity as well (property?).

    robertka Reply