Search Results for

    Show / Hide Table of Contents

    Class PathProcessor

    A processor for determining the Level each entity within a path sits at and also ensures all changes that affect a path result in an updated compiledpath set of entries

    Runs on saving changes to any IAllocationPathRule or IAllocationPath to ensure levels are always consistent and correct

    See https://help.lemonedge.com/allocation-paths/ for more information
    Inheritance
    object
    PathProcessor
    Implements
    IBaseDataSetProcessorWithDBSave
    IBaseDataSetProcessor
    IProcessor
    IDisposable
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.API.Core.FinancialServices.Processors
    Assembly: LemonEdge.API.Core.FinancialServices.dll
    Syntax
    public class PathProcessor : IBaseDataSetProcessorWithDBSave, IBaseDataSetProcessor, IProcessor, IDisposable

    Properties

    Cache

    A local cache for performance

    Declaration
    public IReadOnlyCache Cache { get; }
    Property Value
    Type Description
    IReadOnlyCache

    IgnoreEvents

    Indicates the processor should ignore changes to any items within the processor

    Normally used when the processor responds to an event and wants to prevent any other responses while it finishes processing that change

    Declaration
    public bool IgnoreEvents { get; set; }
    Property Value
    Type Description
    bool

    Loaded

    Flag to indicate if the processor has been fully loaded

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

    Order

    If we have multiple save processors working, this indicates the order in which they will be processed with relation to each other

    Declaration
    public short Order { get; }
    Property Value
    Type Description
    short

    PathRules

    Declaration
    public IEnumerable<IAllocationPathRule> PathRules { get; }
    Property Value
    Type Description
    IEnumerable<IAllocationPathRule>

    Reporter

    A reporter to provide feedback to a log, or client depending on the context the process is running under

    Declaration
    public BusyProgressReporter Reporter { get; set; }
    Property Value
    Type Description
    BusyProgressReporter

    Rules

    Declaration
    public IEnumerable<IAllocationRule> Rules { get; }
    Property Value
    Type Description
    IEnumerable<IAllocationRule>

    SaveProcessed

    Indicates the ProcessOnDBSave has already been run. This is set by the system during save, and prevents recursive calls.

    It is also released by the system on save completion/failure

    Declaration
    public bool SaveProcessed { get; set; }
    Property Value
    Type Description
    bool

    Updater

    A context to ensure the process can query, load and modify all LemonEdge data

    Declaration
    public IEntityUpdater Updater { get; }
    Property Value
    Type Description
    IEntityUpdater

    User

    The current logged in user the process is running under

    Declaration
    public UserInfo User { get; }
    Property Value
    Type Description
    UserInfo

    Methods

    AddToDataSetToProcess(IBaseEntity, EntityOperation)

    Adds the specified IAllocationPathRule or IAllocationPath to this processor

    Declaration
    public void AddToDataSetToProcess(IBaseEntity item, EntityOperation operationType)
    Parameters
    Type Name Description
    IBaseEntity item

    THe IAllocationPathRule or IAllocationPath to add that is a part of this processor

    EntityOperation operationType

    The type of modification this item has

    CalculateCompiledPaths()

    Declaration
    public Task CalculateCompiledPaths()
    Returns
    Type Description
    Task

    CompletePath()

    Declaration
    public Task CompletePath()
    Returns
    Type Description
    Task

    Dispose()

    Declaration
    public void Dispose()

    Dispose(bool)

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    GetAllowableEntityIDsInPath()

    Returns a list of the valid ids for entities within the EntitySetID that can be added to this allocation path

    Declaration
    public Task<IEnumerable<Guid>> GetAllowableEntityIDsInPath()
    Returns
    Type Description
    Task<IEnumerable<Guid>>

    A task with a list of the valid ids for entities within the EntitySetID that can be added to this allocation path

    IsChangedItemPartOfDataSet(IBaseEntity)

    Returns true for a IAllocationPathRule or IAllocationPath that is part of the path this processor handles

    Declaration
    public bool IsChangedItemPartOfDataSet(IBaseEntity item)
    Parameters
    Type Name Description
    IBaseEntity item

    The item to see if it belongs in this processor

    Returns
    Type Description
    bool

    True for a IAllocationPathRule or IAllocationPath that is part of the path this processor handles

    Load()

    A thread safe implementation to load all required data for the processor

    Once completed Loaded should return true.

    Declaration
    public Task Load()
    Returns
    Type Description
    Task

    A task indicating the completion of the load operation

    OnPathEntitySetChanged()

    Indicates the allocation path rules have changed and the processor needs to reload all the entities within the path

    Declaration
    public void OnPathEntitySetChanged()

    ProcessOnDBSave()

    Calculates the correct level (Level) for each entity in the path

    Declaration
    public Task ProcessOnDBSave()
    Returns
    Type Description
    Task

    A task indicating the completion of the operation

    RollbackChanges()

    Changes are valid within the context anyway and do not need to be rolled back on failure

    Declaration
    public Task RollbackChanges()
    Returns
    Type Description
    Task

    A task indicating the completion of the operation

    UpdateLevels()

    Updates all the Level values for the entities in the path to correctly reflect their order through the path

    Declaration
    public Task UpdateLevels()
    Returns
    Type Description
    Task

    A task indicating the completion of the operation

    Validate()

    Any changes are valid within the context anyway

    Declaration
    public Task Validate()
    Returns
    Type Description
    Task

    A task indicating the completion of the operation

    Implements

    IBaseDataSetProcessorWithDBSave
    IBaseDataSetProcessor
    IProcessor
    IDisposable

    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)

    See Also

    IAllocationPath
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.