Table of Contents

Class MeasureProcess

Namespace
Loehnert.TypeAndResult
Assembly
Loehnert.TypeAndResult.dll

Represents the measure results of a Process instance.

public class MeasureProcess : EntityBase, INotifyPropertyChanged, ITrackable
Inheritance
MeasureProcess
Implements
Inherited Members
Extension Methods

Constructors

MeasureProcess(Process)

Initializes a new instance of the MeasureProcess class.

public MeasureProcess(Process process)

Parameters

process Process

The associated process.

Exceptions

ArgumentNullException

Thrown when process is null.

Properties

Classification

Gets or sets the classification.

public Classification Classification { get; set; }

Property Value

Classification

EndTimeStamp

Gets or sets the start time stamp (UTC).

public DateTime EndTimeStamp { get; set; }

Property Value

DateTime

MeasureCycle

Gets the associated measure cycle.

public virtual MeasureCycle MeasureCycle { get; }

Property Value

MeasureCycle

MeasureCycleId

Gets the foreign key for the measure cycle.

public int MeasureCycleId { get; }

Property Value

int

Parameters

Gets the collection for additional parameters.

public virtual EntityCollection<MeasureProcessParameter> Parameters { get; }

Property Value

EntityCollection<MeasureProcessParameter>

Process

Gets the associated process.

public virtual Process Process { get; }

Property Value

Process

ProcessId

Gets the foreign key for the process.

public int ProcessId { get; }

Property Value

int

Results

Gets the measure results of this process.

public virtual ObservableCollection<Result> Results { get; }

Property Value

ObservableCollection<Result>

StartTimeStamp

Gets or sets the start time stamp (UTC).

public DateTime StartTimeStamp { get; set; }

Property Value

DateTime

Methods

Evaluate(bool)

Evaluates the measure process.

public MeasureProcessResult Evaluate(bool throwExceptionIfAttributIsNotEvaluated = true)

Parameters

throwExceptionIfAttributIsNotEvaluated bool

Indicates if an exception should be thrown while an attribute is not measured.

Returns

MeasureProcessResult

The result of measure process evaluation.

Remarks

The Classification property is set to Pass, if all required attributes (see EvaluationRequired) are evaluated and passed, if an attribute is failed the Classification is set to Fail. If any required attribute is not evaluated, Classification is set to Error and an AttributeNotMeasuredException is thrown (depending on throwExceptionIfAttributIsNotEvaluated). A not required attribute is ignored for evaluation.

The EndTimeStamp is set to UtcNow.

Exceptions

AttributeNotMeasuredException

Thrown when any required attribute in the Process has no result in Results and throwExceptionIfAttributIsNotEvaluated is false.

EvaluateAttribute(string, double, string)

Evaluates an Attribute from the Process and adds the result to Results.

public Result EvaluateAttribute(string attributeKey, double value, string text = "")

Parameters

attributeKey string

Key of the attribute to evaluate.

value double

Value for evaluation.

text string

Additional text for evaluation.

Returns

Result

The result of the attribute evaluation.

Exceptions

ArgumentNullException

Thrown when attributeKey is null, empty or whitespace.

KeyNotFoundException

Thrown when an attribute with the specified attributeKey is not found, in Attributes.

PreEvaluate()

Evaluates the measure process, but doesn't set the EndTimeStamp and Classification properties.

public MeasureProcessResult PreEvaluate()

Returns

MeasureProcessResult

The result of measure process evaluation.

Remarks

See Evaluate(bool) for details.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.