close

Filter

loading table of contents...

Release Notes / Version 10.2107

Table Of Contents

Workflow validation now also validates dependent content

When starting a new workflow the entire content set including the dependent content is now validated. This will help to prevent most of the issues that can occur before the the workflow is even started. If the validation takes too long it can be stopped directly in the same window. Some changes were necessary to make that possible.

The workflow validation framework which uses the interface WorkflowValidator in order to created workflow issues was enhanced. Now it is also possible to include the dependent content within a workflow validation and create issues for it.

A new preparation step, represented by the interface WorkflowValidationPreparation was added.

Like this it is now possible to define actions that need to take place before the actual workflow validation. Per default the calculation of dependent content takes place in this preparation step. The content is then passed to the {{WorkflowValidator}}s.

The translation and publication workflows now offer per default the TranslationValidationPreparation and the PublicationValidationPreparation which calculates the dependent content.

The validators are now defined in two new configuration classes PublicationWorkflowValidationConfiguration and TranslationWorkflowValidationConfiguration . They define every validator and all the necessary validation models, using public constants for the bean names, so that everything can be re-used in custom workflows later on.

Upgrade Steps

If you have custom workflows or custom workflow validation configurations, you will need to adapt the configuration classes as stated below. This for example applies to customizations of workflows provided as part of the Blueprint such as the translation workflow. Not doing so will not only affect issues not being reported but also (less obvious, but based on the same mechanism) calculating dependent contents in some workflows.

  1. com.coremedia.rest.cap.workflow.validation.WorkflowValidationConfiguration was split into com.coremedia.rest.cap.workflow.validation.configuration.TranslationWorkflowValidationConfiguration and com.coremedia.rest.cap.workflow.validation.configuration.PublicationWorkflowValidationConfiguration . Update the configuration class of your workflow accordingly.

  2. The com.coremedia.rest.cap.workflow.validation.model.WorkflowValidators 's constructor now receives com.coremedia.rest.cap.workflow.validation.model.WorkflowTaskValidators and com.coremedia.rest.cap.workflow.validation.model.WorkflowStartValidators besides the workflow name. You can re-use all existing validators from the translation and publication workflows by referencing the beans by their names. The names are available as constants in the respective configuration classes.

  3. Should you have a custom publication workflow, using the DefaultPublicationValidator , you need to add a WorkflowValidatorsModel for your workflow, and add the necessary validators and preparation to it. The default validators and preparation are available as beans with the names PublicationWorkflowValidationConfiguration#PUBLICATION_VALIDATION_PREPARATION & PublicationWorkflowValidationConfiguration#DEFAULT_PUBLICATION_VALIDATORS .

Translation Workflow The DependentContentValidator was deleted and replaced by the TranslationValidationPreparation . Publication Workflow The DefaultPublicationValidator was deleted and split into several WorkflowValidators (see above). * PublicationValidationPreparation * PublicationContentRightsWorkflowValidator * PublicationContentStateValidator * PublicationNoAssigneeValidator * PublicationSessionUserRightsWorkflowValidator * PublicationWorkflowUndoWithdrawValidator

For example, this is a snippet of the updated configuration class of the translation workflow with GlobalLink available on CoreMedia Labs:


...

@Configuration
@Import(TranslationWorkflowValidationConfiguration.class)
public class GlobalLinkWorkflowValidationConfiguration {

  public static final String GLOBAL_LINK_DUE_DATE_KEY = "globalLinkDueDate";
  public static final String TRANSLATION_GLOBAL_LINK_VALIDATOR_KEY = "TranslationGlobalLink";
  public static final String HANDLE_SEND_TRANSLATION_REQUEST_ERROR = "HandleSendTranslationRequestError";
  ...

  @Bean
  WorkflowValidatorsModel translationGccWFValidators(@Qualifier(TRANSLATION_START_VALIDATORS) WorkflowStartValidators translationStartValidators,
                                                     @Qualifier(TRANSLATION_WFNOT_RUNNING) List<WorkflowValidator> translationWFNotRunning,
                                                     @Qualifier(TRANSLATION_WFRUNNING) List<WorkflowValidator> translationWFRunning,
                                                     @Qualifier(TASK_ERROR_VALIDATOR) WorkflowValidator taskErrorValidator) {

    ValidationTask runningTask = new ValidationTask(TRANSLATE_TASK_NAME, TaskState.RUNNING);
    ValidationTask waitingTask = new ValidationTask(TRANSLATE_TASK_NAME, TaskState.ACTIVATED);

    // this validator checks the workflow when an editor activats the "HandleSendTranslationRequestError"
    ValidationTask sendTranslationRequestErrorTask = new ValidationTask(HANDLE_SEND_TRANSLATION_REQUEST_ERROR);

    WorkflowTaskValidators taskValidators = new WorkflowTaskValidators(
            Map.of(runningTask, translationWFRunning,
                    waitingTask, translationWFNotRunning,
                    sendTranslationRequestErrorTask, List.of(taskErrorValidator));


    List<WorkflowValidator> workflowValidators = new ArrayList<>();

    // this validator checks the due date parameter of the workflow before being started
    workflowValidators.add(new GCCDateLiesInFutureValidator(GLOBAL_LINK_DUE_DATE_KEY));
    
    workflowValidators.addAll(translationStartValidators.getWorkflowValidators());
    WorkflowStartValidators gccStartValidators = new WorkflowStartValidators(
            translationStartValidators.getWorkflowValidationPreparation(), workflowValidators
    );

    return new WorkflowValidatorsModel(TRANSLATION_GLOBAL_LINK_VALIDATOR_KEY, taskValidators, gccStartValidators);
  }
}

Other changes:

  • WorkflowValidationConfiguration#TRANSLATE_WF_NAM was moved and renamed to TranslationWorkflowValidationConfiguration#TRANSLATE_TASK_NAME

  • com.coremedia.rest.cap.workflow.validation.WorkflowValidationParameterModel was moved to com.coremedia.rest.cap.workflow.validation.model.WorkflowValidationParameterModel

(CMS-17549)

Search Results

Table Of Contents