Table of Contents

Class InputStepFunction

Namespace
Microsoft.Accordant
Assembly
Accordant.Operations.dll

A test operation step function represents the effect of applying the model of an operation. It is enabled based on the shouldApply predicate. It returns all possible updated states returned by Invoke(object, IState) as the set of updated states the system can transition to.

public class InputStepFunction : BaseStepFunction, IStepFunction
Inheritance
InputStepFunction
Implements
Inherited Members

Constructors

InputStepFunction(OperationInput, bool, Func<OperationInput, IState, bool>, Func<OperationInput, IList<OperationInput>, bool>, Func<UnwindContext, bool>, ISpec, Dictionary<string, int>, Dictionary<string, object>, Dictionary<string, object>, Dictionary<string, Func<object>>, IList<DerivationSelector>)

Constructs an instance of this class given a request and a model definition.

public InputStepFunction(OperationInput operationInput, bool addNonInputStepFunctions, Func<OperationInput, IState, bool> shouldApply, Func<OperationInput, IList<OperationInput>, bool> shouldPreserveOperation, Func<UnwindContext, bool> shouldUnwindStepFunction, ISpec spec, Dictionary<string, int> operationCount, Dictionary<string, object> operationCallRequests, Dictionary<string, object> operationCallResponses, Dictionary<string, Func<object>> requestTemplates, IList<DerivationSelector> derivationSelectors)

Parameters

operationInput OperationInput
addNonInputStepFunctions bool
shouldApply Func<OperationInput, IState, bool>
shouldPreserveOperation Func<OperationInput, IList<OperationInput>, bool>
shouldUnwindStepFunction Func<UnwindContext, bool>
spec ISpec
operationCount Dictionary<string, int>
operationCallRequests Dictionary<string, object>
operationCallResponses Dictionary<string, object>
requestTemplates Dictionary<string, Func<object>>
derivationSelectors IList<DerivationSelector>

Properties

OperationInput

public OperationInput OperationInput { get; }

Property Value

OperationInput

StepFunctionId

The unique identifier of the step function.

public override string StepFunctionId { get; }

Property Value

string

Methods

ApplyInternal(IState, IReadOnlyList<(IStepFunction, StateGraphNode)>)

Returns whether the step is enabled based on the shouldApply predicate and a set of updated states (and optional step functions) the system should transition to.

protected override IList<StepResult> ApplyInternal(IState state, IReadOnlyList<(IStepFunction, StateGraphNode)> path)

Parameters

state IState

The current state.

path IReadOnlyList<(IStepFunction, StateGraphNode)>

The path of step functions taken to reach this state.

Returns

IList<StepResult>

List of step results, or null if not enabled.

ToString()

public override string ToString()

Returns

string