Browse Source

Merge branch '2.0.0-release' of https://github.com/apache/dolphinscheduler into 2.0.0-release

2.0.7-release
lenboo 3 years ago
parent
commit
09dbfa2048
  1. 9
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
  2. 2
      dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ResourceMapper.xml
  3. 3
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/EventExecuteService.java

9
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java

@ -282,10 +282,11 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskCode); putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskCode);
return result; return result;
} }
TaskDefinitionLog taskDefinitionLog = taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(taskCode, version); TaskDefinitionLog taskDefinitionUpdate = taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(taskCode, version);
taskDefinitionLog.setUserId(loginUser.getId()); taskDefinitionUpdate.setUserId(loginUser.getId());
taskDefinitionLog.setUpdateTime(new Date()); taskDefinitionUpdate.setUpdateTime(new Date());
int switchVersion = taskDefinitionMapper.updateById(taskDefinitionLog); taskDefinitionUpdate.setId(taskDefinition.getId());
int switchVersion = taskDefinitionMapper.updateById(taskDefinitionUpdate);
if (switchVersion > 0) { if (switchVersion > 0) {
result.put(Constants.DATA_LIST, taskCode); result.put(Constants.DATA_LIST, taskCode);
putMsg(result, Status.SUCCESS); putMsg(result, Status.SUCCESS);

2
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ResourceMapper.xml

@ -63,7 +63,7 @@
<if test="userId != 0"> <if test="userId != 0">
and ( and (
<if test="resIds != null and resIds.size() > 0"> <if test="resIds != null and resIds.size() > 0">
and d.id in d.id in
<foreach collection="resIds" item="i" open="(" close=") or" separator=","> <foreach collection="resIds" item="i" open="(" close=") or" separator=",">
#{i} #{i}
</foreach> </foreach>

3
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/EventExecuteService.java

@ -187,12 +187,13 @@ public class EventExecuteService extends Thread {
StateEventChangeCommand stateEventChangeCommand = new StateEventChangeCommand( StateEventChangeCommand stateEventChangeCommand = new StateEventChangeCommand(
processInstanceId, 0, workflowExecuteThread.getProcessInstance().getState(), processInstance.getId(), taskInstance.getId() processInstanceId, 0, workflowExecuteThread.getProcessInstance().getState(), processInstance.getId(), taskInstance.getId()
); );
stateEventCallbackService.sendResult(address, port, stateEventChangeCommand.convert2Command()); stateEventCallbackService.sendResult(address, port, stateEventChangeCommand.convert2Command());
} }
@Override @Override
public void onFailure(Throwable throwable) { public void onFailure(Throwable throwable) {
logger.info("handle events {} failed.", processInstanceId);
logger.info("handle events failed.", throwable);
} }
}; };
Futures.addCallback(future, futureCallback, this.listeningExecutorService); Futures.addCallback(future, futureCallback, this.listeningExecutorService);

Loading…
Cancel
Save