Class RhinoHigson

java.lang.Object
io.higson.runtime.rhino.RhinoHigson

public class RhinoHigson extends Object
This class is an access point to retrieving parameters or calling functions in core. It is mostly used in body of a function.
Author:
przemek hertel
  • Constructor Details

  • Method Details

    • get

      public Object get(String param, ParamContext ctx)
      Return raw object value from first cell of matched first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || price | isAvailable 'BMW' | 2007 || 45000 | true 'BMW' | 2020 || 69000 | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); assertEquals(45000.0, higson.get("demo.motor.price", ctx));
      Parameters:
      param - parameter code
      ctx - used input context for parameter matrix
      Returns:
      raw value held or 0.0 if double type, or 0 if long type, or null if not found
    • get

      public Object get(String param, Object... tokens)
      Return raw object value from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || price | isAvailable 'BMW' | 2007 || 45000 | true 'BMW' | 2020 || 69000 | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); // passed token will overwrite ctx for this "car.model.year" path assertEquals(69000.0, higson.get("demo.motor.price", ctx, "car.model.year", "2007")); // context will be created on the fly with given key/value - there might be multiple key/value pairs, separated with coma assertEquals(69000.0, higson.get("demo.motor.price", "car.model.year", "2007"));
      Parameters:
      param - parameter code
      tokens - first token might be optional context, next tokens are possible pairs key/values for defined columns, that will overwrite default parameter values
      Returns:
      raw value held in first cell of first row, or null if not found
    • getString

      public String getString(String param, ParamContext ctx)
      Return raw value as String from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || opinion | isAvailable 'BMW' | 2007 || "GOOD" | true 'BMW' | 2020 || "BAD" | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); assertEquals("GOOD", higson.getString("demo.motor.price", ctx));
      Parameters:
      param - parameter code
      ctx - used context as input for parameter
      Returns:
      raw value as String held in first cell of first row, or null if not found
    • getString

      public String getString(String param, Object... tokens)
      Return raw value as String from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || opinion | isAvailable 'BMW' | 2007 || "GOOD" | true 'BMW' | 2020 || "BAD" | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); // passed token will overwrite ctx for this "car.model.year" path assertEquals("BAD", higson.getString("demo.motor.price", ctx, "car.model.year", "2020")) // context will be created on the fly with given key/value - there might be multiple key/value pairs, separated with coma assertEquals("BAD", higson.getString("demo.motor.price", "car.model.year", "2020"))
      Parameters:
      param - parameter code
      tokens - first token might be optional context, next tokens are possible pairs key/values for defined columns, that will overwrite default parameter values
      Returns:
      raw value as String held in first cell of first row, or null if not found
    • getNumber

      public double getNumber(String param, ParamContext ctx)
      Return raw value as double from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || price | isAvailable 'BMW' | 2007 || 45000,54 | true 'BMW' | 2020 || 69000,55 | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). assertEquals(45000.54, higson.getNumber("demo.motor.price", ctx))
      Parameters:
      param - parameter code
      ctx - used context as input for parameter
      Returns:
      raw value as double held in first cell of first row, or 0.0 if not found
    • getNumber

      public double getNumber(String param, Object... tokens)
      Return raw value as double from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || price | isAvailable 'BMW' | 2007 || 45000,54 | true 'BMW' | 2020 || 69000,55 | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); // passed token will overwrite ctx for this "car.model.year" path assertEquals(45000,54, higson.getNumber("demo.motor.price", ctx, "car.model.year", "2020")); // context will be created on the fly with given key/value - there might be multiple key/value pairs, separated with coma assertEquals(45000,54, higson.getNumber("demo.motor.price", "car.model.year", "2020"));
      Parameters:
      param - parameter code
      tokens - used context, and possible values for defined columns, that will overwrite default parameter values
      Returns:
      raw value as double held in first cell of first row, or 0.0 if not found
    • getDecimal

      public BigDecimal getDecimal(String param, ParamContext ctx)
      Return raw value as BigDecimal from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || price | isAvailable 'BMW' | 2007 || 45000,54 | true 'BMW' | 2020 || 69000,55 | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); assertEquals(45000.54, higson.getDecimal("demo.motor.price", ctx));
      Parameters:
      param - parameter code
      ctx - used context as input for parameter
      Returns:
      raw value as BigDecimal held in first cell of first row, or null if not found
    • getDecimal

      public BigDecimal getDecimal(String param, Object... tokens)
      Return raw value as BigDecimal from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || price | isAvailable 'BMW' | 2007 || 45000,54 | true 'BMW' | 2020 || 69000,55 | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); // passed token will overwrite ctx for this "car.model.year" path assertEquals(69000.55, higson.getDecimal("demo.motor.price", ctx, "car.model.year", "2020")); // context will be created on the fly with given key/value - there might be multiple key/value pairs, separated with coma assertEquals(69000.55, higson.getDecimal("demo.motor.price", "car.model.year", "2020"));
      Parameters:
      param - parameter code
      tokens - first token might be optional context, next tokens are possible pairs key/values for defined columns, that will overwrite default parameter values
      Returns:
      raw value as BigDecimal held in first cell of first row, or null if not found
    • getInteger

      public Integer getInteger(String param, ParamContext ctx)
      Return raw value as Integer from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || price | isAvailable 'BMW' | 2007 || 45000 | true 'BMW' | 2020 || 69000 | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); assertEquals(45000, higson.getInteger("demo.motor.price", ctx));
      Parameters:
      param - parameter code
      ctx - used context as input for parameter
      Returns:
      raw value as Integer held in first cell of first row, or null if not found
    • getInteger

      public Integer getInteger(String param, Object... tokens)
      Return raw value as Integer from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || price | isAvailable 'BMW' | 2007 || 45000 | true 'BMW' | 2020 || 69000 | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); // passed token will overwrite ctx for this "car.model.year" path assertEquals(69000, higson.getInteger("demo.motor.price", ctx, "car.model.year", "2020")); // context will be created on the fly with given key/value - there might be multiple key/value pairs, separated with coma assertEquals(69000, higson.getInteger("demo.motor.price", "car.model.year", "2020"));
      Parameters:
      param - parameter code
      tokens - first token might be optional context, next tokens are possible pairs key/values for defined columns, that will overwrite default parameter values
      Returns:
      raw value as Integer held in first cell of first row, or null if not found
    • getDate

      public Date getDate(String param, ParamContext ctx)
      Return raw value as java.util.Date from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || sellDate | isAvailable 'BMW' | 2007 || 2018-01-01 | true 'BMW' | 2020 || 2018-10-01 | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); assertEquals(sdf.parse("2018-01-01"), higson.getDate("demo.motor.price", ctx));
      Parameters:
      param - parameter code
      ctx - used context as input for parameter
      Returns:
      raw value as java.util.Date held in first cell of first row, or null if not found
    • getLocalDate

      public LocalDate getLocalDate(String param, ParamContext ctx)
      Return raw value as java.time.LocalDate from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || sellDate | isAvailable 'BMW' | 2007 || 2018-01-01 | true 'BMW' | 2020 || 2018-10-01 | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); assertEquals(LocalDate.parse("2018-01-01", dtf), higson.getLocalDate("demo.motor.price", ctx));
      Parameters:
      param - parameter code
      ctx - used context as input for parameter
      Returns:
      raw value as java.time.LocalDate held in first cell of first row, or null if not found
    • getLocalDateTime

      public LocalDateTime getLocalDateTime(String param, ParamContext ctx)
      Return raw value as java.time.LocalDateTime from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || sellDate | isAvailable 'BMW' | 2007 || 2018-01-01 13:22:13.342 | true 'BMW' | 2020 || 2018-10-01 13:22:13.342 | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"); assertEquals(LocalDateTime.parse("2018-01-01 13:22:13", dtf), higson.getLocalDateTime("demo.motor.price", ctx));
      Parameters:
      param - parameter code
      ctx - used context as input for parameter
      Returns:
      raw value as java.time.LocalDateTime held in first cell of first row, or null if not found
    • getDate

      public Date getDate(String param, Object... tokens)
      Return raw value as java.util.Date from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || sellDate | isAvailable 'BMW' | 2007 || 2018-01-01 | true 'BMW' | 2020 || 2018-10-01 | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // passed token will overwrite ctx for this "car.model.year" path assertEquals(sdf.parse("2018-10-01"), higson.getDate("demo.motor.price", ctx, "car.model.year", "2020")); // context will be created on the fly with given key/value - there might be multiple key/value pairs, separated with coma assertEquals(sdf.parse("2018-10-01"), higson.getDate("demo.motor.price", "car.model.year", "2020"));
      Parameters:
      param - parameter code
      tokens - first token might be optional context, next tokens are possible pairs key/values for defined columns, that will overwrite default parameter values
      Returns:
      raw value as java.util.Date held in first cell of first row, or null if not found
    • getLocalDate

      public LocalDate getLocalDate(String param, Object... tokens)
      Return raw value as java.time.LocalDate from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || sellDate | isAvailable 'BMW' | 2007 || 2018-01-01 | true 'BMW' | 2020 || 2018-10-01 | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); // passed token will overwrite ctx for this "car.model.year" path assertEquals(LocalDate.parse("2018-10-01", dtf), higson.getLocalDate("demo.motor.price", ctx, "car.model.year", "2020")); // context will be created on the fly with given key/value - there might be multiple key/value pairs, separated with coma assertEquals(LocalDate.parse("2018-10-01", dtf), higson.getLocalDate("demo.motor.price", "car.model.year", "2020"));
      Parameters:
      param - parameter code
      tokens - first token might be optional context, next tokens are possible pairs key/values for defined columns, that will overwrite default parameter values
      Returns:
      raw value as java.time.LocalDate held in first cell of first row, or null if not found
    • getLocalDateTime

      public LocalDateTime getLocalDateTime(String param, Object... tokens)
      Return raw value as java.time.LocalDateTime from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || sellDate | isAvailable 'BMW' | 2007 || 2018-01-01 13:22:13.342 | true 'BMW' | 2020 || 2018-10-01 13:22:13.342 | false where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"); // passed token will overwrite ctx for this "car.model.year" path assertEquals(LocalDateTime.parse("2018-10-01 13:22:13.342", dtf), higson.getLocalDateTime("demo.motor.price", ctx, "car.model.year", "2020")); // context will be created on the fly with given key/value - there might be multiple key/value pairs, separated with coma assertEquals(LocalDateTime.parse("2018-10-01 13:22:13.342", dtf), higson.getLocalDateTime("demo.motor.price", "car.model.year", "2020"));
      Parameters:
      param - parameter code
      tokens - first token might be optional context, next tokens are possible pairs key/values for defined columns, that will overwrite default parameter values
      Returns:
      raw value as java.time.LocalDateTime held in first cell of first row, or null if not found
    • getBoolean

      public boolean getBoolean(String param, ParamContext ctx)
      Return raw value as boolean from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || isAvailable | price 'BMW' | 2007 || true | 56000 'BMW' | 2020 || false | 80000 where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); assertTrue(higson.getBoolean("demo.motor.price", ctx));
      Parameters:
      param - parameter code
      ctx - used context as input for parameter
      Returns:
      raw value as boolean held in first cell of first row, or false if not found
    • getBoolean

      public boolean getBoolean(String param, Object... tokens)
      Return raw value as boolean from first cell of first row based on given parameter within given context as first token value. Useful if parameter returns only single value, if not then it will return first column from possible OUT columns. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || isAvailable | price 'BMW' | 2007 || true | 56000 'BMW' | 2020 || false | 80000 where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); // passed token will overwrite ctx for this "car.model.year" path assertFalse(higson.getBoolean("demo.motor.price", ctx, "car.model.year", "2020")); // context will be created on the fly with given key/value - there might be multiple key/value pairs, separated with coma assertFalse(higson.getBoolean("demo.motor.price", "car.model.year", "2020"));
      Parameters:
      param - parameter code
      tokens - first token might be optional context, next tokens are possible pairs key/values for defined columns, that will overwrite default parameter values
      Returns:
      raw value as boolean held in first cell of first row, or false if not found
    • getValue

      public RhinoParamValue getValue(String param, ParamContext ctx)
      This method is almost the same same getParamValue(String param, ParamContext ctx), but the result is wrapped with type conversion support. Useful if parameter returns multiple rows with more then one column, but also user wants to delegate type conversions from holders into value to higson. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || isAvailable | price 'BMW' | 2007 || true | 56000 'BMW' | 2020 || false | 80000 where defined paths in parameter are: car = "car.model.type", year = "car.model.year" HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). RhinoParamValue subMatrix = higson.getParamValue("demo.motor.price", ctx) subMatrix.row() - first row of matched submatrix subMatrix.row(int rowNo) - row at given position of matched submatrix, counted from 0 subMatrix.rows() - all rows of matched submatrix subMatrix.get(int rowNo, int colNo) - value at given position and column of matched submatrix, counted from 0 subMatrix.getBigDecimal(String columnName) - value from first row and columnName ...
      Parameters:
      param - parameter code
      ctx - used context as input for parameter
      Returns:
      container of parameter's sub-matrix with type conversion support
    • getValue

      public RhinoParamValue getValue(String param, Object... tokens)
      This method is almost the same same getParamValue(String param, Object...tokens), but the result is wrapped with type conversion support. Useful if parameter returns multiple rows with more then one column, but also user wants to delegate type conversions from holders into value to higson. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || isAvailable | price 'BMW' | 2007 || true | 56000 'BMW' | 2020 || false | 80000 where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); // passed token will overwrite ctx for this "car.model.year" path RhinoParamValue subMatrix = higson.getParamValue("demo.motor.price", ctx, "car.model.year", "2020")); // context will be created on the fly with given key/value - there might be multiple key/value pairs, separated with coma RhinoParamValue subMatrix = higson.getParamValue("demo.motor.price", "car.model.year", "2020")); subMatrix.row() - first row of matched submatrix subMatrix.row(int rowNo) - row at given position of matched submatrix, counted from 0 subMatrix.rows() - all rows of matched submatrix subMatrix.get(int rowNo, int colNo) - value at given position and column of matched submatrix, counted from 0 subMatrix.getBigDecimal(String columnName) - value from first row and columnName ...
      Parameters:
      param - parameter code
      tokens - first token might be optional context, next tokens are possible pairs key/values for defined columns, that will overwrite default parameter values
      Returns:
      container of parameter's sub-matrix with type conversion support
    • getParamValue

      public ParamValue getParamValue(String param, ParamContext ctx)
      Return container of parameter's sub-matrix from matrix based on given parameter within given context as first token value. Useful if parameter returns multiple rows with more then one column. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || isAvailable | price 'BMW' | 2007 || true | 56000 'BMW' | 2020 || false | 80000 where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); ParamValue subMatrix = higson.getParamValue("demo.motor.price", ctx) subMatrix.row() - first row of matched submatrix subMatrix.row(int rowNo) - row at given position of matched submatrix, counted from 0 subMatrix.rows() - all rows of matched submatrix subMatrix.get(int rowNo, int colNo) - value at given position and column of matched submatrix, counted from 0 ...
      Parameters:
      param - parameter code
      ctx - used context as input for parameter
      Returns:
      container of parameter's sub-matrix
    • getParamValue

      public ParamValue getParamValue(String param, Object... tokens)
      Return container of parameter's sub-matrix from matrix based on given parameter within given context as first token value. Useful if parameter returns multiple rows with more then one column. Example usage for parameter named "demo.motor.price" Parameter matrix: IN OUT car | year || isAvailable | price 'BMW' | 2007 || true | 56000 'BMW' | 2020 || false | 80000 where defined paths in parameter are: car = "car.model.type", year = "car.model.year" Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). HigsonContext ctx = new HigsonContext( "car.model.type" , "BMW", "car.model.year" , "2007" ); // passed token will overwrite ctx for this "car.model.year" path ParamValue subMatrix = higson.getParamValue("demo.motor.price", ctx, "car.model.year", "2020")); // context will be created on the fly with given key/value - there might be multiple key/value pairs, separated with coma ParamValue subMatrix = higson.getParamValue("demo.motor.price", "car.model.year", "2020")); subMatrix.row() - first row of matched submatrix subMatrix.row(int rowNo) - row at given position of matched submatrix, counted from 0 subMatrix.rows() - all rows of matched submatrix subMatrix.get(int rowNo, int colNo) - value at given position and column of matched submatrix, counted from 0 ...
      Parameters:
      param - parameter code
      tokens - first token might be optional context, next tokens are possible pairs key/values for defined columns, that will overwrite default parameter values
      Returns:
      container of parameter's sub-matrix
    • value

      public ParamValue value(String param, ParamContext ctx)
      Same as getParamValue
      Parameters:
      param - parameter
      ctx - context
      Returns:
      ParamValue object
      See Also:
    • value

      public ParamValue value(String param, Object... tokens)
      Same as getParamValue
      Parameters:
      param - paremeter
      tokens - tokens
      Returns:
      ParamValue object
      See Also:
    • getNum

      @Deprecated public double getNum(String param, ParamContext ctx)
      Deprecated.
      use getNumber, getDecimal or getInteger
      Parameters:
      param - parameter
      ctx - context
      Returns:
      ParamValue object
    • call

      public Object call(String functionName, ParamContext ctx, Object... args)
      Call function in higson with given functionName, context and possible arguments for function. Method will wait for execution to finish and return result of called function. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Object result = higson.call("demo.insurance.calcpremium", ctx); // no input required Object result = higson.call("demo.insurance.calcpremium", ctx, "Start"); // if function can have input of type String
      Parameters:
      functionName - full function name
      ctx - used context as input for function
      args - arguments used in function, if needed
      Returns:
      result of function call as java.lang.Object
    • call

      public Object call(String functionName, ParamContext ctx)
      Method is workaround for python invoke 'higson.call()' without args. Fix problem with overloaded methods in java calling by JEB lib. JIRA MPP-4177
      Parameters:
      functionName - functionName
      ctx - context
      Returns:
      return result from functionName
    • call

      public Object call(String functionName, Object... args)
      Call function in higson with given functionName and possible arguments for function. Use this method if function doesn't required context as input, but if invoked function is using context then, context must be provided. Method will wait for execution to finish and return result of called function. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: Object result = higson.call("demo.insurance.calcpremium"); // if function doesn't require context and any input Object result = higson.call("demo.insurance.calcpremium", "Start"); // if function can have input of type String but no context Object result = higson.call("demo.insurance.calcpremium", ctx, "Start"); // if function can have input of type String and context is provided
      Parameters:
      functionName - full function name
      args - arguments used in function, if needed
      Returns:
      result of function call as java.lang.Object
    • callValue

      public RhinoParamValue callValue(String functionName, ParamContext ctx, Object... args)
      Call function in higson with given functionName, context and possible arguments for function. Use this method if you want more then one value to be returned or even multiple rows. Method will wait for execution to finish and return result of called function. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: RhinoParamValue result = higson.callValue("demo.insurance.calcpremium", ctx); // if function can have input of type String RhinoParamValue result = higson.callValue("demo.insurance.calcpremium", ctx, "Start");
      Parameters:
      functionName - full function name
      ctx - used context as input for function
      args - arguments used in function, if needed
      Returns:
      result of function call as RhinoParamValue
    • callNumber

      public double callNumber(String functionName, ParamContext ctx, Object... args)
      Call function in higson with given functionName, context and possible arguments for function. Method will wait for execution to finish and return result of called function. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: double result = higson.callNumber("demo.insurance.calcpremium", ctx); // only context required double result = higson.callNumber("demo.insurance.calcpremium", ctx, 15); // context and input required
      Parameters:
      functionName - full function name
      ctx - used context as input for function
      args - arguments used in function, if needed
      Returns:
      result of function call as double
    • callDecimal

      public BigDecimal callDecimal(String functionName, ParamContext ctx, Object... args)
      Call function in higson with given functionName, context and possible arguments for function. Method will wait for execution to finish and return result of called function. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: BigDecimal result = higson.callDecimal("demo.insurance.calcpremium", ctx); // only context required BigDecimal result = higson.callDecimal("demo.insurance.calcpremium", ctx, "INPUT"); // context and input required
      Parameters:
      functionName - full function name
      ctx - used context as input for function
      args - arguments used in function, if needed
      Returns:
      result of function call as BigDecimal
    • callInteger

      public Integer callInteger(String functionName, ParamContext ctx, Object... args)
      Call function in higson with given functionName, context and possible arguments for function. Method will wait for execution to finish and return result of called function. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: Integer result = higson.callInteger("demo.insurance.year", ctx); // only context required Integer result = higson.callInteger("demo.insurance.year", ctx, "INPUT"); // context and input required
      Parameters:
      functionName - full function name
      ctx - used context as input for function
      args - arguments used in function, if needed
      Returns:
      result of function call as Integer
    • callDate

      public Date callDate(String functionName, ParamContext ctx, Object... args)
      Call function in higson with given functionName, context and possible arguments for function. Method will wait for execution to finish and return result of called function. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: Date result = higson.callDate("demo.insurance.creationDate", ctx); // only context required Date result = higson.callDate("demo.insurance.creationDate", ctx, "INPUT"); // context and input required
      Parameters:
      functionName - full function name
      ctx - used context as input for function
      args - arguments used in function, if needed
      Returns:
      result of function call as java.util.Date
    • callLocalDate

      public LocalDate callLocalDate(String functionName, ParamContext ctx, Object... args)
      Call function in higson with given functionName, context and possible arguments for function. Method will wait for execution to finish and return result of called function. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: LocalDate result = higson.callLocalDate("demo.insurance.creationLocalDate", ctx); // only context required LocalDate result = higson.callLocalDate("demo.insurance.creationLocalDate", ctx, "INPUT"); // context and input required
      Parameters:
      functionName - full function name
      ctx - used context as input for function
      args - arguments used in function, if needed
      Returns:
      result of function call as java.time.LocalDate
    • callLocalDateTime

      public LocalDateTime callLocalDateTime(String functionName, ParamContext ctx, Object... args)
      Call function in higson with given functionName, context and possible arguments for function. Method will wait for execution to finish and return result of called function. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: LocalDateTime result = higson.getLocalDateTime("demo.insurance.creationLocalDateTime", ctx); // only context required LocalDateTime result = higson.getLocalDateTime("demo.insurance.creationLocalDateTime", ctx, "INPUT"); // context and input required
      Parameters:
      functionName - full function name
      ctx - used context as input for function
      args - arguments used in function, if needed
      Returns:
      result of function call as java.time.LocalDateTime
    • callString

      public String callString(String functionName, ParamContext ctx, Object... args)
      Call function in higson with given functionName, context and possible arguments for function. Method will wait for execution to finish and return result of called function. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: String result = higson.callString("demo.insurance.driver.name", ctx); // only context required String result = higson.callString("demo.insurance.driver.name", ctx, "INPUT"); // context and input required
      Parameters:
      functionName - full function name
      ctx - used context as input for function
      args - arguments used in function, if needed
      Returns:
      result of function call as String
    • callBoolean

      public boolean callBoolean(String functionName, ParamContext ctx, Object... args)
      Call function in higson with given functionName, context and possible arguments for function. Method will wait for execution to finish and return result of called function. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: boolean result = higson.callBoolean("demo.insurance.isValid"); // only context required boolean result = higson.callBoolean("demo.insurance.isValid", "true"); // context and input required
      Parameters:
      functionName - full function name
      ctx - used context as input for function
      args - arguments used in function, if needed
      Returns:
      result of function call as boolean
    • flow

      public Map<String,Object> flow(String flowName, ParamContext ctx, Object... args)
      Executes flow with given name, context and optional arguments. Example: def r = higson.flow("demo.flow", ctx, 'A', 3) def premium = r.premium def status = r['status'] // or in short form: return higson.flow("demo.flow", ctx, 'A', 3).premium
      Parameters:
      flowName - full flow name
      ctx - context for entire flow lifecycle
      args - optional arguments used by the flow
      Returns:
      a flow result map containing variables marked for return.
    • getStringType

      public StringType getStringType()
      Get String type instance used by higson. It might be used for wrapping String into recognizable type by higson, trying out conversions, encoding and decoding supported by engine. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: StringType type = higson.getStringType(); StringHolder holder = type.convert(new Integer(17)); // 17 == holder.getValue()
      Returns:
      supported StringType with String Holder
    • getNumberType

      public NumberType getNumberType()
      Get Number type instance used by higson. It might be used for wrapping Number into recognizable type by higson, trying out conversions, encoding and decoding supported by engine. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: NumberType type = higson.getNumberType(); NumberHolder holder = type.decode("1143.54");
      Returns:
      supported NumberType with Number Holder
    • getIntegerType

      public IntegerType getIntegerType()
      Get Integer type instance used by higson. It might be used for wrapping Integer into recognizable type by higson, trying out conversions, encoding and decoding supported by engine. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: IntegerType type = higson.getIntegerType(); IntegerHolder holder = type.decode("1143");
      Returns:
      supported IntegerType with Integer Holder
    • getBooleanType

      public BooleanType getBooleanType()
      Get Boolean type instance used by higson. It might be used for wrapping Boolean into recognizable type by higson, trying out conversions, encoding and decoding supported by engine. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: BooleanType type = higson.getBooleanType(); BooleanType holder = type.decode("tak"); BooleanType holder = type.decode("y"); BooleanType holder = type.decode("yes"); BooleanType holder = type.decode("1");
      Returns:
      supported BooleanType with Boolean Holder
    • getDateType

      public DateType getDateType()
      Get Date type instance used by higson. It might be used for wrapping Date into recognizable type by higson, trying out conversions, encoding and decoding supported by engine. Supported formats: yyyy-MM-dd - default dd-MM-yyyy dd.MM.yyyy dd/MM/yyyy yyyy-MM-dd yyyy.MM.dd yyyy/MM/dd Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: DateType type = higson.getDateType(); DateHolder holder = type.decode("2018-10-29");
      Returns:
      supported DateType with Date Holder
    • getLocalDateType

      public LocalDateType getLocalDateType()
      Get LocalDate type instance used by higson. It might be used for wrapping LocalDate into recognizable type by higson, trying out conversions, encoding and decoding supported by engine. Supported formats: yyyy-MM-dd - default dd-MM-yyyy dd.MM.yyyy dd/MM/yyyy yyyy-MM-dd yyyy.MM.dd yyyy/MM/dd Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: LocalDateType type = higson.getLocalDateType(); LocalDateHolder holder = type.decode("2018-10-29");
      Returns:
      supported LocalDateType with LocalDate Holder
    • getLocalDateTimeType

      public LocalDateTimeType getLocalDateTimeType()
      Get LocalDateTime type instance used by higson. It might be used for wrapping LocalDateTime into recognizable type by higson, trying out conversions, encoding and decoding supported by engine. Supported formats: yyyy-MM-dd HH:mm:ss.SSS - default dd-MM-yyyy HH:mm:ss.SSS dd.MM.yyyy HH:mm:ss.SSS dd/MM/yyyy HH:mm:ss.SSS yyyy-MM-dd HH:mm:ss.SSS yyyy.MM.dd HH:mm:ss.SSS yyyy/MM/dd HH:mm:ss.SSS DateTimeFormatter.ISO_LOCAL_DATE_TIME DateTimeFormatter.ISO_OFFSET_DATE_TIME DateTimeFormatter.ISO_ZONED_DATE_TIME DateTimeFormatter.ISO_DATE_TIME DateTimeFormatter.RFC_1123_DATE_TIME Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example: LocalDateTimeType type = higson.getLocalDateTimeType(); LocalDateTimeHolder holder = type.decode("2018-10-29");
      Returns:
      supported LocalDateTimeType with LocalDateTime Holder
    • createContext

      public HigsonContext createContext(Object... args)
      Helper method for creating context on fly, for given arguments. Where args are just a simple pair of key value arguments. Because this method is used in function editor in studio, developer will invoke this method using prefix: higson or mpp(deprecated). Example of usage: // if user don't have a parent context HigsonContext ctx = higson.createContext("car.model.type" , "BMW", "car.model.year" , "2007"); // if user have a parent context, but some properties might be overwritten HigsonContext ctx = higson.createContext(parentContext, "car.model.type" , "BMW", "car.model.year" , "2007");
      Parameters:
      args - arguments used as key, value parameters for context
      Returns:
      if pairs were properly given, context was created and returned
      Throws:
      HigsonRuntimeException - If context can't be created