Skip to content

Build types ​

Every record in a flow has a type. You build types in the type editor, import them from a sample or a schema, or let components create them, and you export them as code for the applications a flow talks to. When the flow is compiled, every type becomes a C# class, so scripts and mappings work with real properties.

Open the type editor ​

  • Click Types in the flow designer toolbar.
  • Double-click a connection to open the editor on the connection's type.
  • In a connection's properties, the Data type list offers the flow's types and <...New type ...>, which creates a type and opens it in the editor.

The Flow types editor lists the flow's types on the left. Search filters them, and the eye button switches between your own types and all types, including the ones components generate. Under each type you see the types its fields use.

Create a type ​

Click Add new type. Then, in the header of the type:

  • Type name: a C# identifier, unique in the flow.
  • Class or Enum: a class has fields; an enum has named integer values.
  • Description: shown in the editor and written into exported code.

Click Add new field and fill in the Field editor:

SettingWhat it does
Field nameA C# identifier, unique in the type.
Property kindSimple, List (a list of items) or Dictionary (keys and values).
Property typeText, numbers of every size, dates and times, Guid, TimeSpan, IP and MAC addresses, arrays, geometry, Object, or another type of the flow. Choosing another flow type nests it. Numbers, booleans, dates and times also come as Nullable variants.
Default valueAssigned when a record is created, converted to the field's type.
Required / OptionalWhether the field must have a value.
Serialization nameThe name used in JSON and XML when it differs from the field name, for example order_id for OrderId.
JSON ignoreWhen the field is left out of JSON: Never, Always, When default or When null.
DescriptionDocumentation for the field.
ValidationRules checked for the value: required, number, integer, positive or negative, programmatic identifier, minimum and maximum length or value, and a regular expression.

The field list shows each field's type and tags for required, validation, default value and serialization name. Reorder fields with the arrows; double-click a field to edit it.

For an enum, each member has a name and an Enum value (an integer).

Copy selected type to clipboard copies a type together with every type it uses, so you can paste the set into another flow. Delete unused types removes types nothing refers to; your own types are kept.

Namespaces ​

A flow's types live in the flow's namespace, set in the flow properties (viauser by default). A type's full name is <namespace>.<Name>. When you change the namespace, the flow's types and every reference to them are renamed with it. Give flows you publish as plugins a namespace of their own.

Types that components create ​

Components that know their data generate their types: a Table reader or Table writer the row type of its table, a CSV decoder the type of its columns, a Sql query the type of its result. Many of these are locked: you can view, copy and export them, but only the component changes them, when you reconfigure it. Locked types show a lock and are hidden until you switch on all types.

Next ​

Viaducta documentation