org.activiti.engine
接口 RepositoryService

所有已知实现类:
RepositoryServiceImpl

public interface RepositoryService

Service providing access to the repository of process definitions and deployments.

作者:
Tom Baeyens, Falko Menge, Tijs Rademakers, Joram Barrez, Henry Yan

方法摘要
 void activateProcessDefinitionById(String processDefinitionId)
          Activates the process definition with the given id.
 void activateProcessDefinitionById(String processDefinitionId, boolean activateProcessInstances, Date activationDate)
          Activates the process definition with the given id.
 void activateProcessDefinitionByKey(String processDefinitionKey)
          Activates the process definition with the given key (=id in the bpmn20.xml file).
 void activateProcessDefinitionByKey(String processDefinitionKey, boolean activateProcessInstances, Date activationDate)
          Activates the process definition with the given key (=id in the bpmn20.xml file).
 void addCandidateStarterGroup(String processDefinitionId, String groupId)
          Authorizes a candidate group for a process definition.
 void addCandidateStarterUser(String processDefinitionId, String userId)
          Authorizes a candidate user for a process definition.
 void addModelEditorSource(String modelId, byte[] bytes)
          Saves the model editor source for a model
 void addModelEditorSourceExtra(String modelId, byte[] bytes)
          Saves the model editor source extra for a model
 DeploymentBuilder createDeployment()
          Starts creating a new deployment
 DeploymentQuery createDeploymentQuery()
          Query deployment.
 ModelQuery createModelQuery()
          Query models.
 NativeDeploymentQuery createNativeDeploymentQuery()
          Returns a new NativeQuery for deployment.
 NativeModelQuery createNativeModelQuery()
          Returns a new NativeQuery for process definitions.
 NativeProcessDefinitionQuery createNativeProcessDefinitionQuery()
          Returns a new NativeQuery for process definitions.
 ProcessDefinitionQuery createProcessDefinitionQuery()
          Query process definitions.
 void deleteCandidateStarterGroup(String processDefinitionId, String groupId)
          Removes the authorization of a candidate group for a process definition.
 void deleteCandidateStarterUser(String processDefinitionId, String userId)
          Removes the authorization of a candidate user for a process definition.
 void deleteDeployment(String deploymentId)
          Deletes the given deployment.
 void deleteDeployment(String deploymentId, boolean cascade)
          Deletes the given deployment and cascade deletion to process instances, history process instances and jobs.
 void deleteDeploymentCascade(String deploymentId)
          已过时。 use deleteDeployment(String, boolean). This methods may be deleted from 5.3.
 void deleteModel(String modelId)
           
 org.activiti.bpmn.model.BpmnModel getBpmnModel(String processDefinitionId)
          Returns the BpmnModel corresponding with the process definition with the provided process definition id.
 List<String> getDeploymentResourceNames(String deploymentId)
          Retrieves a list of deployment resources for the given deployment, ordered alphabetically.
 List<IdentityLink> getIdentityLinksForProcessDefinition(String processDefinitionId)
          Retrieves the IdentityLinks associated with the given process definition.
 Model getModel(String modelId)
          Returns the Model
 byte[] getModelEditorSource(String modelId)
          Returns the model editor source as a byte array
 byte[] getModelEditorSourceExtra(String modelId)
          Returns the model editor source extra as a byte array
 ProcessDefinition getProcessDefinition(String processDefinitionId)
          Returns the ProcessDefinition including all BPMN information like additional Properties (e.g. documentation).
 InputStream getProcessDiagram(String processDefinitionId)
          Gives access to a deployed process diagram, e.g., a PNG image, through a stream of bytes.
 DiagramLayout getProcessDiagramLayout(String processDefinitionId)
          Provides positions and dimensions of elements in a process diagram as provided by getProcessDiagram(String).
 InputStream getProcessModel(String processDefinitionId)
          Gives access to a deployed process model, e.g., a BPMN 2.0 XML file, through a stream of bytes.
 InputStream getResourceAsStream(String deploymentId, String resourceName)
          Gives access to a deployment resource through a stream of bytes.
 Model newModel()
          Creates a new model.
 void saveModel(Model model)
          Saves the model.
 void setDeploymentCategory(String deploymentId, String category)
          Sets the category of the deployment.
 void setProcessDefinitionCategory(String processDefinitionId, String category)
          Sets the category of the process definition.
 void suspendProcessDefinitionById(String processDefinitionId)
          Suspends the process definition with the given id.
 void suspendProcessDefinitionById(String processDefinitionId, boolean suspendProcessInstances, Date suspensionDate)
          Suspends the process definition with the given id.
 void suspendProcessDefinitionByKey(String processDefinitionKey)
          Suspends the all process definitions with the given key (= id in the bpmn20.xml file).
 void suspendProcessDefinitionByKey(String processDefinitionKey, boolean suspendProcessInstances, Date suspensionDate)
          Suspends the all process definitions with the given key (= id in the bpmn20.xml file).
 

