mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
[fix] fix workflow's upstream
This commit is contained in:
parent
32db2ae2d0
commit
4344c9fe6a
@ -5,10 +5,7 @@ import com.github.kfcfans.oms.common.OmsException;
|
||||
import com.github.kfcfans.oms.common.OpenAPIConstant;
|
||||
import com.github.kfcfans.oms.common.request.http.SaveJobInfoRequest;
|
||||
import com.github.kfcfans.oms.common.request.http.SaveWorkflowRequest;
|
||||
import com.github.kfcfans.oms.common.response.InstanceInfoDTO;
|
||||
import com.github.kfcfans.oms.common.response.JobInfoDTO;
|
||||
import com.github.kfcfans.oms.common.response.ResultDTO;
|
||||
import com.github.kfcfans.oms.common.response.WorkflowInfoDTO;
|
||||
import com.github.kfcfans.oms.common.response.*;
|
||||
import com.github.kfcfans.oms.common.utils.HttpUtils;
|
||||
import com.github.kfcfans.oms.common.utils.JsonUtils;
|
||||
import com.google.common.collect.Lists;
|
||||
@ -339,7 +336,7 @@ public class OhMyClient {
|
||||
* @return 任务实例信息
|
||||
* @throws Exception 潜在的异常
|
||||
*/
|
||||
public ResultDTO<InstanceInfoDTO> fetchWorkflowInstanceInfo(Long wfInstanceId) throws Exception {
|
||||
public ResultDTO<WorkflowInstanceInfoDTO> fetchWorkflowInstanceInfo(Long wfInstanceId) throws Exception {
|
||||
RequestBody body = new FormBody.Builder()
|
||||
.add("wfInstanceId", wfInstanceId.toString())
|
||||
.add("appId", appId.toString())
|
||||
|
@ -25,6 +25,8 @@ public class SystemInstanceResult {
|
||||
|
||||
/* *********** workflow 专用 *********** */
|
||||
public static final String MIDDLE_JOB_FAILED = "middle job failed";
|
||||
public static final String MIDDLE_JOB_STOPPED = "middle job stopped by user";
|
||||
public static final String CAN_NOT_FIND_JOB = "can't find some job";
|
||||
|
||||
// 被用户手动停止
|
||||
public static final String STOPPED_BY_USER = "stopped by user";
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.github.kfcfans.oms.common.model;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -33,6 +35,7 @@ public class PEWorkflowDAG {
|
||||
private String jobName;
|
||||
|
||||
// 运行时参数,图定义不需要
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long instanceId;
|
||||
private Integer status;
|
||||
private String result;
|
||||
|
@ -27,6 +27,8 @@ public interface JobInfoRepository extends JpaRepository<JobInfoDO, Long> {
|
||||
|
||||
Page<JobInfoDO> findByAppIdAndJobNameLikeAndStatusNot(Long appId, String condition, int status, Pageable pageable);
|
||||
|
||||
// 校验工作流包含的任务
|
||||
long countByAppIdAndStatusAndIdIn(Long appId, int status, List<Long> jobIds);
|
||||
|
||||
long countByAppId(long appId);
|
||||
|
||||
|
@ -15,6 +15,7 @@ import com.github.kfcfans.oms.server.common.constans.InstanceType;
|
||||
import com.github.kfcfans.oms.server.persistence.core.model.InstanceInfoDO;
|
||||
import com.github.kfcfans.oms.server.persistence.core.repository.InstanceInfoRepository;
|
||||
import com.github.kfcfans.oms.server.service.id.IdGenerateService;
|
||||
import com.github.kfcfans.oms.server.service.workflow.WorkflowInstanceService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -41,6 +42,8 @@ public class InstanceService {
|
||||
@Resource
|
||||
private IdGenerateService idGenerateService;
|
||||
@Resource
|
||||
private WorkflowInstanceService workflowInstanceService;
|
||||
@Resource
|
||||
private InstanceInfoRepository instanceInfoRepository;
|
||||
|
||||
/**
|
||||
@ -80,33 +83,34 @@ public class InstanceService {
|
||||
*/
|
||||
public void stopInstance(Long instanceId) {
|
||||
|
||||
log.info("[Instance-{}] try to stop the instance.", instanceId);
|
||||
try {
|
||||
|
||||
InstanceInfoDO instanceInfoDO = instanceInfoRepository.findByInstanceId(instanceId);
|
||||
if (instanceInfoDO == null) {
|
||||
log.warn("[InstanceService] can't find execute log for instanceId: {}.", instanceId);
|
||||
InstanceInfoDO instanceInfo = instanceInfoRepository.findByInstanceId(instanceId);
|
||||
if (instanceInfo == null) {
|
||||
log.warn("[Instance-{}] can't find instanceInfo by instanceId.", instanceId);
|
||||
throw new IllegalArgumentException("invalid instanceId: " + instanceId);
|
||||
}
|
||||
|
||||
// 判断状态,只有运行中才能停止
|
||||
if (!InstanceStatus.generalizedRunningStatus.contains(instanceInfoDO.getStatus())) {
|
||||
if (!InstanceStatus.generalizedRunningStatus.contains(instanceInfo.getStatus())) {
|
||||
throw new IllegalArgumentException("can't stop finished instance!");
|
||||
}
|
||||
|
||||
// 更新数据库,将状态置为停止
|
||||
instanceInfoDO.setStatus(STOPPED.getV());
|
||||
instanceInfoDO.setGmtModified(new Date());
|
||||
instanceInfoDO.setFinishedTime(System.currentTimeMillis());
|
||||
instanceInfoDO.setResult(SystemInstanceResult.STOPPED_BY_USER);
|
||||
instanceInfoRepository.saveAndFlush(instanceInfoDO);
|
||||
instanceInfo.setStatus(STOPPED.getV());
|
||||
instanceInfo.setGmtModified(new Date());
|
||||
instanceInfo.setFinishedTime(System.currentTimeMillis());
|
||||
instanceInfo.setResult(SystemInstanceResult.STOPPED_BY_USER);
|
||||
instanceInfoRepository.saveAndFlush(instanceInfo);
|
||||
|
||||
InstanceManager.processFinishedInstance(instanceId, instanceInfoDO.getWfInstanceId(), STOPPED, SystemInstanceResult.STOPPED_BY_USER);
|
||||
InstanceManager.processFinishedInstance(instanceId, instanceInfo.getWfInstanceId(), STOPPED, SystemInstanceResult.STOPPED_BY_USER);
|
||||
|
||||
/*
|
||||
不可靠通知停止 TaskTracker
|
||||
假如没有成功关闭,之后 TaskTracker 会再次 reportStatus,按照流程,instanceLog 会被更新为 RUNNING,开发者可以再次手动关闭
|
||||
*/
|
||||
ActorSelection taskTrackerActor = OhMyServer.getTaskTrackerActor(instanceInfoDO.getTaskTrackerAddress());
|
||||
ActorSelection taskTrackerActor = OhMyServer.getTaskTrackerActor(instanceInfo.getTaskTrackerAddress());
|
||||
ServerStopInstanceReq req = new ServerStopInstanceReq(instanceId);
|
||||
taskTrackerActor.tell(req, null);
|
||||
|
||||
|
@ -128,6 +128,9 @@ public class CleanService {
|
||||
|
||||
@VisibleForTesting
|
||||
public void cleanInstanceLog() {
|
||||
if (instanceInfoRetentionDay < 0) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Date t = DateUtils.addDays(new Date(), -instanceInfoRetentionDay);
|
||||
int num = instanceInfoRepository.deleteAllByGmtModifiedBefore(t);
|
||||
@ -139,6 +142,9 @@ public class CleanService {
|
||||
|
||||
@VisibleForTesting
|
||||
public void cleanWorkflowInstanceLog() {
|
||||
if (instanceInfoRetentionDay < 0) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Date t = DateUtils.addDays(new Date(), -instanceInfoRetentionDay);
|
||||
int num = workflowInstanceInfoRepository.deleteAllByGmtModifiedBefore(t);
|
||||
|
@ -6,7 +6,9 @@ import com.github.kfcfans.oms.common.SystemInstanceResult;
|
||||
import com.github.kfcfans.oms.common.TimeExpressionType;
|
||||
import com.github.kfcfans.oms.common.WorkflowInstanceStatus;
|
||||
import com.github.kfcfans.oms.common.model.PEWorkflowDAG;
|
||||
import com.github.kfcfans.oms.common.utils.JsonUtils;
|
||||
import com.github.kfcfans.oms.common.utils.SegmentLock;
|
||||
import com.github.kfcfans.oms.server.common.constans.SwitchableStatus;
|
||||
import com.github.kfcfans.oms.server.common.utils.WorkflowDAGUtils;
|
||||
import com.github.kfcfans.oms.server.persistence.core.model.JobInfoDO;
|
||||
import com.github.kfcfans.oms.server.persistence.core.model.WorkflowInfoDO;
|
||||
@ -17,6 +19,7 @@ import com.github.kfcfans.oms.server.service.DispatchService;
|
||||
import com.github.kfcfans.oms.server.service.id.IdGenerateService;
|
||||
import com.github.kfcfans.oms.server.service.instance.InstanceService;
|
||||
import com.google.common.collect.LinkedListMultimap;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Multimap;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -58,6 +61,7 @@ public class WorkflowInstanceManager {
|
||||
*/
|
||||
public Long create(WorkflowInfoDO wfInfo) {
|
||||
|
||||
Long wfId = wfInfo.getId();
|
||||
Long wfInstanceId = idGenerateService.allocate();
|
||||
|
||||
// 仅创建,不写入 DAG 图信息
|
||||
@ -65,13 +69,28 @@ public class WorkflowInstanceManager {
|
||||
WorkflowInstanceInfoDO newWfInstance = new WorkflowInstanceInfoDO();
|
||||
newWfInstance.setAppId(wfInfo.getAppId());
|
||||
newWfInstance.setWfInstanceId(wfInstanceId);
|
||||
newWfInstance.setWorkflowId(wfInfo.getId());
|
||||
newWfInstance.setWorkflowId(wfId);
|
||||
newWfInstance.setStatus(WorkflowInstanceStatus.WAITING.getV());
|
||||
newWfInstance.setActualTriggerTime(System.currentTimeMillis());
|
||||
|
||||
newWfInstance.setGmtCreate(now);
|
||||
newWfInstance.setGmtModified(now);
|
||||
|
||||
// 校验合法性(工作是否存在且启用)
|
||||
List<Long> allJobIds = Lists.newLinkedList();
|
||||
PEWorkflowDAG dag = JSONObject.parseObject(wfInfo.getPeDAG(), PEWorkflowDAG.class);
|
||||
dag.getNodes().forEach(node -> allJobIds.add(node.getJobId()));
|
||||
int needNum = allJobIds.size();
|
||||
long dbNum = jobInfoRepository.countByAppIdAndStatusAndIdIn(wfInfo.getAppId(), SwitchableStatus.ENABLE.getV(), allJobIds);
|
||||
log.debug("[Workflow-{}|{}] contains {} jobs, find {} jobs in database.", wfId, wfInstanceId, needNum, dbNum);
|
||||
|
||||
if (dbNum < allJobIds.size()) {
|
||||
log.warn("[Workflow-{}|{}] this workflow need {} jobs, but just find {} jobs in database, maybe you delete or disable some job!", wfId, wfInstanceId, needNum, dbNum);
|
||||
newWfInstance.setStatus(WorkflowInstanceStatus.FAILED.getV());
|
||||
newWfInstance.setFinishedTime(System.currentTimeMillis());
|
||||
newWfInstance.setResult(SystemInstanceResult.CAN_NOT_FIND_JOB);
|
||||
}
|
||||
|
||||
workflowInstanceInfoRepository.save(newWfInstance);
|
||||
return wfInstanceId;
|
||||
}
|
||||
@ -151,11 +170,6 @@ public class WorkflowInstanceManager {
|
||||
*/
|
||||
public void move(Long wfInstanceId, Long instanceId, InstanceStatus status, String result) {
|
||||
|
||||
// 手动停止的DAG数据已被更新,无需再次处理
|
||||
if (status == InstanceStatus.STOPPED) {
|
||||
return;
|
||||
}
|
||||
|
||||
int lockId = wfInstanceId.hashCode();
|
||||
try {
|
||||
segmentLock.lockInterruptible(lockId);
|
||||
@ -168,6 +182,14 @@ public class WorkflowInstanceManager {
|
||||
WorkflowInstanceInfoDO wfInstance = wfInstanceInfoOpt.get();
|
||||
Long wfId = wfInstance.getWorkflowId();
|
||||
|
||||
// 特殊处理手动终止的情况
|
||||
if (status == InstanceStatus.STOPPED) {
|
||||
// 工作流已经不在运行状态了(由用户手动停止工作流实例导致),不需要任何操作
|
||||
if (!WorkflowInstanceStatus.generalizedRunningStatus.contains(wfInstance.getStatus())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
PEWorkflowDAG dag = JSONObject.parseObject(wfInstance.getDag(), PEWorkflowDAG.class);
|
||||
// 保存 jobId -> Node 的映射关系(一个job只能出现一次的原因)
|
||||
@ -209,6 +231,17 @@ public class WorkflowInstanceManager {
|
||||
return;
|
||||
}
|
||||
|
||||
// 子任务被手动停止
|
||||
if (status == InstanceStatus.STOPPED) {
|
||||
wfInstance.setStatus(WorkflowInstanceStatus.STOPPED.getV());
|
||||
wfInstance.setResult(SystemInstanceResult.MIDDLE_JOB_STOPPED);
|
||||
wfInstance.setFinishedTime(System.currentTimeMillis());
|
||||
workflowInstanceInfoRepository.saveAndFlush(wfInstance);
|
||||
|
||||
log.warn("[Workflow-{}|{}] workflow instance stopped because middle task(instanceId={}) stopped by user", wfId, wfInstanceId, instanceId);
|
||||
return;
|
||||
}
|
||||
|
||||
// 工作流执行完毕(能执行到这里代表该工作流内所有子任务都执行成功了)
|
||||
if (allFinished) {
|
||||
wfInstance.setStatus(WorkflowInstanceStatus.SUCCEED.getV());
|
||||
@ -242,12 +275,12 @@ public class WorkflowInstanceManager {
|
||||
}
|
||||
}
|
||||
|
||||
// 所有依赖已经执行完毕,可以执行该任务
|
||||
Map<Long, String> preJobId2Result = Maps.newHashMap();
|
||||
// 所有依赖已经执行完毕,可以执行该任务 (为什么是 Key 是 String?在 JSON 标准中,key必须由双引号引起来,Long会导致结果无法被反序列化)
|
||||
Map<String, String> preJobId2Result = Maps.newHashMap();
|
||||
// 构建下一个任务的入参 (前置任务 jobId -> result)
|
||||
relyMap.get(jobId).forEach(jid -> preJobId2Result.put(jid, jobId2Node.get(jid).getResult()));
|
||||
relyMap.get(jobId).forEach(jid -> preJobId2Result.put(String.valueOf(jid), jobId2Node.get(jid).getResult()));
|
||||
|
||||
Long newInstanceId = instanceService.create(jobId, wfInstance.getAppId(), JSONObject.toJSONString(preJobId2Result), wfInstanceId, System.currentTimeMillis());
|
||||
Long newInstanceId = instanceService.create(jobId, wfInstance.getAppId(), JsonUtils.toJSONString(preJobId2Result), wfInstanceId, System.currentTimeMillis());
|
||||
jobId2Node.get(jobId).setInstanceId(newInstanceId);
|
||||
jobId2Node.get(jobId).setStatus(InstanceStatus.RUNNING.getV());
|
||||
|
||||
|
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
.genTable[data-v-c679bd94]{padding:20px;min-width:500px;width:500px}
|
@ -1 +0,0 @@
|
||||
.el-input[data-v-34dc2e86]{width:80%}.title[data-v-34dc2e86]{display:inline-block;margin:5px 0;font-size:16px;font-weight:700}svg[data-v-34dc2e86]{font-size:16px}.node rect[data-v-34dc2e86]{stroke:#606266;fill:#fff}.edgePath path[data-v-34dc2e86]{stroke:#606266;fill:#f90;stroke-width:3px}
|
@ -1 +0,0 @@
|
||||
.el-row[data-v-ab282ec8]{margin:20px}.title[data-v-ab282ec8]{display:inline-block;margin:5px 0;font-size:16px;font-weight:700}svg[data-v-ab282ec8]{font-size:16px}.node rect[data-v-ab282ec8]{stroke:#606266;fill:#fff}.edgePath path[data-v-ab282ec8]{stroke:#606266;fill:#333;stroke-width:1.5px}
|
@ -1 +0,0 @@
|
||||
#welcome[data-v-d0a6e3d4]{width:100%;height:100%;background-image:url(../img/banner.f4c75b86.jpg);display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:center;align-items:center}.topBar[data-v-d0a6e3d4]{position:fixed;left:30px;top:10px;color:#fff}.right[data-v-d0a6e3d4]{background-color:#f90;color:#000;display:inline-block;box-sizing:border-box;margin-left:5px;border-radius:5px;padding:5px}#entrance[data-v-d0a6e3d4]{margin:20px}
|
@ -1 +0,0 @@
|
||||
.genTable[data-v-0a0f3a65]{padding:20px;min-width:500px;width:500px}.clearfix[data-v-0a0f3a65]:after,.clearfix[data-v-0a0f3a65]:before{display:table;content:""}.clearfix[data-v-0a0f3a65]:after{clear:both}.wrapper[data-v-0a0f3a65]{display:flex;flex-wrap:wrap}.item[data-v-0a0f3a65]{flex:0 0 340px;margin-right:20px;margin-bottom:20px;background-color:#f0f0f0}.item button[data-v-0a0f3a65]{width:100px;margin:0 auto}.btnWrap[data-v-0a0f3a65]{width:50%;float:left;margin-bottom:20px;display:flex;justify-content:center}.containerText[data-v-0a0f3a65]{margin:20px;font-size:16px;box-sizing:border-box}.value[data-v-0a0f3a65]{display:inline-block;max-width:200px;overflow:hidden}.el-dialog[data-v-0a0f3a65]{height:100vh}
|
@ -1 +0,0 @@
|
||||
.wrap[data-v-19b16cc7]{background:#fff;display:flex;text-align:center;justify-content:space-around;align-items:center;margin:10px;box-shadow:0 2px 12px 0 rgba(0,0,0,.2);font-size:1.5rem;font-weight:bolder;height:131px}.mTitle[data-v-19b16cc7]{font-size:20px;color:rgba(15,15,15,.68);margin-bottom:8px}.el-card[data-v-19b16cc7]{margin:10px}.el-table .warning-row{color:#b8860b}.el-table .success-row{color:green}.el-table .error-row{color:red}
|
@ -1 +0,0 @@
|
||||
svg{font-size:10px;border:1px solid red}text{font-weight:300;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px}.node rect{stroke:#999;fill:#fff;stroke-width:1.5px}.edgePath path{stroke:#333;stroke-width:1px}
|
@ -1 +0,0 @@
|
||||
.title[data-v-9fba5a64]{display:inline-block;margin:5px 0;font-size:16px;font-weight:700}
|
@ -1 +1,17 @@
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>oms-console</title><link href=/css/chunk-0e0356b4.f4bfa50b.css rel=prefetch><link href=/css/chunk-14b23d20.26bbf896.css rel=prefetch><link href=/css/chunk-2b66febb.67d90e6c.css rel=prefetch><link href=/css/chunk-4209dd5c.ae6ef0f8.css rel=prefetch><link href=/css/chunk-45306fc0.789baea2.css rel=prefetch><link href=/css/chunk-5a05a51d.8f643887.css rel=prefetch><link href=/css/chunk-682d1154.51eeb3f0.css rel=prefetch><link href=/css/chunk-bf8cf152.1febd7c9.css rel=prefetch><link href=/js/chunk-0e0356b4.a23e17d9.js rel=prefetch><link href=/js/chunk-14b23d20.b09c6601.js rel=prefetch><link href=/js/chunk-2b66febb.52effc93.js rel=prefetch><link href=/js/chunk-2d0af83d.6685fe8d.js rel=prefetch><link href=/js/chunk-2d21772a.94051cbe.js rel=prefetch><link href=/js/chunk-4209dd5c.487a4f83.js rel=prefetch><link href=/js/chunk-45306fc0.6ec7e8f9.js rel=prefetch><link href=/js/chunk-5a05a51d.d690c877.js rel=prefetch><link href=/js/chunk-682d1154.700eb3c7.js rel=prefetch><link href=/js/chunk-781fa4c9.717288a6.js rel=prefetch><link href=/js/chunk-bf8cf152.edec5c05.js rel=prefetch><link href=/css/app.4a69f710.css rel=preload as=style><link href=/js/app.3c728507.js rel=preload as=script><link href=/js/chunk-vendors.1088769c.js rel=preload as=script><link href=/css/app.4a69f710.css rel=stylesheet></head><body><noscript><strong>We're sorry but oms-console doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.1088769c.js></script><script src=/js/app.3c728507.js></script></body></html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<title>oms-console</title>
|
||||
<link href="/js/0.js" rel="prefetch"><link href="/js/1.js" rel="prefetch"><link href="/js/10.js" rel="prefetch"><link href="/js/11.js" rel="prefetch"><link href="/js/2.js" rel="prefetch"><link href="/js/3.js" rel="prefetch"><link href="/js/4.js" rel="prefetch"><link href="/js/5.js" rel="prefetch"><link href="/js/6.js" rel="prefetch"><link href="/js/7.js" rel="prefetch"><link href="/js/8.js" rel="prefetch"><link href="/js/9.js" rel="prefetch"><link href="/js/app.js" rel="preload" as="script"><link href="/js/chunk-vendors.js" rel="preload" as="script"></head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but oms-console doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
<script type="text/javascript" src="/js/chunk-vendors.js"></script><script type="text/javascript" src="/js/app.js"></script></body>
|
||||
</html>
|
||||
|
9890
oh-my-scheduler-server/src/main/resources/static/js/0.js
Normal file
9890
oh-my-scheduler-server/src/main/resources/static/js/0.js
Normal file
File diff suppressed because one or more lines are too long
97
oh-my-scheduler-server/src/main/resources/static/js/1.js
Normal file
97
oh-my-scheduler-server/src/main/resources/static/js/1.js
Normal file
File diff suppressed because one or more lines are too long
63
oh-my-scheduler-server/src/main/resources/static/js/10.js
Normal file
63
oh-my-scheduler-server/src/main/resources/static/js/10.js
Normal file
File diff suppressed because one or more lines are too long
63
oh-my-scheduler-server/src/main/resources/static/js/11.js
Normal file
63
oh-my-scheduler-server/src/main/resources/static/js/11.js
Normal file
File diff suppressed because one or more lines are too long
328
oh-my-scheduler-server/src/main/resources/static/js/2.js
Normal file
328
oh-my-scheduler-server/src/main/resources/static/js/2.js
Normal file
File diff suppressed because one or more lines are too long
224
oh-my-scheduler-server/src/main/resources/static/js/3.js
Normal file
224
oh-my-scheduler-server/src/main/resources/static/js/3.js
Normal file
File diff suppressed because one or more lines are too long
133
oh-my-scheduler-server/src/main/resources/static/js/4.js
Normal file
133
oh-my-scheduler-server/src/main/resources/static/js/4.js
Normal file
File diff suppressed because one or more lines are too long
131
oh-my-scheduler-server/src/main/resources/static/js/5.js
Normal file
131
oh-my-scheduler-server/src/main/resources/static/js/5.js
Normal file
File diff suppressed because one or more lines are too long
108
oh-my-scheduler-server/src/main/resources/static/js/6.js
Normal file
108
oh-my-scheduler-server/src/main/resources/static/js/6.js
Normal file
File diff suppressed because one or more lines are too long
97
oh-my-scheduler-server/src/main/resources/static/js/7.js
Normal file
97
oh-my-scheduler-server/src/main/resources/static/js/7.js
Normal file
File diff suppressed because one or more lines are too long
97
oh-my-scheduler-server/src/main/resources/static/js/8.js
Normal file
97
oh-my-scheduler-server/src/main/resources/static/js/8.js
Normal file
File diff suppressed because one or more lines are too long
97
oh-my-scheduler-server/src/main/resources/static/js/9.js
Normal file
97
oh-my-scheduler-server/src/main/resources/static/js/9.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
729
oh-my-scheduler-server/src/main/resources/static/js/app.js
Normal file
729
oh-my-scheduler-server/src/main/resources/static/js/app.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,2 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0af83d"],{"0f3d":function(o,t,e){"use strict";e.r(t);var l=function(){var o=this,t=o.$createElement,e=o._self._c||t;return e("div",{attrs:{id:"workflow_manager"}},[e("el-row",{attrs:{gutter:20}},[e("el-col",{attrs:{span:20}},[e("el-form",{staticClass:"el-form--inline",attrs:{inline:!0,model:o.workflowQueryContent}},[e("el-form-item",{attrs:{label:"工作流ID"}},[e("el-input",{attrs:{placeholder:"工作流ID"},model:{value:o.workflowQueryContent.workflowId,callback:function(t){o.$set(o.workflowQueryContent,"workflowId",t)},expression:"workflowQueryContent.workflowId"}})],1),e("el-form-item",{attrs:{label:"关键字"}},[e("el-input",{attrs:{placeholder:"关键字"},model:{value:o.workflowQueryContent.keyword,callback:function(t){o.$set(o.workflowQueryContent,"keyword",t)},expression:"workflowQueryContent.keyword"}})],1),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:o.listWorkflow}},[o._v("查询")]),e("el-button",{attrs:{type:"cancel"},on:{click:o.onClickReset}},[o._v("重置")])],1)],1)],1),e("el-col",{attrs:{span:4}},[e("div",{staticStyle:{float:"right","padding-right":"10px"}},[e("el-button",{attrs:{type:"primary"},on:{click:o.onClickNewWorkflow}},[o._v("新建工作流")])],1)])],1),e("el-row",[e("el-table",{staticStyle:{width:"100%"},attrs:{data:o.workflowPageResult.data}},[e("el-table-column",{attrs:{prop:"id",label:"工作流ID",width:"120"}}),e("el-table-column",{attrs:{prop:"wfName",label:"工作流名称"}}),e("el-table-column",{attrs:{label:"定时信息"},scopedSlots:o._u([{key:"default",fn:function(t){return[o._v(" "+o._s(t.row.timeExpressionType)+" "+o._s(t.row.timeExpression)+" ")]}}])}),e("el-table-column",{attrs:{label:"状态",width:"80"},scopedSlots:o._u([{key:"default",fn:function(t){return[e("el-switch",{attrs:{"active-color":"#13ce66","inactive-color":"#ff4949"},on:{change:function(e){return o.switchWorkflow(t.row)}},model:{value:t.row.enable,callback:function(e){o.$set(t.row,"enable",e)},expression:"scope.row.enable"}})]}}])}),e("el-table-column",{attrs:{label:"操作",width:"300"},scopedSlots:o._u([{key:"default",fn:function(t){return[e("el-button",{attrs:{size:"medium"},on:{click:function(e){return o.onClickModifyWorkflow(t.row)}}},[o._v("编辑")]),e("el-button",{attrs:{size:"medium"},on:{click:function(e){return o.onClickRunWorkflow(t.row)}}},[o._v("运行")]),e("el-button",{attrs:{size:"medium",type:"danger"},on:{click:function(e){return o.onClickDeleteWorkflow(t.row)}}},[o._v("删除")])]}}])})],1)],1)],1)},r=[],n={name:"WorkflowManager",data:function(){return{workflowQueryContent:{appId:this.$store.state.appInfo.id,index:0,pageSize:10,workflowId:void 0,keyword:void 0},workflowPageResult:{pageSize:10,totalItems:0,data:[]},workflowObj:{}}},methods:{listWorkflow:function(){var o=this;this.axios.post("/workflow/list",this.workflowQueryContent).then((function(t){o.workflowPageResult=t}))},onClickReset:function(){this.workflowQueryContent.workflowId=void 0,this.workflowQueryContent.keyword=void 0},switchWorkflow:function(o){var t=this,e=o.enable?"enable":"disable",l="/workflow/"+e+"?appId="+this.$store.state.appInfo.id+"&workflowId="+o.id;this.axios.get(l,(function(o){console.log(o),t.listWorkflow()}))},onClickModifyWorkflow:function(o){this.$router.push({name:"workflowEditor",params:{modify:!0,workflowInfo:o}})},onClickRunWorkflow:function(o){var t=this,e="/workflow/run?appId="+this.$store.state.appInfo.id+"&workflowId="+o.id;this.axios.get(e).then((function(){return t.$message.success("触发成功")}))},onClickDeleteWorkflow:function(o){var t=this,e="/workflow/delete?appId="+this.$store.state.appInfo.id+"&workflowId="+o.id;this.axios.get(e).then((function(){t.$message.success("删除成功"),t.listWorkflow()}))},onClickNewWorkflow:function(){this.$router.push({name:"workflowEditor",params:{modify:!1}})}},mounted:function(){this.listWorkflow()}},i=n,a=e("2877"),s=Object(a["a"])(i,l,r,!1,null,"99a34174",null);t["default"]=s.exports}}]);
|
||||
//# sourceMappingURL=chunk-2d0af83d.6685fe8d.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,2 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4209dd5c"],{"1ddd":function(e,t,i){"use strict";i.r(t);var s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{attrs:{id:"welcome"}},[i("el-button",{attrs:{type:"primary",plain:""},on:{click:function(t){e.appRegisterFormVisible=!0}}},[e._v("应用注册")]),i("div",{attrs:{id:"entrance"}},[i("el-select",{attrs:{id:"appSelect",filterable:"",remote:"","reserve-keyword":"",placeholder:"请输入应用名称","remote-method":e.fetchAppNames,loading:e.loading},on:{change:e.selectedApp},model:{value:e.selectedAppInfo,callback:function(t){e.selectedAppInfo=t},expression:"selectedAppInfo"}},e._l(e.appInfoList,(function(e){return i("el-option",{key:e.id,attrs:{label:e.appName,value:e}})})),1)],1),i("el-button",{attrs:{type:"success",plain:""},on:{click:function(t){e.userRegisterFormVisible=!0}}},[e._v("用户注册")]),i("el-dialog",{attrs:{title:"应用注册",visible:e.appRegisterFormVisible,width:"35%"},on:{"update:visible":function(t){e.appRegisterFormVisible=t}}},[i("el-form",{staticStyle:{margin:"0 5px"},attrs:{model:e.appRegisterForm}},[i("el-form-item",{attrs:{label:"应用名称"}},[i("el-input",{model:{value:e.appRegisterForm.appName,callback:function(t){e.$set(e.appRegisterForm,"appName",t)},expression:"appRegisterForm.appName"}})],1),i("el-form-item",{attrs:{label:"应用描述"}},[i("el-input",{model:{value:e.appRegisterForm.description,callback:function(t){e.$set(e.appRegisterForm,"description",t)},expression:"appRegisterForm.description"}})],1),i("el-form-item",[i("el-button",{attrs:{type:"primary"},on:{click:e.registerApp}},[e._v("注册")]),i("el-button",{on:{click:function(t){e.appRegisterFormVisible=!1}}},[e._v("取消")])],1)],1)],1),i("el-dialog",{attrs:{title:"用户注册",visible:e.userRegisterFormVisible,width:"35%"},on:{"update:visible":function(t){e.userRegisterFormVisible=t}}},[i("el-form",{staticStyle:{margin:"0 5px"},attrs:{model:e.userRegisterForm}},[i("el-form-item",{attrs:{label:"姓名"}},[i("el-input",{model:{value:e.userRegisterForm.username,callback:function(t){e.$set(e.userRegisterForm,"username",t)},expression:"userRegisterForm.username"}})],1),i("el-form-item",{attrs:{label:"手机号"}},[i("el-input",{model:{value:e.userRegisterForm.phone,callback:function(t){e.$set(e.userRegisterForm,"phone",t)},expression:"userRegisterForm.phone"}})],1),i("el-form-item",{attrs:{label:"邮箱地址"}},[i("el-input",{model:{value:e.userRegisterForm.email,callback:function(t){e.$set(e.userRegisterForm,"email",t)},expression:"userRegisterForm.email"}})],1),i("el-form-item",[i("el-button",{attrs:{type:"primary"},on:{click:e.registerUser}},[e._v("注册")]),i("el-button",{on:{click:function(t){e.userRegisterFormVisible=!1}}},[e._v("取消")])],1)],1)],1)],1)},r=[],o={name:"Welcome",data:function(){return{selectedAppInfo:{},appInfoList:[],appRegisterFormVisible:!1,userRegisterFormVisible:!1,appRegisterForm:{appName:"",description:""},userRegisterForm:{username:"",phone:"",email:""}}},methods:{fetchAppNames:function(e){var t=this,i="/appInfo/list?condition="+e;this.axios.get(i).then((function(e){t.appInfoList=e}),(function(e){return t.$message.error(e)}))},selectedApp:function(){this.$store.commit("initAppInfo",this.selectedAppInfo),this.$router.push("/oms/home")},registerApp:function(){var e=this;this.axios.post("/appInfo/save",this.appRegisterForm).then((function(){e.$message.success("应用注册成功!"),e.appRegisterFormVisible=!1}),e.appRegisterFormVisible=!1)},registerUser:function(){var e=this;this.axios.post("/user/save",this.userRegisterForm).then((function(){e.$message.success("用户注册成功!"),e.userRegisterFormVisible=!1}),e.userRegisterFormVisible=!1)}}},n=o,a=(i("b0ce"),i("2877")),l=Object(a["a"])(n,s,r,!1,null,"d0a6e3d4",null);t["default"]=l.exports},"21a8":function(e,t,i){},b0ce:function(e,t,i){"use strict";var s=i("21a8"),r=i.n(s);r.a}}]);
|
||||
//# sourceMappingURL=chunk-4209dd5c.487a4f83.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,2 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5a05a51d"],{6337:function(t,s,e){"use strict";var a=e("ffdc"),i=e.n(a);i.a},"7d8a":function(t,s,e){"use strict";e.r(s);var a=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{attrs:{id:"home"}},[e("el-row",{attrs:{gutter:24}},[e("el-col",{attrs:{span:6}},[e("el-card",{attrs:{shadow:"always"}},[t._v(" 调度中心服务器时间:"+t._s(this.common.timestamp2Str(t.systemInfo.serverTime))+" ")])],1),e("el-col",{attrs:{span:6}},[e("el-card",{attrs:{shadow:"always"}},[t._v(" 本地浏览器时间:"+t._s(this.common.timestamp2Str((new Date).getTime()))+" ")])],1)],1),e("el-row",{attrs:{gutter:24}},[e("el-col",{attrs:{span:6}},[e("div",{staticClass:"wrap"},[e("div",{staticClass:"grid-content bg-purple"},[e("div",{staticClass:"text mTitle"},[t._v("任务总数")]),e("div",{staticClass:"text mText"},[t._v(t._s(t.systemInfo.jobCount))])]),e("i",{staticClass:"el-icon-orange"})])]),e("el-col",{attrs:{span:6}},[e("div",{staticClass:"wrap"},[e("div",{staticClass:"grid-content bg-purple"},[e("div",{staticClass:"text mTitle"},[t._v("当前运行实例数")]),e("div",{staticClass:"text"},[t._v(t._s(t.systemInfo.runningInstanceCount))])]),e("i",{staticClass:"el-icon-loading"})])]),e("el-col",{attrs:{span:6}},[e("div",{staticClass:"wrap"},[e("div",{staticClass:"grid-content bg-purple"},[e("div",{staticClass:"text mTitle"},[t._v("近期失败任务数")]),e("div",{staticClass:"text"},[t._v(t._s(t.systemInfo.failedInstanceCount))])]),e("i",{staticClass:"el-icon-bell"})])]),e("el-col",{attrs:{span:6}},[e("div",{staticClass:"wrap"},[e("div",{staticClass:"grid-content bg-purple"},[e("div",{staticClass:"text mTitle"},[t._v("集群机器数")]),e("div",{staticClass:"text"},[t._v(t._s(t.activeWorkerCount))])]),e("i",{staticClass:"el-icon-cpu"})])])],1),e("el-row",[e("el-col",{attrs:{span:24}},[e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.workerList,height:"400px","row-class-name":t.workerTableRowClassName}},[e("el-table-column",{attrs:{prop:"address",label:"机器地址"}}),e("el-table-column",{attrs:{prop:"cpuLoad",label:"CPU占用"}}),e("el-table-column",{attrs:{prop:"memoryLoad",label:"内存占用"}}),e("el-table-column",{attrs:{prop:"diskLoad",label:"磁盘占用"}})],1)],1)],1)],1)},i=[],r={name:"Home",data:function(){return{systemInfo:{jobCount:"N/A",runningInstanceCount:"N/A",failedInstanceCount:"N/A",serverTime:void 0},activeWorkerCount:"N/A",workerList:[]}},methods:{workerTableRowClassName:function(t){var s=t.row;switch(s.status){case 1:return"success-row";case 2:return"warning-row";case 3:return"error-row"}}},mounted:function(){var t=this,s=this,e=s.$store.state.appInfo.id;s.axios.get("/system/listWorker?appId="+e).then((function(t){s.workerList=t,s.activeWorkerCount=s.workerList.length})),s.axios.get("/system/overview?appId="+e).then((function(e){s.systemInfo=e;var a=(new Date).getTime(),i=e.serverTime;console.log("localTime: %o, serverTime: %o",a,i);var r=a-i;Math.abs(r)>6e4&&t.$notify({title:"警告",message:"调度中心服务器与本地存在时间差,可能影响任务调度准确性,建议排查时间问题!",type:"warning",duration:0})}))}},n=r,o=(e("e1e7"),e("6337"),e("2877")),l=Object(o["a"])(n,a,i,!1,null,"19b16cc7",null);s["default"]=l.exports},e1e7:function(t,s,e){"use strict";var a=e("e3cf"),i=e.n(a);i.a},e3cf:function(t,s,e){},ffdc:function(t,s,e){}}]);
|
||||
//# sourceMappingURL=chunk-5a05a51d.d690c877.js.map
|
File diff suppressed because one or more lines are too long
@ -1,2 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-682d1154"],{"1a8e":function(t,e,n){"use strict";var a=n("5933"),s=n.n(a);s.a},5933:function(t,e,n){},6277:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"wf_instance_manager"}},[n("el-row",[n("el-col",{attrs:{span:20}},[n("el-form",{staticClass:"el-form--inline",attrs:{inline:!0,model:t.wfInstanceQueryContent}},[n("el-form-item",{attrs:{label:"工作流实例ID"}},[n("el-input",{attrs:{placeholder:"工作流实例ID"},model:{value:t.wfInstanceQueryContent.wfInstanceId,callback:function(e){t.$set(t.wfInstanceQueryContent,"wfInstanceId",e)},expression:"wfInstanceQueryContent.wfInstanceId"}})],1),n("el-form-item",{attrs:{label:"任务ID"}},[n("el-input",{attrs:{placeholder:"工作流ID"},model:{value:t.wfInstanceQueryContent.workflowId,callback:function(e){t.$set(t.wfInstanceQueryContent,"workflowId",e)},expression:"wfInstanceQueryContent.workflowId"}})],1),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:t.listWfInstances}},[t._v("查询")]),n("el-button",{attrs:{type:"cancel"},on:{click:t.onClickRest}},[t._v("重置")])],1)],1)],1),n("el-col",{attrs:{span:4}},[n("div",{staticStyle:{float:"right","padding-right":"10px"}},[n("el-button",{attrs:{type:"primary"},on:{click:t.listWfInstances}},[t._v("刷新状态")])],1)])],1),n("el-row",[n("el-table",{staticStyle:{width:"100%"},attrs:{data:t.wfInstancePageResult.data,"row-class-name":t.wfInstanceTableRowClassName}},[n("el-table-column",{attrs:{prop:"workflowId",label:"工作流ID",width:"80"}}),n("el-table-column",{attrs:{prop:"workflowName",label:"工作流名称"}}),n("el-table-column",{attrs:{prop:"wfInstanceId",label:"工作流实例ID"}}),n("el-table-column",{attrs:{prop:"statusStr",label:"状态",width:"80"}}),n("el-table-column",{attrs:{prop:"actualTriggerTime",label:"触发时间"}}),n("el-table-column",{attrs:{prop:"finishedTime",label:"结束时间"}}),n("el-table-column",{attrs:{label:"操作",width:"300"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{attrs:{size:"medium"},on:{click:function(n){return t.onClickShowDetail(e.row)}}},[t._v("详情")]),n("el-button",{attrs:{size:"medium"},on:{click:function(n){return t.onClickStop(e.row)}}},[t._v("停止")])]}}])})],1)],1),n("el-row",[n("el-col",{attrs:{span:24}},[n("el-pagination",{attrs:{total:this.wfInstancePageResult.totalItems,"page-size":this.wfInstancePageResult.pageSize,layout:"prev, pager, next"},on:{"current-change":t.onClickChangeInstancePage}})],1)],1)],1)},s=[],o={name:"WFInstanceManager",data:function(){return{wfInstanceQueryContent:{appId:this.$store.state.appInfo.id,index:0,pageSize:10,wfInstanceId:void 0,workflowId:void 0},wfInstancePageResult:{pageSize:10,totalItems:0,data:[]}}},methods:{listWfInstances:function(){var t=this;this.axios.post("/wfInstance/list",this.wfInstanceQueryContent).then((function(e){return t.wfInstancePageResult=e}))},onClickRest:function(){this.wfInstanceQueryContent.wfInstanceId=void 0,this.wfInstanceQueryContent.workflowId=void 0},onClickShowDetail:function(t){console.log(t),this.$router.push({name:"WorkflowInstanceDetail",params:{wfInstanceId:t.wfInstanceId}})},onClickStop:function(t){var e=this,n="/wfInstance/stop?wfInstanceId="+t.wfInstanceId+"&appId="+this.$store.state.appInfo.id;this.axios.get(n).then((function(){e.$message.success("停止成功"),e.listInstanceInfos()}))},onClickChangeInstancePage:function(t){this.wfInstanceQueryContent.index=t-1,this.listWfInstances()},wfInstanceTableRowClassName:function(t){var e=t.row;switch(e.status){case 3:return"error-row";case 4:return"success-row";case 10:return"warning-row"}}},mounted:function(){this.listWfInstances()}},l=o,c=(n("1a8e"),n("2877")),r=Object(c["a"])(l,a,s,!1,null,null,null);e["default"]=r.exports}}]);
|
||||
//# sourceMappingURL=chunk-682d1154.700eb3c7.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
3249
oh-my-scheduler-server/src/main/resources/static/js/chunk-vendors.js
Normal file
3249
oh-my-scheduler-server/src/main/resources/static/js/chunk-vendors.js
Normal file
File diff suppressed because one or more lines are too long
@ -76,7 +76,7 @@ public class MapReduceProcessorDemo extends MapReduceProcessor {
|
||||
|
||||
@Override
|
||||
public ProcessResult reduce(TaskContext context, List<TaskResult> taskResults) {
|
||||
log.info("================ MapReduceProcessorDemo#postProcess ================");
|
||||
log.info("================ MapReduceProcessorDemo#reduce ================");
|
||||
log.info("TaskContext: {}", JSONObject.toJSONString(context));
|
||||
log.info("List<TaskResult>: {}", JSONObject.toJSONString(taskResults));
|
||||
context.getOmsLogger().info("MapReduce job finished, result is {}.", taskResults);
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.github.kfcfans.oms.samples.workflow;
|
||||
|
||||
import com.github.kfcfans.oms.common.utils.JsonUtils;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.kfcfans.oms.worker.core.processor.ProcessResult;
|
||||
import com.github.kfcfans.oms.worker.core.processor.TaskContext;
|
||||
import com.github.kfcfans.oms.worker.core.processor.sdk.BasicProcessor;
|
||||
@ -21,9 +21,10 @@ public class WorkflowStandaloneProcessor implements BasicProcessor {
|
||||
@Override
|
||||
public ProcessResult process(TaskContext context) throws Exception {
|
||||
OmsLogger logger = context.getOmsLogger();
|
||||
logger.info("current:" + JsonUtils.toJSONString(context));
|
||||
logger.info("current:" + context.getJobParams());
|
||||
System.out.println("current: " + context.getJobParams());
|
||||
System.out.println("currentContext:");
|
||||
System.out.println(JsonUtils.toJSONString(context));
|
||||
System.out.println(JSONObject.toJSONString(context));
|
||||
|
||||
// 尝试获取上游任务
|
||||
Map<Long, String> upstreamTaskResult = context.fetchUpstreamTaskResult();
|
||||
|
@ -6,6 +6,7 @@ import com.google.common.collect.Maps;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -62,10 +63,16 @@ public class TaskContext {
|
||||
* 获取工作流上游任务传递的数据(仅该任务实例由工作流触发时存在)
|
||||
* @return key: 上游任务的 jobId;value: 上游任务的 ProcessResult#result
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings("rawtypes, unchecked")
|
||||
public Map<Long, String> fetchUpstreamTaskResult() {
|
||||
Map<Long, String> res = Maps.newHashMap();
|
||||
if (StringUtils.isEmpty(instanceParams)) {
|
||||
return res;
|
||||
}
|
||||
try {
|
||||
return (Map<Long, String>)JsonUtils.parseObject(instanceParams, Map.class);
|
||||
Map originMap = JsonUtils.parseObject(instanceParams, Map.class);
|
||||
originMap.forEach((k, v) -> res.put(Long.valueOf(String.valueOf(k)), String.valueOf(v)));
|
||||
return res;
|
||||
}catch (Exception ignore) {
|
||||
}
|
||||
return Maps.newHashMap();
|
||||
|
@ -9,7 +9,7 @@
|
||||
Target Server Version : 50724
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 03/06/2020 22:58:32
|
||||
Date: 07/06/2020 11:11:47
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
@ -28,7 +28,7 @@ CREATE TABLE `app_info` (
|
||||
`gmt_modified` datetime(6) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `appNameUK` (`app_name`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for container_info
|
||||
@ -47,7 +47,7 @@ CREATE TABLE `container_info` (
|
||||
`version` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `IDX8hixyaktlnwil2w9up6b0p898` (`app_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for instance_info
|
||||
@ -66,7 +66,7 @@ CREATE TABLE `instance_info` (
|
||||
`job_id` bigint(20) DEFAULT NULL,
|
||||
`result` text,
|
||||
`running_times` bigint(20) DEFAULT NULL,
|
||||
`status` int(11) NOT NULL,
|
||||
`status` int(11) DEFAULT NULL,
|
||||
`task_tracker_address` varchar(255) DEFAULT NULL,
|
||||
`type` int(11) DEFAULT NULL,
|
||||
`wf_instance_id` bigint(20) DEFAULT NULL,
|
||||
@ -74,7 +74,7 @@ CREATE TABLE `instance_info` (
|
||||
KEY `IDX5b1nhpe5je7gc5s1ur200njr7` (`job_id`),
|
||||
KEY `IDXjnji5lrr195kswk6f7mfhinrs` (`app_id`),
|
||||
KEY `IDXa98hq3yu0l863wuotdjl7noum` (`instance_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for job_info
|
||||
@ -108,7 +108,7 @@ CREATE TABLE `job_info` (
|
||||
`time_expression_type` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `IDXk2xprmn3lldmlcb52i36udll1` (`app_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for oms_lock
|
||||
@ -123,7 +123,7 @@ CREATE TABLE `oms_lock` (
|
||||
`ownerip` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `lockNameUK` (`lock_name`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for server_info
|
||||
@ -165,7 +165,7 @@ CREATE TABLE `workflow_info` (
|
||||
`max_wf_instance_num` int(11) DEFAULT NULL,
|
||||
`next_trigger_time` bigint(20) DEFAULT NULL,
|
||||
`notify_user_ids` varchar(255) DEFAULT NULL,
|
||||
`pedag` varchar(255) DEFAULT NULL,
|
||||
`pedag` text,
|
||||
`status` int(11) DEFAULT NULL,
|
||||
`time_expression` varchar(255) DEFAULT NULL,
|
||||
`time_expression_type` int(11) DEFAULT NULL,
|
||||
@ -173,7 +173,7 @@ CREATE TABLE `workflow_info` (
|
||||
`wf_name` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `IDX7uo5w0e3beeho3fnx9t7eiol3` (`app_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for workflow_instance_info
|
||||
@ -192,6 +192,6 @@ CREATE TABLE `workflow_instance_info` (
|
||||
`wf_instance_id` bigint(20) DEFAULT NULL,
|
||||
`workflow_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user