提交 cdc7dc1f 编写于 作者: B Bassam Al-Sarori

Activating/Suspending processDef throws Exception

Activating/Suspending processDef with process instances throws Exception if a process instance is already in the same state.
上级 4039f854
......@@ -165,9 +165,17 @@ public abstract class AbstractSetProcessDefinitionStateCmd implements Command<Vo
protected List<ProcessInstance> fetchProcessInstancesPage(CommandContext commandContext,
ProcessDefinition processDefinition, int currentPageStartIndex) {
return new ProcessInstanceQueryImpl(commandContext)
.processDefinitionId(processDefinition.getId())
.listPage(currentPageStartIndex, Context.getProcessEngineConfiguration().getBatchSizeProcessInstances());
if(SuspensionState.ACTIVE.equals(getProcessDefinitionSuspensionState())){
return new ProcessInstanceQueryImpl(commandContext)
.processDefinitionId(processDefinition.getId())
.suspended()
.listPage(currentPageStartIndex, Context.getProcessEngineConfiguration().getBatchSizeProcessInstances());
}else{
return new ProcessInstanceQueryImpl(commandContext)
.processDefinitionId(processDefinition.getId())
.active()
.listPage(currentPageStartIndex, Context.getProcessEngineConfiguration().getBatchSizeProcessInstances());
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册