
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.
**/
package org.ow2.bonita.facade;
import java.net.URL;
import java.util.Collection;
import java.util.Map;
import org.ow2.bonita.facade.def.element.BusinessArchive;
import org.ow2.bonita.facade.def.majorElement.ProcessDefinition;
import org.ow2.bonita.facade.exception.DeploymentException;
import org.ow2.bonita.facade.exception.PackageNotFoundException;
import org.ow2.bonita.facade.exception.UndeletableInstanceException;
import org.ow2.bonita.facade.exception.UndeletablePackageException;
import org.ow2.bonita.facade.uuid.PackageDefinitionUUID;
/**
* Workflow process deployment operations. Individual or grouped deployment of objects relating to the process definition:
* XPDL file, java class data Ofor 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 XPDL Workflow Package giving the URL of the XPDL file.
* @param xpdlURL the URL of the XPDL file.
* @return a map of deployed process definitions
* (keys are the id of the processes as specified by the value of the Id attribute
* within the WorkflowProcess elements into the XPDL definition file
* and values are the {@link org.ow2.bonita.facade.def.majorElement.ProcessDefinition ProcessDefinition} objects).
* @throws DeploymentException
*
* - if XPDL file cannot be found at the given URL
* - if a process has already been deployed with the same version. New version is required
* - if the version of the package containing processes with new versions has not been changed.
*
* if required classes have not been found into the global class repository.
* @throws BonitaInternalException if an other exception occurs.
*/
@Deprecated
Map deployXpdl(final URL xpdlURL) throws DeploymentException;
/**
* deploys the XPDL Workflow Package giving the byte array of the serialazed XPDL file.
* @param xpdlFile the byte array of the XPDL file.
* @return a map of deployed process definitions
* (keys are the id of the processes as specified by the value of the Id attribute
* within the WorkflowProcess elements into the XPDL definition file
* and values are the {@link org.ow2.bonita.facade.def.majorElement.ProcessDefinition ProcessDefinition} objects).
* @throws DeploymentException
*
* - if XPDL file cannot be deserialized from the given byte arry
* - if a process has already been deployed with the same version. New version is required
* - if the version of the package containing processes with new versions has not been changed.
*
* if required classes have not been found into the global class repository.
* @throws BonitaInternalException if an other exception occurs.
*/
@Deprecated
Map deployXpdl(final byte[] xpdlFile) throws DeploymentException;
/**
* Deploys the XPDL Workflow Package and its depending java classes.
* giving the URL of the XPDL file and the table of classes.
* Classes are deployed at package level (not global level repository).
* @param xpdlURL the URL of the XPDL file.
* @param classes the table of java classes.
* @return a map of deployed process definitions
* (keys are the id of the processes as specified by the value of the Id attribute
* within the WorkflowProcess elements into the XPDL definition file
* and values are the {@link org.ow2.bonita.facade.def.majorElement.ProcessDefinition ProcessDefinition} objects).
* @throws DeploymentException
*
* - if XPDL file cannot be found at the given URL
* - if a process has already been deployed with the same version. New version is required
* - if the version of the package containing processes with new versions has not been changed.
*
* if required classes have not been found firstly within the provided classes (package dependence)
* or secondly into the global class repository.
* @throws BonitaInternalException if an other exception occurs.
*/
@Deprecated
Map deploy(final URL xpdlURL, final Class< ? >[] classes) throws DeploymentException;
/**
* Deploys the XPDL Workflow giving the URL of the bar archive
* containing the XPDL Workflow Package and optionally its depending java classes.
* Classes are deployed at package level (not global level repository).
* @param barURL the URL of the business archive
* @return a map of deployed process definitions
* (keys are the id of the processes as specified by the value of the Id attribute
* within the WorkflowProcess elements into the XPDL definition file
* and values are the {@link org.ow2.bonita.facade.def.majorElement.ProcessDefinition ProcessDefinition} objects).
* @throws DeploymentException
*
* - if the archive does not contain any XPDL file
* - if the archive contains more than one XPDL file
* - if a process has already been deployed with the same version. New version is required
* - if the version of the package containing processes with new versions has not been changed.
* - if required classes have not been found firstly within the archive (package dependence)
* or secondly into the global class repository.
*
* @throws BonitaInternalException if an other exception occurs.
*/
@Deprecated
Map deployZip(final URL barURL) throws DeploymentException;
/**
* Deploys the XPDL Workflow giving the byte table of the zip archive
* containing the XPDL Workflow Package and optionnally its depending java classes.
* Classes are deployed at package level (not global level repository).
* @param zipFile the bytes table of the zip file.
* @return a map of deployed process definitions
* (keys are the id of the processes as specified by the value of the Id attribute
* within the WorkflowProcess elements into the XPDL definition file
* and values are the {@link org.ow2.bonita.facade.def.majorElement.ProcessDefinition ProcessDefinition} objects).
* @throws DeploymentException
*
* - if the archive does not contain any XPDL file
* - if the archive contains more than one XPDL file
* - if a process has already been deployed with the same version. New version is required.
* - if the version of the package containing processes with new versions has not been changed too.
* - if required classes have not been found firstly within the archive (package dependence)
* or secondly into the global class repository.
*
* @throws BonitaInternalException if an other exception occurs.
*/
@Deprecated
Map deployZip(final byte[] zipFile) throws DeploymentException;
/**
* Deploys the XPDL Workflow giving the deployment object containing
* the XPDL Workflow Package and optionnally its depending java classes.
* Classes are deployed at package level (not global level repository).
* @param deployment the deployment object that should contain the XPDL file and the depending classes.
* @return a map of deployed process definitions
* (keys are the id of the processes as specified by the value of the Id attribute
* within the WorkflowProcess elements into the XPDL definition file
* and values are the {@link org.ow2.bonita.facade.def.majorElement.ProcessDefinition ProcessDefinition} objects).
* @throws DeploymentException
*
* - if the deployment does not contain any XPDL file
* - if the deployment contains more than one XPDL file
* - if a process has already been deployed with the same version. New version is required
* - if the version of the package containing processes with new versions has not been changed too.
* - if required classes have not been found firstly within the deployment object (package dependence)
* or secondly into the global class repository.
*
* @throws BonitaInternalException if an exception occurs.
*/
@Deprecated
Map deploy(final BusinessArchive businessArchive) throws DeploymentException;
/**
* Deploys the business archive represented by the given url.
* A businessArchive must contain one and only one xpdl file. It must also contain
* all necessary resources (jar files, classes, forms, properties files...)
* @param barFileURL: url of bar to deploy
* @throws DeploymentException if an error occurs while deploying the given Bar
* @throws BonitaInternalException if an exception occurs.
* @return a Map of all deployed processes. Key=processId, value=processDefinition
*/
Map deployBar(final URL barFileURL) throws DeploymentException;
/**
* Deploys the businessArchive represented by this byte array.
* A businessArchive must contain one and only one xpdl file. It must also contain
* all necessary resources (jar files, classes, forms, properties files...)
* @param barContent: barContent to deploy
* @throws DeploymentException if an error occurs while deploying the given Bar
* @throws BonitaInternalException if an exception occurs.
* @return a Map of all deployed processes. Key=processId, value=processDefinition
*/
Map deployBar(final byte[] barContent) 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 packageUUID the package definition UUID.
* This UUID can be retrieved from any {@link org.ow2.bonita.facade.def.majorElement.DefinitionRecord}
* (e.g. {@link org.ow2.bonita.facade.def.majorElement.ProcessDefinition})
* by calling {@link org.ow2.bonita.facade.def.majorElement.DefinitionRecord#getPackageDefinitionUUID()}
* @throws IllegalStateException if the given parameter is null.
* @throws DeploymentException
*
* - if the package has not been found in the journal (ie. the package is not deployed)
* - if there's still running instances for process(es) deployed within the package.
.
*
* @throws BonitaInternalException if an exception occurs.
*/
void undeploy(final PackageDefinitionUUID packageUUID) 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 UndeletablePackageException is thrown if at least one process can't be deleted.
*
* @param pacDefinitionUUID UUID of the package to delete
* @throws PackageNotFoundException if the package can't be found
* @throws UndeletablePackageException 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 deletePackage(PackageDefinitionUUID pacDefinitionUUID) throws PackageNotFoundException,
UndeletablePackageException, 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 deleteAllPackages() throws UndeletableInstanceException, UndeletablePackageException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy