public class BusinessArchiveBuilder extends Object
BusinessArchive
A typical use of this class is to build programmatically Business archive in order to deploy it using the ProcessAPI
If you wish to deploy a BusinessArchived stored in a .bar file use BusinessArchiveFactory instead.
Usage example:
BusinessArchive businessArchive = BusinessArchiveBuilder().createNewBusinessArchive().setProcessDefinition(processDefinition).done();
| Constructor and Description |
|---|
BusinessArchiveBuilder() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addBarResourceInPath(BarResource resource,
String path) |
BusinessArchiveBuilder |
addClasspathResource(BarResource resource)
Add JAR dependencies to the business archive.
|
BusinessArchiveBuilder |
addConnectorImplementation(BarResource resource)
Add connector implementation descriptor to the business archive.
|
BusinessArchiveBuilder |
addDocumentResource(BarResource resource)
Add document contents in the
BusinessArchive |
BusinessArchiveBuilder |
addExternalResource(BarResource resource)
Add resource in the
BusinessArchive used by extensions |
BusinessArchiveBuilder |
addUserFilters(BarResource resource)
same as
addConnectorImplementation(BarResource) but for UserFilter |
BusinessArchiveBuilder |
createNewBusinessArchive() |
BusinessArchive |
done() |
BusinessArchiveBuilder |
setActorMapping(byte[] xmlContent)
Set the actor mapping for this
BusinessArchive
The file must be compliant with the xsd actorMapping.xsd The actor mapping specify for each actor of the process who it is in the
organization. |
BusinessArchiveBuilder |
setParameters(Map<String,String> parameters)
Set the parameters values
Parameters must also be defined in the
ProcessDefinition using ProcessDefinitionBuilder
DesignProcessDefinition can be constructed using ProcessDefinitionBuilder |
BusinessArchiveBuilder |
setProcessDefinition(DesignProcessDefinition processDefinition)
Set the process definition of the
BusinessArchive that is currently build
DesignProcessDefinition can be constructed using ProcessDefinitionBuilder |
public BusinessArchiveBuilder createNewBusinessArchive()
public BusinessArchiveBuilder setProcessDefinition(DesignProcessDefinition processDefinition)
BusinessArchive that is currently build
DesignProcessDefinition can be constructed using ProcessDefinitionBuilder
processDefinition - BusinessArchiveBuilder in order to chain callsProcessDefinitionBuilderpublic BusinessArchiveBuilder setParameters(Map<String,String> parameters)
Parameters must also be defined in the ProcessDefinition using ProcessDefinitionBuilder
DesignProcessDefinition can be constructed using ProcessDefinitionBuilder
processDefinition - BusinessArchiveBuilder in order to chain callsProcessDefinitionBuilderpublic BusinessArchiveBuilder addClasspathResource(BarResource resource)
Everything that is added as classpath resource will be added in the (JAVA) classpath of the process
e.g. if you add a connector in your process add here dependencies the process need to execute it
resource - the BarResource the represent a JAR fileBusinessArchiveBuilder in order to chain callspublic BusinessArchiveBuilder addConnectorImplementation(BarResource resource)
This resource must be a connector implementation descriptor file (.impl) and must be compliant to the connector-implementation-descriptor.xsd
A connector definition should also be added in the ProcessDefinition using
ProcessDefinitionBuilder#addConnector(String, String, String, org.bonitasoft.engine.bpm.model.ConnectorEvent) or
ActivityDefinitionBuilder#addConnector(String, String, String, org.bonitasoft.engine.bpm.model.ConnectorEvent)
e.g. if you add a connector in your process add here dependencies the process need to execute it
resource - the BarResource the represent a connector implementation descriptor fileBusinessArchiveBuilder in order to chain callspublic BusinessArchiveBuilder addUserFilters(BarResource resource)
addConnectorImplementation(BarResource) but for UserFilterresource - BusinessArchiveBuilder in order to chain callsaddConnectorImplementation(BarResource)public BusinessArchiveBuilder setActorMapping(byte[] xmlContent)
BusinessArchive
The file must be compliant with the xsd actorMapping.xsd The actor mapping specify for each actor of the process who it is in the
organization.
It is not mandatory to set it in the BusinessArchive, it can be set after the process was deployed using
ProcessManagementAPI.addUserToActor(long, long), ProcessManagementAPI.addGroupToActor(long, long), ProcessManagementAPI.addRoleToActor(long, long) or
ProcessManagementAPI.addRoleAndGroupToActor(long, long, long)
xmlContent - the xml file content that describe the actor mappingBusinessArchiveBuilder in order to chain callspublic BusinessArchiveBuilder addExternalResource(BarResource resource)
BusinessArchive used by extensionsresource - the resource to be added in the business archiveBusinessArchiveBuilder in order to chain callspublic BusinessArchiveBuilder addDocumentResource(BarResource resource)
BusinessArchiveresource - ProcessDefinitionBuilder.addDocumentDefinition(String)protected void addBarResourceInPath(BarResource resource, String path)
public BusinessArchive done() throws InvalidBusinessArchiveFormatException
InvalidBusinessArchiveFormatException - when the business archive is inconsistent in the current stateCopyright © 2013 BonitaSoft. All Rights Reserved.