com.im.df.api.support
Interface DFNewTypeWellKnownOptions.NewCalulatedField
- All Superinterfaces:
- DFNewTypeOptions, DFNewTypeWellKnownOptions.FieldOptions, DFNewTypeWellKnownOptions.NewDBField, DFNewTypeWellKnownOptions.SingleDFItem
- Enclosing interface:
- DFNewTypeWellKnownOptions
public static interface DFNewTypeWellKnownOptions.NewCalulatedField
- extends DFNewTypeWellKnownOptions.NewDBField
Options for creating new calculated field, you need to validate calc field by using validateScript method.
setExpression
void setExpression(FieldInfo.Script expression)
getExpression
FieldInfo.Script getExpression()
setFieldsMapping
void setFieldsMapping(Map<String,CalculableGroovyTemplate.FieldDetails> fieldsMapping)
- Set parameters for calculations.
- Parameters:
fieldsMapping - key is variable name.
getFieldsMapping
Map<String,CalculableGroovyTemplate.FieldDetails> getFieldsMapping()
getCalculatedReturnType
CalculatedReturnType getCalculatedReturnType()
validateScript
String validateScript(Map<String,Object> testValues,
Object[] retValue)
- Validate calculated field for predefined values.
- Parameters:
testValues - variable name to value mapretValue - array with size 1 in order to return calculated value
- Returns:
- error message if validation failed. Otherwise it returns null.