Table of Contents

Class WorkflowExpressionBuilder

Namespace
Bonsai.Expressions
Assembly
Bonsai.Core.dll

Provides a base class for expression builders that generate their output by means of an encapsulated workflow.

[WorkflowElementCategory(ElementCategory.Combinator)]
public abstract class WorkflowExpressionBuilder : ExpressionBuilder, IWorkflowExpressionBuilder, INamedElement, IPropertyMappingBuilder, IExpressionBuilder
Inheritance
WorkflowExpressionBuilder
Implements
Derived
Inherited Members
Extension Methods

Constructors

WorkflowExpressionBuilder()

Initializes a new instance of the WorkflowExpressionBuilder class.

protected WorkflowExpressionBuilder()

WorkflowExpressionBuilder(ExpressionBuilderGraph)

Initializes a new instance of the WorkflowExpressionBuilder class with the specified expression builder workflow.

protected WorkflowExpressionBuilder(ExpressionBuilderGraph workflow)

Parameters

workflow ExpressionBuilderGraph

The expression builder workflow instance that will be used by this builder to generate the output expression tree.

Properties

ArgumentRange

Gets the range of input arguments that this expression builder accepts.

public override Range<int> ArgumentRange { get; }

Property Value

Range<int>

Description

Gets or sets a description for the encapsulated workflow.

[Externalizable(false)]
public string Description { get; set; }

Property Value

string

Name

Gets or sets the name of the encapsulated workflow.

[Externalizable(false)]
public string Name { get; set; }

Property Value

string

Workflow

Gets the expression builder workflow that will be used to generate the output expression tree.

[Browsable(false)]
public ExpressionBuilderGraph Workflow { get; }

Property Value

ExpressionBuilderGraph

WorkflowDescriptor

Gets the XML serializable representation of the encapsulated workflow.

[Browsable(false)]
public ExpressionBuilderGraphDescriptor WorkflowDescriptor { get; set; }

Property Value

ExpressionBuilderGraphDescriptor

Methods

BuildWorkflow(IEnumerable<Expression>, Expression, Func<Expression, Expression>)

Builds the output of the encapsulated workflow for the specified source and applies a selector taking into account any available workflow mappings.

protected Expression BuildWorkflow(IEnumerable<Expression> arguments, Expression source, Func<Expression, Expression> selector)

Parameters

arguments IEnumerable<Expression>

A collection of Expression nodes that represents the input arguments.

source Expression

The expression tree that will be used as input to the encapsulated workflow.

selector Func<Expression, Expression>

A selector that will be applied to the output of the encapsulated workflow to determine the final output of the expression builder.

Returns

Expression

An Expression tree that is the result of applying the encapsulated workflow to the specified input source. Property mappings are also resolved in the correct sequence.