Namespace: Microsoft.Azure。Workflows.Sdk
Logic Appsのワークフローで変数操作アクションを作成するためのファクトリーメソッドを提供します。 このクラスはを使ってWorkflowActions.BuiltIn.Variablesからアクセスできます。
使用状況
// 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);
Methods
InitializeVariable<T>(Expression<Func<string>> name , expression<Func<T>> value)
初期値のワークフロー変数を宣言する IVariableWorkflowAction を作成します。
IVariableWorkflowAction InitializeVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
| 名前 | Description | タイプ | 必須 |
|---|---|---|---|
| 名前 | 変数名の式。 | Expression<Func<string>> | はい |
| value | 初期値の式。 | Expression<Func<T>> | はい |
var initVar = WorkflowActions.BuiltIn.Variables.InitializeVariable<string>(
name: () => "greeting",
value: () => "Hello").WithName("InitGreeting");
SetVariable<T>(Expression<Func<string>> name name, expression<Func<T>> value)
既存のワークフロー変数に新しい値を割り当てる IVariableWorkflowAction を作成します。
IVariableWorkflowAction SetVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
| 名前 | Description | タイプ | 必須 |
|---|---|---|---|
| 名前 | 変数名の式。 | Expression<Func<string>> | はい |
| value | 新しい値の式。 | Expression<Func<T>> | はい |
var setVar = WorkflowActions.BuiltIn.Variables.SetVariable<string>(
name: () => "greeting",
value: () => "Updated greeting").WithName("UpdateGreeting");
IncrementVariable<T>(Expression<Func<string>> name name, Expression<Func<T>> value)
数値変数を増やす IVariableWorkflowAction を作成します。
IVariableWorkflowAction IncrementVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
| 名前 | Description | タイプ | 必須 |
|---|---|---|---|
| 名前 | 変数名の式。 | Expression<Func<string>> | はい |
| value | 増分値の表現。 | Expression<Func<T>> | はい |
var increment = WorkflowActions.BuiltIn.Variables.IncrementVariable<int>(
name: () => "counter",
value: () => 1).WithName("IncrementCounter");
DecrementVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
数値変数を減らす IVariableWorkflowAction を作成します。
IVariableWorkflowAction DecrementVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
| 名前 | Description | タイプ | 必須 |
|---|---|---|---|
| 名前 | 変数名の式。 | Expression<Func<string>> | はい |
| value | 減価の式。 | Expression<Func<T>> | はい |
var decrement = WorkflowActions.BuiltIn.Variables.DecrementVariable<int>(
name: () => "counter",
value: () => 1).WithName("DecrementCounter");
AppendToStringVariable
文字列変数にテキストを付け加える IVariableWorkflowAction を作成します。
IVariableWorkflowAction AppendToStringVariable(Expression<Func<string>> name, Expression<Func<string>> value)
| 名前 | Description | タイプ | 必須 |
|---|---|---|---|
| 名前 | 変数名の式。 | Expression<Func<string>> | はい |
| value | 文字列が付加するための式です。 | Expression<Func<string>> | はい |
var append = WorkflowActions.BuiltIn.Variables.AppendToStringVariable(
name: () => "log",
value: () => " new entry").WithName("AppendLog");
AppendToArrayVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
配列変数に値を付け加える IVariableWorkflowAction を作成します。
IVariableWorkflowAction AppendToArrayVariable<T>(Expression<Func<string>> name, Expression<Func<T>> value)
| 名前 | Description | タイプ | 必須 |
|---|---|---|---|
| 名前 | 変数名の式。 | Expression<Func<string>> | はい |
| value | 付加する値の式。 | Expression<Func<T>> | はい |
var appendArray = WorkflowActions.BuiltIn.Variables.AppendToArrayVariable<string>(
name: () => "items",
value: () => "new item").WithName("AddItem");
関連コンテンツ
- AgentToolContextクラス定義
- IChainableNodeインターフェース定義
- IVariableワークフローアクションインターフェース定義
- IWorkflowAction インターフェース定義
- IWorkflowOperation インターフェース定義
- IWorkflowProvider インターフェース定義
- IWorkflowTriggerインターフェース定義
- OperationChainクラスの定義
- タイプ付きワークフローアクションインターフェースの定義
- 型付きワークフロートリガーインターフェースの定義
- WorkflowActionBaseクラス定義
- WorkflowActions クラス定義
- ワークフローBuiltInActionsクラス定義
- ワークフローBuiltInTriggersクラス定義
- WorkflowContextクラス定義
- ワークフローControlActionsクラス定義
- ワークフローファクトリークラス定義
- WorkflowManagedActions クラス定義
- WorkflowManagedTriggers クラス定義
- WorkflowProviderExtensions クラス定義
- WorkflowTriggerBaseクラスの定義
- ワークフロートリガークラス定義