Skip to main content

Generated String Value Model

The generated string value model defines a string value that is generated during editing. The value is not editable by the user. The main use case is to generate a name for a step based on the other properties.

Example

Check the Editors Example.

Configuration

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

builder
.name()
.dependentProperty('variables')
.value(
createGeneratedStringValueModel({
generator(context) {
const variables = context.getPropertyValue('variables');
return `Selected ${variables.variables.length} variables`;
}
})
);

To get an access to the other properties, you need to mark a dependency on them. The dependency is defined by the dependentProperty(propertyName) method.

Required properties:

  • generator - The generator that generates the string value.

Value Reading

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

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