code: protected ProcessInstance buildProcessInstance(ResultSet rs) throws SQLException {
          ProcessInstance pi = new ProcessInstance();
          pi.setMasterRequestId(rs.getString("master_request_id"));
          pi.setId(rs.getLong("process_instance_id"));
          pi.setProcessId(rs.getLong("process_id"));
          pi.setOwner(rs.getString("owner"));
          pi.setOwnerId(rs.getLong("owner_id"));
          int statusCode = rs.getInt("status_cd");
          pi.setStatus(WorkStatuses.getWorkStatuses().get(statusCode));
          pi.setStartDate(rs.getTimestamp("start_dt"));
          pi.setEndDate(rs.getTimestamp("end_dt"));
          pi.setCompletionCode(rs.getString("compcode"));
          pi.setComment(rs.getString("comments"));
          pi.setTemplate(rs.getString("template"));
          // avoid loading into ProcessCache
          if (pi.getComment() != null) {
              AssetHeader assetHeader = new AssetHeader(pi.getComment());
              pi.setProcessName(assetHeader.getName());
              pi.setProcessVersion(assetHeader.getVersion());
              pi.setPackageName(assetHeader.getPackageName());
          }
          if (pi.getTemplate() != null) {
              AssetHeader templateHeader = new AssetHeader(pi.getTemplate());
              pi.setTemplate(templateHeader.getName());
              pi.setTemplatePackage(templateHeader.getPackageName());
              pi.setTemplateVersion(templateHeader.getVersion());
          }
          return pi;
      }
docs: Assumes pi.* table prefix.