IDsl Compiler ContextSet Method
Set value for a context variable.
Definition
Namespace: Casewhere.Runtime.DSL.CompilerContext
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
C#
void Set(
string key,
Object value
)Parameters
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:
You can also declare a variable and bind it to a Form Component using data binding:
Example
C#
// 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"));