Class HvlBpmnProcessServiceImpl

java.lang.Object
tr.com.havelsan.javarch.bpmn.admin.starter.module.process.logic.HvlBpmnProcessServiceImpl
All Implemented Interfaces:
HvlBpmnProcessService

@Service public class HvlBpmnProcessServiceImpl extends Object implements HvlBpmnProcessService
The class which implements HvlBpmnProcessService
  • Constructor Details

  • Method Details

    • save

      public Long save(@Valid @Valid HvlBpmnProcessModel processModel, Long sourceProcessId)
      Adds provided object.
      Specified by:
      save in interface HvlBpmnProcessService
      Parameters:
      processModel - the process model
      sourceProcessId - the source process's id if cloning is wanted
      Returns:
      the long
    • update

      public Long update(@Valid @Valid HvlBpmnProcessModel processModel, boolean newVersion, HvlBpmnProcessUpdateType updateType)
      Edits object associated provided object.
      Specified by:
      update in interface HvlBpmnProcessService
      Parameters:
      processModel - the process model
      newVersion - the new version
      updateType - the update type
      Returns:
      the long
    • delete

      public void delete(@NotNull @NotNull Long id)
      Removes object according to provided parameter.
      Specified by:
      delete in interface HvlBpmnProcessService
      Parameters:
      id - the id
    • deployProcess

      public void deployProcess(@NotNull @NotNull Long id)
      Deploy process.
      Specified by:
      deployProcess in interface HvlBpmnProcessService
      Parameters:
      id - the id
    • importProcess

      public HvlProcessDefinitionImportResultModel importProcess(byte[] xmlBytes, boolean isSystemProcess)
      Imports a bpmn xml.
      Specified by:
      importProcess in interface HvlBpmnProcessService
      Parameters:
      xmlBytes - the xml bytes
      isSystemProcess - the is system process
      Returns:
      the HvlProcessDefinitionImportResultModel
    • importAll

      public List<HvlBpmnProcessModel> importAll(byte[] zipBytes) throws IOException
      Imports all bpmn xml files from a zip file.
      Specified by:
      importAll in interface HvlBpmnProcessService
      Parameters:
      zipBytes - the zip bytes
      Returns:
      the list
      Throws:
      IOException - the io exception
    • exportProcess

      public Map<String,byte[]> exportProcess(@NotNull @NotNull Long id)
      Exports process as bpmn xml.
      Specified by:
      exportProcess in interface HvlBpmnProcessService
      Parameters:
      id - the id
      Returns:
      the map
    • exportAll

      public byte[] exportAll(@NotEmpty @NotEmpty List<Long> idList) throws IOException
      Exports all processes as zip file.
      Specified by:
      exportAll in interface HvlBpmnProcessService
      Parameters:
      idList - the id list
      Returns:
      the byte [ ]
      Throws:
      IOException - the io exception
    • queryList

      public List<HvlBpmnProcessModel> queryList(@NotNull @NotNull HvlBpmnProcessQueryModel processQueryModel)
      Query as list.
      Specified by:
      queryList in interface HvlBpmnProcessService
      Parameters:
      processQueryModel - the process query model
      Returns:
      the list
    • queryPage

      public tr.com.havelsan.javarch.data.commons.pageable.HvlPage<HvlBpmnProcessModel> queryPage(@NotNull @NotNull HvlBpmnProcessQueryModel processQueryModel)
      Query as page.
      Specified by:
      queryPage in interface HvlBpmnProcessService
      Parameters:
      processQueryModel - the process query model
      Returns:
      the hvl page
    • queryCategoryList

      public List<String> queryCategoryList(@NotBlank @Size(min=3,max=64) @NotBlank @Size(min=3,max=64) String namespace)
      Query as list.
      Specified by:
      queryCategoryList in interface HvlBpmnProcessService
      Parameters:
      namespace - the namespace
      Returns:
      the list
    • lock

      public void lock(@NotNull @NotNull Long id)
      Lock the process.
      Specified by:
      lock in interface HvlBpmnProcessService
      Parameters:
      id - the id
    • unlock

      public void unlock(@NotNull @NotNull Long id)
      Unlock the process.
      Specified by:
      unlock in interface HvlBpmnProcessService
      Parameters:
      id - the id
    • isLocked

      public boolean isLocked(@NotNull @NotNull Long id)
      Check the process is locked.
      Specified by:
      isLocked in interface HvlBpmnProcessService
      Parameters:
      id - the id
      Returns:
      the boolean
    • upgradeVersion

      public void upgradeVersion(@NotNull @NotNull String processDefinitionKey, byte[] upgradedProcessDefinitionXmlFile)
      Upgrade existing process definition.
      Specified by:
      upgradeVersion in interface HvlBpmnProcessService
      Parameters:
      processDefinitionKey - the process definition key
      upgradedProcessDefinitionXmlFile - the upgraded process definition xml file
    • getProcessById

      public HvlBpmnProcessModel getProcessById(@NotNull @NotNull Long id)
      Gets process by id.
      Specified by:
      getProcessById in interface HvlBpmnProcessService
      Parameters:
      id - the id
      Returns:
      the process by id
    • getProcessByKey

      public HvlBpmnProcessModel getProcessByKey(@NotNull @NotNull String key)
      Gets process by key.
      Specified by:
      getProcessByKey in interface HvlBpmnProcessService
      Parameters:
      key - the key
      Returns:
      the process model
    • isSystemProcess

      public boolean isSystemProcess(@NotNull @NotNull String processUuid)
      Check the process is system process
      Specified by:
      isSystemProcess in interface HvlBpmnProcessService
      Parameters:
      processUuid - the process uuid
      Returns:
      the boolean
    • getProcessModelNode

      public com.fasterxml.jackson.databind.node.ObjectNode getProcessModelNode(@NotNull @NotNull Long modelId)
      Gets process model node.
      Specified by:
      getProcessModelNode in interface HvlBpmnProcessService
      Parameters:
      modelId - the model id
      Returns:
      the process model node
    • saveProcessModelNode

      @Transactional public void saveProcessModelNode(@NotNull @NotNull Long modelId, @NotEmpty @NotEmpty org.springframework.util.MultiValueMap<String,String> values)
      Saves process model node.
      Specified by:
      saveProcessModelNode in interface HvlBpmnProcessService
      Parameters:
      modelId - the model id
      values - the values
    • getNamespaceList

      public List<String> getNamespaceList()
      Gets namespace list.
      Specified by:
      getNamespaceList in interface HvlBpmnProcessService
      Returns:
      the namespace list
    • isProcessDeploymentExist

      public boolean isProcessDeploymentExist(@NotBlank @NotBlank String key)
      Checks if there is any deployed process exists with given key.
      Specified by:
      isProcessDeploymentExist in interface HvlBpmnProcessService
      Parameters:
      key - process definition key
      Returns:
      boolean boolean
    • isProcessInstanceExist

      public boolean isProcessInstanceExist(@NotBlank @NotBlank String key, @NotNull @NotNull Integer version)
      Checks if there is any process instance exists with given key and version
      Specified by:
      isProcessInstanceExist in interface HvlBpmnProcessService
      Parameters:
      key - process definition key
      version - process definition version
      Returns:
      boolean boolean