0.7.2
We added a new type of a validator: step validator. It allows to restrict a placement of a step in a definition. For example, you can enforce that a step can be placed only inside a specific step.
createStepModel<WriteSocketStep>('writeSocket', 'task', step => {
step.validator({
validate(context: StepValidatorContext) {
const parentTypes = context.getParentStepTypes();
return parentTypes.includes('socket');
? null // No errors
: 'The write socket step must be inside a socket.';
}
});
});
Additionally we've renamed:
- the
CustomValidatorContext
class toPropertyValidatorContext
, - the
customValidator
method of thePropertyModelBuilder
class tovalidator
.