update(REQ-2516) - 调整 ComplexInvokeClient 的响应处理逻辑

This commit is contained in:
wangli 2024-06-18 15:00:41 +08:00
parent ed32d6020c
commit 89e390f102
3 changed files with 31 additions and 1 deletions

View File

@ -239,6 +239,7 @@ public interface WorkflowManageService {
@Operation(summary = "创建审批流程并带上表单")
@PostMapping("/api/process/instance/form/create")
@Manageable
@InvokeMode(SYNC)
String createProcessInstanceWith(@Validated @RequestBody BpmnProcessInstanceCreateWithFormDTO dto);
/**
@ -487,6 +488,7 @@ public interface WorkflowManageService {
* 为指定流程新增变量
*/
@PostMapping("/api/process/variable/create/{executionId}")
@InvokeMode(SYNC)
Void createVariable(@PathVariable @NotBlank(message = "流程实例 ID 不能为空") String executionId, @RequestBody @Validated RestBpmnProcessVariable restVariable);
/**
@ -497,12 +499,14 @@ public interface WorkflowManageService {
* @return
*/
@PostMapping("/api/process/variable/update/{executionId}")
@InvokeMode(SYNC)
Void updateVariable(@PathVariable @NotBlank(message = "流程实例 ID 不能为空") String executionId, @RequestBody @Validated RestBpmnProcessVariable restVariable);
/**
* 批量删除流程变量
*/
@DeleteMapping("/api/process/variable/delete/{executionId}")
@InvokeMode(SYNC)
Void deleteVariables(@PathVariable("executionId") String executionId, @RequestParam String variableNames, @RequestParam(value = "scope", required = false) String scope);
/**

View File

@ -0,0 +1,21 @@
package cn.axzo.workflow.starter.common.exception;
/**
* Starter RPC 动作调用异常
*
* @author wangli
* @since 2024/6/18 14:20
*/
public class WorkflowRpcInvokeException extends WorkflowEngineStarterException {
public WorkflowRpcInvokeException(Throwable cause) {
super(cause);
}
public WorkflowRpcInvokeException(String message) {
super(message);
}
public WorkflowRpcInvokeException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@ -1,5 +1,7 @@
package cn.axzo.workflow.starter.feign.ext;
import cn.axzo.workflow.starter.common.exception.WorkflowEngineStarterException;
import cn.axzo.workflow.starter.common.exception.WorkflowRpcInvokeException;
import cn.azxo.framework.common.model.CommonResponse;
import com.google.common.collect.Lists;
import feign.Response;
@ -72,7 +74,10 @@ final class WorkflowEngineStarterDecoder implements Decoder {
if (decode instanceof CommonResponse) {
CommonResponse<?> commonResponse = (CommonResponse<?>) decode;
if (response.status() == 202) {
log.error("workflow engine starter rpc invoke return msg: {}", commonResponse.getMsg());
log.warn("workflow engine starter rpc invoke return msg: {}", commonResponse.getMsg());
throw new WorkflowRpcInvokeException(commonResponse.getMsg());
} else {
log.error("WorkflowEngineStarterDecoder has error, status:{} msg: {}", response.status(), commonResponse.getMsg());
}
return commonResponse.getData();
}