Muokkaa

Jaa


ReceiveActivity.CanCreateInstance Property

Definition

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

public:
 property bool CanCreateInstance { bool get(); void set(bool value); };
[System.ComponentModel.Browsable(true)]
public bool CanCreateInstance { get; set; }
[<System.ComponentModel.Browsable(true)>]
member this.CanCreateInstance : bool with get, set
Public Property CanCreateInstance As Boolean

Property Value

true if a new workflow instance is created; otherwise, false.

Attributes

Examples

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;

Remarks

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.

Applies to