未验证 提交 2a98aee1 编写于 作者: Z zt-1997 提交者: GitHub

[FEATURE-4451][API]After the workflow editing page is submitted, the user...

[FEATURE-4451][API]After the workflow editing page is submitted, the user chooses whether to go online or not. 0 means not to go online, 1 means online. (#4437)

* vvvv

* vvvvv

* vvvvv

* testReleaseProcessDefinition
Co-authored-by: Nzt-1997 <“18841012545@163.com”>
上级 6429e8c1
......@@ -239,6 +239,7 @@ public class ProcessDefinitionController extends BaseController {
@ApiImplicitParam(name = "locations", value = "PROCESS_DEFINITION_LOCATIONS", required = true, type = "String"),
@ApiImplicitParam(name = "connects", value = "PROCESS_DEFINITION_CONNECTS", required = true, type = "String"),
@ApiImplicitParam(name = "description", value = "PROCESS_DEFINITION_DESC", required = false, type = "String"),
@ApiImplicitParam(name = "releaseState", value = "RELEASE_PROCESS_DEFINITION_NOTES", required = false, dataType = "Int", example = "0")
})
@PostMapping(value = "/update")
@ResponseStatus(HttpStatus.OK)
......@@ -250,13 +251,23 @@ public class ProcessDefinitionController extends BaseController {
@RequestParam(value = "processDefinitionJson", required = true) String processDefinitionJson,
@RequestParam(value = "locations", required = false) String locations,
@RequestParam(value = "connects", required = false) String connects,
@RequestParam(value = "description", required = false) String description) {
@RequestParam(value = "description", required = false) String description,
@RequestParam(value = "releaseState", required = false, defaultValue = "0") int releaseState) {
logger.info("login user {}, update process define, project name: {}, process define name: {}, "
+ "process_definition_json: {}, desc: {}, locations:{}, connects:{}",
loginUser.getUserName(), projectName, name, processDefinitionJson, description, locations, connects);
Map<String, Object> result = processDefinitionService.updateProcessDefinition(loginUser, projectName, id, name,
processDefinitionJson, description, locations, connects);
// If the update fails, the result will be returned directly
Status status = (Status) result.get("status");
if (status.getCode() != 0) {
return returnDataList(result);
}
// Judge whether to go online after editing,0 means offline, 1 means online
if (releaseState == 1) {
result = processDefinitionService.releaseProcessDefinition(loginUser, projectName, id, releaseState);
}
return returnDataList(result);
}
......
......@@ -142,6 +142,7 @@ public class ProcessDefinitionControllerTest {
String description = "desc test";
String connects = "[]";
int id = 1;
int releaseState = 0;
Map<String, Object> result = new HashMap<>();
putMsg(result, Status.SUCCESS);
result.put("processDefinitionId", 1);
......@@ -150,7 +151,7 @@ public class ProcessDefinitionControllerTest {
description, locations, connects)).thenReturn(result);
Result response = processDefinitionController.updateProcessDefinition(user, projectName, name, id, json,
locations, connects, description);
locations, connects, description,releaseState);
Assert.assertEquals(Status.SUCCESS.getCode(), response.getCode().intValue());
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册