mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-30 15:16:41 +08:00
优化模型编辑校验,流程定义删除,流程定义激活挂起等
This commit is contained in:
parent
671d072d2c
commit
58c7fc55fa
@ -221,10 +221,6 @@ public class ActModelServiceImpl implements IActModelService {
|
||||
if (ArrayUtil.isEmpty(xmlBytes)) {
|
||||
throw new ServiceException("模型不能为空!");
|
||||
}
|
||||
byte[] toXmlBytes = WorkflowUtils.bpmnJsonToXmlBytes(xmlBytes);
|
||||
if (ArrayUtil.isEmpty(toXmlBytes)) {
|
||||
throw new ServiceException("模型不能为空,请至少设计一条主线流程!");
|
||||
}
|
||||
repositoryService.addModelEditorSource(model.getId(), xmlBytes);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
|
@ -181,7 +181,8 @@ public class ActProcessDefinitionServiceImpl implements IActProcessDefinitionSer
|
||||
@Override
|
||||
public boolean deleteDeployment(String deploymentId, String processDefinitionId) {
|
||||
try {
|
||||
List<HistoricTaskInstance> taskInstanceList = historyService.createHistoricTaskInstanceQuery().processDefinitionId(processDefinitionId).list();
|
||||
List<HistoricTaskInstance> taskInstanceList = historyService.createHistoricTaskInstanceQuery()
|
||||
.processDefinitionId(processDefinitionId).list();
|
||||
if (CollectionUtil.isNotEmpty(taskInstanceList)) {
|
||||
throw new ServiceException("当前流程定义已被使用不可删除!");
|
||||
}
|
||||
@ -203,7 +204,7 @@ public class ActProcessDefinitionServiceImpl implements IActProcessDefinitionSer
|
||||
public boolean updateProcessDefState(String processDefinitionId) {
|
||||
try {
|
||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
|
||||
.processDefinitionId(processDefinitionId).singleResult();
|
||||
.processDefinitionId(processDefinitionId).processDefinitionTenantId(LoginHelper.getTenantId()).singleResult();
|
||||
//将当前为挂起状态更新为激活状态
|
||||
//参数说明:参数1:流程定义id,参数2:是否激活(true是否级联对应流程实例,激活了则对应流程实例都可以审批),
|
||||
//参数3:什么时候激活,如果为null则立即激活,如果为具体时间则到达此时间后激活
|
||||
|
Loading…
Reference in New Issue
Block a user