Class EventFeatures

Namespace
Cratis.Chronicle.Concepts.Patterns
Assembly
Cratis.Chronicle.dll

Represents the bounded set of contextual facts extracted from a single event before it is fed into pattern mining.

public record EventFeatures : IEquatable<EventFeatures>
Inheritance
EventFeatures
Implements
Inherited Members
Extension Methods

Remarks

Features are derived per event and discarded once mined - nothing here is persisted. Every time-derived value comes from the event's own occurred timestamp, never from wall-clock time at processing, so a backdated append and a replay both land in the bucket the event actually belongs to.

Constructors

EventFeatures(EventFeatures)

protected EventFeatures(EventFeatures original)

Parameters

original EventFeatures

EventFeatures(PatternGroupingKey, FacetValue, InitiatorType, FacetValue, FacetValue, FacetValue, FacetValue, FacetValue, int, int, DayOfWeek, TimeBucket, DateTimeOffset)

Represents the bounded set of contextual facts extracted from a single event before it is fed into pattern mining.

public EventFeatures(PatternGroupingKey GroupingKey, FacetValue CommandType, InitiatorType InitiatorType, FacetValue InitiatorId, FacetValue OnBehalfOf, FacetValue CausedByCommand, FacetValue CorrelationRootId, FacetValue AggregateType, int Year, int Month, DayOfWeek Day, TimeBucket TimeBucket, DateTimeOffset Occurred)

Parameters

GroupingKey PatternGroupingKey

The scope the behavior belongs to - typically the user that caused the event.

CommandType FacetValue

The type of command, or the event type when nothing above it named itself.

InitiatorType InitiatorType

What kind of initiator caused the event.

InitiatorId FacetValue

The identifier of the initiator.

OnBehalfOf FacetValue

The identity the initiator acted on behalf of.

CausedByCommand FacetValue

The command one level up the causation chain.

CorrelationRootId FacetValue

The correlation the event belongs to.

AggregateType FacetValue

The type of the event source the event was appended to.

Year int

The year the event occurred in.

Month int

The month the event occurred in.

Day DayOfWeek

The day of week the event occurred on.

TimeBucket TimeBucket

The part of the day the event occurred in.

Occurred DateTimeOffset

When the event occurred, the source every time-derived value above was taken from.

Remarks

Features are derived per event and discarded once mined - nothing here is persisted. Every time-derived value comes from the event's own occurred timestamp, never from wall-clock time at processing, so a backdated append and a replay both land in the bucket the event actually belongs to.

Properties

AggregateType

The type of the event source the event was appended to.

public FacetValue AggregateType { get; init; }

Property Value

FacetValue

CausedByCommand

The command one level up the causation chain.

public FacetValue CausedByCommand { get; init; }

Property Value

FacetValue

CommandType

The type of command, or the event type when nothing above it named itself.

public FacetValue CommandType { get; init; }

Property Value

FacetValue

CorrelationRootId

The correlation the event belongs to.

public FacetValue CorrelationRootId { get; init; }

Property Value

FacetValue

Day

The day of week the event occurred on.

public DayOfWeek Day { get; init; }

Property Value

DayOfWeek

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

GroupingKey

The scope the behavior belongs to - typically the user that caused the event.

public PatternGroupingKey GroupingKey { get; init; }

Property Value

PatternGroupingKey

InitiatorId

The identifier of the initiator.

public FacetValue InitiatorId { get; init; }

Property Value

FacetValue

InitiatorType

What kind of initiator caused the event.

public InitiatorType InitiatorType { get; init; }

Property Value

InitiatorType

Month

The month the event occurred in.

public int Month { get; init; }

Property Value

int

Occurred

When the event occurred, the source every time-derived value above was taken from.

public DateTimeOffset Occurred { get; init; }

Property Value

DateTimeOffset

OnBehalfOf

The identity the initiator acted on behalf of.

public FacetValue OnBehalfOf { get; init; }

Property Value

FacetValue

TimeBucket

The part of the day the event occurred in.

public TimeBucket TimeBucket { get; init; }

Property Value

TimeBucket

Year

The year the event occurred in.

public int Year { get; init; }

Property Value

int

Methods

AsFacets()

Gets every facet the event carries, keyed by FacetName.

public IReadOnlyDictionary<FacetName, FacetValue> AsFacets()

Returns

IReadOnlyDictionary<FacetName, FacetValue>

A dictionary of every facet, including the ones holding no value.

Remarks

Which of these take part in the mined itemset is a policy decision made further up, not here - this is the full vocabulary an event contributes, and the miner selects from it.

Deconstruct(out PatternGroupingKey, out FacetValue, out InitiatorType, out FacetValue, out FacetValue, out FacetValue, out FacetValue, out FacetValue, out int, out int, out DayOfWeek, out TimeBucket, out DateTimeOffset)

public void Deconstruct(out PatternGroupingKey GroupingKey, out FacetValue CommandType, out InitiatorType InitiatorType, out FacetValue InitiatorId, out FacetValue OnBehalfOf, out FacetValue CausedByCommand, out FacetValue CorrelationRootId, out FacetValue AggregateType, out int Year, out int Month, out DayOfWeek Day, out TimeBucket TimeBucket, out DateTimeOffset Occurred)

Parameters

GroupingKey PatternGroupingKey
CommandType FacetValue
InitiatorType InitiatorType
InitiatorId FacetValue
OnBehalfOf FacetValue
CausedByCommand FacetValue
CorrelationRootId FacetValue
AggregateType FacetValue
Year int
Month int
Day DayOfWeek
TimeBucket TimeBucket
Occurred DateTimeOffset

Equals(EventFeatures?)

public virtual bool Equals(EventFeatures? other)

Parameters

other EventFeatures

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(EventFeatures?, EventFeatures?)

public static bool operator ==(EventFeatures? left, EventFeatures? right)

Parameters

left EventFeatures
right EventFeatures

Returns

bool

operator !=(EventFeatures?, EventFeatures?)

public static bool operator !=(EventFeatures? left, EventFeatures? right)

Parameters

left EventFeatures
right EventFeatures

Returns

bool