public class RepositoryServiceImpl extends ServiceImpl implements RepositoryService
commandExecutor, processEngineConfiguration
Constructor and Description |
---|
RepositoryServiceImpl() |
Modifier and Type | Method and Description |
---|---|
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 |
activateProcessDefinitionByKey(String processDefinitionKey,
boolean activateProcessInstances,
Date activationDate,
String tenantId)
Similar to
RepositoryService.activateProcessDefinitionByKey(String, boolean, Date) , but only applicable for the given tenant identifier. |
void |
activateProcessDefinitionByKey(String processDefinitionKey,
String tenantId)
Similar to
RepositoryService.activateProcessDefinitionByKey(String) , but only applicable for the given tenant identifier. |
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
|
void |
changeDeploymentTenantId(String deploymentId,
String newTenantId)
EXPERIMENTAL FEATURE!
Changes the tenant identifier of a deployment to match the given tenant identifier.
|
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)
Deletes the given deployment and cascade deletion to process instances,
history process instances and jobs.
|
void |
deleteModel(String modelId) |
Deployment |
deploy(DeploymentBuilderImpl deploymentBuilder) |
org.activiti.bpmn.model.BpmnModel |
getBpmnModel(String processDefinitionId)
Returns the
BpmnModel corresponding with the process definition with
the provided process definition id. |
ReadOnlyProcessDefinition |
getDeployedProcessDefinition(String processDefinitionId) |
List<String> |
getDeploymentResourceNames(String deploymentId)
Retrieves a list of deployment resources for the given deployment,
ordered alphabetically.
|
List<IdentityLink> |
getIdentityLinksForProcessDefinition(String processDefinitionId)
Retrieves the
IdentityLink s 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. |
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
RepositoryService.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.
|
boolean |
isProcessDefinitionSuspended(String processDefinitionId)
Checks if the process definition is suspended.
|
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).
|
void |
suspendProcessDefinitionByKey(String processDefinitionKey,
boolean suspendProcessInstances,
Date suspensionDate,
String tenantId)
Similar to
RepositoryService.suspendProcessDefinitionByKey(String, boolean, Date) , but only applicable for the given tenant identifier. |
void |
suspendProcessDefinitionByKey(String processDefinitionKey,
String tenantId)
Similar to
RepositoryService.suspendProcessDefinitionByKey(String) , but only applicable for the given tenant identifier. |
List<ValidationError> |
validateProcess(org.activiti.bpmn.model.BpmnModel bpmnModel)
Validates the given process definition against the rules for executing a process definition
on the Activiti engine.
|
getCommandExecutor, setCommandExecutor
public DeploymentBuilder createDeployment()
RepositoryService
createDeployment
in interface RepositoryService
public Deployment deploy(DeploymentBuilderImpl deploymentBuilder)
public void deleteDeployment(String deploymentId)
RepositoryService
deleteDeployment
in interface RepositoryService
deploymentId
- id of the deployment, cannot be null.public void deleteDeploymentCascade(String deploymentId)
RepositoryService
deleteDeploymentCascade
in interface RepositoryService
deploymentId
- id of the deployment, cannot be null.public void deleteDeployment(String deploymentId, boolean cascade)
RepositoryService
deleteDeployment
in interface RepositoryService
deploymentId
- id of the deployment, cannot be null.public void setDeploymentCategory(String deploymentId, String category)
RepositoryService
DeploymentQuery.deploymentCategory(String)
.setDeploymentCategory
in interface RepositoryService
public ProcessDefinitionQuery createProcessDefinitionQuery()
RepositoryService
createProcessDefinitionQuery
in interface RepositoryService
public NativeProcessDefinitionQuery createNativeProcessDefinitionQuery()
RepositoryService
NativeQuery
for process definitions.createNativeProcessDefinitionQuery
in interface RepositoryService
public List<String> getDeploymentResourceNames(String deploymentId)
RepositoryService
getDeploymentResourceNames
in interface RepositoryService
deploymentId
- id of the deployment, cannot be null.public InputStream getResourceAsStream(String deploymentId, String resourceName)
RepositoryService
getResourceAsStream
in interface RepositoryService
deploymentId
- id of the deployment, cannot be null.resourceName
- name of the resource, cannot be null.public void changeDeploymentTenantId(String deploymentId, String newTenantId)
RepositoryService
changeDeploymentTenantId
in interface RepositoryService
deploymentId
- The id of the deployment of which the tenant identifier will be changed.newTenantId
- The new tenant identifier.public DeploymentQuery createDeploymentQuery()
RepositoryService
createDeploymentQuery
in interface RepositoryService
public NativeDeploymentQuery createNativeDeploymentQuery()
RepositoryService
NativeQuery
for deployment.createNativeDeploymentQuery
in interface RepositoryService
public ProcessDefinition getProcessDefinition(String processDefinitionId)
RepositoryService
ProcessDefinition
including all BPMN information like additional
Properties (e.g. documentation).getProcessDefinition
in interface RepositoryService
public org.activiti.bpmn.model.BpmnModel getBpmnModel(String processDefinitionId)
RepositoryService
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.getBpmnModel
in interface RepositoryService
public ReadOnlyProcessDefinition getDeployedProcessDefinition(String processDefinitionId)
public boolean isProcessDefinitionSuspended(String processDefinitionId)
RepositoryService
isProcessDefinitionSuspended
in interface RepositoryService
public void suspendProcessDefinitionById(String processDefinitionId)
RepositoryService
suspendProcessDefinitionById
in interface RepositoryService
public void suspendProcessDefinitionById(String processDefinitionId, boolean suspendProcessInstances, Date suspensionDate)
RepositoryService
suspendProcessDefinitionById
in interface RepositoryService
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!public void suspendProcessDefinitionByKey(String processDefinitionKey)
RepositoryService
suspendProcessDefinitionByKey
in interface RepositoryService
public void suspendProcessDefinitionByKey(String processDefinitionKey, boolean suspendProcessInstances, Date suspensionDate)
RepositoryService
suspendProcessDefinitionByKey
in interface RepositoryService
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!public void suspendProcessDefinitionByKey(String processDefinitionKey, String tenantId)
RepositoryService
RepositoryService.suspendProcessDefinitionByKey(String)
, but only applicable for the given tenant identifier.suspendProcessDefinitionByKey
in interface RepositoryService
public void suspendProcessDefinitionByKey(String processDefinitionKey, boolean suspendProcessInstances, Date suspensionDate, String tenantId)
RepositoryService
RepositoryService.suspendProcessDefinitionByKey(String, boolean, Date)
, but only applicable for the given tenant identifier.suspendProcessDefinitionByKey
in interface RepositoryService
public void activateProcessDefinitionById(String processDefinitionId)
RepositoryService
activateProcessDefinitionById
in interface RepositoryService
public void activateProcessDefinitionById(String processDefinitionId, boolean activateProcessInstances, Date activationDate)
RepositoryService
activateProcessDefinitionById
in interface RepositoryService
activationDate
- The date on which the process definition will be activated. If null, the
process definition is activated immediately.
Note: The job executor needs to be active to use this!public void activateProcessDefinitionByKey(String processDefinitionKey)
RepositoryService
activateProcessDefinitionByKey
in interface RepositoryService
public void activateProcessDefinitionByKey(String processDefinitionKey, boolean activateProcessInstances, Date activationDate)
RepositoryService
activateProcessDefinitionByKey
in interface RepositoryService
activationDate
- The date on which the process definition will be activated. If null, the
process definition is activated immediately.
Note: The job executor needs to be active to use this!public void activateProcessDefinitionByKey(String processDefinitionKey, String tenantId)
RepositoryService
RepositoryService.activateProcessDefinitionByKey(String)
, but only applicable for the given tenant identifier.activateProcessDefinitionByKey
in interface RepositoryService
public void activateProcessDefinitionByKey(String processDefinitionKey, boolean activateProcessInstances, Date activationDate, String tenantId)
RepositoryService
RepositoryService.activateProcessDefinitionByKey(String, boolean, Date)
, but only applicable for the given tenant identifier.activateProcessDefinitionByKey
in interface RepositoryService
public void setProcessDefinitionCategory(String processDefinitionId, String category)
RepositoryService
ProcessDefinitionQuery.processDefinitionCategory(String)
.setProcessDefinitionCategory
in interface RepositoryService
public InputStream getProcessModel(String processDefinitionId)
RepositoryService
getProcessModel
in interface RepositoryService
processDefinitionId
- id of a ProcessDefinition
, cannot be null.public InputStream getProcessDiagram(String processDefinitionId)
RepositoryService
getProcessDiagram
in interface RepositoryService
processDefinitionId
- id of a ProcessDefinition
, cannot be null.ProcessDefinition
is null.public DiagramLayout getProcessDiagramLayout(String processDefinitionId)
RepositoryService
RepositoryService.getProcessDiagram(String)
.
This method requires a process model and a diagram image to be deployed.getProcessDiagramLayout
in interface RepositoryService
processDefinitionId
- id of a ProcessDefinition
, cannot be null.public Model newModel()
RepositoryService
RepositoryService.saveModel(Model)
.newModel
in interface RepositoryService
public void saveModel(Model model)
RepositoryService
saveModel
in interface RepositoryService
model
- model to save, cannot be null.public void deleteModel(String modelId)
deleteModel
in interface RepositoryService
modelId
- id of model to delete, cannot be null. When an id is passed
for an unexisting model, this operation is ignored.public void addModelEditorSource(String modelId, byte[] bytes)
RepositoryService
addModelEditorSource
in interface RepositoryService
modelId
- id of model to delete, cannot be null. When an id is passed
for an unexisting model, this operation is ignored.public void addModelEditorSourceExtra(String modelId, byte[] bytes)
RepositoryService
addModelEditorSourceExtra
in interface RepositoryService
modelId
- id of model to delete, cannot be null. When an id is passed
for an unexisting model, this operation is ignored.public ModelQuery createModelQuery()
RepositoryService
createModelQuery
in interface RepositoryService
public NativeModelQuery createNativeModelQuery()
RepositoryService
NativeQuery
for process definitions.createNativeModelQuery
in interface RepositoryService
public Model getModel(String modelId)
RepositoryService
Model
getModel
in interface RepositoryService
modelId
- id of modelpublic byte[] getModelEditorSource(String modelId)
RepositoryService
getModelEditorSource
in interface RepositoryService
modelId
- id of modelpublic byte[] getModelEditorSourceExtra(String modelId)
RepositoryService
getModelEditorSourceExtra
in interface RepositoryService
modelId
- id of modelpublic void addCandidateStarterUser(String processDefinitionId, String userId)
RepositoryService
addCandidateStarterUser
in interface RepositoryService
processDefinitionId
- id of the process definition, cannot be null.userId
- id of the user involve, cannot be null.public void addCandidateStarterGroup(String processDefinitionId, String groupId)
RepositoryService
addCandidateStarterGroup
in interface RepositoryService
processDefinitionId
- id of the process definition, cannot be null.groupId
- id of the group involve, cannot be null.public void deleteCandidateStarterGroup(String processDefinitionId, String groupId)
RepositoryService
deleteCandidateStarterGroup
in interface RepositoryService
processDefinitionId
- id of the process definition, cannot be null.groupId
- id of the group involve, cannot be null.public void deleteCandidateStarterUser(String processDefinitionId, String userId)
RepositoryService
deleteCandidateStarterUser
in interface RepositoryService
processDefinitionId
- id of the process definition, cannot be null.userId
- id of the user involve, cannot be null.public List<IdentityLink> getIdentityLinksForProcessDefinition(String processDefinitionId)
RepositoryService
IdentityLink
s associated with the given process definition.
Such an IdentityLink
informs how a certain identity (eg. group or user)
is authorized for a certain process definitiongetIdentityLinksForProcessDefinition
in interface RepositoryService
public List<ValidationError> validateProcess(org.activiti.bpmn.model.BpmnModel bpmnModel)
RepositoryService
BpmnModel
from a String, following code may be used:
XMLInputFactory xif = XMLInputFactory.newInstance();
InputStreamReader in = new InputStreamReader(new ByteArrayInputStream(myProcess.getBytes()), "UTF-8"); // Change to other streams for eg from classpath
XMLStreamReader xtr = xif.createXMLStreamReader(in);
bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);validateProcess
in interface RepositoryService
Copyright © 2016 Alfresco. All rights reserved.