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
ProcessThe associated process.
Exceptions
- ArgumentNullException
Thrown when
process
is null.
Properties
Classification
Gets or sets the classification.
public Classification Classification { get; set; }
Property Value
EndTimeStamp
Gets or sets the start time stamp (UTC).
public DateTime EndTimeStamp { get; set; }
Property Value
MeasureCycle
Gets the associated measure cycle.
public virtual MeasureCycle MeasureCycle { get; }
Property Value
MeasureCycleId
Gets the foreign key for the measure cycle.
public int MeasureCycleId { get; }
Property Value
Parameters
Gets the collection for additional parameters.
public virtual EntityCollection<MeasureProcessParameter> Parameters { get; }
Property Value
Process
Gets the associated process.
public virtual Process Process { get; }
Property Value
ProcessId
Gets the foreign key for the process.
public int ProcessId { get; }
Property Value
Results
Gets the measure results of this process.
public virtual ObservableCollection<Result> Results { get; }
Property Value
StartTimeStamp
Gets or sets the start time stamp (UTC).
public DateTime StartTimeStamp { get; set; }
Property Value
Methods
Evaluate(bool)
Evaluates the measure process.
public MeasureProcessResult Evaluate(bool throwExceptionIfAttributIsNotEvaluated = true)
Parameters
throwExceptionIfAttributIsNotEvaluated
boolIndicates 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)
public Result EvaluateAttribute(string attributeKey, double value, string text = "")
Parameters
attributeKey
stringKey of the attribute to evaluate.
value
doubleValue for evaluation.
text
stringAdditional 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.