Package com.orchestranetworks.workflow

# Interface WorkflowPublisher

public interface WorkflowPublisher
Publishes one or more workflow.

If no version label is defined, a default one is automatically generated for the publication.

It is possible to publish one or more workflow models by using the `addPublicationSpec(PublicationSpec)` and `addAllPublicationSpecs(Collection)` methods.

Once the publisher object is correctly set up, the `publish()` method is used to publish the workflows.

Limitation: it is not possible to publish several workflows in a single publication if one of them contains sub-workflows (same behavior as the publication by the user interface). For this use case, it is necessary to create several `WorkflowPublisher` (and thus several versions).

Since:
  6.1.3
See Also:
  - `WorkflowEngine.getWorkflowPublisher()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addAllPublicationSpecs(Collection<PublicationSpec> aPublicationSpecs)`
  Adds a collection of publication specifications.
  `void`
  `addPublicationSpec(PublicationSpec aPublicationSpec)`
  Adds a publication specification.
  `Collection<PublicationSpec>`
  `getPublicationSpecs()`
  Gets the publication specifications.
  `UserMessage`
  `getVersionDescription()`
  Gets the description of the version associated with the publication.
  `UserMessage`
  `getVersionLabel()`
  Gets the label of the version associated with the publication.
  `VersionKey`
  `publish()`
  Publishes the defined workflow models according to the publication specifications.
  `void`
  `setVersionDescription(UserMessage aVersionDescription)`
  Sets the description of the version associated with the publication.
  `void`
  `setVersionLabel(UserMessage aVersionLabel)`
  Sets the label of the version associated with the publication.

- ## Method Details

  - ### setVersionLabel

    void setVersionLabel(UserMessage aVersionLabel)
    Sets the label of the version associated with the publication.

    This version is created from the dataspace that contains all the workflow models.

  - ### setVersionDescription

    void setVersionDescription(UserMessage aVersionDescription)
    Sets the description of the version associated with the publication.

    This version is created from the dataspace that contains all the workflow models.

  - ### getVersionLabel

    UserMessage getVersionLabel()
    Gets the label of the version associated with the publication.

    This version is created from the dataspace that contains all the workflow models.

  - ### getVersionDescription

    UserMessage getVersionDescription()
    Gets the description of the version associated with the publication.

    This version is created from the dataspace that contains all the workflow models.

  - ### getPublicationSpecs

    Collection<PublicationSpec> getPublicationSpecs()
    Gets the publication specifications.

  - ### addPublicationSpec

    void addPublicationSpec(PublicationSpec aPublicationSpec) throws OperationException
    Adds a publication specification.

    This specification selects the workflow models to be published and specifies the `publication mode` and the publication name.

    Throws:
      `OperationException` -
      - If the name is already used for a new publication,
      - If the workflow model has no step,
      - If the workflow model contains sub workflows and others publication specifications exists.

  - ### addAllPublicationSpecs

    void addAllPublicationSpecs(Collection<PublicationSpec> aPublicationSpecs) throws OperationException
    Adds a collection of publication specifications.

    Each specification selects the workflow models to be published and specifies the `publication mode` and the publication name.

    Throws:
      `OperationException` -
      - If the name is already used for a new publication,
      - If the workflow model has no step,
      - If the workflow model contains sub workflows and others publication specifications exists.

  - ### publish

    VersionKey publish() throws OperationException
    Publishes the defined workflow models according to the publication specifications.
    Throws:
      `OperationException`