|
|
|
@ -17,6 +17,7 @@
|
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.dao.entity; |
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference; |
|
|
|
|
import org.apache.dolphinscheduler.common.Constants; |
|
|
|
|
import org.apache.dolphinscheduler.common.enums.ExecutionStatus; |
|
|
|
|
import org.apache.dolphinscheduler.common.enums.Flag; |
|
|
|
@ -448,7 +449,7 @@ public class TaskInstance implements Serializable {
|
|
|
|
|
|
|
|
|
|
public DependentParameters getDependency() { |
|
|
|
|
if (this.dependency == null) { |
|
|
|
|
Map<String, Object> taskParamsMap = JSONUtils.toMap(this.getTaskParams(), String.class, Object.class); |
|
|
|
|
Map<String, Object> taskParamsMap = JSONUtils.parseObject(this.getTaskParams(), new TypeReference<Map<String, Object>>() {}); |
|
|
|
|
this.dependency = JSONUtils.parseObject((String) taskParamsMap.get(Constants.DEPENDENCE), DependentParameters.class); |
|
|
|
|
} |
|
|
|
|
return this.dependency; |
|
|
|
@ -460,14 +461,14 @@ public class TaskInstance implements Serializable {
|
|
|
|
|
|
|
|
|
|
public SwitchParameters getSwitchDependency() { |
|
|
|
|
if (this.switchDependency == null) { |
|
|
|
|
Map<String, Object> taskParamsMap = JSONUtils.toMap(this.getTaskParams(), String.class, Object.class); |
|
|
|
|
Map<String, Object> taskParamsMap = JSONUtils.parseObject(this.getTaskParams(), new TypeReference<Map<String, Object>>() {}); |
|
|
|
|
this.switchDependency = JSONUtils.parseObject((String) taskParamsMap.get(Constants.SWITCH_RESULT), SwitchParameters.class); |
|
|
|
|
} |
|
|
|
|
return this.switchDependency; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setSwitchDependency(SwitchParameters switchDependency) { |
|
|
|
|
Map<String, Object> taskParamsMap = JSONUtils.toMap(this.getTaskParams(), String.class, Object.class); |
|
|
|
|
Map<String, Object> taskParamsMap = JSONUtils.parseObject(this.getTaskParams(), new TypeReference<Map<String, Object>>() {}); |
|
|
|
|
taskParamsMap.put(Constants.SWITCH_RESULT,JSONUtils.toJsonString(switchDependency)); |
|
|
|
|
this.setTaskParams(JSONUtils.toJsonString(taskParamsMap)); |
|
|
|
|
} |
|
|
|
|