views:

37

answers:

1

I'm using a pick brabch acitivity with two branches. Each branch has a receive action, but when the workflow is paused on the pick activity waiting for a cliente comunication and I call a service method wich is not in those brach activity I got a error. Actually I think the workflow enter in an infinite loop or something like.

Is there any way to buil a "default" branch, like a defaul case in a switch/case contructions?

+1  A: 

You can add a PickBranch with a Delay activity as a timeout branch if none of the other branches is called within the alloted time.

Maurice
But i'm using this Pick in a long runnig worklfow, so i don't know the moment that the ReceiveActivity must complete.
Murilo Lima
So what is your intention with the "default" branch? The pick is done as soon as the first trigger and its action is completed.
Maurice
I'm creating a workflow service, so there are many receive activities. I'm also using messages correlation to know wich point of the workflow resume. Everything is fine and when I try to send a message X but the workflow is waiting for the message Y a Exception is raised. The problem is that in a specific point I can receive two diferent messages X and Y, so I used the pick branch with one branck wating for X and another one waiting for Y, but when the client send a message Z the pick branch doesn't do anything and the workflow doesn't answer.
Murilo Lima
What would you expect the workflow to do when you send a message that can't be handled at the moment? The way you modeled the workflow you can handle either message X or Y using the Pick. So message Z is rejected. If you also want to receive Z either add that to the Pick or add another parallel branch that can handle the Z message.
Maurice
I don't want to receive Z, but the client cand send a message Z and then the wokflow doesn't answer, I'd like to send a fault, but I don't know how.
Murilo Lima
Any ideas to solve this problem?
Murilo Lima
So you do not want to receive the message but you do want to determine what happens when it is send? The default behavior is to throw an exception when a message cannot be delivered, the exception depends a bit on the workflow structure. See http://stackoverflow.com/questions/3541703/workflow-services-receiveandsendreply-unordered-calls-timeout for more details.
Maurice
I'm using a workflow like this: http://img828.imageshack.us/img828/4048/workflow.jpgMy problem is that when the workflow reaches the Pic kBranch it is waiting for operation2 or operation3, but when the client calls the operation1 it resuls on a timeout. I'm no using Delay activities, the problem is inside the Pick Branch.
Murilo Lima
This seems like a different but that the one I was describing but it is still related to the same Pick behavior. In each case I ran into this I was able to work around it by removing the Delay. The best I can suggest is adding Operation1 to the Pick and returning a fault from there. That way you don't have to wait a minute for the timeout. BTW if you are using persistence you can check the Instances table for the current bookmarks and see the allowed WCF operations in there. Not pretty but it might help.
Maurice
The problem is that I have more than three operation and I have to add all other operations to the pick. I also can create a generic operation that encapsulates the operation2 and operation3.
Murilo Lima
I am afraid there is no good solution in this case. There are some bugs I am aware of in the service message routing and this seems to be a new variant I wasn't aware of. Please report this on connect so MS is aware of this one.
Maurice
Ok, https://connect.microsoft.com/wf/feedback/details/604060/workflow-service-results-on-a-timeout-when-there-are-receives-inside-pickbranch
Murilo Lima