org.ow2.bonita.facade
Interface ManagementAPI


public interface ManagementAPI

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, ....

Author:
Marc Blachon, Guillaume Porcher, Charles Souillard, Miguel Valdes, Pierre Vigneras
See Also:
TxHook, Hook

Method Summary
 void addMetaData(java.lang.String key, java.lang.String value)
          Add a meta data.
 void deleteAllProcesses()
          Deletes from journal and history :
all packages and their processes all instances of these processes.
 void deleteMetaData(java.lang.String key)
          Delete a meta data.
 void deleteProcess(ProcessDefinitionUUID processUUID)
          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.
 ProcessDefinition deploy(BusinessArchive businessArchive)
           
 ProcessDefinition deployBar(byte[] barContent)
          Deploys the businessArchive represented by this byte array.
 ProcessDefinition deployBar(java.net.URL barFileURL)
          Deploys the business archive represented by the given url.
 void deployClass(byte[] clazz)
          Deploys a class giving its bytes table.
 void deployClasses(java.util.Collection<byte[]> classes)
          Deploys several classes in global class repository giving a collection of data classes.
 void deployClassesInJar(byte[] classesArchive)
          Deploys several classes in global class repository giving an archive containing the classes.
 java.lang.String getLoggedUser()
          Returns the current logged user
 java.lang.String getMetaData(java.lang.String key)
          Obtains a meta data.
 void removeClass(java.lang.String className)
          Removes a class giving the class name.
 void removeClasses(java.lang.String[] classNames)
          Removes classes giving there class names.
 void replaceClass(java.lang.String className, byte[] newClazz)
          Removes the class with the given className name.
 void undeploy(ProcessDefinitionUUID processUUID)
          Un-deploys a Workflow package giving the package UUID.
 

Method Detail

deployBar

ProcessDefinition deployBar(java.net.URL barFileURL)
                            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...)

Parameters:
barFileURL: - url of bar to deploy
Returns:
a Map of all deployed processes. Key=processId, value=processDefinition
Throws:
DeploymentException - if an error occurs while deploying the given Bar
BonitaInternalException - if an exception occurs.

deployBar

ProcessDefinition deployBar(byte[] barContent)
                            throws DeploymentException
Deploys the businessArchive represented by this byte array. A businessArchive must contain one and only one xpdl file or one def file. It must also contain all necessary resources (jar files, classes, forms, properties files...)

Parameters:
barContent: - barContent to deploy
Returns:
a Map of all deployed processes. Key=processId, value=processDefinition
Throws:
DeploymentException - if an error occurs while deploying the given Bar
BonitaInternalException - if an exception occurs.

deploy

ProcessDefinition deploy(BusinessArchive businessArchive)
                         throws DeploymentException
Throws:
DeploymentException

deployClass

void deployClass(byte[] clazz)
                 throws DeploymentException
Deploys a class giving its bytes table.

Parameters:
clazz - the bytes table of the class.
Throws:
DeploymentException - if there is already a deployed class with this name.
BonitaInternalException - if an other exception occurs.

deployClasses

void deployClasses(java.util.Collection<byte[]> classes)
                   throws DeploymentException
Deploys several classes in global class repository giving a collection of data classes.

Parameters:
classes - a collection of classes. Each class is represented by a bytes table.
Throws:
java.lang.IllegalArgumentException - if classes is null parameter.
DeploymentException - if there is already a deployed class with the name
BonitaInternalException - if an other exception occurs.

deployClassesInJar

void deployClassesInJar(byte[] classesArchive)
                        throws DeploymentException
Deploys several classes in global class repository giving an archive containing the classes.

Parameters:
classesArchive - the archive containing the classes represented by a bytes table.
Throws:
java.lang.IllegalArgumentException - if the classes is null parameter.
DeploymentException - if there is already a deployed class with this name or there's an IOException occurs.
BonitaInternalException - if an other exception occurs.

undeploy

void undeploy(ProcessDefinitionUUID processUUID)
              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.

Parameters:
processUUID - the process definition UUID. This UUID can be retrieved from any NamedElement (e.g. ProcessDefinition) by calling org.ow2.bonita.facade.def.majorElement.NamedElement#getProcessDefinitionUUID()
Throws:
java.lang.IllegalStateException - if the given parameter is null.
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.
  • .
BonitaInternalException - if an exception occurs.

removeClass

void removeClass(java.lang.String className)
                 throws DeploymentException
Removes a class giving the class name.

Parameters:
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.
BonitaInternalException - if an other exception occurs.

removeClasses

void removeClasses(java.lang.String[] classNames)
                   throws DeploymentException
Removes classes giving there class names.

Parameters:
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).
BonitaInternalException - if an other exception occurs.

replaceClass

void replaceClass(java.lang.String className,
                  byte[] newClazz)
                  throws DeploymentException
Removes the class with the given className name. Deploy the new given one.

Parameters:
className - the class name to be replaced.
newClazz - the bytes table of the new class.
Throws:
DeploymentException - if the class to be replaced is not found into the global class repository.
BonitaInternalException - if an other exception occurs.

deleteProcess

void deleteProcess(ProcessDefinitionUUID processUUID)
                   throws ProcessNotFoundException,
                          UndeletableProcessException,
                          UndeletableInstanceException
Deletes from journal and history :

deleteAllProcesses

void deleteAllProcesses()
                        throws UndeletableInstanceException,
                               UndeletableProcessException
Deletes from journal and history :

getLoggedUser

java.lang.String getLoggedUser()
Returns the current logged user


addMetaData

void addMetaData(java.lang.String key,
                 java.lang.String value)
Add a meta data.

Parameters:
key - the meta data key
value - the meta data value

getMetaData

java.lang.String getMetaData(java.lang.String key)
Obtains a meta data.

Parameters:
key - the key of the meta data
Returns:
the value of the meta data

deleteMetaData

void deleteMetaData(java.lang.String key)
Delete a meta data.

Parameters:
key - the key of the meta data


Copyright © 2009 OW2 Consortium. All Rights Reserved.