Skip to content

Low-Code API

Regulator|Low-Code Scripting · C#

The Low-Code API extends the No-Code API with C# scripting functions for cases, payruns, and reports. Scripts are embedded directly in regulation files and compiled by the backend at object creation time — no build pipeline required.

Scripting Functions

Object Functions
Case Build, Validate
Wage Type Available, Value, Result
Collector Start, Apply, End
Payrun Start, Employee Available, Employee Start/End, End
Report Build, Start, End

Scripts have access to case values, lookup tables, payrun results, and time data utilities.

Runtime Context

Each scripting function receives a typed runtime context that exposes the payroll object model and helper methods:

Context Available In
ICaseRuntime Case Build, Case Validate
ICaseRelationRuntime Case Relation Build, Case Relation Validate
IWageTypeRuntime Wage Type Available, Value, Result
ICollectorRuntime Collector Start, Apply, End
IPayrunRuntime Payrun Start/End, Employee Available/Start/End
IReportRuntime Report Build, Start, End

All runtimes expose shared utilities: GetCaseValue, GetLookupValue, PayrunResults, and date/period helpers.

Embedding Scripts

Scripts are embedded as plain C# function bodies inside regulation JSON or YAML:

{
  "name": "BasicSalary",
  "wageTypeNumber": 1000,
  "valueExpression": "return GetCaseValue<decimal>(\"MonthlySalary\");"
}

The backend compiles each expression with Roslyn when the regulation object is created. Compilation errors are reported immediately via the REST API response.

Local Development

Case and report scripts can be developed and debugged locally in Visual Studio or VS Code using the scripting runtime from the Client SDK:

  1. Add PayrollEngine.Client.Scripting NuGet package
  2. Implement the scripting interface (e.g. IWageTypeValueFunction)
  3. Run and debug with full IntelliSense and breakpoint support
  4. Copy the function body into the regulation JSON/YAML

See the ScriptingDevelopment tutorial for a complete setup.

API Reference

The full scripting API reference is generated from the PayrollEngine.Client.Scripting source:

Scripting API Reference →

See Also