Show / Hide Table of Contents

Class CaseRelationBuildFunction

Populates target case fields based on source case values when a case relation is applied.

Inheritance
object
Function
PayrollFunction
CaseRelationFunction
CaseRelationBuildFunction
Implements
IDisposable
Inherited Members
CaseRelationFunction.GetSourceStart(string)
CaseRelationFunction.GetSourceEnd(string)
CaseRelationFunction.GetSourceValueType(string)
CaseRelationFunction.GetSourceValue(string)
CaseRelationFunction.GetSourceValue(string, object)
CaseRelationFunction.GetSourceValue<T>(string)
CaseRelationFunction.GetSourceValue<T>(string, T)
CaseRelationFunction.GetSourcePayrollValue(string)
CaseRelationFunction.GetSourcePeriod(string)
CaseRelationFunction.GetSourceFieldNames()
CaseRelationFunction.HasSourceFields()
CaseRelationFunction.HasSourceField(string)
CaseRelationFunction.IsSourceFieldComplete(string)
CaseRelationFunction.IsSourceFieldEmpty(string)
CaseRelationFunction.HasSourceStart(string)
CaseRelationFunction.HasSourceEnd(string)
CaseRelationFunction.HasSourceValue(string)
CaseRelationFunction.SourceValueEquals<T>(string, T)
CaseRelationFunction.SourceValueContainsCsvToken(string, string)
CaseRelationFunction.SourceValueIsWithin(string, int, int)
CaseRelationFunction.SourceValueIsWithin(string, decimal, decimal)
CaseRelationFunction.GetSourceCaseAttribute(string)
CaseRelationFunction.GetSourceCaseAttribute<T>(string, T)
CaseRelationFunction.GetSourceCaseFieldAttribute(string, string)
CaseRelationFunction.GetSourceCaseFieldAttribute<T>(string, string, T)
CaseRelationFunction.GetSourceCaseValueAttribute(string, string)
CaseRelationFunction.GetSourceCaseValueAttribute<T>(string, string, T)
CaseRelationFunction.GetTargetStart(string)
CaseRelationFunction.SetTargetStart(string, DateTime?)
CaseRelationFunction.GetTargetEnd(string)
CaseRelationFunction.SetTargetEnd(string, DateTime?)
CaseRelationFunction.GetTargetValue(string)
CaseRelationFunction.GetTargetValue(string, object)
CaseRelationFunction.GetTargetValue<T>(string)
CaseRelationFunction.GetTargetValue<T>(string, T)
CaseRelationFunction.SetTargetValue(string, object)
CaseRelationFunction.GetTargetPayrollValue(string)
CaseRelationFunction.SetTargetPayrollValue(string, PayrollValue)
CaseRelationFunction.GetTargetPeriod(string)
CaseRelationFunction.GetTargetFieldNames()
CaseRelationFunction.HasTargetFields()
CaseRelationFunction.HasTargetField(string)
CaseRelationFunction.IsTargetFieldComplete(string)
CaseRelationFunction.IsTargetFieldEmpty(string)
CaseRelationFunction.TargetFieldAvailable(string)
CaseRelationFunction.TargetFieldAvailable(string, bool)
CaseRelationFunction.HasTargetStart(string)
CaseRelationFunction.InitTargetStart(string, DateTime?)
CaseRelationFunction.HasTargetEnd(string)
CaseRelationFunction.InitTargetEnd(string, DateTime?)
CaseRelationFunction.GetTargetValueType(string)
CaseRelationFunction.HasTargetValue(string)
CaseRelationFunction.InitTargetValue(string, object)
CaseRelationFunction.TargetValueEquals<T>(string, T)
CaseRelationFunction.TargetValueContainsCsvToken(string, string)
CaseRelationFunction.TargetValueHasSourceSlotCsvToken(string)
CaseRelationFunction.TargetValueIsWithin(string, int, int)
CaseRelationFunction.TargetValueIsWithin(string, decimal, decimal)
CaseRelationFunction.GetTargetCaseAttribute(string)
CaseRelationFunction.GetTargetCaseAttribute<T>(string, T)
CaseRelationFunction.GetTargetCaseFieldAttribute(string, string)
CaseRelationFunction.GetTargetCaseFieldAttribute<T>(string, string, T)
CaseRelationFunction.GetTargetCaseValueAttribute(string, string)
CaseRelationFunction.GetTargetCaseValueAttribute<T>(string, string, T)
CaseRelationFunction.InitStart(string, string)
CaseRelationFunction.CopyStart(string, string)
CaseRelationFunction.InitEnd(string, string)
CaseRelationFunction.CopyEnd(string, string)
CaseRelationFunction.InitValue(string, string)
CaseRelationFunction.CopyValue(string, string)
CaseRelationFunction.SourceCaseName
CaseRelationFunction.SourceCaseSlot
CaseRelationFunction.SourceCaseCancellationDate
CaseRelationFunction.SourceCaseCancellation
CaseRelationFunction.SourceStart
CaseRelationFunction.SourceEnd
CaseRelationFunction.SourceValue
CaseRelationFunction.SourcePayrollValue
CaseRelationFunction.TargetCaseName
CaseRelationFunction.TargetCaseSlot
CaseRelationFunction.TargetCaseCancellationDate
CaseRelationFunction.TargetCaseCancellation
CaseRelationFunction.TargetStart
CaseRelationFunction.TargetEnd
CaseRelationFunction.TargetValue
CaseRelationFunction.TargetPayrollValue
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 class CaseRelationBuildFunction : CaseRelationFunction, IDisposable
Remarks

