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
originalEventFeatures
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
GroupingKeyPatternGroupingKeyThe scope the behavior belongs to - typically the user that caused the event.
CommandTypeFacetValueThe type of command, or the event type when nothing above it named itself.
InitiatorTypeInitiatorTypeWhat kind of initiator caused the event.
InitiatorIdFacetValueThe identifier of the initiator.
OnBehalfOfFacetValueThe identity the initiator acted on behalf of.
CausedByCommandFacetValueThe command one level up the causation chain.
CorrelationRootIdFacetValueThe correlation the event belongs to.
AggregateTypeFacetValueThe type of the event source the event was appended to.
YearintThe year the event occurred in.
MonthintThe month the event occurred in.
DayDayOfWeekThe day of week the event occurred on.
TimeBucketTimeBucketThe part of the day the event occurred in.
OccurredDateTimeOffsetWhen 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
CausedByCommand
The command one level up the causation chain.
public FacetValue CausedByCommand { get; init; }
Property Value
CommandType
The type of command, or the event type when nothing above it named itself.
public FacetValue CommandType { get; init; }
Property Value
CorrelationRootId
The correlation the event belongs to.
public FacetValue CorrelationRootId { get; init; }
Property Value
Day
The day of week the event occurred on.
public DayOfWeek Day { get; init; }
Property Value
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
GroupingKey
The scope the behavior belongs to - typically the user that caused the event.
public PatternGroupingKey GroupingKey { get; init; }
Property Value
InitiatorId
The identifier of the initiator.
public FacetValue InitiatorId { get; init; }
Property Value
InitiatorType
What kind of initiator caused the event.
public InitiatorType InitiatorType { get; init; }
Property Value
Month
The month the event occurred in.
public int Month { get; init; }
Property Value
Occurred
When the event occurred, the source every time-derived value above was taken from.
public DateTimeOffset Occurred { get; init; }
Property Value
OnBehalfOf
The identity the initiator acted on behalf of.
public FacetValue OnBehalfOf { get; init; }
Property Value
TimeBucket
The part of the day the event occurred in.
public TimeBucket TimeBucket { get; init; }
Property Value
Year
The year the event occurred in.
public int Year { get; init; }
Property Value
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
GroupingKeyPatternGroupingKeyCommandTypeFacetValueInitiatorTypeInitiatorTypeInitiatorIdFacetValueOnBehalfOfFacetValueCausedByCommandFacetValueCorrelationRootIdFacetValueAggregateTypeFacetValueYearintMonthintDayDayOfWeekTimeBucketTimeBucketOccurredDateTimeOffset
Equals(EventFeatures?)
public virtual bool Equals(EventFeatures? other)
Parameters
otherEventFeatures
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(EventFeatures?, EventFeatures?)
public static bool operator ==(EventFeatures? left, EventFeatures? right)
Parameters
leftEventFeaturesrightEventFeatures
Returns
operator !=(EventFeatures?, EventFeatures?)
public static bool operator !=(EventFeatures? left, EventFeatures? right)
Parameters
leftEventFeaturesrightEventFeatures