Click or drag to resize

IDslCompilerContext Interface

This interface will provide a list of function that helps user create the data to data object for each levels in the system.

Namespace:  Casewhere.Runtime.DSL.CompilerContext
Assembly:  Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.8.1.0
Syntax
C#
public interface IDslCompilerContext

The IDslCompilerContext type exposes the following members.

Properties
  NameDescription
Public propertyActivity
The Activity in Context.
Public propertyCase
The Case in Context.
Public propertyFormData
The Form ActualData in context.
Public propertyInput
Workflow input object. If there is multiple objects, it references the first one.
Public propertyInputs
Workflow input objects.
Public propertyOutput
Using this property to get/set Output value object for the workflow in the current context.
Public propertyCode exampleParameters
The parameters are parsed from the query string of the web trigger request
Examples
Assume that a dynamic web trigger has the friendly uri: employee/info
Then a request for that trigger is: employee/info?isActive=true&from=2020-07-27
var dataApi = ctx.Use<IDataApi>();
var @from = ctx.Parameters.Get<DateTime>("from");
var isActive = ctx.Parameters["isActive"];
var filter = FilterBuilder.Create().Eq("Active", isActive)
                                      .Gt("CreatedAt", @from)
                                      .Build();
var result = dataApi.Search(DataObjectApiQuery
                    .For("Employee")
                    .FilterBy(filter));
var employee  = result.Data.FirstOrDefault();
ctx.Output = employee;
Public propertyCode exampleRouteParameters
The route parameters are parsed from the url of the web trigger request
Examples
Assume that a dynamic web trigger has the friendly uri: employee/info/{code}
Then a request for that trigger is: employee/info/DEV-123
var dataApi = ctx.Use<IDataApi>();
var employeeCode = ctx.RouteParameters.Get<string>("code");
var filter = FilterBuilder.Create().Eq("Active", true)
                                      .Eq("Code", employeeCode)
                                      .Build();
var result = dataApi.Search(DataObjectApiQuery
                    .For("Employee")
                    .Paging(0, 1)
                    .FilterBy(filter));
var employee  = result.Data.FirstOrDefault();
ctx.Output = employee;
Public propertyUser
The User in context.
Public propertyWorkerSite
The WorkerSite in Context
Public propertyWorkflow
The Workflow in Context.
Public propertyWorkflowContext
The context object.
Top
Methods
  NameDescription
Public methodAddDataObject Obsolete.
Public methodCode exampleAttachToDataSource
Links a ActualData Object that is created in Scripted Activity to a Workflow ActualData Source so it can be used in Form Activity.
Public methodBadData
Throw an exception when the data is in invalid state
Public methodCommitChanges
Saves all changes made in this context to the underlying database.
Public methodDeleteDataObject(Object) Obsolete.
Public methodDeleteDataObject(String, Object) Obsolete.
Public methodEmit
Emit data with event name
Public methodFindDataObject(String, DataObjectExpression) Obsolete.
Public methodFindDataObject(String, DataObjectExpression, Int32, Int32) Obsolete.
Public methodGet(String)
Get value object by name.
Public methodCode exampleGetT(String)
Get value by name.
Public methodGetDataObject Obsolete.
Public methodGetDataObjectById Obsolete.
Public methodGetDataObjects Obsolete.
Public methodCode exampleGetTempT
Get value by name in a context workflow. Throw an exception when key is not existed yet.
Public methodHas
Determines if a variable exists in the workflow.
Public methodHasTempKey
Determines if a temporary key exists in the current workflow context.
Public methodHasValue
Determines if a variable exists in the workflow and it has value e.g. not empty string, not empty array, etc.
Public methodLoadDataObject(String, DataLoadingScope) Obsolete.
Public methodLoadDataObject(String, Object) Obsolete.
Public methodLoadDataObjectById Obsolete.
Public methodLoadDataObjects Obsolete.
Public methodNotFound
Throw an exception when the object is not present.
Public methodRef(String)
Get the data object is being referenced.
Public methodRef(String, String)
Set value for a context reference.
Public methodSearchDataObjects(String, DataObjectExpression) Obsolete.
Public methodSearchDataObjects(String, DataObjectExpression, Int32, Int32) Obsolete.
Public methodCode exampleSet
Set value for a context variable.
Public methodCode exampleSetTemp
Set temporary value in a context workflow. The value only maintaines in memory and will not be persisted to database.
Public methodUnauthorized
Throw an exception when the user lacking permission
Public methodUpdateDataObject(Object, Object) Obsolete.
Public methodUpdateDataObject(String, Object, Object) Obsolete.
Public methodUseTApi
Factory method to create API objects.
Public methodUseIOApiTIOApi Obsolete.
Top
See Also