Class PayrunFunction
Payrun function
Inheritance
Implements
Inherited Members
Namespace: PayrollEngine.Client.Scripting.Function
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
public abstract class PayrunFunction : PayrollFunction, IDisposable
Remarks
This class sits between PayrollFunction and the concrete payrun function types. It adds the payrun execution context (job identity, retro period, forecast flag, cycle/period names) and the shared-memory facilities that allow functions running at different lifecycle stages to communicate without writing permanent data.
Execution order within a payrun:
- PayrunStartFunction — once at the start of the entire job.
- PayrunEmployeeAvailableFunction — once per employee (gate).
- PayrunEmployeeStartFunction — once per included employee.
- PayrunWageTypeAvailableFunction — once per wage type per employee (gate).
- WageTypeValueFunction / WageTypeResultFunction — value calculation and post-processing.
- CollectorStartFunction / CollectorApplyFunction / CollectorEndFunction — collector lifecycle.
- PayrunEmployeeEndFunction — once per included employee.
- PayrunEndFunction — once at the end of the entire job.
Runtime values are in-memory key/value string stores scoped to either the entire payrun (GetPayrunRuntimeValue(string) / SetPayrunRuntimeValue(string, string)) or to a single employee (GetEmployeeRuntimeValue(string) / SetEmployeeRuntimeValue(string, string)). They exist only for the duration of the payrun job and are not persisted.
Payrun results (SetPayrunResult(string, object, ValueType?, string, IEnumerable<string>, Dictionary<string, object>, string)) are durable named value entries written to the payrun result store and accessible by reports and downstream processes.
Constructors
View SourcePayrunFunction(object)
Initializes a new instance with the function runtime
Declaration
protected PayrunFunction(object runtime)
Parameters
| Type | Name | Description |
|---|---|---|
| object | runtime | The runtime |
PayrunFunction(string)
New function instance without runtime (scripting development)
Declaration
protected PayrunFunction(string sourceFileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | sourceFileName | The name of the source file |
Properties
View SourceCycleName
The cycle name
Declaration
[ActionProperty("Cycle name", null)]
public string CycleName { get; }
Property Value
| Type | Description |
|---|---|
| string |
ExecutionPhase
The current execution phase of the payrun job (e.g. Setup, Execution, Cleanup)
Declaration
public PayrunExecutionPhase ExecutionPhase { get; }
Property Value
| Type | Description |
|---|---|
| PayrunExecutionPhase |
Forecast
Forecast name
Declaration
[ActionProperty("Forecast name", null)]
public string Forecast { get; }
Property Value
| Type | Description |
|---|---|
| string |
IsCycleRetroPayrun
True for a retro payrun within the current cycle
Declaration
[ActionProperty("Test for cycle retro payrun", null)]
public bool IsCycleRetroPayrun { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsForecast
True for a forecast payrun
Declaration
[ActionProperty("Test for forecast", null)]
public bool IsForecast { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsRetroPayrun
True for a retro payrun
Declaration
[ActionProperty("Test for retro payrun", null)]
public bool IsRetroPayrun { get; }
Property Value
| Type | Description |
|---|---|
| bool |
PayrunId
The payrun id
Declaration
public int PayrunId { get; }
Property Value
| Type | Description |
|---|---|
| int |
PayrunName
The payrun name
Declaration
[ActionProperty("Payrun name", null)]
public string PayrunName { get; }
Property Value
| Type | Description |
|---|---|
| string |
PeriodName
The period name
Declaration
[ActionProperty("Period name", null)]
public string PeriodName { get; }
Property Value
| Type | Description |
|---|---|
| string |
PreviewJob
True when the payrun job was started in preview mode; results are calculated but not committed
Declaration
public bool PreviewJob { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
Use this flag to suppress side-effects (e.g. task creation, webhook calls) that must not fire during previews.
RetroPeriod
The period being recalculated in a retro run; null for a normal payrun
Declaration
public DatePeriod RetroPeriod { get; }
Property Value
| Type | Description |
|---|---|
| DatePeriod |
Remarks
Use IsRetroPayrun as a guard. The retro period precedes the current evaluation period.
Methods
View SourceGetCollectorCycleResults(CollectorCycleResultQuery)
Returns collector results for the current employee spanning one or more complete payroll cycles
Declaration
public IList<CollectorResult> GetCollectorCycleResults(CollectorCycleResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| CollectorCycleResultQuery | query | Cycle query specifying collector names, cycle count offset, forecast, job status, and tags |
Returns
| Type | Description |
|---|---|
| IList<CollectorResult> | List of CollectorResult covering the requested cycles |
Remarks
Collector equivalent of GetWageTypeCycleResults(WageTypeCycleResultQuery).
GetCollectorPeriodResults(CollectorPeriodResultQuery)
Returns collector results for the current employee spanning a number of payroll periods back from the current period
Declaration
public IList<CollectorResult> GetCollectorPeriodResults(CollectorPeriodResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| CollectorPeriodResultQuery | query | Period query specifying collector names, period count offset, forecast, job status, and tags |
Returns
| Type | Description |
|---|---|
| IList<CollectorResult> | List of CollectorResult covering the requested periods |
Remarks
Collector equivalent of GetPeriodWageTypeResults(WageTypePeriodResultQuery).
GetCollectorResults(CollectorRangeResultQuery)
Returns collector results for the current employee within an explicit date range
Declaration
public IList<CollectorResult> GetCollectorResults(CollectorRangeResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| CollectorRangeResultQuery | query | Range query specifying collector names, start/end dates, forecast, job status, and tags |
Returns
| Type | Description |
|---|---|
| IList<CollectorResult> | List of CollectorResult within the date range |
GetCollectorResults(IEnumerable<string>, DateTime, DateTime, string, PayrunJobStatus?, IEnumerable<string>)
Returns collector results for the current employee within an explicit date range (low-level overload)
Declaration
public IList<CollectorResult> GetCollectorResults(IEnumerable<string> collectorNames, DateTime start, DateTime end, string forecast = null, PayrunJobStatus? jobStatus = null, IEnumerable<string> tags = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | collectorNames | The PascalCase collector names to query |
| DateTime | start | Range start date (inclusive) |
| DateTime | end | Range end date (inclusive) |
| string | forecast | Optional forecast name; |
| PayrunJobStatus? | jobStatus | Optional job status filter; |
| IEnumerable<string> | tags | Optional tag filter |
Returns
| Type | Description |
|---|---|
| IList<CollectorResult> | List of CollectorResult within the date range |
GetConsolidatedCollectorCustomResults(CollectorConsolidatedResultQuery)
Returns consolidated custom collector results for the current employee, merging retro corrections into the base values
Declaration
public IList<CollectorCustomResult> GetConsolidatedCollectorCustomResults(CollectorConsolidatedResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| CollectorConsolidatedResultQuery | query | Consolidated query specifying collector names, reference period moment, forecast, job status, and tags |
Returns
| Type | Description |
|---|---|
| IList<CollectorCustomResult> | List of CollectorCustomResult with retro differences already applied |
Remarks
Set query.NoRetro = true to suppress retro merging.
GetConsolidatedCollectorResults(CollectorConsolidatedResultQuery)
Returns consolidated collector results for the current employee, merging retro corrections into the base values
Declaration
public IList<CollectorResult> GetConsolidatedCollectorResults(CollectorConsolidatedResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| CollectorConsolidatedResultQuery | query | Query specifying collector names, the reference period moment, forecast, job status, and tags |
Returns
| Type | Description |
|---|---|
| IList<CollectorResult> | List of CollectorResult with retro differences already applied |
Remarks
Equivalent to GetConsolidatedWageTypeResults(WageTypeConsolidatedResultQuery) but for collectors.
Retro merging can be suppressed with query.NoRetro = true.
GetConsolidatedWageTypeCustomResults(WageTypeConsolidatedResultQuery)
Returns consolidated custom wage type results for the current employee, merging retro corrections into the base values
Declaration
public IList<WageTypeCustomResult> GetConsolidatedWageTypeCustomResults(WageTypeConsolidatedResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| WageTypeConsolidatedResultQuery | query | Consolidated query specifying wage type numbers, reference period moment, forecast, job status, and tags |
Returns
| Type | Description |
|---|---|
| IList<WageTypeCustomResult> | List of WageTypeCustomResult with retro differences already applied |
Remarks
Set query.NoRetro = true to suppress retro merging.
GetConsolidatedWageTypeResults(WageTypeConsolidatedResultQuery)
Returns consolidated wage type results for the current employee, merging retro corrections into the base values
Declaration
public IList<WageTypeResult> GetConsolidatedWageTypeResults(WageTypeConsolidatedResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| WageTypeConsolidatedResultQuery | query | Query specifying wage type numbers, the reference period moment, forecast, job status, and tags |
Returns
| Type | Description |
|---|---|
| IList<WageTypeResult> | List of WageTypeResult with retro differences already applied |
Remarks
"Consolidated" means the engine merges any retro-payrun corrections for the queried periods
into the base results, so the returned values reflect the net committed amount.
Set query.NoRetro = true to suppress retro merging and return only base results.
Use GetWageTypeCycleResults(WageTypeCycleResultQuery) or GetPeriodWageTypeResults(WageTypePeriodResultQuery) when you
need raw per-period results without retro consolidation.
GetCycleCollectorValue(string)
Get collector year-to-date value
Declaration
[ActionParameter("name", "The collector name", new string[] { "String" }, null, null)]
[PayrunAction("GetCycleCollectorValue", "Get collector year-to-date value", new string[] { "Collector" })]
public ActionValue GetCycleCollectorValue(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Collector name |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetCycleWageTypeValue(decimal)
Get wage type year-to-date value by wage type number
Declaration
[ActionParameter("number", "The wage type number", new string[] { "Dec" }, null, null)]
[PayrunAction("GetCycleWageTypeValue", "Get wage type year-to-date value by wage type number", new string[] { "WageType" })]
public ActionValue GetCycleWageTypeValue(decimal number)
Parameters
| Type | Name | Description |
|---|---|---|
| decimal | number |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetCycleWageTypeValue(string)
Get wage type year-to-date value by wage type name
Declaration
[ActionParameter("name", "The wage type name", new string[] { "String" }, null, null)]
[PayrunAction("GetCycleWageTypeValue", "Get wage type year-to-date value by wage type name", new string[] { "WageType" })]
public ActionValue GetCycleWageTypeValue(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetEmployeeRuntimeValue(string)
Returns the raw string value of an employee-scoped runtime entry for the current employee
Declaration
public string GetEmployeeRuntimeValue(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
Returns
| Type | Description |
|---|---|
| string | The stored string, or |
Remarks
Employee runtime values are scoped to the current employee and isolated from other employees. They allow data to flow from early functions (e.g. PayrunEmployeeStartFunction) to later ones (e.g. CollectorEndFunction, PayrunEmployeeEndFunction) for the same employee. In PayrunEndFunction, all employees' values are accessible via GetEmployeeRuntimeValues(string).
GetEmployeeRuntimeValue<T>(string)
Returns an employee-scoped runtime value deserialized to the specified type
Declaration
public T GetEmployeeRuntimeValue<T>(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
Returns
| Type | Description |
|---|---|
| T | The deserialized value, or |
Type Parameters
| Name | Description |
|---|---|
| T | The target type; the stored JSON string is deserialized into this type |
GetPayrunJobAttribute(string)
Returns the value of a payrun job attribute by name
Declaration
public object GetPayrunJobAttribute(string attributeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName | The attribute name |
Returns
| Type | Description |
|---|---|
| object | The attribute value, or |
GetPayrunJobAttribute<T>(string, T)
Returns the typed value of a payrun job attribute by name
Declaration
public T GetPayrunJobAttribute<T>(string attributeName, T defaultValue = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName | The attribute name |
| T | defaultValue | Value returned when the attribute does not exist |
Returns
| Type | Description |
|---|---|
| T | The typed attribute value, or |
Type Parameters
| Name | Description |
|---|---|
| T | The expected value type |
GetPayrunResult(string)
Returns a previously written payrun result value by name
Declaration
public object GetPayrunResult(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The result name as passed to SetPayrunResult(string, object, ValueType?, string, IEnumerable<string>, Dictionary<string, object>, string) |
Returns
| Type | Description |
|---|---|
| object | The raw result value, or |
GetPayrunResultValue(string)
Get payrun result value
Declaration
[ActionParameter("name", "The result name", new string[] { "String" }, null, null)]
[PayrunAction("GetPayrunResultValue", "Get payrun result value", new string[] { "Payrun" })]
public ActionValue GetPayrunResultValue(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetPayrunResult<T>(string, T)
Returns a previously written payrun result value cast to the specified type
Declaration
public T GetPayrunResult<T>(string name, T defaultValue = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The result name |
| T | defaultValue | Value returned when the result does not exist |
Returns
| Type | Description |
|---|---|
| T | The typed result value, or |
Type Parameters
| Name | Description |
|---|---|
| T | The expected value type |
GetPayrunRuntimeValue(string)
Returns the raw string value of a payrun-scoped runtime entry
Declaration
public string GetPayrunRuntimeValue(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
Returns
| Type | Description |
|---|---|
| string | The stored string, or |
Remarks
Payrun runtime values are shared across all functions within the same payrun job execution. They are ephemeral — written in one function (e.g. PayrunStartFunction) and readable in any later function within the same job. They are not persisted after the job completes. For complex types use GetPayrunRuntimeValue<T>(string) which deserializes from JSON.
GetPayrunRuntimeValue<T>(string)
Returns a payrun-scoped runtime value deserialized to the specified type
Declaration
public T GetPayrunRuntimeValue<T>(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
Returns
| Type | Description |
|---|---|
| T | The deserialized value, or |
Type Parameters
| Name | Description |
|---|---|
| T | The target type; the stored JSON string is deserialized into this type |
GetPeriodWageTypeResults(WageTypePeriodResultQuery)
Returns wage type results for the current employee spanning a number of payroll periods back from the current period
Declaration
public IList<WageTypeResult> GetPeriodWageTypeResults(WageTypePeriodResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| WageTypePeriodResultQuery | query | Period query specifying wage type numbers, period count offset, forecast, job status, and tags |
Returns
| Type | Description |
|---|---|
| IList<WageTypeResult> | List of WageTypeResult covering the requested periods |
Remarks
query.PeriodCount = 1 returns the previous period, query.PeriodCount = 3 the last three periods.
For full-cycle queries use GetWageTypeCycleResults(WageTypeCycleResultQuery); for an explicit date range use
GetWageTypeResults(WageTypeRangeResultQuery).
GetRetroWageTypeValueSum(decimal)
Returns the net sum of all pending retro corrections for a wage type identified by number
Declaration
public decimal GetRetroWageTypeValueSum(decimal number)
Parameters
| Type | Name | Description |
|---|---|---|
| decimal | number | The wage type number |
Returns
| Type | Description |
|---|---|
| decimal | Sum of all retro correction deltas; zero when no corrections are pending |
Remarks
Typical use: add the retro correction to the current period's wage type value so the employee receives the missed amount in the current payslip.
Examples
// Include retro correction in the current period's gross salary
var retro = GetRetroWageTypeValueSum(1000m);
return GetCaseValue<decimal>("MonthlySalary") + retro;
View Source
GetRetroWageTypeValueSum(string)
Returns the net sum of all pending retro corrections for a wage type identified by name
Declaration
public decimal GetRetroWageTypeValueSum(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The wage type name |
Returns
| Type | Description |
|---|---|
| decimal | Sum of all retro correction deltas; zero when no corrections are pending |
GetRetroWageTypeValueSumByName(string)
Get sum of retro corrections for a wage type by name
Declaration
[ActionParameter("name", "The wage type name", new string[] { "String" }, null, null)]
[PayrunAction("GetRetroWageTypeValueSum", "Get sum of retro wage type corrections by name", new string[] { "WageType" })]
public ActionValue GetRetroWageTypeValueSumByName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetRetroWageTypeValueSumByNumber(decimal)
Get sum of retro corrections for a wage type by number
Declaration
[ActionParameter("number", "The wage type number", new string[] { "Dec" }, null, null)]
[PayrunAction("GetRetroWageTypeValueSum", "Get sum of retro wage type corrections by number", new string[] { "WageType" })]
public ActionValue GetRetroWageTypeValueSumByNumber(decimal number)
Parameters
| Type | Name | Description |
|---|---|---|
| decimal | number |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetRuntimeValue(string)
Get runtime action value
Declaration
[ActionParameter("key", "The value key", new string[] { "String" }, null, null)]
[PayrunAction("GetRuntimeValue", "Get payrun runtime value", new string[] { "Runtime" })]
public ActionValue GetRuntimeValue(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key |
Returns
| Type | Description |
|---|---|
| ActionValue |
GetWageTypeCustomResults(WageTypeRangeResultQuery)
Returns custom wage type results (additional named values) for the current employee within an explicit date range
Declaration
public IList<WageTypeCustomResult> GetWageTypeCustomResults(WageTypeRangeResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| WageTypeRangeResultQuery | query | Range query specifying wage type numbers, start/end dates, forecast, job status, and tags |
Returns
| Type | Description |
|---|---|
| IList<WageTypeCustomResult> | List of WageTypeCustomResult within the date range |
Remarks
Custom results are the extra named values a WageTypeValueFunction stores via
AddCustomResult. Use this method to read them back in later functions.
GetWageTypeCycleResults(WageTypeCycleResultQuery)
Returns wage type results for the current employee spanning one or more complete payroll cycles
Declaration
public IList<WageTypeResult> GetWageTypeCycleResults(WageTypeCycleResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| WageTypeCycleResultQuery | query | Cycle query specifying wage type numbers, cycle count offset, forecast, job status, and tags |
Returns
| Type | Description |
|---|---|
| IList<WageTypeResult> | List of WageTypeResult covering the requested cycles |
Remarks
Use query.CycleCount = 1 for the previous cycle (YTD prior year),
query.CycleCount = 0 for the current cycle up to the evaluation period.
For finer period-level control use GetPeriodWageTypeResults(WageTypePeriodResultQuery).
GetWageTypeName(decimal)
Returns the name of a wage type by its numeric identifier
Declaration
public string GetWageTypeName(decimal wageTypeNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| decimal | wageTypeNumber | The wage type number |
Returns
| Type | Description |
|---|---|
| string | The PascalCase wage type name |
GetWageTypeNumber(string)
Returns the numeric identifier of a wage type by its name
Declaration
public decimal GetWageTypeNumber(string wageTypeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | wageTypeName | The PascalCase wage type name |
Returns
| Type | Description |
|---|---|
| decimal | The wage type number |
Remarks
Use this to convert a readable name to a number before calling result query methods.
GetWageTypeResults(WageTypeRangeResultQuery)
Returns wage type results for the current employee within an explicit date range
Declaration
public IList<WageTypeResult> GetWageTypeResults(WageTypeRangeResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| WageTypeRangeResultQuery | query | Range query specifying wage type numbers, start/end dates, forecast, job status, and tags |
Returns
| Type | Description |
|---|---|
| IList<WageTypeResult> | List of WageTypeResult within the date range |
GetWageTypeResults(IEnumerable<decimal>, DateTime, DateTime, string, PayrunJobStatus?, IEnumerable<string>)
Returns wage type results for the current employee within an explicit date range (low-level overload)
Declaration
public IList<WageTypeResult> GetWageTypeResults(IEnumerable<decimal> wageTypeNumbers, DateTime start, DateTime end, string forecast = null, PayrunJobStatus? jobStatus = null, IEnumerable<string> tags = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<decimal> | wageTypeNumbers | The wage type numbers to query |
| DateTime | start | Range start date (inclusive) |
| DateTime | end | Range end date (inclusive) |
| string | forecast | Optional forecast name; |
| PayrunJobStatus? | jobStatus | Optional job status filter; |
| IEnumerable<string> | tags | Optional tag filter; only results carrying all listed tags are returned |
Returns
| Type | Description |
|---|---|
| IList<WageTypeResult> | List of WageTypeResult within the date range |
GetWageTypeRetroResultSum(decimal)
Get summary of retro wage type results
Declaration
public decimal GetWageTypeRetroResultSum(decimal wageTypeNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| decimal | wageTypeNumber | The wage type number |
Returns
| Type | Description |
|---|---|
| decimal | Retro employee wage type value (difference) |
GetWageTypeRetroResults(WageTypeResultQuery)
Returns the individual retro-correction amounts for a wage type across all pending retro periods
Declaration
public IList<decimal> GetWageTypeRetroResults(WageTypeResultQuery query)
Parameters
| Type | Name | Description |
|---|---|---|
| WageTypeResultQuery | query | Query identifying the wage type number and optional forecast/status/tag filters |
Returns
| Type | Description |
|---|---|
| IList<decimal> | List of correction deltas (positive = underpayment correction, negative = overpayment correction) |
Remarks
Each entry represents the difference between the recalculated and the originally committed result for one retro period. Use GetRetroWageTypeValueSum(decimal) to get the total correction in a single call.
HasEmployeeRuntimeValue(string)
Tests whether an employee-scoped runtime value with the given key exists for the current employee
Declaration
public bool HasEmployeeRuntimeValue(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
Returns
| Type | Description |
|---|---|
| bool |
|
HasPayrunRuntimeValue(string)
Tests whether a payrun-scoped runtime value with the given key exists
Declaration
public bool HasPayrunRuntimeValue(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
Returns
| Type | Description |
|---|---|
| bool |
|
RemovePayrunJobAttribute(string)
Removes a payrun job attribute by name
Declaration
public bool RemovePayrunJobAttribute(string attributeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName | The attribute name |
Returns
| Type | Description |
|---|---|
| bool |
|
RemoveRuntimeValue(string)
Remove runtime action value
Declaration
[ActionParameter("key", "The value key", new string[] { "String" }, null, null)]
[PayrunAction("RemoveRuntimeValue", "Remove payrun runtime value", new string[] { "Runtime" })]
public void RemoveRuntimeValue(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key |
SetEmployeeRuntimeValue(string, string)
Writes an employee-scoped runtime value as a raw string for the current employee
Declaration
public void SetEmployeeRuntimeValue(string key, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
| string | value | The string value to store; pass |
SetEmployeeRuntimeValue<T>(string, T)
Serializes a value to JSON and writes it as an employee-scoped runtime entry for the current employee
Declaration
public void SetEmployeeRuntimeValue<T>(string key, T value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
| T | value | The value to serialize and store; pass |
Type Parameters
| Name | Description |
|---|---|
| T | The value type to serialize |
SetPayrunJobAttribute(string, object)
Creates or updates a payrun job attribute
Declaration
public void SetPayrunJobAttribute(string attributeName, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeName | The attribute name |
| object | value | The attribute value to store |
SetPayrunResult(string, object, DateTime, DateTime, ValueType?, string, IEnumerable<string>, Dictionary<string, object>, string)
Writes a named payrun result for an explicit date range to the durable payrun result store
Declaration
public void SetPayrunResult(string name, object value, DateTime startDate, DateTime endDate, ValueType? valueType = null, string slot = null, IEnumerable<string> tags = null, Dictionary<string, object> attributes = null, string culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Unique result name within this payrun execution |
| object | value | The result value; serialized to JSON internally |
| DateTime | startDate | The result validity start date |
| DateTime | endDate | The result validity end date |
| ValueType? | valueType | Explicit value type; inferred from |
| string | slot | Optional slot name for multi-slot results |
| IEnumerable<string> | tags | Optional result tags for filtering |
| Dictionary<string, object> | attributes | Optional key/value metadata attached to the result |
| string | culture | Optional culture for value formatting |
Remarks
Use this overload when the result must cover a date range different from the current payroll period.
SetPayrunResult(string, object, ValueType?, string, IEnumerable<string>, Dictionary<string, object>, string)
Writes a named payrun result for the current period to the durable payrun result store
Declaration
public void SetPayrunResult(string name, object value, ValueType? valueType = null, string slot = null, IEnumerable<string> tags = null, Dictionary<string, object> attributes = null, string culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Unique result name within this payrun execution |
| object | value | The result value; serialized to JSON internally |
| ValueType? | valueType | Explicit value type; inferred from |
| string | slot | Optional slot name for multi-slot results |
| IEnumerable<string> | tags | Optional result tags for filtering |
| Dictionary<string, object> | attributes | Optional key/value metadata attached to the result |
| string | culture | Optional culture for value formatting |
Remarks
Payrun results are durable — unlike runtime values, they are persisted after
the payrun completes and are accessible by reports via ExecutePayrunResultQuery.
Use them to publish derived metrics (totals, counts, flags) that reports or downstream
processes need to consume. The name must be unique within the payrun job.
SetPayrunResultValue(string, object, string)
Set payrun result value
Declaration
[ActionParameter("name", "The result name", new string[] { "String" }, null, null)]
[ActionParameter("value", "The value to set", null, null, null)]
[ActionParameter("type", "The value type (default: Money), [StringType]", null, null, null)]
[PayrunAction("SetPayrunResultValue", "Set payrun result value", new string[] { "Payrun" })]
public void SetPayrunResultValue(string name, object value, string type = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | |
| object | value | |
| string | type |
SetPayrunRuntimeValue(string, string)
Writes a payrun-scoped runtime value as a raw string
Declaration
public void SetPayrunRuntimeValue(string key, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
| string | value | The string value to store; pass |
Remarks
Values written here are visible to all subsequent functions within the same payrun job. Use SetPayrunRuntimeValue<T>(string, T) to serialize complex types to JSON automatically.
SetPayrunRuntimeValue<T>(string, T)
Serializes a value to JSON and writes it as a payrun-scoped runtime entry
Declaration
public void SetPayrunRuntimeValue<T>(string key, T value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The value key |
| T | value | The value to serialize and store |
Type Parameters
| Name | Description |
|---|---|
| T | The value type to serialize |
SetRuntimeValue(string, object)
Set runtime action value
Declaration
[ActionParameter("key", "The value key", new string[] { "String" }, null, null)]
[ActionParameter("value", "The value to set", null, null, null)]
[PayrunAction("SetRuntimeValue", "Set payrun runtime value", new string[] { "Runtime" })]
public void SetRuntimeValue(string key, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | |
| object | value |