public Map<String, ParamDefinition> getParamFromWorkflows(
      String workflowIdPrefix, String paramName) {
    Map<String, ParamDefinition> workflowParams = new HashMap<>();
    return withMetricLogError(
        () ->
            withRetryableQuery(
                GET_WORKFLOW_PARAM_FOR_PREFIX_QUERY,
                stmt -> {
                  stmt.setString(1, paramName);
                  stmt.setString(2, workflowIdPrefix + "%");
                },
                result -> {
                  while (result.next()) {
                    String val = result.getString(PAYLOAD_COLUMN);
                    if (val != null) {
                      workflowParams.put(
                          result.getString(ID_COLUMN), fromJson(val, ParamDefinition.class));
                    }
                  }
                  return workflowParams;
                }),
        "getParamFromWorkflows",
        "Failed to get the workflow param [{}] from workflows with the prefix [{}]",
        paramName,
        workflowIdPrefix);
  }
@Test
  public void testGetParamFromWorkflows() throws Exception {
    WorkflowDefinition wfd = loadWorkflow(TEST_WORKFLOW_ID1);
    WorkflowDefinition definition =
        workflowDao.addWorkflowDefinition(wfd, wfd.getPropertiesSnapshot().extractProperties());
    assertNotNull(wfd.getInternalId());
    assertEquals(wfd, definition);

    wfd = loadWorkflow(TEST_WORKFLOW_ID7);
    definition =
        workflowDao.addWorkflowDefinition(wfd, wfd.getPropertiesSnapshot().extractProperties());
    assertNotNull(wfd.getInternalId());
    assertEquals(wfd, definition);

    Map<String, ParamDefinition> results = workflowDao.getParamFromWorkflows("sample", "foo");
    assertEquals(2, results.size());
    assertEquals("bar", results.get("sample-active-wf-with-props").getValue());
    assertEquals("bar", results.get("sample-active-wf-with-output-signals").getValue());
  }