Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
package com.sdm.common.entity.flowable.params;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BaseExecuteParams {
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.sdm.common.entity.req.pbs;
|
||||
|
||||
import com.sdm.common.entity.flowable.executeConfig.BaseExecuteConfig;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -8,7 +9,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class SubmitHpcTaskRemoteReq {
|
||||
public class SubmitHpcTaskRemoteReq extends BaseExecuteConfig {
|
||||
|
||||
@Schema(description = "计算任务名称")
|
||||
public String jobName;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"executeType": "HPC",
|
||||
"asyncCallback": true,
|
||||
"waitUser":true,
|
||||
"beforeNodeId": false
|
||||
"beforeNodeId": "start"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.Map;
|
||||
|
||||
// 云应用处理器(executeType=cloudApp)
|
||||
@Component("cloudApp")
|
||||
public class CloudAppHandler implements ExecutionHandler<CloudAppExecuteConfig> {
|
||||
public class CloudAppHandler implements ExecutionHandler<Map<String, Object>,CloudAppExecuteConfig> {
|
||||
@Override
|
||||
public void execute(DelegateExecution execution, Map<String, Object> params, CloudAppExecuteConfig config) {
|
||||
// 实现云应用处理逻辑...
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.Map;
|
||||
|
||||
// 数据处理执行器(executeType=data_process)
|
||||
@Component("dataProcess")
|
||||
public class DataProcessHandler implements ExecutionHandler<DataProcessExecuteConfig> {
|
||||
public class DataProcessHandler implements ExecutionHandler<Map<String, Object>,DataProcessExecuteConfig> {
|
||||
@Override
|
||||
public void execute(DelegateExecution execution, Map<String, Object> params, DataProcessExecuteConfig config) {
|
||||
// 实现数据处理逻辑...
|
||||
|
||||
@@ -5,6 +5,6 @@ import org.flowable.engine.delegate.DelegateExecution;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface ExecutionHandler<T extends BaseExecuteConfig> {
|
||||
void execute(DelegateExecution execution, Map<String, Object> params, T config);
|
||||
public interface ExecutionHandler<P,T extends BaseExecuteConfig> {
|
||||
void execute(DelegateExecution execution, P params, T config);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("exportWordScript")
|
||||
public class ExportWordScriptHandler implements ExecutionHandler<ExportWordScriptExecuteConfig> {
|
||||
public class ExportWordScriptHandler implements ExecutionHandler<Map<String, Object>,ExportWordScriptExecuteConfig> {
|
||||
@Autowired
|
||||
private IDataFeignClient dataFeignClient;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.common.entity.flowable.executeConfig.HPCExecuteConfig;
|
||||
import com.sdm.common.entity.req.pbs.SubmitHpcTaskRemoteReq;
|
||||
import com.sdm.common.feign.inter.pbs.ITaskFeignClient;
|
||||
import com.sdm.common.entity.flowable.executeConfig.BaseExecuteConfig;
|
||||
import com.sdm.flowable.service.IAsyncTaskRecordService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -16,12 +15,11 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
// HPC(executeType=HPC)
|
||||
@Slf4j
|
||||
@Component("HPC")
|
||||
public class HpcHandler implements ExecutionHandler<HPCExecuteConfig> {
|
||||
public class HpcHandler implements ExecutionHandler<SubmitHpcTaskRemoteReq,HPCExecuteConfig> {
|
||||
|
||||
@Autowired
|
||||
private IAsyncTaskRecordService asyncTaskRecordService;
|
||||
@@ -30,8 +28,8 @@ public class HpcHandler implements ExecutionHandler<HPCExecuteConfig> {
|
||||
private ITaskFeignClient taskFeignClient;
|
||||
|
||||
@Override
|
||||
public void execute(DelegateExecution execution, Map<String, Object> params, HPCExecuteConfig config) {
|
||||
|
||||
public void execute(DelegateExecution execution, SubmitHpcTaskRemoteReq params, HPCExecuteConfig config) {
|
||||
String beforeNodeId = config.getBeforeNodeId();
|
||||
// 实现HPC处理逻辑...
|
||||
// INIT(初始化)/RUNNING(执行中)/SUCCESS(执行成功)/FAIL(执行失败)
|
||||
String status = "INIT";
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.Map;
|
||||
|
||||
// HTTP请求执行器(executeType=HTTP)
|
||||
@Component("http")
|
||||
public class HttpHandler implements ExecutionHandler<HttpExecuteConfig> {
|
||||
public class HttpHandler implements ExecutionHandler<Map<String, Object>,HttpExecuteConfig> {
|
||||
|
||||
@Override
|
||||
public void execute(DelegateExecution execution, Map<String, Object> params, HttpExecuteConfig config) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.Map;
|
||||
|
||||
// 本地应用处理器(executeType=localApp)
|
||||
@Component("localApp")
|
||||
public class LocalAppHandler implements ExecutionHandler<LocalAppExecuteConfig> {
|
||||
public class LocalAppHandler implements ExecutionHandler<Map<String, Object>,LocalAppExecuteConfig> {
|
||||
@Override
|
||||
public void execute(DelegateExecution execution, Map<String, Object> params, LocalAppExecuteConfig config) {
|
||||
// 实现本地应用处理逻辑...
|
||||
|
||||
Reference in New Issue
Block a user