Gets or sets whether the operation causes a new workflow service instance to be created.
Assembly: System.WorkflowServices (in System.WorkflowServices.dll)
A ReceiveActivity activity that has 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 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;