Table of Contents

Class SetVariable

Namespace
Acuit.Pinpoint.Workflows.Activities
Assembly
Acuit.Pinpoint.Workflows.dll

Sets a variable to a value.

public class SetVariable : Activity, IActivity
Inheritance
SetVariable
Implements
Inherited Members

Properties

Name

Gets or sets the variable name. This is required and must match a known variable within the active workflow context (i.e., this or an ascendant activity should have defined a variable with this name). If it does not, the activity execution will fail with KeyNotFoundException.

public ValueSource<string> Name { get; set; }

Property Value

ValueSource<string>

Value

Gets or sets the value. This is required but can evaluate to null.

public ValueSource Value { get; set; }

Property Value

ValueSource

Remarks

The value is automatically converted to the variable type, if possible. If the value cannot be converted, then the activity will fail.

Methods

OnExecuteAsync(ActivityContext, CancellationToken)

Derived classes must implement this to perform the activity.

protected override Task OnExecuteAsync(ActivityContext context, CancellationToken cancellationToken)

Parameters

context ActivityContext

The activity context.

cancellationToken CancellationToken

The cancellation token used to request canceling the activity.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

ArgumentNullException

context is null.

InvalidOperationException

A service required by the activity is not available, or a required activity property value is not set.

Exception

An error occurred while performing the activity.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Remarks

This is expected to produce a string suitable for labeling this activity in a workflow diagram. It should be as specific as possible, but while keeping it very short. In general, it should be the short name of the class (as that is how it would typically be defined in the workflow XAML), optionally followed by other property values of interest in a diagram. The default implementation returns the short name of the class.