2

I would like to implement next workflow scenario: enter image description here
I have workflow service with two branches. Operation2 (Receive activity) is correlated with CorrelationHandle “handle2” which is initialized from message header.

enter image description here

The flow is next:

1) Someone calls Operation1 and it initializes correlation handler for Operation2. So the case is that correlation value for Operation2 is not the same as for Operation1 and should be obtained in runtime when execution Operation1.
2) Using correlation value client may call Operation2.
3) If correlation is not correct Operation2 should still be executed but with custom logic.

The problem is when I call the first service I get an exception:

The CorrelationHandle is already in use with BookmarkScope '{bookmark scope id x} ', so it cannot be used with BookmarkScope '{bookmark scope id y}'



Debugging shows that even if I call Operation1 only “handle2” from Operation2 is also initialized with some value in Receive2 activity!!! so I it seems I cannot re-initialize it.

Any ideas how it can be fixed?

UPDATE:

I have attached file with source code so you may reproduce the issue. Just launch Operation1.

http://dl.dropbox.com/u/27847776/WorkflowCorrelation.zip

Thanks beforehand,

-Petro

petro.sidlovskyy
  • 5,075
  • 1
  • 25
  • 29
  • Are you using context-based or content-based correlation? You mention headers, so I assume you are using WCF Context Bindings. If so, what is your context binding type? – SliverNinja - MSFT Sep 30 '11 at 19:37
  • I am using content based correlation and basic http binding. I do correlate on my custom WCF message headers (in basic http binding it seems to be SOAP header). Client has to pass required header in message to corelate with specific workflow instance. I have just attached sources so you may review. – petro.sidlovskyy Oct 03 '11 at 07:39

2 Answers2

0

In my experience you cannot re-initialize a correlation handle. You would need to create a separate correlation handle for each key you want to correlate on.

joshb
  • 5,182
  • 4
  • 41
  • 55
0

Do't use Pick. Use Parallel and set the parallel to terminate only when you are sure the conversation has ended. The Parallel has a property where you can set the terminate condition.

Sentinel
  • 3,582
  • 1
  • 30
  • 44