public Number insertStatus(Integer workingSetID, WorkflowStatus status)
      throws WorkflowManagerException {
    final Number id;

    final Row row = new Row();
    try {
      row.add(new CInteger("id", id = RowID.get(ec, WorkflowConstants.WORKFLOW_TABLE, "id")));
    } catch (DBException e) {
      throw new WorkflowManagerException(e);
    }
    row.add(new CString("status", status.toString()));
    row.add(new CString("workingsetid", workingSetID.toString()));

    final InsertQuery query = new InsertQuery();
    query.setTable(WorkflowConstants.WORKFLOW_TABLE);
    query.setRow(row);

    try {
      ec.doUpdate(query);
    } catch (DBException e) {
      throw new WorkflowManagerException(e);
    }

    return id;
  }
  @Override
  public void updateStatus(Number id, WorkflowStatus status) throws WorkflowManagerException {
    final Row row = new Row();
    row.add(new CString("status", status.toString()));

    final UpdateQuery query = new UpdateQuery();
    query.setTable(WorkflowConstants.WORKFLOW_TABLE);
    query.setRow(row);
    query.constrain(
        new CanonicalColumnName(WorkflowConstants.WORKFLOW_TABLE, "id"), QConstraint.CT_EQUALS, id);

    try {
      ec.doUpdate(query);
    } catch (DBException e) {
      throw new WorkflowManagerException(e);
    }
  }