This topic has not yet been rated - Rate this topic

ReceiveActivity.ParameterBindings Property

Gets the collection of bindable parameters as found in the service's formal parameter list.

Namespace:  System.Workflow.Activities
Assembly:  System.WorkflowServices (in System.WorkflowServices.dll)
[BrowsableAttribute(false)]
public WorkflowParameterBindingCollection ParameterBindings { get; }

ParameterBindings can be used to specify a binding between the service operation parameters and public field/properties of the workflow that contain the ReceiveActivity activity. When a client invokes the operation, the corresponding parameter values are written to bound workflow properties during the receive activity's execution.

ParameterBindings can also be used by the receive activity's child activities to read the parameter values passed in by client invocation. Child activities can use the ParameterBindings collection to set the return value of the parent ReceiveActivity activity.

All parameters of the service contract should be included in the ParameterBindings property. Unbound parameters cause compiler warnings upon compilation and an exception can occur when the ReceiveActivity returns this message back to the client.

The following example shows how to access the ParameterBindings property. This code was adapted from the Conversations SDK sample, from the ShipperWorkflow.designer.cs file.

ReceiveActivity receiveQuoteFromShipper1 = new ReceiveActivity();
CodeActivity shipper1ShippingQuote = new CodeActivity();
ContextToken contextToken1 = new ContextToken();
ActivityBind activityBind1 = new ActivityBind();
WorkflowParameterBinding workflowParameterBinding1 = new WorkflowParameterBinding();
TypedOperationInfo typedOperationInfo1 = new TypedOperationInfo();

receiveQuoteFromShipper1.Activities.Add(shipper1ShippingQuote);
contextToken1.Name = "Shipper1Context";
contextToken1.OwnerActivityName = "GetShippingQuotes";
receiveQuoteFromShipper1.ContextToken = contextToken1;
receiveQuoteFromShipper1.Name = "receiveQuoteFromShipper1";
activityBind1.Name = "SupplierWorkflow";
activityBind1.Path = "quoteShipper1";
workflowParameterBinding1.ParameterName = "quote";
workflowParameterBinding1.SetBinding(WorkflowParameterBinding.ValueProperty, ((ActivityBind)(activityBind1)));
receiveQuoteFromShipper1.ParameterBindings.Add(workflowParameterBinding1);
typedOperationInfo1.ContractType = typeof(IShippingQuote);
typedOperationInfo1.Name = "ShippingQuote";
receiveQuoteFromShipper1.ServiceOperationInfo = typedOperationInfo1;

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.