mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-05 05:38:30 +08:00
add tenant id in process definition
This commit is contained in:
parent
a67bc60872
commit
ec7406ddab
@ -494,11 +494,7 @@ public class ProcessDao extends AbstractBaseDao {
|
||||
processInstance.setProcessInstancePriority(command.getProcessInstancePriority());
|
||||
processInstance.setWorkerGroupId(command.getWorkerGroupId());
|
||||
processInstance.setTimeout(processDefinition.getTimeout());
|
||||
Tenant tenant = getTenantForProcess(processDefinition.getTenantId(),
|
||||
processDefinition.getUserId());
|
||||
if(tenant!= null){
|
||||
processInstance.setTenantCode(tenant.getTenantCode());
|
||||
}
|
||||
processInstance.setTenantId(processDefinition.getTenantId());
|
||||
return processInstance;
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ public class ProcessInstance {
|
||||
/**
|
||||
* tenant id
|
||||
*/
|
||||
private String tenantId;
|
||||
private int tenantId;
|
||||
|
||||
public ProcessInstance(){
|
||||
|
||||
@ -553,4 +553,11 @@ public class ProcessInstance {
|
||||
'}';
|
||||
}
|
||||
|
||||
public void setTenantId(int tenantId) {
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public int getTenantId() {
|
||||
return this.tenantId ;
|
||||
}
|
||||
}
|
||||
|
@ -23,10 +23,7 @@ import cn.escheduler.common.thread.ThreadUtils;
|
||||
import cn.escheduler.common.utils.FileUtils;
|
||||
import cn.escheduler.common.utils.OSUtils;
|
||||
import cn.escheduler.dao.ProcessDao;
|
||||
import cn.escheduler.dao.model.ProcessDefinition;
|
||||
import cn.escheduler.dao.model.ProcessInstance;
|
||||
import cn.escheduler.dao.model.TaskInstance;
|
||||
import cn.escheduler.dao.model.WorkerGroup;
|
||||
import cn.escheduler.dao.model.*;
|
||||
import cn.escheduler.server.zk.ZKWorkerClient;
|
||||
import com.cronutils.utils.StringUtils;
|
||||
import org.apache.commons.configuration.Configuration;
|
||||
@ -194,9 +191,16 @@ public class FetchTaskThread implements Runnable{
|
||||
// get process instance
|
||||
ProcessInstance processInstance = processDao.findProcessInstanceDetailById(taskInstance.getProcessInstanceId());
|
||||
|
||||
|
||||
// get process define
|
||||
ProcessDefinition processDefine = processDao.findProcessDefineById(taskInstance.getProcessDefinitionId());
|
||||
|
||||
Tenant tenant = processDao.getTenantForProcess(processInstance.getTenantId(),
|
||||
processDefine.getUserId());
|
||||
|
||||
if(tenant != null){
|
||||
processInstance.setTenantCode(tenant.getTenantCode());
|
||||
}
|
||||
|
||||
taskInstance.setProcessInstance(processInstance);
|
||||
taskInstance.setProcessDefine(processDefine);
|
||||
|
Loading…
Reference in New Issue
Block a user