JinyLeeChina commented on a change in pull request #5554:
URL: https://github.com/apache/dolphinscheduler/pull/5554#discussion_r641160376
##########
File path:
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
##########
@@ -621,23 +621,24 @@ private void setProcessInstance(ProcessInstance
processInstance, Tenant tenant,
throw new RuntimeException("workflow instance is null");
}
+ Date scheduleTime = processInstance.getScheduleTime();
Map<String, String> timeParams = BusinessTimeUtils
.getBusinessTime(processInstance.getCmdTypeIfComplement(),
- processInstance.getScheduleTime());
+ scheduleTime !=null ? scheduleTime :
processInstance.getStartTime());
String userDefinedParams = processInstance.getGlobalParams();
// global params
List<Property> globalParams = new ArrayList<>();
+ if (userDefinedParams != null && userDefinedParams.length() > 0) {
Review comment:
This is the feature of parameter transfer to be modified. I suggest that
it be retained first
##########
File path:
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
##########
@@ -621,23 +621,24 @@ private void setProcessInstance(ProcessInstance
processInstance, Tenant tenant,
throw new RuntimeException("workflow instance is null");
}
+ Date scheduleTime = processInstance.getScheduleTime();
Map<String, String> timeParams = BusinessTimeUtils
.getBusinessTime(processInstance.getCmdTypeIfComplement(),
- processInstance.getScheduleTime());
+ scheduleTime !=null ? scheduleTime :
processInstance.getStartTime());
Review comment:
Thanks for your contribute, I think that can't be modify it like this,
because system.datetime is definited for processIntance scheduleTime. When
scheduleTime is null, system.datetime is reasonable to use the current time.
##########
File path:
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessInstanceServiceImpl.java
##########
@@ -661,8 +662,8 @@ private void setProcessInstance(ProcessInstance
processInstance, Tenant tenant,
TaskDefinitionLog taskDefinitionLog =
taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(
taskInstance.getTaskCode(),
taskInstance.getTaskDefinitionVersion());
String parameter = taskDefinitionLog.getTaskParams();
- Map<String, String> map = JSONUtils.toMap(parameter);
- String localParams = map.get(LOCAL_PARAMS);
+ Map<String, Object> map =
JSONUtils.toMap(parameter,String.class,Object.class);
Review comment:
Very good
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]