方法详细信息

createDeployment

DeploymentBuilder createDeployment()
Starts creating a new deployment


deleteDeployment

void deleteDeployment(String deploymentId)
Deletes the given deployment.

参数:
deploymentId - id of the deployment, cannot be null.

deleteDeploymentCascade

void deleteDeploymentCascade(String deploymentId)
已过时。 use deleteDeployment(String, boolean). This methods may be deleted from 5.3.

Deletes the given deployment and cascade deletion to process instances, history process instances and jobs.

参数:
deploymentId - id of the deployment, cannot be null.

deleteDeployment

void deleteDeployment(String deploymentId,
                      boolean cascade)
Deletes the given deployment and cascade deletion to process instances, history process instances and jobs.

参数:
deploymentId - id of the deployment, cannot be null.

setDeploymentCategory

void setDeploymentCategory(String deploymentId,
                           String category)
Sets the category of the deployment. Deployments can be queried by category: see DeploymentQuery.deploymentCategory(String).

抛出:
ActivitiObjectNotFoundException - if no deployment with the provided id can be found.

getDeploymentResourceNames

List<String> getDeploymentResourceNames(String deploymentId)
Retrieves a list of deployment resources for the given deployment, ordered alphabetically.

参数:
deploymentId - id of the deployment, cannot be null.

getResourceAsStream

InputStream getResourceAsStream(String deploymentId,
                                String resourceName)
Gives access to a deployment resource through a stream of bytes.

参数:
deploymentId - id of the deployment, cannot be null.
resourceName - name of the resource, cannot be null.
抛出:
ActivitiObjectNotFoundException - when the resource doesn't exist in the given deployment or when no deployment exists for the given deploymentId.

createProcessDefinitionQuery

ProcessDefinitionQuery createProcessDefinitionQuery()
Query process definitions.


createNativeProcessDefinitionQuery

NativeProcessDefinitionQuery createNativeProcessDefinitionQuery()
Returns a new NativeQuery for process definitions.


createDeploymentQuery

DeploymentQuery createDeploymentQuery()
Query deployment.


createNativeDeploymentQuery

NativeDeploymentQuery createNativeDeploymentQuery()
Returns a new NativeQuery for deployment.


suspendProcessDefinitionById

void suspendProcessDefinitionById(String processDefinitionId)
Suspends the process definition with the given id. If a process definition is in state suspended, it will not be possible to start new process instances based on the process definition. Note: all the process instances of the process definition will still be active (ie. not suspended)!

抛出:
ActivitiObjectNotFoundException - if no such processDefinition can be found
ActivitiException - if the process definition is already in state suspended.

suspendProcessDefinitionById

void suspendProcessDefinitionById(String processDefinitionId,
                                  boolean suspendProcessInstances,
                                  Date suspensionDate)
Suspends the process definition with the given id. If a process definition is in state suspended, it will not be possible to start new process instances based on the process definition.

参数:
suspendProcessInstances - If true, all the process instances of the provided process definition will be suspended too.
suspensionDate - The date on which the process definition will be suspended. If null, the process definition is suspended immediately. Note: The job executor needs to be active to use this!
抛出:
ActivitiObjectNotFoundException - if no such processDefinition can be found.
ActivitiException - if the process definition is already in state suspended.

suspendProcessDefinitionByKey

void suspendProcessDefinitionByKey(String processDefinitionKey)
Suspends the all process definitions with the given key (= id in the bpmn20.xml file). If a process definition is in state suspended, it will not be possible to start new process instances based on the process definition. Note: all the process instances of the process definition will still be active (ie. not suspended)!

抛出:
ActivitiObjectNotFoundException - if no such processDefinition can be found
ActivitiException - if the process definition is already in state suspended.

suspendProcessDefinitionByKey

void suspendProcessDefinitionByKey(String processDefinitionKey,
                                   boolean suspendProcessInstances,
                                   Date suspensionDate)
Suspends the all process definitions with the given key (= id in the bpmn20.xml file). If a process definition is in state suspended, it will not be possible to start new process instances based on the process definition.

参数:
suspendProcessInstances - If true, all the process instances of the provided process definition will be suspended too.
suspensionDate - The date on which the process definition will be suspended. If null, the process definition is suspended immediately. Note: The job executor needs to be active to use this!
抛出:
ActivitiObjectNotFoundException - if no such processDefinition can be found
ActivitiException - if the process definition is already in state suspended.

activateProcessDefinitionById

void activateProcessDefinitionById(String processDefinitionId)
Activates the process definition with the given id.

抛出:
ActivitiObjectNotFoundException - if no such processDefinition can be found or if the process definition is already in state active.

activateProcessDefinitionById

void activateProcessDefinitionById(String processDefinitionId,
                                   boolean activateProcessInstances,
                                   Date activationDate)
Activates the process definition with the given id.

参数:
activationDate - The date on which the process definition will be activated. If null, the process definition is suspended immediately. Note: The job executor needs to be active to use this!
抛出:
ActivitiObjectNotFoundException - if no such processDefinition can be found.
ActivitiException - if the process definition is already in state active.

activateProcessDefinitionByKey

void activateProcessDefinitionByKey(String processDefinitionKey)
Activates the process definition with the given key (=id in the bpmn20.xml file).

抛出:
ActivitiObjectNotFoundException - if no such processDefinition can be found.
ActivitiException - if the process definition is already in state active.

activateProcessDefinitionByKey

void activateProcessDefinitionByKey(String processDefinitionKey,
                                    boolean activateProcessInstances,
                                    Date activationDate)
Activates the process definition with the given key (=id in the bpmn20.xml file).

参数:
activationDate - The date on which the process definition will be activated. If null, the process definition is suspended immediately. Note: The job executor needs to be active to use this!
抛出:
ActivitiObjectNotFoundException - if no such processDefinition can be found.
ActivitiException - if the process definition is already in state active.

setProcessDefinitionCategory

void setProcessDefinitionCategory(String processDefinitionId,
                                  String category)
Sets the category of the process definition. Process definitions can be queried by category: see ProcessDefinitionQuery.processDefinitionCategory(String).

抛出:
ActivitiObjectNotFoundException - if no process defintion with the provided id can be found.

getProcessModel

InputStream getProcessModel(String processDefinitionId)
Gives access to a deployed process model, e.g., a BPMN 2.0 XML file, through a stream of bytes.

参数:
processDefinitionId - id of a ProcessDefinition, cannot be null.
抛出:
ActivitiObjectNotFoundException - when the process model doesn't exist.

getProcessDiagram

InputStream getProcessDiagram(String processDefinitionId)
Gives access to a deployed process diagram, e.g., a PNG image, through a stream of bytes.

参数:
processDefinitionId - id of a ProcessDefinition, cannot be null.
返回:
null when the diagram resource name of a ProcessDefinition is null.
抛出:
ActivitiObjectNotFoundException - when the process diagram doesn't exist.

getProcessDefinition

ProcessDefinition getProcessDefinition(String processDefinitionId)
Returns the ProcessDefinition including all BPMN information like additional Properties (e.g. documentation).


