|
@@ -221,9 +221,8 @@ public class ProcessDefinitionServiceImpl extends BaseService implements
|
|
|
processDefineMapper.updateVersionByProcessDefinitionId(processDefine.getId(), version);
|
|
|
|
|
|
// return processDefinition object with ID
|
|
|
- result.put(Constants.DATA_LIST, processDefineMapper.selectById(processDefine.getId()));
|
|
|
+ result.put(Constants.DATA_LIST, processDefine.getId());
|
|
|
putMsg(result, Status.SUCCESS);
|
|
|
- result.put(PROCESSDEFINITIONID, processDefine.getId());
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -888,8 +887,8 @@ public class ProcessDefinitionServiceImpl extends BaseService implements
|
|
|
|
|
|
//create process definition
|
|
|
Integer processDefinitionId =
|
|
|
- Objects.isNull(createProcessResult.get(PROCESSDEFINITIONID))
|
|
|
- ? null : Integer.parseInt(createProcessResult.get(PROCESSDEFINITIONID).toString());
|
|
|
+ Objects.isNull(createProcessResult.get(Constants.DATA_LIST))
|
|
|
+ ? null : Integer.parseInt(createProcessResult.get(Constants.DATA_LIST).toString());
|
|
|
|
|
|
//scheduler param
|
|
|
return getImportProcessScheduleResult(loginUser,
|
|
@@ -1516,41 +1515,6 @@ public class ProcessDefinitionServiceImpl extends BaseService implements
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * copy process definition
|
|
|
- *
|
|
|
- * @param loginUser login user
|
|
|
- * @param projectName project name
|
|
|
- * @param processId process definition id
|
|
|
- * @return copy result code
|
|
|
- */
|
|
|
- public Map<String, Object> copyProcessDefinition(User loginUser, String projectName, Integer processId) {
|
|
|
-
|
|
|
- Map<String, Object> result = new HashMap<>(5);
|
|
|
- Project project = projectMapper.queryByName(projectName);
|
|
|
-
|
|
|
- Map<String, Object> checkResult = projectService.checkProjectAndAuth(loginUser, project, projectName);
|
|
|
- Status resultStatus = (Status) checkResult.get(Constants.STATUS);
|
|
|
- if (resultStatus != Status.SUCCESS) {
|
|
|
- return checkResult;
|
|
|
- }
|
|
|
-
|
|
|
- ProcessDefinition processDefinition = processDefineMapper.selectById(processId);
|
|
|
- if (processDefinition == null) {
|
|
|
- putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, processId);
|
|
|
- return result;
|
|
|
- } else {
|
|
|
- return createProcessDefinition(
|
|
|
- loginUser,
|
|
|
- projectName,
|
|
|
- processDefinition.getName() + "_copy_" + System.currentTimeMillis(),
|
|
|
- processDefinition.getProcessDefinitionJson(),
|
|
|
- processDefinition.getDescription(),
|
|
|
- processDefinition.getLocations(),
|
|
|
- processDefinition.getConnects());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* batch copy process definition
|
|
|
*
|