Browse Source

Return ProcessDefinition ID when call ProcessController.createProject. (#2849)

Return Scheduler ID when call SchedulerController.createScheduler.

client need the created object ID to bind the relationship between client system and Dolphinscheduler system.
pull/2/head
GabrielWithTina 5 years ago committed by GitHub
parent
commit
d00627ff77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java
  2. 3
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SchedulerService.java

3
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java

@ -159,6 +159,9 @@ public class ProcessDefinitionService extends BaseDAGService {
processDefine.setUpdateTime(now); processDefine.setUpdateTime(now);
processDefine.setFlag(Flag.YES); processDefine.setFlag(Flag.YES);
processDefineMapper.insert(processDefine); processDefineMapper.insert(processDefine);
// return processDefinition object with ID
result.put(Constants.DATA_LIST, processDefineMapper.selectById(processDefine.getId()));
putMsg(result, Status.SUCCESS); putMsg(result, Status.SUCCESS);
result.put("processDefinitionId",processDefine.getId()); result.put("processDefinitionId",processDefine.getId());
return result; return result;

3
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/SchedulerService.java

@ -165,6 +165,9 @@ public class SchedulerService extends BaseService {
processDefinition.setReceivers(receivers); processDefinition.setReceivers(receivers);
processDefinition.setReceiversCc(receiversCc); processDefinition.setReceiversCc(receiversCc);
processDefinitionMapper.updateById(processDefinition); processDefinitionMapper.updateById(processDefinition);
// return scheduler object with ID
result.put(Constants.DATA_LIST, scheduleMapper.selectById(scheduleObj.getId()));
putMsg(result, Status.SUCCESS); putMsg(result, Status.SUCCESS);
result.put("scheduleId", scheduleObj.getId()); result.put("scheduleId", scheduleObj.getId());

Loading…
Cancel
Save