close

Filter

loading table of contents...

Studio Developer Manual / Version 2107

Table Of Contents

7.23.3.1 Studio Server

For the server side, you need to define custom validators for your new workflow. Please refer to Section 7.23.1.3, “Customizing Workflow Validation” for general information on how to do this. This section introduces the default publication workflow validators that cover most needs for publication workflow validation. Feel free to add further validators if needed.

Caution

Caution

Before the actual validators are executed, a so called WorkflowValidationPreparation takes place, which provides the workflow's computed change set as well as the dependent contents as INFO issues.

The default publication workflow validators offer the following functionality:

PublicationContentStateValidator

All content validators from the application context are applied to check the complete publication set for validity.

PublicationNoAssigneeValidator

If assignees are selected, all assignees are checked for having the required (see below) content rights for the publication set as well as for having the right rights for accepting the next selected task.

PublicationSessionUserRightsWorkflowValidator

For the workflow start, it is checked whether there are contents that need to be checked in and if the current user does not have the right to do it.

PublicationContentRightsWorkflowValidator

Workflow validator that checks if the given members have the configured content rights on the chosen content, that a necessary to perform publication workflow. The validator can be configured.

For each user task of the workflow, you can define the required content rights. For example, the Approve task does not need publish rights.

You can also configure if assignees can accept not only the next selected task but also a number of follow-up tasks, for example if they are auto-accepted. E.g. for the case of the built-in 2-step publication workflow, the user that accepts the Approve task also needs to be able to accept the following Publish task.

PublicationWorkflowUndoWithdrawValidator

Validator that removes (undoes) toBeDeleted and toBeWithdrawn states from the given contents and their parent folders.

All the validators are defined as Spring Beans within the PublicationWorkflowValidationConfiguration.java, where you can also find their Bean names, defined as constants, which you can import, or override.

The following code shows the validation configuration for the 3-step publication example.

           @Bean("threeStepPublicationWorkflowValidator")
  WorkflowValidatorsModel threeStepPublicationWorkflowValidator(@Qualifier("publicationValidationPreparation") WorkflowValidationPreparation publicationValidationPreparation,
                                                                @Qualifier("threeStepDefaultPublicationWorkflowValidator") WorkflowValidator threeStepDefaultPublicationWorkflowValidator,
                                                                @Qualifier("publicationNoAssigneeValidator") WorkflowValidator publicationNoAssigneeValidator,
                                                                @Qualifier("publicationSessionUserRightsWorkflowValidator") WorkflowValidator publicationSessionUserRightsWorkflowValidator,
                                                                @Qualifier("publicationWorkflowUndoWithdrawValidator") WorkflowValidator publicationWorkflowUndoWithdrawValidator,
                                                                @Qualifier("publicationContentIssuesValidator") WorkflowValidator publicationContentIssuesValidator) {
    ValidationTask composeRunningTask = new ValidationTask(COMPOSE_TASK_NAME, TaskState.RUNNING);
    ValidationTask approveRunningTask = new ValidationTask(APPROVE_TASK_NAME, TaskState.RUNNING);

    final List<WorkflowValidator> validators = List.of(threeStepDefaultPublicationWorkflowValidator, publicationNoAssigneeValidator, publicationSessionUserRightsWorkflowValidator, publicationWorkflowUndoWithdrawValidator, publicationContentIssuesValidator);

    final WorkflowTaskValidators taskValidators =
            new WorkflowTaskValidators(Map.of(composeRunningTask, validators, approveRunningTask, validators));

    return new WorkflowValidatorsModel("StudioThreeStepPublication", taskValidators, new WorkflowStartValidators(publicationValidationPreparation, validators));
  }


  @Bean("threeStepDefaultPublicationWorkflowValidator")
  PublicationContentRightsWorkflowValidator threeStepDefaultPublicationWorkflowValidator(ContentRepository contentRepository) {
    Map<String, Rights> requiredContentRightsForTasks = new HashMap<>();
    requiredContentRightsForTasks.put("Approve", Rights.valueOf("RA"));
    requiredContentRightsForTasks.put("Publish", Rights.valueOf("RAP"));
    return new PublicationContentRightsWorkflowValidator(contentRepository, requiredContentRightsForTasks, Map.of("Approve", List.of("Publish")));
  }

        

Example 7.93. Workflow validation configuration for the StudioThreeStepPublication workflow


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.