update(REQ-2516) - 调整 ComplexInvokeClient 的响应处理逻辑
This commit is contained in:
parent
ed32d6020c
commit
89e390f102
@ -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);
|
||||
|
||||
/**
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
@ -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();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user