Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Behaviour of SendResponse in WF4

at the top of my template workflow I put a ReceiveRequest / SendReply block where I'd like to perform synchronous operations, enabling then the user client to receive a timely response of the workflow being started. Client calls the WF via WCF.

Client knows about the status of the current request with status of an entry on my application database.

For example, I create an order, call a PlaceOrderWF, set the status of the order on DB to "Accepted". The client can then perform whatever he wants while the WF is doing checks, controls, etc, ..., setting the final value of the order to "Completed" or "Error".

I expect that the client will receive response just after the SendResponse block. Actually it doesn't seem to work this way, but it waits for some kind of "event" to release the client. Unfortunately, I have no evidence of events triggering this behaviour.

To test it, just put a Delay activity after the SendResponde activity and you should be able to reproduce the behaviour I am talking about.

Any hints on how to avoid this unwanted error?

WF template -- Operation name left intentionally blank

like image 901
Mauro Avatar asked Nov 16 '10 11:11

Mauro


1 Answers

The workflow will continue and execute as much as it can on the current thread and as a result doesn't return to the caller right away.If you add a Delay with a small timeout, say 1 second, to the workflow this will cause the workflow to go idle and the WCF response to be send to the client after which the workflow will continue.

like image 87
Maurice Avatar answered Sep 25 '22 13:09

Maurice