提交 945ed63f 编写于 作者: T Tijs Rademakers

Merge pull request #46 from balsarori/master

Fix #45 - Activating/Suspending processDef throws Exception
......@@ -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.
先完成此消息的编辑!
想要评论请 注册