locked
Correlation tokens... RRS feed

  • Question

  • Hi, I have several workflows that need to make simultaneous exchanges with external methods and events through a DataExchangeService. To make sure each event is caught by the correct handler I’ve implemented the correlation attributes to the exchange interface. It all works fine, but I find it tedious to set up the parameters and properties related to correlation on the different activities in the workflow. I do not understand why this has to be as complicated as it is now. Why have Microsoft used a parameter in the external method as a correlation key. This means that you rely on the workflow developer to specify a unique key. Would it not be better if this key was generated behind the scenes, and that all the developer had to do was to select an “OwnerActivity” for each method call and each corresponding handler?

    Secondly, why does the developer have to supply a name for the “CorrelationToken”? Would it not suffice with just the “OwnerActivity”?

    Most likely I’m missing some vital point to why this is the way it is.

    Thanks!

    Ole

    Sunday, February 19, 2006 7:52 AM

Answers

  • Using the parameters allows you control over the data being used to correlate items.  Using an opaque key would require the application developer to somehow manage a nonsense key simply for correlation, in addition to the data you are already managing for your method and events. 

    You have to use a name (variable actually) for the token because you might have more than one correlation happening in the same parent activity. 

     

    Matt

    Sunday, February 19, 2006 3:36 PM

All replies

  • Using the parameters allows you control over the data being used to correlate items.  Using an opaque key would require the application developer to somehow manage a nonsense key simply for correlation, in addition to the data you are already managing for your method and events. 

    You have to use a name (variable actually) for the token because you might have more than one correlation happening in the same parent activity. 

     

    Matt

    Sunday, February 19, 2006 3:36 PM
  • Sure, the developer of the Data Exchange Serive would have to manage the token key anyway, but could not the token still be hidden to the developer working in the workflow designer. Anyway I see your point.

    For the second issue I also see your point. Did not think of this.

    Thanks!

    Ole

    Sunday, February 19, 2006 6:29 PM
  • The developer of the dataexchange service, and by extension, probably the developer of the application interacting with the workflow. The asp.net or windows forms developer, because they would have to be passing back some key that let the data exchange service look up the workflow instance id in order to raise events to the right instance.  In some cases is might be possible to abstract that away from the user, but I can see your point in wanting to make things easier for the workflow developer as well.  I guess the thinking is that if you have to learn workflow, might as well have you learn this one thing as well, instead of forcing your UI or application devs to have to learn it. 

    My $.02.   :)
    Matt

    Sunday, February 19, 2006 8:15 PM