Interface HvlBpmnRepositoryService

All Known Implementing Classes:
HvlBpmnRepositoryServiceImpl

@Validated public interface HvlBpmnRepositoryService
This service provides operational and retrieve methods.
  • 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 name
      resourcePath - the resource path
      removeAllDeploymentBefore - the remove all deployment before
    • deleteDeployment

      void deleteDeployment(@NotBlank @NotBlank String deploymentId)
      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

      void deleteDeployment(@NotBlank @NotBlank String deploymentId, boolean cascade)
      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

      void setDeploymentCategory(@NotBlank @NotBlank String deploymentId, String category)
      Sets the category of the deployment. Deployments can be queried by category: see DeploymentQuery.deploymentCategory(String).
      Parameters:
      deploymentId - the deployment id
      category - the category
      Throws:
      org.flowable.common.engine.api.FlowableObjectNotFoundException - if no deployment with the provided id can be found.
    • setDeploymentKey

      void setDeploymentKey(@NotBlank @NotBlank String deploymentId, String key)
      Sets the key of the deployment. Deployments can be queried by key: see DeploymentQuery.deploymentKey(String).
      Parameters:
      deploymentId - the deployment id
      key - the key
      Throws:
      org.flowable.common.engine.api.FlowableObjectNotFoundException - if no deployment with the provided id can be found.
    • getDeploymentResourceNames

      List<String> getDeploymentResourceNames(@NotBlank @NotBlank String deploymentId)
      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 new NativeQuery 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 new NativeQuery 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 found
      org.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

      void setProcessDefinitionCategory(@NotBlank @NotBlank String processDefinitionId, String category)
      Sets the category of the process definition. Process definitions can be queried by category: see ProcessDefinitionQuery.processDefinitionCategory(String).
      Parameters:
      processDefinitionId - the process definition id
      category - the category
      Throws:
      org.flowable.common.engine.api.FlowableObjectNotFoundException - if no process definition with the provided id can be found.
    • getProcessModel

      InputStream getProcessModel(@NotBlank @NotBlank String processDefinitionId)
      Gives access to a deployed process model, e.g., a BPMN 2.0 XML file, through a stream of bytes.
      Parameters:
      processDefinitionId - id of a ProcessDefinition, cannot be null.
      Returns:
      the process model
      Throws:
      org.flowable.common.engine.api.FlowableObjectNotFoundException - when the process model doesn't exist.
    • getProcessDiagram

      InputStream getProcessDiagram(@NotBlank @NotBlank String processDefinitionId)
      Gives access to a deployed process diagram, e.g., a PNG image, through a stream of bytes.
      Parameters:
      processDefinitionId - id of a ProcessDefinition, 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 the ProcessDefinition including all BPMN information like additional Properties (e.g. documentation).
      Parameters:
      processDefinitionId - the process definition id
      Returns:
      the process definition
    • isProcessDefinitionSuspended

      boolean isProcessDefinitionSuspended(@NotBlank @NotBlank String processDefinitionId)
      Checks if the process definition is suspended.
      Parameters:
      processDefinitionId - the process definition id
      Returns:
      the boolean
    • getBpmnModel

      org.flowable.bpmn.model.BpmnModel getBpmnModel(@NotBlank @NotBlank 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.
      Parameters:
      processDefinitionId - the process definition id
      Returns:
      the bpmn model
    • getBpmnModelByteArray

      byte[] getBpmnModelByteArray(@NotBlank @NotBlank String processDefinitionId)
      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 by RepositoryService.getProcessDiagram(String).

      This method requires a process model and a diagram image to be deployed.

      Parameters:
      processDefinitionId - id of a ProcessDefinition, 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

      void addCandidateStarterUser(@NotBlank @NotBlank String processDefinitionId, String userId)
      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

      void addCandidateStarterGroup(@NotBlank @NotBlank String processDefinitionId, String groupId)
      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

      void deleteCandidateStarterUser(@NotBlank @NotBlank String processDefinitionId, String userId)
      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

      void deleteCandidateStarterGroup(@NotBlank @NotBlank String processDefinitionId, String groupId)
      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 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
      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