Show / Hide Table of Contents

Class PayrunFunction

Payrun function

Inheritance
object
Function
PayrollFunction
PayrunFunction
CollectorFunction
PayrunEmployeeAvailableFunction
PayrunEmployeeEndFunction
PayrunEmployeeStartFunction
PayrunEndFunction
PayrunStartFunction
PayrunWageTypeAvailableFunction
WageTypeFunction
Implements
IDisposable
Inherited Members
PayrollFunction.StringType
PayrollFunction.IntType
PayrollFunction.NumericType
PayrollFunction.DecimalType
PayrollFunction.DateType
PayrollFunction.TimeSpanType
PayrollFunction.BooleanType
PayrollFunction.HasFieldValue(string)
PayrollFunction.GetFieldValue(string)
PayrollFunction.HasLookupValue(string, ActionValue, string)
PayrollFunction.HasLookupValue(string, ActionValue, ActionValue, string)
PayrollFunction.GetLookupValue(string, ActionValue, string)
PayrollFunction.GetLookupValue(string, ActionValue, ActionValue, string)
PayrollFunction.ApplyRangeLookupValue(string, decimal, string)
PayrollFunction.Min(params ActionValue[])
PayrollFunction.Min(ActionValue, ActionValue)
PayrollFunction.Max(params ActionValue[])
PayrollFunction.Max(ActionValue, ActionValue)
PayrollFunction.Within(ActionValue, ActionValue, ActionValue)
PayrollFunction.Range(ActionValue, ActionValue, ActionValue)
PayrollFunction.Concat(params ActionValue[])
PayrollFunction.Contains(ActionValue, params ActionValue[])
PayrollFunction.GetTimeSpan(ActionValue, ActionValue)
PayrollFunction.SameYear(ActionValue, ActionValue)
PayrollFunction.SameMonth(ActionValue, ActionValue)
PayrollFunction.SameDay(ActionValue, ActionValue)
PayrollFunction.YearDiff(ActionValue, ActionValue)
PayrollFunction.Age(ActionValue, ActionValue)
PayrollFunction.IsNull(ActionValue)
PayrollFunction.IsNotNull(ActionValue)
PayrollFunction.IfNull(ActionValue, ActionValue)
PayrollFunction.IIf(bool, ActionValue, ActionValue)
PayrollFunction.SetNamespace(string, string)
PayrollFunction.Log(string, LogLevel)
PayrollFunction.GetCalendarPeriod(DateTime?, int)
PayrollFunction.GetCalendarDayCount(string)
PayrollFunction.GetEmployeeAttribute(string)
PayrollFunction.GetEmployeeAttribute<T>(string, T)
PayrollFunction.GetCycle(int)
PayrollFunction.GetCycle(DateTime, int)
PayrollFunction.GetPeriods(int, int)
PayrollFunction.GetCyclePeriods()
PayrollFunction.GetPastCyclePeriods(bool)
PayrollFunction.GetFutureCyclePeriods(bool)
PayrollFunction.IsFirstCycleDay(DateTime)
PayrollFunction.IsLastCycleDay(DateTime)
PayrollFunction.PastPeriod()
PayrollFunction.FuturePeriod()
PayrollFunction.GetPeriod(int)
PayrollFunction.GetPeriod(DateTime, int)
PayrollFunction.GetPeriodOffset(DateTime)
PayrollFunction.IsFirstPeriodDay(DateTime)
PayrollFunction.IsLastPeriodDay(DateTime)
PayrollFunction.GetCaseValueType(string)
PayrollFunction.HasCaseFieldAttribute(string, string)
PayrollFunction.GetCaseFieldAttribute(string, string)
PayrollFunction.GetCaseFieldAttribute<T>(string, string, T)
PayrollFunction.HasCaseValueAttribute(string, string)
PayrollFunction.GetCaseValueAttribute(string, string)
PayrollFunction.GetCaseValueAttribute<T>(string, string, T)
PayrollFunction.TestAvailableCaseValues(IEnumerable<string>)
PayrollFunction.TestAvailableCaseValues(DatePeriod, IEnumerable<string>)
PayrollFunction.GetFirstAvailableCaseValue(IEnumerable<string>)
PayrollFunction.GetFirstAvailableCaseValue(DatePeriod, IEnumerable<string>)
PayrollFunction.GetFirstUnavailableCaseValue(IEnumerable<string>)
PayrollFunction.GetFirstUnavailableCaseValue(DatePeriod, IEnumerable<string>)
PayrollFunction.CaseFieldSlot(string, string)
PayrollFunction.GetPeriodCaseValue<T>(DatePeriod, string, string)
PayrollFunction.GetPeriodCaseValue(DatePeriod, string, string)
PayrollFunction.GetPeriodCaseValues(DatePeriod, params string[])
PayrollFunction.GetPeriodCaseValues(int, params string[])
PayrollFunction.GetPeriodCaseValue<T>(int, string, string)
PayrollFunction.GetPeriodCaseValue(int, string, string)
PayrollFunction.GetCaseValue<T>(string, string)
PayrollFunction.GetCaseValue(string, string)
PayrollFunction.GetPeriodCaseValue(int, int, string, string)
PayrollFunction.GetMultiPeriodCaseValues(int, int, params string[])
PayrollFunction.GetRawCaseValue(string, DateTime)
PayrollFunction.GetRawCaseValues(IList<string>, DateTime)
PayrollFunction.GetRawCaseValue<T>(string, DateTime)
PayrollFunction.GetPeriodRawCaseValues(string, DatePeriod)
PayrollFunction.GetPeriodRawCaseValues(string)
PayrollFunction.GetPeriodRawCaseValues(string, int)
PayrollFunction.GetRawCaseValues(string, DateTime?, DateTime?)
PayrollFunction.GetCaseObjectValues<T>(bool, bool)
PayrollFunction.GetCaseObject<T>(List<CasePayrollValue>, DateTime)
PayrollFunction.GetRawCaseObject<T>(DateTime, bool)
PayrollFunction.GetPeriodRawCaseObjects<T>(List<DateTime>, bool)
PayrollFunction.GetCaseValues(params string[])
PayrollFunction.GetCaseValueTags(string)
PayrollFunction.GetCaseValueTags(string, DateTime)
PayrollFunction.GetCaseValueSlots(string)
PayrollFunction.GetSlotValues(string)
PayrollFunction.GetSlotValues<T>(string)
PayrollFunction.GetSlotByValue(string, string, string)
PayrollFunction.HasLookup(string)
PayrollFunction.GetLookup<T>(string, string, string)
PayrollFunction.GetLookup<T>(string, object[], string)
PayrollFunction.GetObjectLookup<T>(string, string, string, string)
PayrollFunction.GetLookupRanges(string, decimal?)
PayrollFunction.GetLookupThresholdRange(string, decimal)
PayrollFunction.GetLookupProgressiveRanges(string, decimal)
PayrollFunction.GetRangeLookup<T>(string, decimal, string, string)
PayrollFunction.GetRangeObjectLookup<T>(string, decimal, string, string, string)
PayrollFunction.ApplyRangeValue(string, decimal, string)
PayrollFunction.GetAttributeIssue(string, params object[])
PayrollFunction.None
PayrollFunction.Null
PayrollFunction.PayrollId
PayrollFunction.Namespace
PayrollFunction.HasNamespace
PayrollFunction.DivisionId
PayrollFunction.PayrollCulture
PayrollFunction.EmployeeId
PayrollFunction.EmployeeIdentifier
PayrollFunction.CycleStart
PayrollFunction.CycleStartYear
PayrollFunction.CycleStartMonth
PayrollFunction.CycleStartDay
PayrollFunction.CycleEnd
PayrollFunction.CycleEndYear
PayrollFunction.CycleEndMonth
PayrollFunction.CycleEndDay
PayrollFunction.CycleDuration
PayrollFunction.Cycle
PayrollFunction.CycleDays
PayrollFunction.PreviousCycle
PayrollFunction.NextCycle
PayrollFunction.EvaluationDate
PayrollFunction.EvaluationPeriod
PayrollFunction.Periods
PayrollFunction.PeriodStart
PayrollFunction.PeriodStartYear
PayrollFunction.PeriodStartMonth
PayrollFunction.PeriodStartDay
PayrollFunction.PeriodEnd
PayrollFunction.PeriodEndYear
PayrollFunction.PeriodEndMonth
PayrollFunction.PeriodEndDay
PayrollFunction.PeriodDuration
PayrollFunction.Period
PayrollFunction.PeriodDays
PayrollFunction.PreviousPeriod
PayrollFunction.NextPeriod
PayrollFunction.FirstCyclePeriod
PayrollFunction.LastCyclePeriod
PayrollFunction.CycleStartOffset
PayrollFunction.CycleEndOffset
PayrollFunction.PastCyclePeriods
PayrollFunction.FutureCyclePeriods
PayrollFunction.PeriodsInCycle
PayrollFunction.CaseValue
PayrollFunction.CaseValueTags
Function.GetTenantAttribute(string)
Function.GetTenantAttribute<T>(string, T)
Function.GetUserAttribute(string)
Function.GetUserAttribute<T>(string, T)
Function.GetDerivedCulture(int, int)
Function.GetDerivedCalendar(int, int)
Function.GetCalendarDayCount(DateTime, DateTime, string)
Function.GetCalendarDayCount(string, DateTime, DateTime, string)
Function.IsCalendarWorkDay(string, DateTime?)
Function.IsCalendarWorkDay(DateTime?)
Function.GetPreviousWorkDay(string, DateTime?)
Function.GetPreviousWorkDays(string, DateTime?, int)
Function.GetNextWorkDay(string, DateTime?)
Function.GetNextWorkDays(string, DateTime?, int)
Function.GetCalendarPeriod(DateTime?, int, int, int)
Function.GetCalendarPeriod(string, DateTime?, int, string)
Function.LogVerbose(string, string, string)
Function.LogDebug(string, string, string)
Function.LogInformation(string, string, string)
Function.LogWarning(string, string, string)
Function.LogError(string, string, string)
Function.LogError(Exception, string, string)
Function.LogFatal(string, string, string)
Function.LogFatal(Exception, string, string)
Function.Log(LogLevel, string, string, string)
Function.AddTask(string, string, DateTime, string, Dictionary<string, object>)
Function.InvokeWebhook<T>(string, object)
Function.GetSourceFileName(string)
Function.ChangeValueType<T>(object, T, IFormatProvider)
Function.Dispose()
Function.Runtime
Function.TenantId
Function.TenantIdentifier
Function.UserId
Function.UserIdentifier
Function.UserCulture
Function.UserType
Function.SelfServiceUser
Function.AdminUser
Function.SourceFileName
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
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 Source

