• Docs
  • Learn
  • Community
    Search Results for

      Show / Hide Table of Contents

      Class IncludeWorkflowBuilder

      Represents an expression builder that uses an encapsulated workflow stored externally to generate its output.

      The IncludeWorkflow operator works in exactly the same way as GroupWorkflow, with the difference that the nested workflow definition is stored externally in a file, rather than locally in the node itself. Include nodes are used to organize larger workflows into modular building blocks. They allow reusing functionality across different parts of a workflow, or even across different projects. Changing the definition of an included workflow will be automatically reflected in all places where that workflow is reused.

      All observable sequences passed as arguments to the outer IncludeWorkflow will be routed to the inner WorkflowInput nodes. Conversely, all notifications emitted by the sequence connected to the single WorkflowOutput node will be passed to any observers of the include workflow node. It is possible to subscribe multiple times to the same include workflow, in which case the nested workflow will run potentially in parallel and is considered to be reentrant.

      Note

      Externalized properties contained inside the included workflow will be exposed when selecting the IncludeWorkflow node. Any changes to the values of these properties can be recovered, even if the included workflow is reused multiple times in different parts of the program. They can also be further externalized as part of other nested operators or dynamically assigned using PropertyMapping or InputMapping operators.

      Warning

      If the nested workflow is reentrant, properties of inner nodes are shared by all asynchronous operations which are running simultaneously. If the shared state never changes across reentrant operations (i.e. the state is immutable), this is not a problem. If shared state is changing dynamically, you should consider using synchronization primitives to make sure that state updates are coordinated across the different asynchronous operations.

      Inheritance
      Object
      ExpressionBuilder
      VariableArgumentExpressionBuilder
      IncludeWorkflowBuilder
      Implements
      IWorkflowExpressionBuilder
      IExpressionBuilder
      INamedElement
      Inherited Members
      VariableArgumentExpressionBuilder.SetArgumentRange(Int32, Int32)
      ExpressionBuilder.ToString()
      ExpressionBuilder.Unwrap(ExpressionBuilder)
      ExpressionBuilder.GetWorkflowElement(ExpressionBuilder)
      ExpressionBuilder.GetVisualizerElement(ExpressionBuilder)
      ExpressionBuilder.GetVisualizerMappings(ExpressionBuilder)
      ExpressionBuilder.FromWorkflowElement(Object, ElementCategory)
      ExpressionBuilder.GetElementDisplayName(Type)
      ExpressionBuilder.GetElementDisplayName(Object)
      Object.Equals(Object)
      Object.Equals(Object, Object)
      Object.ReferenceEquals(Object, Object)
      Object.GetHashCode()
      Object.GetType()
      Object.MemberwiseClone()
      Namespace: Bonsai.Expressions
      Assembly: Bonsai.Core.dll
      Syntax
      [WorkflowElementCategory(ElementCategory.Workflow)]
      public sealed class IncludeWorkflowBuilder : VariableArgumentExpressionBuilder, IWorkflowExpressionBuilder, IExpressionBuilder, INamedElement

      Constructors

      | Improve this Doc View Source

      IncludeWorkflowBuilder()

      Initializes a new instance of the IncludeWorkflowBuilder class.

      Declaration
      public IncludeWorkflowBuilder()

      Properties

      | Improve this Doc View Source

      ArgumentRange

      Gets the range of input arguments the included workflow accepts.

      Declaration
      public override Range<int> ArgumentRange { get; }
      Property Value
      Type Description
      Range<Int32>
      Overrides
      VariableArgumentExpressionBuilder.ArgumentRange
      | Improve this Doc View Source

      Description

      Gets a description for the included workflow.

      Declaration
      [Browsable(false)]
      public string Description { get; }
      Property Value
      Type Description
      String
      | Improve this Doc View Source

      Name

      Gets the name of the included workflow.

      Declaration
      [Browsable(false)]
      public string Name { get; }
      Property Value
      Type Description
      String
      | Improve this Doc View Source

      Path

      Gets or sets the path of the workflow to include.

      Declaration
      [Externalizable(false)]
      [FileNameFilter("Bonsai Files (*.bonsai)|*.bonsai")]
      public string Path { get; set; }
      Property Value
      Type Description
      String
      | Improve this Doc View Source

      PropertiesXml

      Gets or sets the XML representation of externalized property values from the included workflow.

      Declaration
      [Browsable(false)]
      public XElement[] PropertiesXml { get; set; }
      Property Value
      Type Description
      XElement[]
      | Improve this Doc View Source

      Workflow

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

      Declaration
      [Browsable(false)]
      public ExpressionBuilderGraph Workflow { get; }
      Property Value
      Type Description
      ExpressionBuilderGraph

      Methods

      | Improve this Doc View Source

      Build(IEnumerable<Expression>)

      Generates an Expression node from a collection of input arguments. The result can be chained with other builders in a workflow.

      Declaration
      public override Expression Build(IEnumerable<Expression> arguments)
      Parameters
      Type Name Description
      IEnumerable<Expression> arguments

      A collection of Expression nodes that represents the input arguments.

      Returns
      Type Description
      Expression

      An Expression tree node.

      Overrides
      ExpressionBuilder.Build(IEnumerable<Expression>)

      Implements

      IWorkflowExpressionBuilder
      IExpressionBuilder
      INamedElement

      Extension Methods

      ExpressionBuilderGraphExtensions.Build(ExpressionBuilder, Expression[])
      ExpressionBuilderGraphExtensions.IsBuildDependency(ExpressionBuilder)
      ExpressionBuilderGraphExtensions.AsInspectBuilder(ExpressionBuilder)
      • Improve this Doc
      • View Source
      In This Article
      Back to top Generated by DocFX