Class WorkflowWebService

java.lang.Object
ubic.gemma.rest.WorkflowWebService

@Service @Path("/") public class WorkflowWebService extends Object
RESTful interface for the 8-state workflow lifecycle (HANDOFF_WORKFLOW_STATE_STORAGE.md).

Three endpoints:

  • GET /datasets/{id}/workflow — current state + history.
  • PUT /datasets/{id}/workflow — advance the state.
  • GET /workflow/queue?state=... — curator worklist.

The endpoints are deliberately partitioned across two path prefixes (/datasets/{id}/workflow and /workflow/queue); JAX-RS dispatch is by full path, so a single resource class can serve both. Per the handoff the queue endpoint is also a forward-compat hook for PreboardedExperiment -- WorkflowService is what gates datasetType today; the REST surface is type-agnostic.

Author:
paul
  • Constructor Details

  • Method Details

    • getDatasetWorkflow

      @GET @Path("/datasets/{id}/workflow") @Produces("application/json") public ResponseDataObject<WorkflowWebService.WorkflowStateResponse> getDatasetWorkflow(@PathParam("id") Long datasetId)
      Retrieve the current workflow state and full transition history of a dataset.

      The handoff is explicit that "history" is derived from the AUDIT_EVENT stream filtered to WorkflowStateChangedEvent -- no separate history table.

    • advanceDatasetWorkflow

      @PUT @Path("/datasets/{id}/workflow") @Consumes("application/json") @Produces("application/json") @PreAuthorize("hasAuthority('GROUP_CURATOR') or hasAuthority('GROUP_ADMIN')") public jakarta.ws.rs.core.Response advanceDatasetWorkflow(@PathParam("id") Long datasetId, @Nullable WorkflowWebService.AdvanceWorkflowRequest req)
      Advance a dataset to a new workflow state. PUT body must include targetState; reason and ticketId are optional.

      Per the handoff Open Question 1 ("per-transition role granularity") recommendation, the first cut is permissive: any curator or admin may advance any allowed transition. The Public -&gt; Curate transition additionally requires admin role + a non-empty reason (Open Question 5 recommendation).

    • getWorkflowQueue

      @GET @Path("/workflow/queue") @Produces("application/json") public PaginatedResponseDataObject<WorkflowWebService.WorkflowQueueEntryResponse> getWorkflowQueue(@QueryParam("state") @Nullable String stateName, @QueryParam("datasetType") @Nullable String datasetType, @QueryParam("dataset_type") @Nullable String datasetTypeLegacy, @QueryParam("assignee") @Nullable String assignee, @QueryParam("since") @Nullable Date since, @QueryParam("offset") @DefaultValue("0") OffsetArg offsetArg, @QueryParam("limit") @DefaultValue("20") LimitArg limitArg)
      Curator worklist: datasets currently in a given workflow state.