PayrunFunction(object)

Initializes a new instance with the function runtime

Declaration
protected PayrunFunction(object runtime)
Parameters
Type Name Description
object runtime

The runtime

View Source

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 Source

CycleName

The cycle name

Declaration
[ActionProperty("Cycle name", null)]
public string CycleName { get; }
Property Value
Type Description
string
View Source

ExecutionPhase

The current execution phase of the payrun job (e.g. Setup, Execution, Cleanup)

Declaration
public PayrunExecutionPhase ExecutionPhase { get; }
Property Value
Type Description
PayrunExecutionPhase
View Source

Forecast

Forecast name

Declaration
[ActionProperty("Forecast name", null)]
public string Forecast { get; }
Property Value
Type Description
string
View Source

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
View Source

IsForecast

True for a forecast payrun

Declaration
[ActionProperty("Test for forecast", null)]
public bool IsForecast { get; }
Property Value
Type Description
bool
View Source

IsRetroPayrun

True for a retro payrun

Declaration
[ActionProperty("Test for retro payrun", null)]
public bool IsRetroPayrun { get; }
Property Value
Type Description
bool
View Source

PayrunId

The payrun id

Declaration
public int PayrunId { get; }
Property Value
Type Description
int
View Source

PayrunName

The payrun name

Declaration
[ActionProperty("Payrun name", null)]
public string PayrunName { get; }
Property Value
Type Description
string
View Source

