locked
Two SendReply activities have the same fault type but different Action RRS feed

  • Question

  • Hi,

    I have developed a sample App to understand FaultException in WF. When i browse my XAMLX file, i am receiving the below error "Two SendReply activities have the same fault type but different Action". Can any one help me in resolving the above error.

    Repro steps:

    1. Added new XAMLX file

    2. Dragged a state machine control from ToolBox and added two states

    3. Added two DataContracts FaultExec, Response

    4. Added "ReceiveAndSendReply" control in each state

    5. Right click on the "Receive" and selected  "Create SendReply"

    6. Added condition and returned "FaultExec" and "Response" from "SendReplyToReceived"

    7. Did step6 for second state

    8. Browse the XAMLX.

     

    Please suggest if I am missing anything here.

     

    References used:

    http://blogs.msdn.com/b/rjacobs/archive/2011/01/18/wf4-workflow-service-data-validation-design.aspx

    -------------------------------------------

    DataContracts defined:

    namespace TryCatchHandling
    {
        [DataContract]
        public class FaultExec
        {
            [DataMember]
            public string ErrorMessage { get; set; }
        }
        [DataContract]
        public class Response
        {
            [DataMember]
            public string ErrorMessage { get; set; }
        }
    }

    -------------------------------------------

    XAMLX code:

    <WorkflowService mc:Ignorable="sap" ConfigurationName="Service2" sap:VirtualizedContainerService.HintSize="644,666" Name="Service2" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/servicemodel" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:p="http://tempuri.org/" xmlns:p1="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=System.Xml" xmlns:s3="clr-namespace:System;assembly=System.Core" xmlns:s4="clr-namespace:System;assembly=System.ServiceModel" xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:ss="clr-namespace:System.ServiceModel;assembly=System.ServiceModel.Activities" xmlns:ss1="clr-namespace:System.ServiceModel;assembly=System.ServiceModel" xmlns:ssa="clr-namespace:System.ServiceModel.Activities;assembly=System.ServiceModel.Activities" xmlns:st="clr-namespace:System.Text;assembly=mscorlib" xmlns:t="clr-namespace:TryCatchHandling;assembly=TryCatchHandling" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
      <p1:StateMachine InitialState="{x:Reference __ReferenceID4}" sad:XamlDebuggerXmlReader.FileName="E:\WFSample\TryCatchHandling\TryCatchHandling\Service2.xamlx" sap:VirtualizedContainerService.HintSize="614,636" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">
        <sap:WorkflowViewStateService.ViewState>
          <scg3:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">False</x:Boolean>
            <av:Point x:Key="ShapeLocation">270,2.5</av:Point>
            <x:Double x:Key="StateContainerWidth">600</x:Double>
            <x:Double x:Key="StateContainerHeight">600</x:Double>
            <av:PointCollection x:Key="ConnectorLocation">273,77.5 273,107.5 363,107.5 363,172.55 347,172.55</av:PointCollection>
          </scg3:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
        <p1:State x:Name="__ReferenceID4" DisplayName="State1" sap:VirtualizedContainerService.HintSize="114,61">
          <p1:State.Entry>
            <p1:Sequence sap:VirtualizedContainerService.HintSize="557,451">
              <p1:Sequence.Variables>
                <p1:Variable x:TypeArguments="CorrelationHandle" Name="__handle1" />
              </p1:Sequence.Variables>
              <sap:WorkflowViewStateService.ViewState>
                <scg3:Dictionary x:TypeArguments="x:String, x:Object">
                  <x:Boolean x:Key="IsExpanded">True</x:Boolean>
                </scg3:Dictionary>
              </sap:WorkflowViewStateService.ViewState>
              <Receive x:Name="__ReferenceID0" sap:VirtualizedContainerService.HintSize="535,86" OperationName="Operation1" ServiceContractName="p:IService">
                <Receive.CorrelationInitializers>
                  <RequestReplyCorrelationInitializer CorrelationHandle="[__handle1]" />
                </Receive.CorrelationInitializers>
              </Receive>
              <p1:If Condition="[SomeCondition = True]" sap:VirtualizedContainerService.HintSize="535,201">
                <p1:If.Then>
                  <SendReply Request="{x:Reference __ReferenceID0}" DisplayName="SendReplyToReceive" sap:VirtualizedContainerService.HintSize="255,100">
                    <SendMessageContent>
                      <p1:InArgument x:TypeArguments="t:Response">[UsrResponse]</p1:InArgument>
                    </SendMessageContent>
                  </SendReply>
                </p1:If.Then>
                <p1:If.Else>
                  <SendReply Request="{x:Reference __ReferenceID0}" DisplayName="SendReplyToReceive" sap:VirtualizedContainerService.HintSize="255,100">
                    <SendMessageContent>
                      <p1:InArgument x:TypeArguments="FaultException(t:FaultExec)">[APPEXEC]</p1:InArgument>
                    </SendMessageContent>
                  </SendReply>
                </p1:If.Else>
              </p1:If>
            </p1:Sequence>
          </p1:State.Entry>
          <sap:WorkflowViewStateService.ViewState>
            <scg3:Dictionary x:TypeArguments="x:String, x:Object">
              <av:Point x:Key="ShapeLocation">233,169.5</av:Point>
              <av:Size x:Key="ShapeSize">114,61</av:Size>
              <x:Boolean x:Key="IsPinned">False</x:Boolean>
            </scg3:Dictionary>
          </sap:WorkflowViewStateService.ViewState>
          <p1:State.Transitions>
            <p1:Transition DisplayName="T1">
              <sap:WorkflowViewStateService.ViewState>
                <scg3:Dictionary x:TypeArguments="x:String, x:Object">
                  <av:PointCollection x:Key="ConnectorLocation">278.6,230.5 278.6,279.5</av:PointCollection>
                </scg3:Dictionary>
              </sap:WorkflowViewStateService.ViewState>
              <p1:Transition.To>
                <p1:State x:Name="__ReferenceID3" DisplayName="State2" sap:VirtualizedContainerService.HintSize="583,762">
                  <p1:State.Entry>
                    <p1:Sequence sap:VirtualizedContainerService.HintSize="557,451">
                      <p1:Sequence.Variables>
                        <p1:Variable x:TypeArguments="CorrelationHandle" Name="__handle1" />
                      </p1:Sequence.Variables>
                      <sap:WorkflowViewStateService.ViewState>
                        <scg3:Dictionary x:TypeArguments="x:String, x:Object">
                          <x:Boolean x:Key="IsExpanded">True</x:Boolean>
                        </scg3:Dictionary>
                      </sap:WorkflowViewStateService.ViewState>
                      <Receive x:Name="__ReferenceID1" sap:VirtualizedContainerService.HintSize="535,86" OperationName="Operation1" ServiceContractName="p:IService">
                        <Receive.CorrelationInitializers>
                          <RequestReplyCorrelationInitializer CorrelationHandle="[__handle1]" />
                        </Receive.CorrelationInitializers>
                      </Receive>
                      <p1:If Condition="[SomeCondition = True]" sap:VirtualizedContainerService.HintSize="535,201">
                        <p1:If.Then>
                          <SendReply Request="{x:Reference __ReferenceID1}" DisplayName="SendReplyToReceive" sap:VirtualizedContainerService.HintSize="255,100">
                            <SendMessageContent>
                              <p1:InArgument x:TypeArguments="t:Response">[UsrResponse]</p1:InArgument>
                            </SendMessageContent>
                          </SendReply>
                        </p1:If.Then>
                        <p1:If.Else>
                          <SendReply Request="{x:Reference __ReferenceID1}" DisplayName="SendReplyToReceive" sap:VirtualizedContainerService.HintSize="255,100">
                            <SendMessageContent>
                              <p1:InArgument x:TypeArguments="FaultException(t:FaultExec)">[APPEXEC]</p1:InArgument>
                            </SendMessageContent>
                          </SendReply>
                        </p1:If.Else>
                      </p1:If>
                    </p1:Sequence>
                  </p1:State.Entry>
                  <sap:WorkflowViewStateService.ViewState>
                    <scg3:Dictionary x:TypeArguments="x:String, x:Object">
                      <av:Point x:Key="ShapeLocation">233,279.5</av:Point>
                      <av:Size x:Key="ShapeSize">114,61</av:Size>
                      <x:Boolean x:Key="IsPinned">False</x:Boolean>
                    </scg3:Dictionary>
                  </sap:WorkflowViewStateService.ViewState>
                  <p1:State.Transitions>
                    <p1:Transition DisplayName="T2">
                      <sap:WorkflowViewStateService.ViewState>
                        <scg3:Dictionary x:TypeArguments="x:String, x:Object">
                          <av:PointCollection x:Key="ConnectorLocation">295.7,340.5 295.7,399.5</av:PointCollection>
                        </scg3:Dictionary>
                      </sap:WorkflowViewStateService.ViewState>
                      <p1:Transition.To>
                        <p1:State x:Name="__ReferenceID2" DisplayName="Final State" sap:VirtualizedContainerService.HintSize="114,61" IsFinal="True">
                          <sap:WorkflowViewStateService.ViewState>
                            <scg3:Dictionary x:TypeArguments="x:String, x:Object">
                              <av:Point x:Key="ShapeLocation">233,399.5</av:Point>
                              <av:Size x:Key="ShapeSize">114,61</av:Size>
                              <x:Boolean x:Key="IsPinned">False</x:Boolean>
                            </scg3:Dictionary>
                          </sap:WorkflowViewStateService.ViewState>
                        </p1:State>
                      </p1:Transition.To>
                    </p1:Transition>
                  </p1:State.Transitions>
                </p1:State>
              </p1:Transition.To>
            </p1:Transition>
          </p1:State.Transitions>
        </p1:State>
        <x:Reference>__ReferenceID2</x:Reference>
        <x:Reference>__ReferenceID3</x:Reference>
        <p1:StateMachine.Variables>
          <p1:Variable x:TypeArguments="x:Boolean" Default="True" Name="SomeCondition" />
          <p1:Variable x:TypeArguments="FaultException(t:FaultExec)" Name="APPEXEC" />
          <p1:Variable x:TypeArguments="t:Response" Name="UsrResponse" />
        </p1:StateMachine.Variables>
      </p1:StateMachine>
    </WorkflowService>

    Regards,

    Kummi


    Kota
    • Edited by Kummi Wednesday, January 18, 2012 2:16 AM
    Wednesday, January 18, 2012 2:15 AM

