Skip to content

Allow table fields to reference process queries, but only for single record questions - #142

Merged
ryanrdoherty merged 4 commits into
masterfrom
table-process-queries
Aug 3, 2026
Merged

Allow table fields to reference process queries, but only for single record questions#142
ryanrdoherty merged 4 commits into
masterfrom
table-process-queries

Conversation

@ryanrdoherty

@ryanrdoherty ryanrdoherty commented Jun 1, 2026

Copy link
Copy Markdown
Member

TableFields allow a table of data (rows/cols) to be added to an instance of a WDK recordclass (e.g. a gene). The way these traditionally work is the model writer adds a SqlQuery to the XML that returns all rows of the table for all records (including ID columns), then WDK either joins to a cached set of IDs (for a gene search result), or adds a where clause when looking for a single records (gene), which is what we use when displaying tables on the record page (gene page).

DataDev requested the ability to use a process query (WSF plugin/Java code) instead of a SQL query to provide the tables. This has been a longstanding request but we have resisted because we would have to decide how to feed the process query the genes we want tables for (could be many for search results) e.g. Implement some sort of streaming logic? Give the process query the ID SQL?

In this case, they're ok with it being allowed only for the single record case (not search results), so the content of this PR is:

  • Allow the query reference (string attribute) in a XML TableField to resolve to a ProcessQuery BUT flag that table as only being available when referencing a single record. Note we mean the user MUST use a SingleRecordQuestion (adds special logic for the where clause vs joining as mentioned above); they cannot use a regular search that just happens to return a single record.
  • Ensure proper checking by looking up available table fields on the Question, not the RecordClass (unless able to specify whether to include single-record tables.
  • Add logic to figure out what kind of query is feeding the table and call the query the right way

For an example process query to serve this purpose, see: VEuPathDB/ApiCommonWebService@master...table-process-queries

@ryanrdoherty ryanrdoherty self-assigned this Jun 1, 2026
@ryanrdoherty
ryanrdoherty requested a review from Foxcapades July 30, 2026 14:35
@ryanrdoherty
ryanrdoherty merged commit 7e0b11f into master Aug 3, 2026
1 check passed
@ryanrdoherty
ryanrdoherty deleted the table-process-queries branch August 3, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants