Any Variables Value Model
The any variables value model describes a list that contains variables of any type. For example you can allow the user to select a string variable and a number variable and add to the list.
Example
Check the Editors Example.
Configuration
import { createAnyVariablesValueModel } from 'sequential-workflow-editor-model';
builder
.property('foo')
.value(
createAnyVariablesValueModel({
valueTypes: [
'number',
'string'
]
})
);
Optional properties:
valueTypes
- Types of the variables that can be added to the list. If not specified, all types are allowed.
Value Reading
The value is stored in a simple object:
interface AnyVariable {
name: string;
type: ValueType;
}
interface AnyVariables {
variables: AnyVariable[];
}
To read the value you just need to read the property value:
const value: AnyVariables = step.properties['foo'];
const variables = value.variables; // [{ name: 'x', type: 'number' }, ...]