Answers

  • Hi again Kummi,
    I'm back to relay an official response to the bug report that came back from WF team's triage via this unofficial channel. This was confirmed to be a bug, however there is no plan to fix it because it only affects the workflow at validation time, and it also has a straightforward workaround. The workaround is to specify a single value (such as 'FaultExecAction') for the 'Action' property on both SendReply activities, so that they both have the exact same Action value.

    [Disclaimer and moderator's note - the standard place to file WF4 bug reports is still http://connect.microsoft.com/wf - you are advised to file bugs there if you actually want an official response, as there is no guarantee you'll get official responses via this community forum. ;-)]

    Tim


    Wednesday, February 15, 2012 12:41 AM

All replies

  • Hi,

    Any ideas? Can any one suggest if i have missed anything

     

    Regards,

    Kummi


    Kota
    Friday, January 20, 2012 6:18 PM
  • To be honest I'm with you on this one - I'm not quite sure why this restriction exists. I'll try to find out. Thank you for the extremely clear repro steps!
    Tim
    Sunday, January 22, 2012 2:16 AM
  • Hi again Kummi,
    I'm back to relay an official response to the bug report that came back from WF team's triage via this unofficial channel. This was confirmed to be a bug, however there is no plan to fix it because it only affects the workflow at validation time, and it also has a straightforward workaround. The workaround is to specify a single value (such as 'FaultExecAction') for the 'Action' property on both SendReply activities, so that they both have the exact same Action value.

    [Disclaimer and moderator's note - the standard place to file WF4 bug reports is still http://connect.microsoft.com/wf - you are advised to file bugs there if you actually want an official response, as there is no guarantee you'll get official responses via this community forum. ;-)]

    Tim


    Wednesday, February 15, 2012 12:41 AM
  • Have logged this as a bug in Connect.

    https://connect.microsoft.com/VisualStudio/feedback/details/782021/

    For anyone else that comes across this problem and misinterprets the above workaround, you need to set the Action property of each SendReply activity to the same value.

    I was confusing this with the Action part of the PickBranch activity.

    Also, this only appears to be a problem if you are using FaultException<TDetail> rather than a vanilla FaultException.

    God only knows what this error was supposed to be preventing...

    • Edited by Saffy Tuesday, March 26, 2013 2:05 PM
    Tuesday, March 26, 2013 11:46 AM