Package io.higson.runtime.rhino
Class RhinoHigson
java.lang.Object
io.higson.runtime.rhino.RhinoHigson
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall(String functionName, ParamContext ctx) Method is workaround for python invoke 'higson.call()' without args.call(String functionName, ParamContext ctx, Object... args) Call function in higson with given functionName, context and possible arguments for function.Call function in higson with given functionName and possible arguments for function.booleancallBoolean(String functionName, ParamContext ctx, Object... args) Call function in higson with given functionName, context and possible arguments for function.callDate(String functionName, ParamContext ctx, Object... args) Call function in higson with given functionName, context and possible arguments for function.callDecimal(String functionName, ParamContext ctx, Object... args) Call function in higson with given functionName, context and possible arguments for function.callInteger(String functionName, ParamContext ctx, Object... args) Call function in higson with given functionName, context and possible arguments for function.callLocalDate(String functionName, ParamContext ctx, Object... args) Call function in higson with given functionName, context and possible arguments for function.callLocalDateTime(String functionName, ParamContext ctx, Object... args) Call function in higson with given functionName, context and possible arguments for function.doublecallNumber(String functionName, ParamContext ctx, Object... args) Call function in higson with given functionName, context and possible arguments for function.callString(String functionName, ParamContext ctx, Object... args) Call function in higson with given functionName, context and possible arguments for function.callValue(String functionName, ParamContext ctx, Object... args) Call function in higson with given functionName, context and possible arguments for function.createContext(Object... args) Helper method for creating context on fly, for given arguments.flow(String flowName, ParamContext ctx, Object... args) Executes flow with given name, context and optional arguments.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.Return raw object value from first cell of first row based on given parameter within given context as first token value.booleangetBoolean(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.booleangetBoolean(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.Get Boolean type instance used by higson.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.Return raw value as java.util.Date from first cell of first row based on given parameter within given context as first token value.Get Date type instance used by higson.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.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.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.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.Get Integer type instance used by higson.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.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.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.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.Get LocalDateTime type instance used by higson.Get LocalDate type instance used by higson.doublegetNum(String param, ParamContext ctx) Deprecated.use getNumber, getDecimal or getIntegerdoublegetNumber(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.doubleReturn raw value as double from first cell of first row based on given parameter within given context as first token value.Get Number type instance used by higson.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.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.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.Return raw value as String from first cell of first row based on given parameter within given context as first token value.Get String type instance used by higson.getValue(String param, ParamContext ctx) This method is almost the same samegetParamValue(String param, ParamContext ctx), but the result is wrapped with type conversion support.This method is almost the same samegetParamValue(String param, Object...tokens), but the result is wrapped with type conversion support.value(String param, ParamContext ctx) Same as getParamValueSame as getParamValue
-
Constructor Details
-
RhinoHigson
-
-
Method Details
-
get
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 codectx- 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
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 codetokens- 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
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 codectx- used context as input for parameter- Returns:
- raw value as String held in first cell of first row, or null if not found
-
getString
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 codetokens- 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
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 codectx- 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
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 codetokens- 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
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 codectx- used context as input for parameter- Returns:
- raw value as BigDecimal held in first cell of first row, or null if not found
-
getDecimal
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 codetokens- 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
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 codectx- used context as input for parameter- Returns:
- raw value as Integer held in first cell of first row, or null if not found
-
getInteger
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 codetokens- 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
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 codectx- 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
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 codectx- 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
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 codectx- 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
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 codetokens- 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
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 codetokens- 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
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 codetokens- 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
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 codectx- used context as input for parameter- Returns:
- raw value as boolean held in first cell of first row, or false if not found
-
getBoolean
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 codetokens- 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
This method is almost the same samegetParamValue(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 codectx- used context as input for parameter- Returns:
- container of parameter's sub-matrix with type conversion support
-
getValue
This method is almost the same samegetParamValue(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 codetokens- 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
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 codectx- used context as input for parameter- Returns:
- container of parameter's sub-matrix
-
getParamValue
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 codetokens- 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
Same as getParamValue- Parameters:
param- parameterctx- context- Returns:
- ParamValue object
- See Also:
-
value
Same as getParamValue- Parameters:
param- paremetertokens- tokens- Returns:
- ParamValue object
- See Also:
-
getNum
Deprecated.use getNumber, getDecimal or getInteger- Parameters:
param- parameterctx- context- Returns:
- ParamValue object
-
call
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 namectx- used context as input for functionargs- arguments used in function, if needed- Returns:
- result of function call as java.lang.Object
-
call
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- functionNamectx- context- Returns:
- return result from functionName
-
call
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 nameargs- arguments used in function, if needed- Returns:
- result of function call as java.lang.Object
-
callValue
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 namectx- used context as input for functionargs- arguments used in function, if needed- Returns:
- result of function call as RhinoParamValue
-
callNumber
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 namectx- used context as input for functionargs- arguments used in function, if needed- Returns:
- result of function call as double
-
callDecimal
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 namectx- used context as input for functionargs- arguments used in function, if needed- Returns:
- result of function call as BigDecimal
-
callInteger
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 namectx- used context as input for functionargs- arguments used in function, if needed- Returns:
- result of function call as Integer
-
callDate
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 namectx- used context as input for functionargs- arguments used in function, if needed- Returns:
- result of function call as java.util.Date
-
callLocalDate
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 namectx- used context as input for functionargs- arguments used in function, if needed- Returns:
- result of function call as java.time.LocalDate
-
callLocalDateTime
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 namectx- used context as input for functionargs- arguments used in function, if needed- Returns:
- result of function call as java.time.LocalDateTime
-
callString
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 namectx- used context as input for functionargs- arguments used in function, if needed- Returns:
- result of function call as String
-
callBoolean
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 namectx- used context as input for functionargs- arguments used in function, if needed- Returns:
- result of function call as boolean
-
flow
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 namectx- context for entire flow lifecycleargs- optional arguments used by the flow- Returns:
- a flow result map containing variables marked for return.
-
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
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
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
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
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
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
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
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
-