Skip to main content

Dynamic Value Model

The dynamic value model is used to create a property with a dynamic value. The dynamic value means here that a user can select a value from a list of choices. For example, a user can select a number value and set a value to the input or can choose a number variable from a list of variables.

Dynamic Value Model Example


Check the Editors Example.


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

models: [
createNumberValueModel({ /* ... */ }),
createNullableVariableValueModel({ /* ... */ })

Required properties:

  • models - the list of value models. The first model is the default value model.

Value Reading

The chosen model with the value is stored in a simple object:

interface Dynamic<TValue> {
modelId: string; // 'string`, 'nullableVariable', ...
value: TValue;

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

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

const dynamic: Dynamic<string> =['foo']; // { modelId: '...', value: '...' }

if (dynamic.modelId === 'number') {
const value: number = dynamic.value;
// ...
else if (dynamic.modelId === 'nullableVariable') {
const variable: NullableVariable = dynamic.value;
// ...