Interface HvlBpmnRepositoryService
- All Known Implementing Classes:
HvlBpmnRepositoryServiceImpl
@Validated
public interface HvlBpmnRepositoryService
This service provides operational and retrieve methods.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activateProcessDefinition
(@NotNull HvlBpmnActivateProcessDefinitionModel activateProcessDefinitionModel) Activates the process definition with the given id.void
addCandidateStarterGroup
(@NotBlank String processDefinitionId, String groupId) Authorizes a candidate group for a process definition.void
addCandidateStarterUser
(@NotBlank String processDefinitionId, String userId) Authorizes a candidate user for a process definition.void
changeDeploymentParentDeploymentId
(@NotBlank String deploymentId, String newParentDeploymentId) Changes the parent deployment id of a deployment.org.flowable.engine.repository.DeploymentBuilder
Create deployment deployment builder.org.flowable.engine.repository.DeploymentQuery
Query deployment.org.flowable.engine.repository.NativeDeploymentQuery
Returns a newNativeQuery
for deployment.org.flowable.engine.repository.NativeProcessDefinitionQuery
Returns a newNativeQuery
for process definitions.org.flowable.engine.repository.ProcessDefinitionQuery
Query process definitions.void
deleteCandidateStarterGroup
(@NotBlank String processDefinitionId, String groupId) Removes the authorization of a candidate group for a process definition.void
deleteCandidateStarterUser
(@NotBlank String processDefinitionId, String userId) Removes the authorization of a candidate user for a process definition.void
deleteDeployment
(@NotBlank String deploymentId) Deletes the given deployment.void
deleteDeployment
(@NotBlank String deploymentId, boolean cascade) Deletes the given deployment and cascade deletion to process instances, history process instances and jobs.void
Deploys all provided sources to the process engine.org.flowable.bpmn.model.BpmnModel
getBpmnModel
(@NotBlank String processDefinitionId) Returns theBpmnModel
corresponding with the process definition with the provided process definition id.byte[]
getBpmnModelByteArray
(@NotBlank String processDefinitionId) Get bpmn model byte array byte [ ].getDeploymentResourceNames
(@NotBlank String deploymentId) Retrieves a list of deployment resources for the given deployment, ordered alphabetically.List<org.flowable.identitylink.api.IdentityLink>
getIdentityLinksForProcessDefinition
(@NotBlank String processDefinitionId) Retrieves theIdentityLink
s associated with the given process definition.org.flowable.engine.repository.ProcessDefinition
getProcessDefinition
(@NotBlank String processDefinitionId) Returns theProcessDefinition
including all BPMN information like additional Properties (e.g.getProcessDiagram
(@NotBlank String processDefinitionId) Gives access to a deployed process diagram, e.g., a PNG image, through a stream of bytes.org.flowable.engine.repository.DiagramLayout
getProcessDiagramLayout
(@NotBlank String processDefinitionId) Provides positions and dimensions of elements in a process diagram as provided byRepositoryService.getProcessDiagram(String)
.getProcessModel
(@NotBlank String processDefinitionId) Gives access to a deployed process model, e.g., a BPMN 2.0 XML file, through a stream of bytes.getResourceAsStream
(@NotBlank String deploymentId, @NotBlank String resourceName) Gives access to a deployment resource through a stream of bytes.boolean
isProcessDefinitionSuspended
(@NotBlank String processDefinitionId) Checks if the process definition is suspended.void
setDeploymentCategory
(@NotBlank String deploymentId, String category) Sets the category of the deployment.void
setDeploymentKey
(@NotBlank String deploymentId, String key) Sets the key of the deployment.void
setProcessDefinitionCategory
(@NotBlank String processDefinitionId, String category) Sets the category of the process definition.void
suspendProcessDefinition
(@NotNull HvlBpmnSuspendProcessDefinitionModel suspendProcessDefinitionModel) Suspends the process definition with the given id.List<org.flowable.validation.ValidationError>
validateProcess
(@NotNull org.flowable.bpmn.model.BpmnModel bpmnModel) Validates the given process definition against the rules for executing a process definition on the process engine.
-
Method Details
-
createDeployment
org.flowable.engine.repository.DeploymentBuilder createDeployment()Create deployment deployment builder.- Returns:
- the deployment builder
-
deploy
void deploy(@NotBlank @NotBlank String name, @NotBlank @NotBlank String resourcePath, boolean removeAllDeploymentBefore) Deploys all provided sources to the process engine.- Parameters:
name
- the nameresourcePath
- the resource pathremoveAllDeploymentBefore
- the remove all deployment before
-
deleteDeployment
Deletes the given deployment.- Parameters:
deploymentId
- id of the deployment, cannot be null.- Throws:
RuntimeException
- if there are still runtime or history process instances or jobs.
-
deleteDeployment
Deletes the given deployment and cascade deletion to process instances, history process instances and jobs.- Parameters:
deploymentId
- id of the deployment, cannot be null.cascade
- the cascade
-
setDeploymentCategory
Sets the category of the deployment. Deployments can be queried by category: seeDeploymentQuery.deploymentCategory(String)
.- Parameters:
deploymentId
- the deployment idcategory
- the category- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- if no deployment with the provided id can be found.
-
setDeploymentKey
Sets the key of the deployment. Deployments can be queried by key: seeDeploymentQuery.deploymentKey(String)
.- Parameters:
deploymentId
- the deployment idkey
- the key- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- if no deployment with the provided id can be found.
-
getDeploymentResourceNames
Retrieves a list of deployment resources for the given deployment, ordered alphabetically.- Parameters:
deploymentId
- id of the deployment, cannot be null.- Returns:
- the deployment resource names
-
getResourceAsStream
InputStream getResourceAsStream(@NotBlank @NotBlank String deploymentId, @NotBlank @NotBlank String resourceName) Gives access to a deployment resource through a stream of bytes.- Parameters:
deploymentId
- id of the deployment, cannot be null.resourceName
- name of the resource, cannot be null.- Returns:
- the resource as stream
- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the resource doesn't exist in the given deployment or when no deployment exists for the given deploymentId.
-
changeDeploymentParentDeploymentId
void changeDeploymentParentDeploymentId(@NotBlank @NotBlank String deploymentId, String newParentDeploymentId) Changes the parent deployment id of a deployment. This is used to move deployments to a different app deployment parent.- Parameters:
deploymentId
- The id of the deployment of which the parent deployment identifier will be changed.newParentDeploymentId
- The new parent deployment identifier.
-
createProcessDefinitionQuery
org.flowable.engine.repository.ProcessDefinitionQuery createProcessDefinitionQuery()Query process definitions.- Returns:
- the process definition query
-
createNativeProcessDefinitionQuery
org.flowable.engine.repository.NativeProcessDefinitionQuery createNativeProcessDefinitionQuery()Returns a newNativeQuery
for process definitions.- Returns:
- the native process definition query
-
createDeploymentQuery
org.flowable.engine.repository.DeploymentQuery createDeploymentQuery()Query deployment.- Returns:
- the deployment query
-
createNativeDeploymentQuery
org.flowable.engine.repository.NativeDeploymentQuery createNativeDeploymentQuery()Returns a newNativeQuery
for deployment.- Returns:
- the native deployment query
-
suspendProcessDefinition
void suspendProcessDefinition(@NotNull @NotNull HvlBpmnSuspendProcessDefinitionModel suspendProcessDefinitionModel) 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)!
- Parameters:
suspendProcessDefinitionModel
- the suspend process definition model- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- if no such processDefinition can be foundorg.flowable.common.engine.api.FlowableException
- if the process definition is already in state suspended.
-
activateProcessDefinition
void activateProcessDefinition(@NotNull @NotNull HvlBpmnActivateProcessDefinitionModel activateProcessDefinitionModel) Activates the process definition with the given id.- Parameters:
activateProcessDefinitionModel
- the activate process definition model- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- if no such processDefinition can be found or if the process definition is already in state active.
-
setProcessDefinitionCategory
Sets the category of the process definition. Process definitions can be queried by category: seeProcessDefinitionQuery.processDefinitionCategory(String)
.- Parameters:
processDefinitionId
- the process definition idcategory
- the category- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- if no process definition with the provided id can be found.
-
getProcessModel
Gives access to a deployed process model, e.g., a BPMN 2.0 XML file, through a stream of bytes.- Parameters:
processDefinitionId
- id of aProcessDefinition
, cannot be null.- Returns:
- the process model
- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the process model doesn't exist.
-
getProcessDiagram
Gives access to a deployed process diagram, e.g., a PNG image, through a stream of bytes.- Parameters:
processDefinitionId
- id of aProcessDefinition
, cannot be null.- Returns:
- null when the diagram resource name of a
ProcessDefinition
is null. - Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the process diagram doesn't exist.
-
getProcessDefinition
org.flowable.engine.repository.ProcessDefinition getProcessDefinition(@NotBlank @NotBlank String processDefinitionId) Returns theProcessDefinition
including all BPMN information like additional Properties (e.g. documentation).- Parameters:
processDefinitionId
- the process definition id- Returns:
- the process definition
-
isProcessDefinitionSuspended
Checks if the process definition is suspended.- Parameters:
processDefinitionId
- the process definition id- Returns:
- the boolean
-
getBpmnModel
Returns theBpmnModel
corresponding with the process definition with the provided process definition id. TheBpmnModel
is a pojo versions of the BPMN 2.0 xml and can be used to introspect the process definition using regular Java.- Parameters:
processDefinitionId
- the process definition id- Returns:
- the bpmn model
-
getBpmnModelByteArray
Get bpmn model byte array byte [ ].- Parameters:
processDefinitionId
- the process definition id- Returns:
- the byte [ ]
-
getProcessDiagramLayout
org.flowable.engine.repository.DiagramLayout getProcessDiagramLayout(@NotBlank @NotBlank String processDefinitionId) Provides positions and dimensions of elements in a process diagram as provided byRepositoryService.getProcessDiagram(String)
.This method requires a process model and a diagram image to be deployed.
- Parameters:
processDefinitionId
- id of aProcessDefinition
, cannot be null.- Returns:
- DiagramLayout instance containing diagram info, null when the input stream of a process diagram is null.
- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the process model or diagram doesn't exist.
-
addCandidateStarterUser
Authorizes a candidate user for a process definition.- Parameters:
processDefinitionId
- id of the process definition, cannot be null.userId
- id of the user involve, cannot be null.- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the process definition or user doesn't exist.
-
addCandidateStarterGroup
Authorizes a candidate group for a process definition.- Parameters:
processDefinitionId
- id of the process definition, cannot be null.groupId
- id of the group involve, cannot be null.- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the process definition or group doesn't exist.
-
deleteCandidateStarterUser
Removes the authorization of a candidate user for a process definition.- Parameters:
processDefinitionId
- id of the process definition, cannot be null.userId
- id of the user involve, cannot be null.- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the process definition or user doesn't exist.
-
deleteCandidateStarterGroup
Removes the authorization of a candidate group for a process definition.- Parameters:
processDefinitionId
- id of the process definition, cannot be null.groupId
- id of the group involve, cannot be null.- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException
- when the process definition or group doesn't exist.
-
getIdentityLinksForProcessDefinition
List<org.flowable.identitylink.api.IdentityLink> getIdentityLinksForProcessDefinition(@NotBlank @NotBlank String processDefinitionId) Retrieves theIdentityLink
s associated with the given process definition. Such anIdentityLink
informs how a certain identity (eg. group or user) is authorized for a certain process definition- Parameters:
processDefinitionId
- the process definition id- Returns:
- the identity links for process definition
-
validateProcess
List<org.flowable.validation.ValidationError> validateProcess(@NotNull @NotNull org.flowable.bpmn.model.BpmnModel bpmnModel) Validates the given process definition against the rules for executing a process definition on the process engine.To create such a
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);
- Parameters:
bpmnModel
- the bpmn model- Returns:
- the list
-