Class HvlBpmnProcessRestController
java.lang.Object
tr.com.havelsan.javarch.bpmn.admin.starter.module.process.controller.HvlBpmnProcessRestController
- All Implemented Interfaces:
HvlBpmnProcessOperationalRestService
,HvlBpmnProcessRestService
@RestController
@RequestMapping("${hvl.bpmn.service.process.controller-path:/process}")
@HvlActuatorService(name="HvlBpmnProcessRestService",
groupName="HvlBpmnProcess")
public class HvlBpmnProcessRestController
extends Object
implements HvlBpmnProcessRestService, HvlBpmnProcessOperationalRestService
The class in which service endpoints are defined for process instance operations.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionHvlBpmnProcessRestController
(HvlBpmnProcessService processService, HvlBpmnProcessVersionService processVersionService) Instantiates a new HvlBpmnProcessRestController. -
Method Summary
Modifier and TypeMethodDescriptiontr.com.havelsan.javarch.service.data.HvlResponse
<Void> Removes object according to provided parameter.tr.com.havelsan.javarch.service.data.HvlResponse
<Void> deployProcess
(@NotNull Long processId) Deploy process.tr.com.havelsan.javarch.service.data.HvlResponseEntity
<byte[]> Exports all processes as zip file.tr.com.havelsan.javarch.service.data.HvlResponseEntity
<byte[]> exportProcess
(@NotNull Long processId) Exports process as bpmn xml.tr.com.havelsan.javarch.service.data.HvlResponse
<Long> getCurrentVersion
(@NotBlank String processCode) Gets current version of process.Gets namespace list.tr.com.havelsan.javarch.service.data.HvlResponse
<HvlBpmnProcessModel> getProcessById
(@NotNull Long id) Gets process by id.tr.com.havelsan.javarch.service.data.HvlResponse
<HvlBpmnProcessModel> getProcessByVersion
(@NotBlank String processCode, @NotNull Long processVersion) Gets process by version.com.fasterxml.jackson.databind.node.ObjectNode
getProcessModelNode
(@NotNull Long modelId) Gets process model node.getProcessVersionList
(@NotBlank String processCode) Gets process version list.tr.com.havelsan.javarch.service.data.HvlResponse
<List<HvlBpmnProcessModel>> importAll
(org.springframework.web.multipart.MultipartFile zipFile) Imports all bpmn xml files from a zip file.tr.com.havelsan.javarch.service.data.HvlResponse
<HvlProcessDefinitionImportResultModel> importProcess
(org.springframework.web.multipart.MultipartFile xmlFile) Imports a bpmn xml.tr.com.havelsan.javarch.service.data.HvlResponse
<Boolean> Check the process is locked.tr.com.havelsan.javarch.service.data.HvlResponse
<Void> Lock the process.queryCategoryList
(@NotBlank @Size(min=3,max=64) String namespace) Returns a list of category by provided namespace.tr.com.havelsan.javarch.service.data.HvlResponse
<List<HvlBpmnProcessModel>> queryList
(@NotNull @Valid HvlBpmnProcessQueryModel bpmnQueryModel) Returns a list of process matching the query criteria.tr.com.havelsan.javarch.service.data.HvlResponse
<tr.com.havelsan.javarch.data.commons.pageable.HvlPage<HvlBpmnProcessModel>> queryPage
(@NotNull @Valid HvlBpmnProcessQueryModel bpmnQueryModel) Returns a page of process matching the query criteria.tr.com.havelsan.javarch.service.data.HvlResponse
<Long> save
(@Valid HvlBpmnProcessModel bpmnModel, Long sourceProcessId) Adds provided object.tr.com.havelsan.javarch.service.data.HvlResponse
<Void> saveProcessModelNode
(@NotNull Long modelId, @NotEmpty org.springframework.util.MultiValueMap<String, String> values) Saves process model node.tr.com.havelsan.javarch.service.data.HvlResponse
<Void> Unlock the process.tr.com.havelsan.javarch.service.data.HvlResponse
<Long> update
(@Valid HvlBpmnProcessModel processModel, Boolean newVersion) Edits object associated provided object.tr.com.havelsan.javarch.service.data.HvlResponse
<Void> upgradeVersion
(@NotNull String processDefinitionKey, org.springframework.web.multipart.MultipartFile upgradedProcessDefinitionXmlFile) Upgrades existing process definition.
-
Field Details
-
CONTENT_TYPE_APPLICATION_ZIP
The constant CONTENT_TYPE_APPLICATION_ZIP.- See Also:
-
CONTENT_TYPE_XML
The constant CONTENT_TYPE_XML.- See Also:
-
FILE_NAME
The constant FILE_NAME.- See Also:
-
ZIP
The constant ZIP.- See Also:
-
-
Constructor Details
-
HvlBpmnProcessRestController
public HvlBpmnProcessRestController(HvlBpmnProcessService processService, HvlBpmnProcessVersionService processVersionService) Instantiates a new HvlBpmnProcessRestController.- Parameters:
processService
- the process serviceprocessVersionService
- the process version service
-
-
Method Details
-
save
@PreAuthorize("hasAuthority(\'bpmn:designer\')") public tr.com.havelsan.javarch.service.data.HvlResponse<Long> save(@Valid @RequestBody @Valid HvlBpmnProcessModel bpmnModel, @RequestParam(required=false) Long sourceProcessId) Adds provided object.- Specified by:
save
in interfaceHvlBpmnProcessOperationalRestService
- Parameters:
bpmnModel
- the bpmn modelsourceProcessId
- the source process's id if cloning is wanted- Returns:
- the hvl response
-
update
@PreAuthorize("hasAuthority(\'bpmn:designer\')") public tr.com.havelsan.javarch.service.data.HvlResponse<Long> update(@Valid @RequestBody @Valid HvlBpmnProcessModel processModel, @RequestParam Boolean newVersion) Edits object associated provided object.- Specified by:
update
in interfaceHvlBpmnProcessOperationalRestService
- Parameters:
processModel
- the bpmn modelnewVersion
- the new version- Returns:
- the hvl response
-
delete
@PreAuthorize("hasAuthority(\'bpmn:designer\')") public tr.com.havelsan.javarch.service.data.HvlResponse<Void> delete(@NotNull @PathVariable("id") @NotNull Long id) Removes object according to provided parameter.- Specified by:
delete
in interfaceHvlBpmnProcessOperationalRestService
- Parameters:
id
- the id- Returns:
- the hvl response
-
queryList
@PreAuthorize("hasAuthority(\'default_authority\')") public tr.com.havelsan.javarch.service.data.HvlResponse<List<HvlBpmnProcessModel>> queryList(@NotNull @Valid @RequestBody @NotNull @Valid HvlBpmnProcessQueryModel bpmnQueryModel) Returns a list of process matching the query criteria.- Specified by:
queryList
in interfaceHvlBpmnProcessRestService
- Parameters:
bpmnQueryModel
- the bpmn query model- Returns:
- the hvl response
-
queryPage
@PreAuthorize("hasAuthority(\'default_authority\')") public tr.com.havelsan.javarch.service.data.HvlResponse<tr.com.havelsan.javarch.data.commons.pageable.HvlPage<HvlBpmnProcessModel>> queryPage(@NotNull @Valid @RequestBody @NotNull @Valid HvlBpmnProcessQueryModel bpmnQueryModel) Returns a page of process matching the query criteria.- Specified by:
queryPage
in interfaceHvlBpmnProcessRestService
- Parameters:
bpmnQueryModel
- the bpmn query model- Returns:
- the hvl response
-
queryCategoryList
@PreAuthorize("hasAuthority(\'default_authority\')") public tr.com.havelsan.javarch.service.data.HvlResponse<List<String>> queryCategoryList(@NotBlank @Size(min=3,max=64) @PathVariable("namespace") @NotBlank @Size(min=3,max=64) String namespace) Returns a list of category by provided namespace.- Specified by:
queryCategoryList
in interfaceHvlBpmnProcessRestService
- Parameters:
namespace
- the namespace- Returns:
- the hvl response
-
deployProcess
@PreAuthorize("hasAuthority(\'bpmn:designer\')") public tr.com.havelsan.javarch.service.data.HvlResponse<Void> deployProcess(@NotNull @PathVariable("processId") @NotNull Long processId) Deploy process.- Specified by:
deployProcess
in interfaceHvlBpmnProcessOperationalRestService
- Parameters:
processId
- the process id- Returns:
- the hvl response
-
importProcess
@PreAuthorize("hasAuthority(\'bpmn:designer\')") public tr.com.havelsan.javarch.service.data.HvlResponse<HvlProcessDefinitionImportResultModel> importProcess(@RequestPart org.springframework.web.multipart.MultipartFile xmlFile) Imports a bpmn xml.- Specified by:
importProcess
in interfaceHvlBpmnProcessOperationalRestService
- Parameters:
xmlFile
- the xml file- Returns:
- the hvl response
-
importAll
@PreAuthorize("hasAuthority(\'bpmn:designer\')") public tr.com.havelsan.javarch.service.data.HvlResponse<List<HvlBpmnProcessModel>> importAll(@RequestPart org.springframework.web.multipart.MultipartFile zipFile) Imports all bpmn xml files from a zip file.- Specified by:
importAll
in interfaceHvlBpmnProcessOperationalRestService
- Parameters:
zipFile
- the zip file- Returns:
- the hvl response
-
exportProcess
@PreAuthorize("hasAuthority(\'bpmn:designer\')") public tr.com.havelsan.javarch.service.data.HvlResponseEntity<byte[]> exportProcess(@NotNull @PathVariable("processId") @NotNull Long processId) Exports process as bpmn xml.- Specified by:
exportProcess
in interfaceHvlBpmnProcessOperationalRestService
- Parameters:
processId
- the process id- Returns:
- the hvl response entity
-
exportAll
@PreAuthorize("hasAuthority(\'bpmn:designer\')") public tr.com.havelsan.javarch.service.data.HvlResponseEntity<byte[]> exportAll(@NotEmpty @RequestBody @NotEmpty List<Long> processIdList) Exports all processes as zip file.- Specified by:
exportAll
in interfaceHvlBpmnProcessOperationalRestService
- Parameters:
processIdList
- the process id list- Returns:
- the hvl response entity
-
getCurrentVersion
public tr.com.havelsan.javarch.service.data.HvlResponse<Long> getCurrentVersion(@NotBlank @PathVariable("processCode") @NotBlank String processCode) Gets current version of process.- Specified by:
getCurrentVersion
in interfaceHvlBpmnProcessRestService
- Parameters:
processCode
- the process code- Returns:
- the current version
-
getProcessById
public tr.com.havelsan.javarch.service.data.HvlResponse<HvlBpmnProcessModel> getProcessById(@NotNull @PathVariable("id") @NotNull Long id) Gets process by id.- Specified by:
getProcessById
in interfaceHvlBpmnProcessRestService
- Parameters:
id
- the id- Returns:
- the process by id
-
getProcessByVersion
public tr.com.havelsan.javarch.service.data.HvlResponse<HvlBpmnProcessModel> getProcessByVersion(@NotBlank @PathVariable("processCode") @NotBlank String processCode, @NotNull @PathVariable("processVersion") @NotNull Long processVersion) Gets process by version.- Specified by:
getProcessByVersion
in interfaceHvlBpmnProcessRestService
- Parameters:
processCode
- the process codeprocessVersion
- the process version- Returns:
- the process by version
-
getProcessVersionList
public tr.com.havelsan.javarch.service.data.HvlResponse<List<Long>> getProcessVersionList(@NotBlank @PathVariable("processCode") @NotBlank String processCode) Gets process version list.- Specified by:
getProcessVersionList
in interfaceHvlBpmnProcessRestService
- Parameters:
processCode
- the process code- Returns:
- the process version list
-
lock
@PreAuthorize("hasAuthority(\'bpmn:designer\')") public tr.com.havelsan.javarch.service.data.HvlResponse<Void> lock(@NotNull @PathVariable("id") @NotNull Long id) Lock the process.- Specified by:
lock
in interfaceHvlBpmnProcessOperationalRestService
- Parameters:
id
- the id- Returns:
- the hvl response
-
unlock
@PreAuthorize("hasAuthority(\'bpmn:designer\')") public tr.com.havelsan.javarch.service.data.HvlResponse<Void> unlock(@NotNull @PathVariable("id") @NotNull Long id) Unlock the process.- Specified by:
unlock
in interfaceHvlBpmnProcessOperationalRestService
- Parameters:
id
- the id- Returns:
- the hvl response
-
isLocked
public tr.com.havelsan.javarch.service.data.HvlResponse<Boolean> isLocked(@NotNull @PathVariable("id") @NotNull Long id) Check the process is locked.- Specified by:
isLocked
in interfaceHvlBpmnProcessRestService
- Parameters:
id
- the id- Returns:
- the hvl response
-
getProcessModelNode
public com.fasterxml.jackson.databind.node.ObjectNode getProcessModelNode(@NotNull @PathVariable("modelId") @NotNull Long modelId) Gets process model node.- Specified by:
getProcessModelNode
in interfaceHvlBpmnProcessRestService
- Parameters:
modelId
- the model id- Returns:
- the process model node
-
saveProcessModelNode
public tr.com.havelsan.javarch.service.data.HvlResponse<Void> saveProcessModelNode(@NotNull @PathVariable("modelId") @NotNull Long modelId, @NotEmpty @RequestBody @NotEmpty org.springframework.util.MultiValueMap<String, String> values) Saves process model node.- Specified by:
saveProcessModelNode
in interfaceHvlBpmnProcessOperationalRestService
- Parameters:
modelId
- the model idvalues
- the values- Returns:
- the hvl response
-
getNamespaceList
Gets namespace list.- Specified by:
getNamespaceList
in interfaceHvlBpmnProcessRestService
- Returns:
- the namespace list
-
upgradeVersion
public tr.com.havelsan.javarch.service.data.HvlResponse<Void> upgradeVersion(@NotNull @PathVariable("processDefinitionKey") @NotNull String processDefinitionKey, @RequestPart org.springframework.web.multipart.MultipartFile upgradedProcessDefinitionXmlFile) Upgrades existing process definition.- Specified by:
upgradeVersion
in interfaceHvlBpmnProcessOperationalRestService
- Parameters:
processDefinitionKey
- the process definition keyupgradedProcessDefinitionXmlFile
- the upgraded process definition xml file- Returns:
- the hvl response
-