String query_expression = "(" + sharkExpression + ")" + " /*sql (" + sqlExpression + ") " + sortStr + " sql*/ " + queryExpression;
pi.set_query_expression(query_expression);
WfProcess[] wfRunningProcessList = pi.get_next_n_sequence(0);
for (int i = 0; i < wfRunningProcessList.length; ++i) {
WfProcess wfProcess = wfRunningProcessList[i];
WfProcessMgr manager = wfProcess.manager();
WorkflowProcess workflowProcess = new WorkflowProcess();
workflowProcess.setId(manager.name());
workflowProcess.setInstanceId(wfProcess.key());
workflowProcess.setName(wfProcess.name());
workflowProcess.setState(wfProcess.state());
workflowProcess.setPackageId(MiscUtilities.getProcessMgrPkgId(manager.name()));
workflowProcess.setVersion(manager.version());
workflowProcess.setRequesterId(getUserByProcessIdAndActivityDefId(workflowProcess.getId(), workflowProcess.getInstanceId(), WorkflowUtil.ACTIVITY_DEF_ID_RUN_PROCESS));
WorkflowProcess trackWflowProcess = getRunningProcessInfo(wfProcess.key());
workflowProcess.setStartedTime(trackWflowProcess.getStartedTime());
workflowProcess.setDue(trackWflowProcess.getDue());
runningProcessList.add(workflowProcess);
}