Search Results for

    Show / Hide Table of Contents

    Class TriggerContext

    The context class that holds all the changes that triggered a IActionTriggerGate

    Inheritance
    object
    StandardFunctions
    FormulaFunctions
    FormulaFunctionsWithUpdater
    FormulaFunctionsWithContext<IBaseEntity>
    FormulaFunctionsWithContext
    TriggerContext
    Implements
    IFormulaFunctionsWithContext<IBaseEntity>
    IFormulaFunctionsWithContext
    IFormulaFunctions
    Inherited Members
    FormulaFunctionsWithContext<IBaseEntity>.TestEvents()
    FormulaFunctionsWithContext<IBaseEntity>.ItemAs<T1>()
    FormulaFunctionsWithContext<IBaseEntity>.SetExtendedPropertyValue(IBaseEntity, string, string, object)
    FormulaFunctionsWithContext<IBaseEntity>.SetBusy(string)
    FormulaFunctionsWithContext<IBaseEntity>.StopBusy()
    FormulaFunctionsWithContext<IBaseEntity>.CreateFormulaContext(Type)
    FormulaFunctionsWithContext<IBaseEntity>.GetValue<T2>(string)
    FormulaFunctionsWithContext<IBaseEntity>.GetAnswerTotal(string)
    FormulaFunctionsWithContext<IBaseEntity>.GetContextType(EntityDescriptor)
    FormulaFunctionsWithContext<IBaseEntity>.MyItem
    FormulaFunctionsWithContext<IBaseEntity>.Item
    FormulaFunctionsWithContext<IBaseEntity>.PropertyChangedItem
    FormulaFunctionsWithContext<IBaseEntity>.PropertyChangedName
    FormulaFunctionsWithContext<IBaseEntity>.PropertyChangedAlias
    FormulaFunctionsWithContext<IBaseEntity>.ChangedItemType
    FormulaFunctionsWithUpdater.SetCustomParameters(Dictionary<string, object>)
    FormulaFunctionsWithUpdater.CreateNewData()
    FormulaFunctionsWithUpdater.CreateNewItem(string)
    FormulaFunctionsWithUpdater.CreateNewItem<T>()
    FormulaFunctionsWithUpdater.GetCustomParamValue(string)
    FormulaFunctionsWithUpdater.HasCustomParamValue(string)
    FormulaFunctionsWithUpdater.HasCustomParamValueEqualTo(string, object)
    FormulaFunctionsWithUpdater.RunCodeSnippet(string, params string[])
    FormulaFunctionsWithUpdater.MyData
    FormulaFunctions.ShareThisQueryCacheWithTarget(IFormulaFunctions)
    FormulaFunctions.SetQueryRunnerHelper(Func<IEntityUpdater, ISQLWrapperInterpretor, Dictionary<string, string>, QueryableExecuter<ISQLWrapperResult>, Task<DataRow[]>>)
    FormulaFunctions.GetItemPropertyValue(object, string)
    FormulaFunctions.GetTaskID(string)
    FormulaFunctions.GetTaskParameter(string)
    FormulaFunctions.SetObjectValue(object, string, object)
    FormulaFunctions.GetObjectValue(object, string)
    FormulaFunctions.GetExtendedPropertyValue(IBaseEntity, string, string)
    FormulaFunctions.GetExtendedPropertyItem(IBaseEntity, string)
    FormulaFunctions.GetExtendedObject(IBaseEntity, string, bool)
    FormulaFunctions.GetEntityTypeID(string)
    FormulaFunctions.Evaluate<T>(string, bool)
    FormulaFunctions.IsValid<T>(string)
    FormulaFunctions.IsValid<T>(string, Type)
    FormulaFunctions.GetContextItemType(object)
    FormulaFunctions.GetItemFromDataSourceID(string, string)
    FormulaFunctions.GetItemFromDataSourceID(string, string, string)
    FormulaFunctions.GetItem(string, Guid)
    FormulaFunctions.GetItemAs<T>(Guid)
    FormulaFunctions.GetItems(string, QueryableFilter)
    FormulaFunctions.GetFirstOrDefaultItem(string, QueryableFilter)
    FormulaFunctions.GetItems(string, string, SQLOperator, object)
    FormulaFunctions.GetFirstOrDefaultItem(string, string, SQLOperator, object)
    FormulaFunctions.GetItems<T>(QueryableFilter)
    FormulaFunctions.GetFirstOrDefaultItem<T>(QueryableFilter)
    FormulaFunctions.GetItems<T>(string, SQLOperator, object)
    FormulaFunctions.GetFirstOrDefaultItem<T>(string, SQLOperator, object)
    FormulaFunctions.GetEnumValue(object)
    FormulaFunctions.GetEnumCode(object)
    FormulaFunctions.XIRR(string, string, string, params string[])
    FormulaFunctions.XIRR(string, string, string, (string, object)[], params string[])
    FormulaFunctions.TWR(string, string, string, string, params string[])
    FormulaFunctions.TWRRow(string, string, string, string, params string[])
    FormulaFunctions.RunQuery(string, string, params string[])
    FormulaFunctions.HasQueryResult(string, params string[])
    FormulaFunctions.GetQueryResult(ISQLWrapperResult, string)
    FormulaFunctions.GetQueryResult(DataRow, string)
    FormulaFunctions.GetQueryResult(string, string, ISQLWrapperResult)
    FormulaFunctions.GetQueryResult(string, string, DataRow)
    FormulaFunctions.GetQueryResult(string, string, ISQLWrapperResult[], string, object)
    FormulaFunctions.RunQueryResult(string, params string[])
    FormulaFunctions.RunDRQueryResult(string, params string[])
    FormulaFunctions.LogInfo(string, params object[])
    FormulaFunctions.LogError(Exception, string, params object[])
    FormulaFunctions.GetQueryCount(string, string, string)
    FormulaFunctions.GetQueryItems(string, string, string, string)
    FormulaFunctions.GetDRQueryItems(string, string, string, string)
    FormulaFunctions.Data
    FormulaFunctions.Cache
    FormulaFunctions.Services
    FormulaFunctions.User
    StandardFunctions.FormatAsString(object)
    StandardFunctions.Null()
    StandardFunctions.IsNull(object)
    StandardFunctions.Not(bool)
    StandardFunctions.Or(bool, bool)
    StandardFunctions.And(bool, bool)
    StandardFunctions.Sin(double)
    StandardFunctions.Cos(double)
    StandardFunctions.Now()
    StandardFunctions.Today()
    StandardFunctions.TodayString()
    StandardFunctions.EndOfMonth(DateTime)
    StandardFunctions.BeginningOfMonth(DateTime)
    StandardFunctions.BeginningOfWeek(DateTime)
    StandardFunctions.EndOfYear(DateTime)
    StandardFunctions.EndOfDay(DateTime)
    StandardFunctions.Floor(decimal)
    StandardFunctions.Ceiling(decimal)
    StandardFunctions.BeginningOfYear(DateTime)
    StandardFunctions.BeginningOfDay(DateTime)
    StandardFunctions.Random(int, int)
    StandardFunctions.Trim(string)
    StandardFunctions.TrimStart(string, char[])
    StandardFunctions.TrimEnd(string, char[])
    StandardFunctions.PadLeft(string, int, char)
    StandardFunctions.PadRight(string, int, char)
    StandardFunctions.Mod(double, double)
    StandardFunctions.If(bool, object, object)
    StandardFunctions.IsIn(object, object)
    StandardFunctions.IsIn(object, object, object)
    StandardFunctions.IsIn(object, object, object, object)
    StandardFunctions.IsIn(object, object, object, object, object)
    StandardFunctions.IsIn(object, object, object, object, object, object)
    StandardFunctions.IsIn(object, object, object, object, object, object, object)
    StandardFunctions.IsIn(object, object, object, object, object, object, object, object)
    StandardFunctions.IsIn(object, object, object, object, object, object, object, object, object)
    StandardFunctions.IsIn(object, object, object, object, object, object, object, object, object, object)
    StandardFunctions.IsIn(object, object, object, object, object, object, object, object, object, object, object)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.Format(object, string)
    StandardFunctions.Lower(string)
    StandardFunctions.Upper(string)
    StandardFunctions.WCase(string)
    StandardFunctions.Date(int, int, int)
    StandardFunctions.Year(DateTime)
    StandardFunctions.Month(DateTime)
    StandardFunctions.Day(DateTime)
    StandardFunctions.WeekDay(DateTime)
    StandardFunctions.Replace(string, string, string)
    StandardFunctions.Substr(string, int, int)
    StandardFunctions.Len(string)
    StandardFunctions.Abs(double)
    StandardFunctions.Int(object)
    StandardFunctions.Trunc(double, int)
    StandardFunctions.Dec(object)
    StandardFunctions.Round(object)
    StandardFunctions.IsBlank(string)
    StandardFunctions.Round(object, int)
    StandardFunctions.Min(double, double, double, double, double)
    StandardFunctions.Max(double, double, double, double, double)
    StandardFunctions.Chr(int)
    StandardFunctions.ChCR()
    StandardFunctions.ChLF()
    StandardFunctions.ChCRLF()
    StandardFunctions.Money(object)
    StandardFunctions.Contains(string, string)
    StandardFunctions.FormatDate(DateTime, string)
    StandardFunctions.Sqrt(double)
    StandardFunctions.Power(double, double)
    StandardFunctions.ValString(object)
    StandardFunctions.ValBool(object)
    StandardFunctions.ValDate(object)
    StandardFunctions.ValDateTimeOffset(object)
    StandardFunctions.ValDecimal(object)
    StandardFunctions.ValLong(object)
    StandardFunctions.ValID(object)
    StandardFunctions.DateAdd(DateTime, decimal, decimal, decimal)
    StandardFunctions.DateAdd(DateTimeOffset, decimal, decimal, decimal)
    StandardFunctions.DateAddWorkDays(DateTime, decimal)
    StandardFunctions.DateAdd(DateTime, DateTime)
    StandardFunctions.DayDifference(DateTime, DateTime)
    StandardFunctions.DayDifferenceWorkDays(DateTime, DateTime)
    StandardFunctions.HourDifference(DateTime, DateTime)
    StandardFunctions.MinuteDifference(DateTime, DateTime)
    StandardFunctions.YearDifference(DateTime, DateTime)
    StandardFunctions.NullDate()
    StandardFunctions.NullDateTimeOffset()
    StandardFunctions.TempValue1
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.API.Core.Tasks.Parameters.Triggers
    Assembly: LemonEdge.API.dll
    Syntax
    public class TriggerContext : FormulaFunctionsWithContext, IFormulaFunctionsWithContext<IBaseEntity>, IFormulaFunctionsWithContext, IFormulaFunctions

    Constructors

    TriggerContext(IEntityRetriever, IReadOnlyCache, UserInfo, IBaseEntity, IFormulaFunctionsServiceContext)

    Creates a new trigger context holding the information for the items that triggered a IActionTriggerGate

    Declaration
    public TriggerContext(IEntityRetriever retriever, IReadOnlyCache cache, UserInfo user, IBaseEntity item, IFormulaFunctionsServiceContext services)
    Parameters
    Type Name Description
    IEntityRetriever retriever

    A context for querying all the data in the syste,

    IReadOnlyCache cache

    A local cache

    UserInfo user

    The current logged in user

    IBaseEntity item

    The item in the system that this trigger is being activated by

    IFormulaFunctionsServiceContext services

    The services demanded from the IServiceProvider for the use in formulas

    Properties

    IsActionMatch

    Holds the custom action string from the parameters

    Declaration
    public string IsActionMatch { get; }
    Property Value
    Type Description
    string

    IsDeleted

    Indicates the triggered item was deleted as it has no current item, and only has a previous item

    Declaration
    public bool IsDeleted { get; }
    Property Value
    Type Description
    bool

    IsNew

    Indicates the triggered item is new, as it has no older version

    Declaration
    public bool IsNew { get; }
    Property Value
    Type Description
    bool

    IsUpdated

    Indicates the triggered item is not new, as it has an older version

    Declaration
    public bool IsUpdated { get; }
    Property Value
    Type Description
    bool

    NotifyItem

    The main item (of type EntityTypeID) that notifies the action to be triggered.

    Linked to through a relationship of the gate via ActionItemProperty

    Declaration
    public object NotifyItem { get; }
    Property Value
    Type Description
    object

    NotifyOldItem

    The previous version of the notification item. Will be null if the notification item is new

    Declaration
    public object NotifyOldItem { get; }
    Property Value
    Type Description
    object

    OldItem

    The previous version of the triggered MyItem. Will be null if the item is new, indicated with IsNew

    Declaration
    public object OldItem { get; }
    Property Value
    Type Description
    object

    Trigger

    The parent action trigger that would be triggered by this context

    Declaration
    public IActionTrigger Trigger { get; }
    Property Value
    Type Description
    IActionTrigger

    Methods

    GetNotifyOldValue(string)

    Returns the old value of the specified property of the NotifyItem. Returns the previous version if it exists, else returns the current value if the item is new

    Declaration
    public object GetNotifyOldValue(string propName)
    Parameters
    Type Name Description
    string propName

    The name of the property value to return from the item

    Returns
    Type Description
    object

    The old value of the specified property of the NotifyItem. Returns the previous version if it exists, else returns the current value if the item is new

    GetNotifyOldValue<T>(string)

    Returns the old value of the specified property of the NotifyItem. Returns the previous version if it exists, else returns the current value if the item is new

    Declaration
    public T GetNotifyOldValue<T>(string propName)
    Parameters
    Type Name Description
    string propName

    The name of the property value to return from the item

    Returns
    Type Description
    T

    The old value of the specified property of the NotifyItem. Returns the previous version if it exists, else returns the current value if the item is new

    Type Parameters
    Name Description
    T

    The type of the specified property value

    GetNotifyValue(string)

    Returns the value of the specified property of the NotifyItem. Returns the latest version if it exists, else returns the previous value if the item was deleted

    Declaration
    public object GetNotifyValue(string propName)
    Parameters
    Type Name Description
    string propName

    The name of the property value to return from the item

    Returns
    Type Description
    object

    The value of the specified property of the NotifyItem. Returns the latest version if it exists, else returns the previous value if the item was deleted

    GetNotifyValue<T>(string)

    Returns the value of the specified property of the NotifyItem. Returns the latest version if it exists, else returns the previous value if the item was deleted

    Declaration
    public T GetNotifyValue<T>(string propName)
    Parameters
    Type Name Description
    string propName

    The name of the property value to return from the item

    Returns
    Type Description
    T

    The value of the specified property of the NotifyItem. Returns the latest version if it exists, else returns the previous value if the item was deleted

    Type Parameters
    Name Description
    T

    The type of the specified property value

    GetOldValue(string)

    Returns the old value of the specified property of the MyItem. Returns the previous version if it exists, else returns the current value if the item is new

    Declaration
    public object GetOldValue(string propName)
    Parameters
    Type Name Description
    string propName

    The name of the property value to return from the item

    Returns
    Type Description
    object

    The old value of the specified property of the MyItem. Returns the previous version if it exists, else returns the current value if the item is new

    GetOldValue<T>(string)

    Returns the old value of the specified property of the MyItem. Returns the previous version if it exists, else returns the current value if the item is new

    Declaration
    public T GetOldValue<T>(string propName)
    Parameters
    Type Name Description
    string propName

    The name of the property value to return from the item

    Returns
    Type Description
    T

    The old value of the specified property of the MyItem. Returns the previous version if it exists, else returns the current value if the item is new

    Type Parameters
    Name Description
    T

    The type of the specified property value

    GetValue(string)

    Returns the value of the specified property of the MyItem. Returns the latest version if it exists, else returns the previous value if the item was deleted

    Declaration
    public override object GetValue(string propName)
    Parameters
    Type Name Description
    string propName

    The name of the property value to return from the item

    Returns
    Type Description
    object

    The value of the specified property of the MyItem. Returns the latest version if it exists, else returns the previous value if the item was deleted

    Overrides
    FormulaFunctionsWithContext<IBaseEntity>.GetValue(string)

    HasNotifyValueChanged(string)

    Returns true if the value of the specified property has changed from the previous version to the current version of the NotifyItem and NotifyOldItem

    Declaration
    public bool HasNotifyValueChanged(string propName)
    Parameters
    Type Name Description
    string propName

    The name of the property value to see if it has changed between versions

    Returns
    Type Description
    bool

    True if the value of the specified property has changed from the previous version to the current version

    HasValueChanged(string)

    Returns true if the value of the specified property has changed from the previous version to the current version of the MyItem and OldItem

    Declaration
    public bool HasValueChanged(string propName)
    Parameters
    Type Name Description
    string propName

    The name of the property value to see if it has changed between versions

    Returns
    Type Description
    bool

    True if the value of the specified property has changed from the previous version to the current version

    NotifyItemAs<T>()

    The item that notifies the action to be triggered (NotifyItem) as the correct type

    Declaration
    public T NotifyItemAs<T>()
    Returns
    Type Description
    T

    The NotifyItem as the correct type

    Type Parameters
    Name Description
    T

    The type to cast the notification item as

    NotifyOldItemAs<T>()

    The previous version of the item that notifies the action to be triggered (NotifyItem) as the correct type

    Declaration
    public T NotifyOldItemAs<T>()
    Returns
    Type Description
    T

    The NotifyOldItem as the correct type

    Type Parameters
    Name Description
    T

    The type to cast the notification item as

    OldItemAs<T>()

    The previous version of the triggered MyItem. Will be null if the item is new, indicated with IsNew

    Declaration
    public T OldItemAs<T>()
    Returns
    Type Description
    T

    The previous version of the item as the correct type

    Type Parameters
    Name Description
    T

    The type the old version should be cast to

    Implements

    IFormulaFunctionsWithContext<T>
    IFormulaFunctionsWithContext
    IFormulaFunctions

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.