Skip to main content

String Value Model

The string value model describes a string value. The value is always a string, never null or undefined. So if the value is empty, then it's an empty string ('').

Example

Check the Editors Example.

Configuration

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

builder
.property('foo')
.value(
createStringValueModel({
defaultValue: 'lorem ipsum',
minLength: 10,
pattern: /^https:\/\//
})
);

Optional properties:

  • defaultValue - the default value,
  • minLength - the minimum length of the string,
  • pattern - the regular expression that the string must match.

Value Reading

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

const value: string = stepOrRoot.properties['foo']; // string

Model Id

The model id is string.