hotfix-处理引擎内部异常,包装成自定义Exception抛出异常
This commit is contained in:
parent
a64807017a
commit
694a95d267
@ -26,6 +26,7 @@ public enum BpmnInstanceRespCode implements IModuleRespCode {
|
||||
PROCESS_INSTANCE_CANT_START("011", "流程实例不能启动"),
|
||||
TASK_CANT_COMMENT_INSTANCE_NOT_EXISTS("012", "流程实例【{}】不存在, 不能评论"),
|
||||
RUNNING_INSTANCE_ONLY_FORECAST("013", "仅运行中的实例可以推测"),
|
||||
ENGINE_EXEC_EXCEPTION("014", "引擎内部异常"),
|
||||
;
|
||||
private final String code;
|
||||
private final String message;
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
package cn.axzo.workflow.core.engine.cmd;
|
||||
|
||||
|
||||
import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
|
||||
import org.flowable.common.engine.impl.interceptor.Command;
|
||||
import org.flowable.common.engine.impl.interceptor.CommandContext;
|
||||
|
||||
import static cn.axzo.workflow.core.common.code.BpmnInstanceRespCode.ENGINE_EXEC_EXCEPTION;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
@ -12,4 +16,19 @@ import org.flowable.common.engine.impl.interceptor.Command;
|
||||
public abstract class AbstractCommand<T> implements Command<T> {
|
||||
|
||||
public abstract String paramToJsonString();
|
||||
|
||||
@Override
|
||||
public T execute(CommandContext commandContext) {
|
||||
try {
|
||||
return executeInternal(commandContext);
|
||||
} catch (WorkflowEngineException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new WorkflowEngineException(ENGINE_EXEC_EXCEPTION);
|
||||
}
|
||||
}
|
||||
|
||||
public T executeInternal(CommandContext commandContext) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ public class CustomApproveTaskAsyncCmd extends AbstractCommand<String> implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public String execute(CommandContext commandContext) {
|
||||
public String executeInternal(CommandContext commandContext) {
|
||||
ProcessEngineConfigurationImpl processEngineConfiguration =
|
||||
CommandContextUtil.getProcessEngineConfiguration(commandContext);
|
||||
HistoricTaskInstanceQuery taskQuery =
|
||||
|
||||
@ -38,7 +38,7 @@ public class CustomRejectionTaskAsyncCmd extends AbstractCommand<String> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public String execute(CommandContext commandContext) {
|
||||
public String executeInternal(CommandContext commandContext) {
|
||||
ProcessEngineConfigurationImpl processEngineConfiguration =
|
||||
CommandContextUtil.getProcessEngineConfiguration(commandContext);
|
||||
HistoricTaskInstanceQuery taskQuery =
|
||||
|
||||
Loading…
Reference in New Issue
Block a user