Nullable Any VariableValue Model
The nullable any variable value model describes a single variable that the user may pick from the list of variables. The variable can be of any type.
Example
Check the Editors Example.
Configuration
import { createNullableAnyVariableValueModel } from 'sequential-workflow-editor-model';
builder
.property('foo')
.value(
createNullableAnyVariableValueModel({
isRequired: true,
valueTypes: ['number', 'string']
})
);
Optional properties:
isRequired
- Defines if the value is required. Default value isfalse
.valueTypes
- Defines the list of allowed value types. If the list is empty, then all types are allowed.
Value Reading
The value is stored in a simple object:
interface AnyVariable {
name: string;
type: ValueType;
}
To read the value you just need to read the property value:
const value: AnyVariable | null = step.properties['foo']; // { name: 'x', type: 'number' } or null