优化模型编辑校验,流程定义删除,流程定义激活挂起等

This commit is contained in:
songgaoshuai 2023-06-06 12:27:30 +08:00
parent 671d072d2c
commit 58c7fc55fa
2 changed files with 3 additions and 6 deletions

View File

@ -221,10 +221,6 @@ public class ActModelServiceImpl implements IActModelService {
if (ArrayUtil.isEmpty(xmlBytes)) { if (ArrayUtil.isEmpty(xmlBytes)) {
throw new ServiceException("模型不能为空!"); throw new ServiceException("模型不能为空!");
} }
byte[] toXmlBytes = WorkflowUtils.bpmnJsonToXmlBytes(xmlBytes);
if (ArrayUtil.isEmpty(toXmlBytes)) {
throw new ServiceException("模型不能为空,请至少设计一条主线流程!");
}
repositoryService.addModelEditorSource(model.getId(), xmlBytes); repositoryService.addModelEditorSource(model.getId(), xmlBytes);
return true; return true;
} catch (Exception e) { } catch (Exception e) {

View File

@ -181,7 +181,8 @@ public class ActProcessDefinitionServiceImpl implements IActProcessDefinitionSer
@Override @Override
public boolean deleteDeployment(String deploymentId, String processDefinitionId) { public boolean deleteDeployment(String deploymentId, String processDefinitionId) {
try { try {
List<HistoricTaskInstance> taskInstanceList = historyService.createHistoricTaskInstanceQuery().processDefinitionId(processDefinitionId).list(); List<HistoricTaskInstance> taskInstanceList = historyService.createHistoricTaskInstanceQuery()
.processDefinitionId(processDefinitionId).list();
if (CollectionUtil.isNotEmpty(taskInstanceList)) { if (CollectionUtil.isNotEmpty(taskInstanceList)) {
throw new ServiceException("当前流程定义已被使用不可删除!"); throw new ServiceException("当前流程定义已被使用不可删除!");
} }
@ -203,7 +204,7 @@ public class ActProcessDefinitionServiceImpl implements IActProcessDefinitionSer
public boolean updateProcessDefState(String processDefinitionId) { public boolean updateProcessDefState(String processDefinitionId) {
try { try {
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery() ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
.processDefinitionId(processDefinitionId).singleResult(); .processDefinitionId(processDefinitionId).processDefinitionTenantId(LoginHelper.getTenantId()).singleResult();
//将当前为挂起状态更新为激活状态 //将当前为挂起状态更新为激活状态
//参数说明参数1流程定义id,参数2是否激活true是否级联对应流程实例激活了则对应流程实例都可以审批 //参数说明参数1流程定义id,参数2是否激活true是否级联对应流程实例激活了则对应流程实例都可以审批
//参数3什么时候激活如果为null则立即激活如果为具体时间则到达此时间后激活 //参数3什么时候激活如果为null则立即激活如果为具体时间则到达此时间后激活