All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ow2.bonita.facade.ManagementAPI Maven / Gradle / Ivy

/**
 * Copyright (C) 2007  Bull S. A. S.
 * Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois
 * This library is free software; you can redistribute it and/or modify it under the terms
 * of the GNU Lesser General Public License as published by the Free Software Foundation
 * version 2.1 of the License.
 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 * You should have received a copy of the GNU Lesser General Public License along with this
 * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
 * Floor, Boston, MA  02110-1301, USA.
 * 
 * Modified by Matthieu Chaffotte - BonitaSoft S.A.
 **/
package org.ow2.bonita.facade;

import java.util.Collection;

import org.ow2.bonita.facade.def.element.BusinessArchive;
import org.ow2.bonita.facade.def.majorElement.ProcessDefinition;
import org.ow2.bonita.facade.exception.BonitaInternalException;
import org.ow2.bonita.facade.exception.DeploymentException;
import org.ow2.bonita.facade.exception.ProcessNotFoundException;
import org.ow2.bonita.facade.exception.UndeletableInstanceException;
import org.ow2.bonita.facade.exception.UndeletableProcessException;
import org.ow2.bonita.facade.uuid.ProcessDefinitionUUID;

/**
 * Workflow process deployment operations. Individual or grouped deployment of objects relating to the process definition:
 * XPDL file, java class data for hooks, mappers, performer assignments, ....
 * @see org.ow2.bonita.definition.TxHook
 * @see org.ow2.bonita.definition.Hook
 * @author Marc Blachon, Guillaume Porcher, Charles Souillard, Miguel Valdes, Pierre Vigneras
 */
public interface ManagementAPI {

  /**
   * Deploys the given businessArchive into Bonita server.
   * A businessArchive can be build using BusinessArchiveFactory class
   * @param businessArchive businessArchive to deploy
   * @throws DeploymentException if an error occurs while deploying the given Bar
   * @throws BonitaInternalException if an exception occurs.
   * @return the deployed process
   */
  ProcessDefinition deploy(final BusinessArchive businessArchive) throws DeploymentException;

  /**
   * Deploys a class giving its bytes table.
   * @param clazz the bytes table of the class.
   * @throws DeploymentException if there is already a deployed class with this name.
   * @throws BonitaInternalException if an other exception occurs.
   */
  void deployClass(byte[] clazz) throws DeploymentException;

  /**
   * Deploys several classes in global class repository giving a collection of data classes.
   * @param classes a collection of classes. Each class is represented by a bytes table.
   * @throws IllegalArgumentException if classes is null parameter.
   * @throws DeploymentException if there is already a deployed class with the name
   * @throws BonitaInternalException if an other exception occurs.
   */
  void deployClasses(Collection classes) throws DeploymentException;

  /**
   * Deploys several classes in global class repository giving an archive containing the classes.
   * @param classesArchive the archive containing the classes represented by a bytes table.
   * @throws IllegalArgumentException if the classes is null parameter.
   * @throws DeploymentException if there is already a deployed class with this name or there's an IOException occurs.
   * @throws BonitaInternalException if an other exception occurs.
   */
  void deployClassesInJar(byte[] classesArchive) throws DeploymentException;

  /**
   * Un-deploys a Workflow package giving the package UUID. This operation undeploys also
   * the classes that have been deployed within the initial package deployment.
   * @param processUUID the process definition UUID.
   * This UUID can be retrieved from any {@link org.ow2.bonita.facade.def.majorElement.NamedElement}
   * (e.g. {@link org.ow2.bonita.facade.def.majorElement.ProcessDefinition})
   * by calling {@link org.ow2.bonita.facade.def.majorElement.NamedElement#getProcessDefinitionUUID()}
   * @throws IllegalStateException if the given parameter is null.
   * @throws DeploymentException
   * 
    *
  • if the package has not been found in the journal (i.e. the package is not deployed)
  • *
  • if there's still running instances for process(es) deployed within the package.
  • . *
* @throws BonitaInternalException if an exception occurs. */ @Deprecated void undeploy(final ProcessDefinitionUUID processUUID) throws DeploymentException; /** * Removes a class giving the class name. * @param className the name of the class. * @throws DeploymentException if there's no class defined in global class repository with this name * or a deployed process is still using this class. * @throws BonitaInternalException if an other exception occurs. */ void removeClass(String className) throws DeploymentException; /** * Removes classes giving there class names. * @param classNames the table of class names. * @throws DeploymentException if there's no class defined in global class repository with this name * or a deployed process is still using given classes (deployed into the global class repository). * @throws BonitaInternalException if an other exception occurs. */ void removeClasses(String[] classNames) throws DeploymentException; /** * Removes the class with the given className name. Deploy the new given one. * @param className the class name to be replaced. * @param newClazz the bytes table of the new class. * @throws DeploymentException if the class to be replaced is not found * into the global class repository. * @throws BonitaInternalException if an other exception occurs. */ void replaceClass(String className, byte[] newClazz) throws DeploymentException; /** * Deletes from journal and history :
*
    *
  • the given package
  • *
  • all its processes
  • *
  • all instances of these processes.
  • *
      * Warning UndeletableProcessException is thrown if at least one process can't be deleted. * * @param processUUID UUID of the package to delete * @throws ProcessNotFoundException if the package can't be found * @throws UndeletableProcessException if at least one process instance can't be deleted * @throws UndeletableInstanceException if at least one instance of this process can't be deleted * @throws BonitaInternalException if an other exception occurs. */ void deleteProcess(ProcessDefinitionUUID processUUID) throws ProcessNotFoundException, UndeletableProcessException, UndeletableInstanceException; /** * Deletes from journal and history :
      *
        *
      • all packages and their processes
      • *
      • all instances of these processes.
      • *
          * * @throws UndeletableInstanceException if at least one instance of this process can't be deleted * @throws UndeletablePackaException if at least one instance of this process can't be deleted * @throws BonitaInternalException if an other exception occurs. */ void deleteAllProcesses() throws UndeletableInstanceException, UndeletableProcessException; /** * Returns the current logged user
          */ String getLoggedUser(); /** * Add a meta data. * @param key the meta data key * @param value the meta data value */ void addMetaData(String key, String value); /** * Obtains a meta data. * @param key the key of the meta data * @return the value of the meta data */ String getMetaData(String key); /** * Delete a meta data. * @param key the key of the meta data */ void deleteMetaData(String key); /** * Disable a process * @param processUUID the process definition UUID * @throws DeploymentException if the process has not got the enable state */ void disable(final ProcessDefinitionUUID processUUID) throws DeploymentException; /** * Enable a process * @param processUUID the process definition UUID * @throws DeploymentException if the process has not got the disable state */ void enable(final ProcessDefinitionUUID processUUID) throws DeploymentException; /** * Archive a process. An archived process cannot be enable anymore. * @param processUUID the process definition UUID * @throws DeploymentException if the process has not got the disable state */ void archive(final ProcessDefinitionUUID processUUID) throws DeploymentException; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy