Studio Developer Manual / Version 2512.1
Table Of ContentsThis section describes how to customize start validators for built-in workflows. Workflow start validators may need to be added due to project requirements like, e.g., excluding specific content items from translation.
Workflow start validator beans for built-in workflows are annotated to assign them accordingly. The following Java annotations are available:
A custom validator bean implementing interface WorkflowValidator may be added to one or more of the workflows by adding the corresponding annotation(s) to the bean definition.
See Java API documentation on
PublicationWorkflowValidationConfiguration
,
TranslationWorkflowValidationConfiguration
, and com.coremedia.blueprint.studio.rest.workflow.validation.WorkflowValidationAutoConfiguration
for default assignment of validator beans.
No specific order is imposed on the validators by default. Should you require a specific order, adding
annotation org.springframework.core.annotation.Order to your custom validator will put it in
first position. When another order of validators is desired, the alteration procedure (see below) can also be
applied by re-qualifying validator beans and applying the Order annotation on them.
Altering Pre-Defined Workflow Validation
Note
It is generally not recommended to omit or change pre-defined validators of built-in workflows.
To remove pre-defined validators, proceed like follows.
Create a new Java annotation for each workflow you want to remove default validators for. See
SimplePublicationWorkflowStartValidatorfor an example. Create a newQualifiervalue for your new annotation. Example:@Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @Qualifier("myTwoStepPublicationWorkflowStartValidator") public @interface MyTwoStepPublicationWorkflowStartValidator { }
Replicate bean definitions of validators that you want to keep for each workflow which is to be changed. See references above for pre-defined validator beans. For each validator bean to be kept, create a bean definition in your project code with your new Java annotation(s) and the pre-defined bean. Example:
@Bean @MyTwoStepPublicationWorkflowStartValidator public WorkflowValidator myPublicationNoAssigneeValidator(WorkflowValidator publicationNoAssigneeValidator) { return publicationNoAssigneeValidator; }
Provide a new aggregating bean for each of your new annotations. Example:
@Bean public List<WorkflowValidator> twoStepPublicationWorkflowValidators(@MyTwoStepPublicationWorkflowStartValidator List<WorkflowValidator> validators) { return validators; } }


