Skip to main content

Nullable Variable Definition Value Model

The value model describes an optional definition of a variable.

Example

Check the Editors Example.

Configuration

import { createNullableVariableDefinitionValueModel } from 'sequential-workflow-editor-model';

builder
.property('foo')
.value(
createNullableVariableDefinitionValueModel({
variableType: 'string',
isRequired: true,
defaultValue: {
name: 'someName',
type: 'string'
}
})
);

Required properties:

  • variableType - the type of the variable.

Optional properties:

  • isRequired - if the variable definition is required. Default value is false,
  • defaultValue - the default value of the variable definition.

Value Reading

The value is stored in a simple object:

interface VariableDefinition {
name: string;
type: string;
}

type NullableVariableDefinition = VariableDefinition | null;

To read the value you just need to read the property value:

const value: NullableVariableDefinition = step.properties['foo']; // null or { name: '...', type: '...' }