cancel
Showing results for 
Search instead for 
Did you mean: 

Semantics of RepositoryService.deleteDeployment()

rafael_cordones
Champ in-the-making
Champ in-the-making
Hi!

I am in the process (pun intended 😉 ) of getting to know Activiti and I have come across something that I interpret as a bug.

The following methods from the interface org.activiti.engine.RepositoryService:

  /** Deletes the given deployment.
   * @param deploymentId id of the deployment, cannot be null.
   * @throwns RuntimeException if there are still runtime or history process
   * instances or jobs.
   */
  void deleteDeployment(String deploymentId);
 
  /**
   * Deletes the given deployment and cascade deletion to process instances,
   * history process instances and jobs.
   * @param deploymentId id of the deployment, cannot be null.
   * @deprecated use {@link #deleteDeployment(String, boolean)}.  This methods may be deleted from 5.3.
   */
  void deleteDeploymentCascade(String deploymentId);

  /**
   * Deletes the given deployment and cascade deletion to process instances,
   * history process instances and jobs.
   * @param deploymentId id of the deployment, cannot be null.
   */
  void deleteDeployment(String deploymentId, boolean cascade);
do not report any error when you pass them a deploymentId that does not exist.
I would have expected an ActivitiException telling me that no deployment with that id was found (?).

While investigating I modified I added a test case to reproduce the issue
activiti-trunk/modules/activiti-engine/src/test/java/org/activiti/engine/test/api/repository/RepositoryServiceTest.java:


    public void testDeleteDeploymentWithNonExistingDeploymentId() {
      String deploymentId = "NonExistingDeploymentId";
      try {
        repositoryService.deleteDeployment(deploymentId);
        fail("ActivitiException expected");
      } catch (ActivitiException ae) {
        assertTextPresent("Unable to find a deployment with deploymentId '" + deploymentId + "'", ae.getMessage());
      }
    }

Is this a bug or expected behavior? Thanks for your feedback!

Regards,

/rafa
2 REPLIES 2

bernd_ruecker
Champ in-the-making
Champ in-the-making
Hi Rafa.

From my perspective this is indeed a bug and an exception should be thrown instead. If knowbody complains maybe best is to create a JIRA issue and indicate the importance for you, since I think that is not a super urgent issue?

Cheers
Bernd

rafael_cordones
Champ in-the-making
Champ in-the-making
I've created https://jira.codehaus.org/browse/ACT-1025 to track this!

Regards,

/rafa
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.