public ReceiveRequestSendResponseScope()
        {
            DelegateInArgument <Exception> propagatedException = new DelegateInArgument <Exception>();

            tryCatch = new TryCatch
            {
                //Try = Body, // it is already set above
                Catches =
                {
                    new Catch <Exception>
                    {
                        Action = new ActivityAction <Exception>
                        {
                            Argument = propagatedException,
                            Handler  = new ProtectFaultedOperation
                            {
                                PropagatedException = propagatedException,
                            },
                        },
                    },
                },
                // The Finally works differently here than in C#, it is called only when the Try/Catch blocks complete.
                // In case of exception, ProtectFaultedOperation will handle the exception and will close, won't fault.
                // So this Finally is called in case of Close, Cancel or Fault, only in case of Close or Cancel, we should check the operation task's completion state.
                Finally = new ProtectClosedOrCanceledOperation(),
            };

            Constraints.Add(OperationActivityHelper.VerifyParentIsWorkflowActivity());
            Constraints.Add(ReceiveRequestSendResponseScopeHelper.VerifyReceiveRequestSendResponseScopeChildren());
            Constraints.Add(ReceiveRequestSendResponseScopeHelper.SetWorkflowInterfaceOperationNames());
            Constraints.Add(ReceiveRequestSendResponseScopeHelper.SetReceiveRequestSendResponseScopeExecutionPropertyFactory());
        }
Exemple #2
0
 public ReceiveRequestSendResponseScope()
 {
     Constraints.Add(OperationActivityHelper.VerifyParentIsWorkflowActivity());
     Constraints.Add(ReceiveRequestSendResponseScopeHelper.VerifyReceiveRequestSendResponseScopeChildren());
     Constraints.Add(ReceiveRequestSendResponseScopeHelper.SetReceiveRequestSendResponseScopeExecutionPropertyFactory());
 }