Click or drag to resize

IDslCompilerContextSet Method

Set value for a context variable.

Namespace:  Casewhere.Runtime.DSL.CompilerContext
Assembly:  Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.8.1.0
Syntax
C#
void Set(
	string key,
	Object value
)

Parameters

key
Type: SystemString
The key.
value
Type: SystemObject
The value.
Remarks
In general, a context variable can accept anything. However, for storing data objects, we recommend using Ref(String, String) for more efficiency and better overall performance.
You can also declare a variable and bind it to a Form Component using data binding:
Examples
// Assuming a workflow has 2 activities like below:
// Activity 1:
ctx.Set("Confirmed", true);
ctx.Set("ConfirmedOption", 5);
// Activity 2:
if (ctx.Get<bool>("Confirmed"))
    DoSomething(ctx.Get<int>("ConfirmedOption"));
See Also