WorkflowHostingEndpoint.OnGetInstanceId(Object[], OperationContext) Methode

Definitie

Overschrijven om de exemplaar-id te retourneren voor het werkstroomexemplaren dat wordt gemaakt.

protected public:
 virtual Guid OnGetInstanceId(cli::array <System::Object ^> ^ inputs, System::ServiceModel::OperationContext ^ operationContext);
protected internal virtual Guid OnGetInstanceId(object[] inputs, System.ServiceModel.OperationContext operationContext);
abstract member OnGetInstanceId : obj[] * System.ServiceModel.OperationContext -> Guid
override this.OnGetInstanceId : obj[] * System.ServiceModel.OperationContext -> Guid
Protected Friend Overridable Function OnGetInstanceId (inputs As Object(), operationContext As OperationContext) As Guid

Parameters

inputs
Object[]

De invoer voor de servicebewerking.

operationContext
OperationContext

De bewerkingscontext van de servicebewerking.

Retouren

De exemplaar-id voor het zojuist gemaakte werkstroomexemplaren.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de OnGetInstanceId methode implementeert.

protected override Guid OnGetInstanceId(object[] inputs, OperationContext operationContext)
{
    //Create was called by client
    if (operationContext.IncomingMessageHeaders.Action.EndsWith("Create"))
    {
        return Guid.Empty;
    }
    //CreateWithInstanceId was called by client
    else if (operationContext.IncomingMessageHeaders.Action.EndsWith("CreateWithInstanceId"))
    {
        return (Guid)inputs[1];
    }
    else
    {
        throw new InvalidOperationException("Invalid Action: " + operationContext.IncomingMessageHeaders.Action);
    }
}

Opmerkingen

Retourneer null om aan te geven dat er automatisch een exemplaar-id moet worden gegenereerd.

Van toepassing op