evalAll method

Future<List<HGrid>> evalAll(
  1. HGrid req, {
  2. bool checked = true,
})

Call "evalAll" operation to evaluate a batch of vendor specific expressions on the server.

See "eval" method for list of vendor expression formats. The request grid must specify an "expr" column. A separate grid is returned for each row in the request. If checked is false, then this call does not automatically check for error grids. Client code must individual check each grid for partial failures using "Grid.isErr". If checked is true and one of the requests failed, then raise CallErrException for first failure.

Implementation

Future<List<HGrid>> evalAll(HGrid req, {bool checked = true}) {
  String reqStr = HZincWriter.gridToString(req);

  return _postString("evalAll", reqStr).then((String resStr) {
    List<HGrid> res = HZincReader(resStr).readGrids();

    if (checked) {
      var errorGrid = res.firstWhereOrNull((g) => g.isErr);

      if (errorGrid != null) {
        throw CallErrError(errorGrid);
      }
    }

    return res;
  });
}