Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CanCreateInstance Property

ReceiveActivity.CanCreateInstance Property

Gets or sets whether the operation causes a new workflow service instance to be created.

Namespace:  System.Workflow.Activities
Assembly:  System.WorkflowServices (in System.WorkflowServices.dll)

[BrowsableAttribute(true)]
public bool CanCreateInstance { get; set; }

Property Value

Type: System.Boolean
true if a new workflow instance is created; otherwise, false.

A ReceiveActivity activity that has CanCreateInstance set to true represents a service operation that, when invoked by a service client without being part of a conversation, causes a new instance of the service workflow to be created.

Service workflows that do not have a ReceiveActivity activity with CanCreateInstance set to true cannot be instantiated by a client using a service operation invocation. Such workflows can be created using the CreateWorkflow method of the associated WorkflowRuntime object.

The default value for this property is false.

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

ReceiveActivity receiveRequestShippingQuote;
CodeActivity doAcceptQuoteRequest;

doAcceptQuoteRequest = new System.Workflow.Activities.CodeActivity();
receiveRequestShippingQuote = new System.Workflow.Activities.ReceiveActivity();

receiveRequestShippingQuote.Activities.Add(doAcceptQuoteRequest);
receiveRequestShippingQuote.CanCreateInstance = true;

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5
Show:
© 2015 Microsoft