Home Dashboard Directory Help
Search

Windows workflow 4 error "Two SendReply activities have the same fault type but different Action." by Saffy


Status: 

Active


1
0
Sign in
to vote
Type: Bug
ID: 782021
Opened: 3/25/2013 4:34:24 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

I am modelling a lengthy process where the same action could be triggered at different stages of the workflow life-cycle. This includes approval/rejection, cancellation by administrator, abandonment by the originator, etc.

I have been adding fault reporting to my actions but have discovered that once I do I get the error "Two SendReply activities have the same fault type but different Action". This seems like an unnecessary restriction.

For example, during the initial stages of the workflow I have an approval process (see attachment for xamlx) and later on in the process I need another approval (see second attachment).

So the only difference is that the first refers to ReferenceID0 and the second to ReferenceID1, but that's enough to trigger the error.

Making the two actions exactly the same by manually changing the Reference name to be globally identical yields a different error about names being the same so it doesn't even seem possible for the two actions to ever be the same.
Details
Sign in to post a comment.
Posted by Microsoft on 5/15/2013 at 3:46 PM
Thank you for reporting this issue. Unfortunately, the behavior you are describing is by design. If the issue is blocking you from using the product, please contact our support via the Visual Studio Help and Support (http://msdn.microsoft.com/en-us/vstudio/cc136615.aspx) page on MSDN.
Posted by Saffy on 3/26/2013 at 5:58 AM
Looking at the ContractInferenceHelper AddFaultDescription method, it looks like this problem is only triggered when returning a generic fault, ie. FaultException<TDetail> rather than a plain FaultException.

                    if (internalDeclaredMessageType.IsGenericType && (internalDeclaredMessageType.GetGenericTypeDefinition() == FaultExceptionType))
                    {
                        System.Type faultType = internalDeclaredMessageType.GetGenericArguments()[0];
                        bool flag = false;
                        foreach (FaultDescription description in operation.Faults)
                        {
                            if (description.DetailType == faultType)
                            {
                                if (description.Action != overridingAction)
                                {
                                    throw System.ServiceModel.Activities.FxTrace.Exception.AsError(new ValidationException(System.ServiceModel.Activities.SR.SendRepliesHaveSameFaultTypeDifferentAction));
                                }
                                flag = true;
                                break;
                            }
                        }

When debugging the code above, the description.Action value is "http://tempuri.org/PaymentService/ApprovedFaultDetailFault" whilst the overridingAction value is null.

AH! A breakthrough. I was not understanding what the error was referring to. I had assumed that the word "Action" was referring to the action part of the PickBranch activity, when it is actually referring to the Action property of the SendReply activity.
So making sure that the Action property is set and matching for each of the replies corresponding to the receive activities sharing the same receive operation name gets rid of the error message.

I still think this is a bug worth fixing though.
Posted by Microsoft on 3/25/2013 at 7:11 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 3/25/2013 at 4:49 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
File Name Submitted By Submitted On File Size  
Approval2.xml 3/25/2013 5 KB
Approval1.xml 3/25/2013 5 KB