getBpmnModel

org.activiti.bpmn.model.BpmnModel getBpmnModel(String processDefinitionId)
Returns the BpmnModel corresponding with the process definition with the provided process definition id. The BpmnModel is a pojo versions of the BPMN 2.0 xml and can be used to introspect the process definition using regular Java.


getProcessDiagramLayout

DiagramLayout getProcessDiagramLayout(String processDefinitionId)
Provides positions and dimensions of elements in a process diagram as provided by getProcessDiagram(String). This method requires a process model and a diagram image to be deployed.

参数:
processDefinitionId - id of a ProcessDefinition, cannot be null.
返回:
Map with process element ids as keys and positions and dimensions as values.
抛出:
ActivitiObjectNotFoundException - when the process model or diagram doesn't exist.

newModel

Model newModel()
Creates a new model. The model is transient and must be saved using saveModel(Model).


saveModel

void saveModel(Model model)
Saves the model. If the model already existed, the model is updated otherwise a new model is created.

参数:
model - model to save, cannot be null.

deleteModel

void deleteModel(String modelId)
参数:
modelId - id of model to delete, cannot be null. When an id is passed for an unexisting model, this operation is ignored.

addModelEditorSource

void addModelEditorSource(String modelId,
                          byte[] bytes)
Saves the model editor source for a model

参数:
modelId - id of model to delete, cannot be null. When an id is passed for an unexisting model, this operation is ignored.

addModelEditorSourceExtra

void addModelEditorSourceExtra(String modelId,
                               byte[] bytes)
Saves the model editor source extra for a model

参数:
modelId - id of model to delete, cannot be null. When an id is passed for an unexisting model, this operation is ignored.

createModelQuery

ModelQuery createModelQuery()
Query models.


createNativeModelQuery

NativeModelQuery createNativeModelQuery()
Returns a new NativeQuery for process definitions.


getModel

Model getModel(String modelId)
Returns the Model

参数:
modelId - id of model

getModelEditorSource

byte[] getModelEditorSource(String modelId)
Returns the model editor source as a byte array

参数:
modelId - id of model

getModelEditorSourceExtra

byte[] getModelEditorSourceExtra(String modelId)
Returns the model editor source extra as a byte array

参数:
modelId - id of model

addCandidateStarterUser

void addCandidateStarterUser(String processDefinitionId,
                             String userId)
Authorizes a candidate user for a process definition.

参数:
processDefinitionId - id of the process definition, cannot be null.
userId - id of the user involve, cannot be null.
抛出:
ActivitiObjectNotFoundException - when the process definition or user doesn't exist.

addCandidateStarterGroup

void addCandidateStarterGroup(String processDefinitionId,
                              String groupId)
Authorizes a candidate group for a process definition.

参数:
processDefinitionId - id of the process definition, cannot be null.
groupId - id of the group involve, cannot be null.
抛出:
ActivitiObjectNotFoundException - when the process definition or group doesn't exist.

deleteCandidateStarterUser

void deleteCandidateStarterUser(String processDefinitionId,
                                String userId)
Removes the authorization of a candidate user for a process definition.

参数:
processDefinitionId - id of the process definition, cannot be null.
userId - id of the user involve, cannot be null.
抛出:
ActivitiObjectNotFoundException - when the process definition or user doesn't exist.

deleteCandidateStarterGroup

void deleteCandidateStarterGroup(String processDefinitionId,
                                 String groupId)
Removes the authorization of a candidate group for a process definition.

参数:
processDefinitionId - id of the process definition, cannot be null.
groupId - id of the group involve, cannot be null.
抛出:
ActivitiObjectNotFoundException - when the process definition or group doesn't exist.

getIdentityLinksForProcessDefinition

List<IdentityLink> getIdentityLinksForProcessDefinition(String processDefinitionId)
Retrieves the IdentityLinks associated with the given process definition. Such an IdentityLink informs how a certain identity (eg. group or user) is authorized for a certain process definition



Copyright © 2013 Alfresco. All rights reserved.