This function runs whenever the source case is submitted and the relation is evaluated. It transfers, transforms, or derives values from the source case into the target case fields.

Available source accessors (read-only):

  • SourceValue — indexer for source field values.
  • SourceStart — indexer for source field start dates.
  • SourceEnd — indexer for source field end dates.
  • HasSourceValue(string) — test for defined source values.

Available target mutators (read-write):

  • TargetValue — set a target field value.
  • TargetStart — set the target field start date.
  • TargetEnd — set the target field end date.
  • CopyValue(string, string), CopyStart(string, string), CopyEnd(string, string) — copy fields unconditionally.
  • InitValue(string, string), InitStart(string, string), InitEnd(string, string) — copy fields only if not already set.

Return value: Return null to indicate a successful build. Return false to abort the build without modifying target fields.

Low-Code / No-Code: Field transfer can be expressed through action expressions using CaseRelationBuildAction attributes — no C# scripting required. The Build() entry point invokes all registered actions before executing any inline script body.

Examples
// Copy wage from source to target with an 8 % surcharge
TargetValue["Wage"] = (decimal)SourceValue["Wage"] * 1.08m;
TargetStart["Wage"] = SourceStart["Wage"];
// Copy start date, shift end date by 3 months
CopyStart("Contract", "Contract");
TargetEnd["Contract"] = SourceEnd["Contract"]?.AddMonths(3);

Constructors

View Source

CaseRelationBuildFunction(object)

Initializes a new instance with the function runtime

Declaration
public CaseRelationBuildFunction(object runtime)
Parameters
Type Name Description
object runtime

The runtime

View Source

CaseRelationBuildFunction(string)

New function instance without runtime (scripting development)

