Class Task

java.lang.Object
org.dspace.workflow.Task

public class Task extends Object
An association between a curation task and the workflow system. A single curation task may be associated with more than one workflow, and each association may be configured differently.

A curation task can be given "powers" to affect the progress of a workflow. For example, a curation task can cause a workflow item to be rejected if it fails.

A curation task can be associated with "contacts" (email addresses) to be notified when the curation task returns a given status.

  • Field Details

    • name

      public final String name
      Name of the curation task.
    • powers

      public final List<String> powers
      Effects of curation task completion on the workflow step.
    • contacts

      public final Map<String,List<String>> contacts
      Contacts to be notified on a given completion status.
  • Constructor Details

    • Task

      public Task(@NotNull @NotNull String name)
      Create an instance of an association with a given curation task.
      Parameters:
      name - the name of a curation task to be attached to some workflow.
  • Method Details

    • addPower

      public void addPower(@NotNull @NotNull String power)
      Empower this attachment to affect a workflow in some way.
      Parameters:
      power - the given power. See XmlWorkflowCuratorServiceImpl.curate(org.dspace.curate.Curator, org.dspace.core.Context, java.lang.String). TODO should use schema-generated enum?
    • addContact

      public void addContact(@NotNull @NotNull String status, @NotNull @NotNull String contact)
      Associate a contact with a given curation status such as Curator.CURATE_ERROR.
      Parameters:
      status - an exit status of the curation task. TODO should use schema-generated enum?
      contact - an address to be notified of this status.
    • getContacts

      @NotNull public @NotNull List<String> getContacts(@NotNull @NotNull String status)
      Get the collection of contacts for a given status such as Curator.CURATE_SUCCESS.
      Parameters:
      status - the given status. TODO should use schema-generated enum?
      Returns:
      contacts associated with this status.