close

Filter

loading table of contents...

Studio Developer Manual / Version 2010

Table Of Contents

7.22.3.1 Studio Server

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

Caution

Caution

Using the DefaultPublicationWorkflowValidator is mandatory. Amongst other things, it provides the workflow's computed change set as well as the dependent contents as INFO issues. Without it, the workflow integration on the Studio Client side does not work anymore. Consequently, validation customization for your publication workflow needs to be done on top of using the DefaultPublicationWorkflowValidator. You can configure it as described below and and you can write additional validators.

The DefaultPublicationWorkflowValidator does the following out of the box.

Publication Set

From the given workflow change set, a complete publication set is computed, including dependent contents.

Content Validity

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

Assignee Rights

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.

Content Checked Out State

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

The DefaultPublicationWorkflowValidator can be configured in the following way. For more details, please consult the code documentation.

Required Rights for Tasks

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

Max Iterations to Complete ChangeSet

Computing the complete publication set may be very costly. You can limit the depth / iterations for this recursive computation.

Successor Tasks to Check for Acceptance

Sometimes you need to check whether an 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.

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

          
private static final String THREE_STEP_PUBLICATION_WORKFLOW_NAME = "StudioThreeStepPublication";

@Bean
WorkflowValidatorsModel threeStepPublicationWorkflowValidator(DefaultPublicationWorkflowValidator threeStepDefaultPublicationWorkflowValidator) {
  ValidationTask composeRunningTask = new ValidationTask("Compose", TaskState.RUNNING);
  ValidationTask approveRunningTask = new ValidationTask("Approve", TaskState.RUNNING);
  ValidationTask publishRunningTask = new ValidationTask("Publish", TaskState.RUNNING);

  List<WorkflowValidator> threeStepWorkflowValidators
        = List.of(threeStepDefaultPublicationWorkflowValidator);
  Map<ValidationTask, List<WorkflowValidator>> taskValidators
        = Map.of(composeRunningTask, threeStepWorkflowValidators, approveRunningTask, threeStepWorkflowValidators, publishRunningTask, threeStepWorkflowValidators);

  return new WorkflowValidatorsModel(THREE_STEP_PUBLICATION_WORKFLOW_NAME,
                                     taskValidators,
                                     threeStepWorkflowValidators);
}

@Bean
DefaultPublicationWorkflowValidator threeStepDefaultPublicationWorkflowValidator(StudioConfigurationProperties studioConfigurationProperties) {
  Map<String, Rights> requiredContentRightsForTasks = new HashMap<>();
  requiredContentRightsForTasks.put("Approve", Rights.valueOf("RA"));
  requiredContentRightsForTasks.put("Publish", Rights.valueOf("RAP"));

  DefaultPublicationWorkflowValidator defaultPublicationWorkflowValidator
        = new DefaultPublicationWorkflowValidator();
  defaultPublicationWorkflowValidator
        .setRequiredContentRightsForTasks(requiredContentRightsForTasks);
  defaultPublicationWorkflowValidator
        .setMaxIterationsToCompleteChangeSet(studioConfigurationProperties
              .getRest()
              .getMax()
              .getIterations()
              .getComplete()
              .getChangeset());

  return defaultPublicationWorkflowValidator;
}
        

Example 7.88. Workflow validation configuration for the StudioThreeStepPublication workflow


Search Results

Table Of Contents