SqlWorkflowInstanceStore.InstanceCompletionAction Eigenschap

Definitie

Hiermee geeft u de actie op die moet worden uitgevoerd nadat een werkstroomexemplaren zijn voltooid. Mogelijke waarden zijn 'DeleteNothing' en 'DeleteAll'. De standaardwaarde is 'DeleteAll'. Als de eigenschap is ingesteld op DeleteNothing, bewaart de persistentieprovider alle instantiegegevens en metagegevens in de persistentiedatabase nadat het werkstroomexemplaren zijn voltooid. Als de eigenschap is ingesteld op 'DeleteAll', verwijdert de persistentieprovider alle exemplaargegevens en metagegevens nadat het werkstroomexemplaren zijn voltooid.

public:
 property System::Activities::DurableInstancing::InstanceCompletionAction InstanceCompletionAction { System::Activities::DurableInstancing::InstanceCompletionAction get(); void set(System::Activities::DurableInstancing::InstanceCompletionAction value); };
public System.Activities.DurableInstancing.InstanceCompletionAction InstanceCompletionAction { get; set; }
member this.InstanceCompletionAction : System.Activities.DurableInstancing.InstanceCompletionAction with get, set
Public Property InstanceCompletionAction As InstanceCompletionAction

Waarde van eigenschap

De actie die moet worden uitgevoerd nadat een werkstroom is voltooid.

Voorbeelden

Het volgende codevoorbeeld laat zien hoe u InstanceCompletionAction gebruikt in een SqlWorkflowInstanceStore.

static void Main(string[] args)
{
    // Create service host.
    WorkflowServiceHost host = new WorkflowServiceHost(new CountingWorkflow(), new Uri(hostBaseAddress));

    // Add service endpoint.
    host.AddServiceEndpoint("ICountingWorkflow", new BasicHttpBinding(), "");

    // Define SqlWorkflowInstanceStoreBehavior:
    //   Set interval to renew instance lock to 5 seconds.
    //   Set interval to check for runnable instances to 2 seconds.
    //   Instance Store does not keep instances after it is completed.
    //   Select exponential back-off algorithm when retrying to load a locked instance.
    //   Instance state information is compressed using the GZip compressing algorithm.
    SqlWorkflowInstanceStoreBehavior instanceStoreBehavior = new SqlWorkflowInstanceStoreBehavior(connectionString);
    instanceStoreBehavior.HostLockRenewalPeriod = new TimeSpan(0, 0, 5);
    instanceStoreBehavior.RunnableInstancesDetectionPeriod = new TimeSpan(0, 0, 2);
    instanceStoreBehavior.InstanceCompletionAction = InstanceCompletionAction.DeleteAll;
    instanceStoreBehavior.InstanceLockedExceptionAction = InstanceLockedExceptionAction.AggressiveRetry;
    instanceStoreBehavior.InstanceEncodingOption = InstanceEncodingOption.GZip;
    host.Description.Behaviors.Add(instanceStoreBehavior);

    // Open service host.
    host.Open();

    // Create a client that sends a message to create an instance of the workflow.
    ICountingWorkflow client = ChannelFactory<ICountingWorkflow>.CreateChannel(new BasicHttpBinding(), new EndpointAddress(hostBaseAddress));
    client.start();

    Console.WriteLine("(Press [Enter] at any time to terminate host)");
    Console.ReadLine();
    host.Close();
}

Opmerkingen

Mogelijke waarden zijn 'DeleteNothing' en 'DeleteAll'. De standaardwaarde is 'DeleteAll'. Als de eigenschap is ingesteld op DeleteNothing, bewaart de persistentieprovider alle instantiegegevens en metagegevens in de persistentiedatabase nadat het werkstroomexemplaren zijn voltooid. Als de eigenschap is ingesteld op 'DeleteAll', verwijdert de persistentieprovider alle exemplaargegevens en metagegevens nadat het werkstroomexemplaren zijn voltooid.

Van toepassing op