PeriodName

The period name

Declaration
[ActionProperty("Period name", null)]
public string PeriodName { get; }
Property Value
Type Description
string
View Source

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.

View Source

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 Source

GetCollectorCycleResults(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).

View Source

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).

View Source

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

View Source

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; null for committed results

PayrunJobStatus? jobStatus

Optional job status filter; null returns all statuses

IEnumerable<string> tags

Optional tag filter

Returns
Type Description
IList<CollectorResult>

List of CollectorResult within the date range

View Source

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.

View Source

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.

View Source

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.

View Source

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.

View Source

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
View Source

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
View Source

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
View Source

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 null when the key does not exist

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).

View Source

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 default(T) when the key does not exist

Type Parameters
Name Description
T

The target type; the stored JSON string is deserialized into this type

View Source

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 null when the attribute does not exist

View Source

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 defaultValue when not found

Type Parameters
Name Description
T

The expected value type

View Source

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 null when no result with that name exists

View Source

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
View Source

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 defaultValue when not found

Type Parameters
Name Description
T

The expected value type

View Source

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 null when the key does not exist

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.

View Source

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 default(T) when the key does not exist

Type Parameters
Name Description
T

The target type; the stored JSON string is deserialized into this type

View Source

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).

View Source

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

View Source

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
View Source

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
View Source

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
View Source

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.

View Source

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).

View Source

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

View Source

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.

View Source

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

View Source

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; null for committed results

PayrunJobStatus? jobStatus

Optional job status filter; null returns all statuses

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

View Source

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)

View Source

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.

View Source

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

true if the key is present; false otherwise

View Source

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

true if the key is present; false otherwise

View Source

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

true if the attribute existed and was removed; false otherwise

View Source

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
View Source

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 null to delete the entry

View Source

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 null to delete the entry

Type Parameters
Name Description
T

The value type to serialize

View Source

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

View Source

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 value when null

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.

View Source

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 value when null

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.

View Source

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
View Source

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 null to delete the entry

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.

View Source

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

View Source

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

Implements

IDisposable

Extension Methods

ConsoleExtensions.WriteProperties(object, bool)
ValueTypeExtensions.GetValueType(object)
ObjectInfo.GetPropertyValue(object, string)
ObjectInfo.GetPropertyValue<T>(object, string, T)
ObjectInfo.ResolvePropertyValue(object, string)
ObjectInfo.SetPropertyValue(object, string, object)
  • View Source
☀
☾
Back to top Generated by DocFX