public WorkflowInstance getWorkflowInstance(
      String workflowId, long workflowInstanceId, String workflowRun, boolean aggregated) {
    long runId = Constants.LATEST_ONE;
    if (!Constants.LATEST_INSTANCE_RUN.equalsIgnoreCase(workflowRun)) {
      runId = Long.parseLong(workflowRun);
    }
    WorkflowInstance instance = getWorkflowInstanceRun(workflowId, workflowInstanceId, runId);
    if (aggregated) {
      instance.setAggregatedInfo(AggregatedViewHelper.computeAggregatedView(instance, true));
    }
    return instance;
  }
@Test
  public void testGetWorkflowInstance() {
    WorkflowInstance instanceRun =
        instanceDao.getWorkflowInstance(
            wfi.getWorkflowId(), wfi.getWorkflowInstanceId(), Constants.LATEST_INSTANCE_RUN, false);
    instanceRun.setModifyTime(null);
    assertEquals(wfi, instanceRun);

    instanceRun =
        instanceDao.getWorkflowInstance(
            wfi.getWorkflowId(), wfi.getWorkflowInstanceId(), "1", false);
    instanceRun.setModifyTime(null);
    assertEquals(wfi, instanceRun);
  }