WorkflowVariableActions-Klasse

Namespace: Microsoft.Azure. Workflows.Sdk

Stellt Factory-Methoden zur Erstellung von Variablenmanipulationsaktionen in Logic Apps-Workflows bereit. Zugriff auf diese Klasse über WorkflowBuiltInActions mit WorkflowActions.BuiltIn.Variables.

Verwendung

// Variable actions are accessed via WorkflowActions.BuiltIn.Variables
var trigger = WorkflowTriggers.BuiltIn.CreateHttpTrigger();

var init = WorkflowActions.BuiltIn.Variables.InitializeVariable<int>(
    name: () => "counter", value: () => 0).WithName("InitCounter");
var increment = WorkflowActions.BuiltIn.Variables.IncrementVariable<int>(
    name: () => "counter", value: () => 1).WithName("AddOne");

trigger.Then(init).Then(increment);
WorkflowFactory.CreateStatefulWorkflow("VariableExample", trigger);

Methodik

InitializeVariable<T> (Ausdruck<Func<String Name>> , Ausdruck<Func<T>> Wert)

Erstellt eine IVariableWorkflowAction , die eine Workflow-Variable mit ihrem Anfangswert deklariert.

IVariableWorkflowAction InitializeVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
Name Beschreibung Typ Erforderlich
Name Ausdruck für den Variablennamen. Ausdrucks-Func-String<<>> Yes
value Ausdruck für den Anfangswert. Ausdruck<Func<T>> Yes
var initVar = WorkflowActions.BuiltIn.Variables.InitializeVariable<string>(
    name: () => "greeting",
    value: () => "Hello").WithName("InitGreeting");

SetVariable<T> (Ausdruck<Funkt-Stringname<>>, Expression<Func<T-Wert>>)

Erstellt eine IVariableWorkflowAction, die einer bestehenden Workflow-Variable einen neuen Wert zuweist.

IVariableWorkflowAction SetVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
Name Beschreibung Typ Erforderlich
Name Ausdruck für den Variablennamen. Ausdrucks-Func-String<<>> Yes
value Ausdruck für den neuen Wert. Ausdruck<Func<T>> Yes
var setVar = WorkflowActions.BuiltIn.Variables.SetVariable<string>(
    name: () => "greeting",
    value: () => "Updated greeting").WithName("UpdateGreeting");

IncrementVariable<T> (Expression<Func<String Name>> , Expression<Func<T>> Wert)

Erstellt eine IVariableWorkflowAction, die eine numerische Variable inkrementiert.

IVariableWorkflowAction IncrementVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
Name Beschreibung Typ Erforderlich
Name Ausdruck für den Variablennamen. Ausdrucks-Func-String<<>> Yes
value Ausdruck für den Inkrementwert. Ausdruck<Func<T>> Yes
var increment = WorkflowActions.BuiltIn.Variables.IncrementVariable<int>(
    name: () => "counter",
    value: () => 1).WithName("IncrementCounter");

DecrementVariable<T> (Expression<Func<String Name>> , Expression<Func<T>> Wert)

Erstellt eine IVariableWorkflowAction, die eine numerische Variable verringert.

IVariableWorkflowAction DecrementVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
Name Beschreibung Typ Erforderlich
Name Ausdruck für den Variablennamen. Ausdrucks-Func-String<<>> Yes
value Ausdruck für den Abrementwert. Ausdruck<Func<T>> Yes
var decrement = WorkflowActions.BuiltIn.Variables.DecrementVariable<int>(
    name: () => "counter",
    value: () => 1).WithName("DecrementCounter");

AppendToStringVariable

Erstellt eine IVariableWorkflowAction, die Text an eine String-Variable anhängt.

IVariableWorkflowAction AppendToStringVariable(Expression<Func<string>> name, Expression<Func<string>> value)
Name Beschreibung Typ Erforderlich
Name Ausdruck für den Variablennamen. Ausdrucks-Func-String<<>> Yes
value Ausdruck für den String zum Anhängen. Ausdrucks-Func-String<<>> Yes
var append = WorkflowActions.BuiltIn.Variables.AppendToStringVariable(
    name: () => "log",
    value: () => " new entry").WithName("AppendLog");

AppendToArrayVariable<T> (Ausdruck<Func-Stringname<>>, Ausdruck<Func<T-Wert>>)

Erstellt eine IVariableWorkflowAction, die einen Wert an eine Array-Variable anhängt.

IVariableWorkflowAction AppendToArrayVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
Name Beschreibung Typ Erforderlich
Name Ausdruck für den Variablennamen. Ausdrucks-Func-String<<>> Yes
value Ausdruck für den Wert zum Anfügen. Ausdruck<Func<T>> Yes
var appendArray = WorkflowActions.BuiltIn.Variables.AppendToArrayVariable<string>(
    name: () => "items",
    value: () => "new item").WithName("AddItem");