Declaration
protected CaseRelationBuildFunction(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 Source

Build()

Entry point for the runtime

Declaration
public bool? Build()
Returns
Type Description
bool?
Remarks

Internal usage only, do not call this method

View Source

GetSourceFieldEnd(string)

Get the case relation source field end date

Declaration
[ActionParameter("field", "The case field on the target case", new string[] { "String" }, null, null)]
[CaseRelationBuildAction("GetSourceFieldEnd", "Get the case relation source field end date", new string[] { "RelationField" })]
public ActionValue GetSourceFieldEnd(string field)
Parameters
Type Name Description
string field

The case field on the source case

Returns
Type Description
ActionValue
View Source

GetSourceFieldStart(string)

Get the case relation source field start date

Declaration
[ActionParameter("field", "The case field on the target case", new string[] { "String" }, null, null)]
[CaseRelationBuildAction("GetSourceFieldStart", "Get the case relation source field start date", new string[] { "RelationField" })]
public ActionValue GetSourceFieldStart(string field)
Parameters
Type Name Description
string field

The case field on the source case

Returns
Type Description
ActionValue
View Source

GetSourceFieldValue(string)

Get the case relation source field value

Declaration
[ActionParameter("field", "The case field on the source case", new string[] { "String" }, null, null)]
[CaseRelationBuildAction("GetSourceFieldValue", "Det the case relation source field value", new string[] { "RelationField" })]
public ActionValue GetSourceFieldValue(string field)
Parameters
Type Name Description
string field

The case field on the source case

Returns
Type Description
ActionValue
View Source

GetTargetFieldEnd(string)

Get the case relation target field end date

Declaration
[ActionParameter("field", "The case field on the target case", new string[] { "String" }, null, null)]
[CaseRelationBuildAction("GetTargetFieldEnd", "Get the case relation target field end date", new string[] { "RelationField" })]
public ActionValue GetTargetFieldEnd(string field)
Parameters
Type Name Description
string field

The case field on the target case

Returns
Type Description
ActionValue
View Source

GetTargetFieldStart(string)

Get the case relation target field start date

Declaration
[ActionParameter("field", "The case field on the target case", new string[] { "String" }, null, null)]
[CaseRelationBuildAction("GetTargetFieldStart", "Get the case relation target field start date", new string[] { "RelationField" })]
public ActionValue GetTargetFieldStart(string field)
Parameters
Type Name Description
string field

The case field on the target case

Returns
Type Description
ActionValue
View Source

GetTargetFieldValue(string)

Get the case relation target field value

Declaration
[ActionParameter("field", "The case field on the target case", new string[] { "String" }, null, null)]
[CaseRelationBuildAction("GetTargetFieldValue", "Get the case relation target field value", new string[] { "RelationField" })]
public ActionValue GetTargetFieldValue(string field)
Parameters
Type Name Description
string field

The case field on the target case

Returns
Type Description
ActionValue
View Source

SetTargetFieldEnd(string, DateTime?)

Set the case relation target field end date

Declaration
[ActionParameter("field", "The case field on the target case", new string[] { "String" }, null, null)]
[ActionParameter("end", "The end date to set", new string[] { "Date" }, null, null)]
[CaseRelationBuildAction("SetTargetFieldEnd", "Set the case relation target field change end date", new string[] { "RelationField" })]
public void SetTargetFieldEnd(string field, DateTime? end)
Parameters
Type Name Description
string field

The case field on the target case

DateTime? end

The end date to set

View Source

SetTargetFieldStart(string, DateTime?)

Set the case relation target field start date

Declaration
[ActionParameter("field", "The case field on the target case", new string[] { "String" }, null, null)]
[ActionParameter("start", "The start date to set", new string[] { "Date" }, null, null)]
[CaseRelationBuildAction("SetTargetFieldStart", "Set the case relation target field change start date", new string[] { "RelationField" })]
public void SetTargetFieldStart(string field, DateTime? start)
Parameters
Type Name Description
string field

The case field on the target case

DateTime? start

The start date to set

View Source

SetTargetFieldValue(string, object)

Set the case relation target field value

Declaration
[ActionParameter("field", "The case field on the target case", new string[] { "String" }, null, null)]
[ActionParameter("value", "The value to set", null, null, null)]
[CaseRelationBuildAction("SetTargetFieldValue", "Set the case relation target field value", new string[] { "RelationField" })]
public void SetTargetFieldValue(string field, object value)
Parameters
Type Name Description
string field

The case field on the target case

object value

The value to set

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)

See Also

CaseRelationValidateFunction
  • View Source
☀
☾
Back to top Generated by DocFX