JaxbQueryProcessInstanceResult result = new JaxbQueryProcessInstanceResult();
Map<Long, JaxbQueryProcessInstanceInfo> procInstIdProcInstInfoMap = new HashMap<Long, JaxbQueryProcessInstanceInfo>();
for( ProcessInstanceLog procLog : procLogs ) {
long procInstId = procLog.getProcessInstanceId();
JaxbQueryProcessInstanceInfo procInfo = getQueryProcessInstanceInfo(procInstId, procInstIdProcInstInfoMap);
procInfo.setProcessInstance(new JaxbProcessInstance(procLog));
}
for( VariableInstanceLog varLog : varLogs ) {
long procInstId = varLog.getProcessInstanceId();
JaxbQueryProcessInstanceInfo procInfo = procInstIdProcInstInfoMap.get(procInstId);
if( procInfo == null ) {
throwDebugExceptionWithQueryInformation();
}
procInfo.getVariables().add(new JaxbVariableInfo(varLog));
}
result.getProcessInstanceInfoList().addAll(procInstIdProcInstInfoMap.values());
return result;
}