Table of Contents

Class LeftHandSideExtensions

Namespace
JobFlow.Core.Rules.Dsl
Assembly
JobFlow.Core.dll

Methods for use with the NRules When() operator. Provide JobFlow data matching abilities.

public static class LeftHandSideExtensions
Inheritance
LeftHandSideExtensions

Remarks

These methods provide a JobFlow specific DSL for matching Jobs, Documents, etc. Each method takes a parameter expression that allows for further customization of the matching algorithm.

See Matcher which contains the default methods that apply to all matchers.

Methods

HaveDocument<D>(LeftHandExpression<JobFlowRule<D>>, Action<Matcher<Document<D>>>)

Match against the document.

public static LeftHandExpression<JobFlowRule<D>> HaveDocument<D>(this LeftHandExpression<JobFlowRule<D>> leftHandSideExpression, Action<Matcher<Document<D>>> expression = null)

Parameters

leftHandSideExpression LeftHandExpression<JobFlowRule<D>>
expression Action<Matcher<Document<D>>>

See Matcher<T>, which contains the default methods that apply to all matchers.

Returns

LeftHandExpression<JobFlowRule<D>>

Type Parameters

D

Remarks

Note that this method works only against a rule defined with JobFlowRule<D> in which the Document type is specified as a generic parameter.

HaveDocument<D>(LeftHandExpression<JobFlowRule<D>>, Expression<Func<Document<D>>>, Action<Matcher<Document<D>>>)

Match against the document, and specify an alias to use later.

public static LeftHandExpression<JobFlowRule<D>> HaveDocument<D>(this LeftHandExpression<JobFlowRule<D>> leftHandSideExpression, Expression<Func<Document<D>>> alias, Action<Matcher<Document<D>>> expression = null)

Parameters

leftHandSideExpression LeftHandExpression<JobFlowRule<D>>
alias Expression<Func<Document<D>>>
expression Action<Matcher<Document<D>>>

Returns

LeftHandExpression<JobFlowRule<D>>

Type Parameters

D

Remarks

Note that this method works only against a rule defined with JobFlowRule<D> in which the Document type is specified as a generic parameter.

HaveJobGroup<T>(LeftHandExpression<T>, Expression<Func<JobGroupDefinition>>, string)

Match against a previously created Job Group.

public static LeftHandExpression<T> HaveJobGroup<T>(this LeftHandExpression<T> leftHandExpression, Expression<Func<JobGroupDefinition>> alias, string name) where T : JobFlowRule

Parameters

leftHandExpression LeftHandExpression<T>
alias Expression<Func<JobGroupDefinition>>
name string

Returns

LeftHandExpression<T>

Type Parameters

T

HaveJob<R>(LeftHandExpression<R>, Action<Matcher<JobModel>>)

Allows matching against a JobModel representing the previously executed Job.

public static LeftHandExpression<R> HaveJob<R>(this LeftHandExpression<R> leftHandSideExpression, Action<Matcher<JobModel>> expression = null) where R : JobFlowRule

Parameters

leftHandSideExpression LeftHandExpression<R>
expression Action<Matcher<JobModel>>

See JobMatchExtensions for more information about Job match methods.

Returns

LeftHandExpression<R>

Type Parameters

R

HaveJob<R>(LeftHandExpression<R>, Expression<Func<JobModel>>, Action<Matcher<JobModel>>)

Allows matching against a JobModel representing the previously executed Job, specifying an alias to use later.

public static LeftHandExpression<R> HaveJob<R>(this LeftHandExpression<R> leftHandSideExpression, Expression<Func<JobModel>> alias, Action<Matcher<JobModel>> expression = null) where R : JobFlowRule

Parameters

leftHandSideExpression LeftHandExpression<R>
alias Expression<Func<JobModel>>
expression Action<Matcher<JobModel>>

Returns

LeftHandExpression<R>

Type Parameters

R

HaveNewJob<T>(LeftHandExpression<T>, Expression<Func<DispatchJobDefinition>>, Action<Matcher<DispatchJobDefinition>>)

public static LeftHandExpression<T> HaveNewJob<T>(this LeftHandExpression<T> leftHandExpression, Expression<Func<DispatchJobDefinition>> alias, Action<Matcher<DispatchJobDefinition>> matchAction) where T : JobFlowRule

Parameters

leftHandExpression LeftHandExpression<T>
alias Expression<Func<DispatchJobDefinition>>
matchAction Action<Matcher<DispatchJobDefinition>>

Returns

LeftHandExpression<T>

Type Parameters

T

HaveWorkResponse<R>(LeftHandExpression<R>, Action<Matcher<WorkResponse>>)

Allows matching against a WorkResponse representing the results of the previously executed Job.

public static LeftHandExpression<R> HaveWorkResponse<R>(this LeftHandExpression<R> leftHandSideExpression, Action<Matcher<WorkResponse>> expression = null) where R : JobFlowRule

Parameters

leftHandSideExpression LeftHandExpression<R>
expression Action<Matcher<WorkResponse>>

See JobMatchExtensions for more information about Job match methods.

Returns

LeftHandExpression<R>

Type Parameters

R

HaveWorkResponse<R>(LeftHandExpression<R>, Expression<Func<WorkResponse>>, Action<Matcher<WorkResponse>>)

Allows matching against a WorkResponse representing the results of the previously executed Job, specifying an alias to use later.

public static LeftHandExpression<R> HaveWorkResponse<R>(this LeftHandExpression<R> leftHandSideExpression, Expression<Func<WorkResponse>> alias, Action<Matcher<WorkResponse>> expression = null) where R : JobFlowRule

Parameters

leftHandSideExpression LeftHandExpression<R>
alias Expression<Func<WorkResponse>>
expression Action<Matcher<WorkResponse>>

See JobMatchExtensions for more information about Job match methods.

Returns

LeftHandExpression<R>

Type Parameters

R