Class CollectorStartFunction
Executes when a collector is first activated in a payrun, before any wage type values are applied.
Implements
Inherited Members
Namespace: PayrollEngine.Client.Scripting.Function
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
public class CollectorStartFunction : CollectorFunction, IDisposable
Remarks
This function runs once per collector per employee, at the moment the collector is initialised. It is used to set an initial state or override the starting value set.
Typical uses:
- Override the initial value set with SetValues(decimal[]) — for example, to carry a residual amount forward from a previous period.
- Read an employee runtime value (GetEmployeeRuntimeValue(string)) to seed the collector from pre-computed data.
- Log collector initialisation for audit purposes.
Return value: Return null to proceed normally.
Return any numeric value to override the initial collector value directly.
Returning false (cast to object) suppresses further processing for this collector.
Low-Code / No-Code: Simple initialization can be expressed through
CollectorStartAction attributes. The Start() entry point invokes all
registered actions before executing any inline script body.
Examples
// Carry forward a residual amount from the previous period
SetValues(new[] { GetCaseValue<decimal>("CollectorCarry") });
Constructors
View SourceCollectorStartFunction(object)
Initializes a new instance with the function runtime
Declaration
public CollectorStartFunction(object runtime)
Parameters
| Type | Name | Description |
|---|---|---|
| object | runtime | The runtime |
CollectorStartFunction(string)
New function instance without runtime (scripting development)
Declaration
protected CollectorStartFunction(string sourceFileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | sourceFileName | The name of the source file |
Remarks
Use GetSourceFileName(string) in your constructor for the source file name
Methods
View SourceGetValues()
Get collector values
Declaration
public decimal[] GetValues()
Returns
| Type | Description |
|---|---|
| decimal[] |
SetValues(decimal[])
Set collector values
Declaration
public void SetValues(decimal[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| decimal[] | values |
Start()
Entry point for the runtime
Declaration
public object Start()
Returns
| Type | Description |
|---|---|
| object |
Remarks
Internal usage only, do not call this method