{"record":{"id":"1914f2aa53518347","repo":"dbeaver/dbeaver","slug":"expression-property-not-specified","errorCode":null,"errorMessage":"Expression property not specified","messagePattern":"Expression property not specified","errorType":"validation","errorClass":"DBCException","httpStatus":null,"severity":"error","filePath":"plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/transformers/DataTransferTransformerExpression.java","lineNumber":53,"sourceCode":" */\npublic class DataTransferTransformerExpression implements IDataTransferAttributeTransformer {\n\n    private JexlExpression jexlExpression;\n\n    @Override\n    public Object transformAttribute(@NotNull DBCSession session, @NotNull DBDAttributeBinding[] dataAttributes, @NotNull Object[] dataRow, @NotNull DBDAttributeBinding attribute, Object attrValue, @NotNull Map<String, Object> options) throws DBException {\n        JexlExpression jexlExpression = getJexlExpression(options);\n\n        JexlContext context = new VariablesContext(session, dataAttributes, dataRow);\n\n        return jexlExpression.evaluate(context);\n    }\n\n    public JexlExpression getJexlExpression(Map<String, Object> options) throws DBCException {\n        if (jexlExpression == null) {\n            String expr = JSONUtils.getString(options, \"expression\");\n            if (expr == null) {\n                throw new DBCException(\"Expression property not specified\");\n            }\n            jexlExpression = DBVUtils.parseExpression(expr);\n        }\n\n        return jexlExpression;\n    }\n\n    private static class VariablesContext implements JexlContext {\n\n        private final DBCSession session;\n        private final DBDAttributeBinding[] dataAttributes;\n        private final Object[] dataRow;\n\n        public VariablesContext(DBCSession session, DBDAttributeBinding[] dataAttributes, Object[] dataRow) {\n            this.session = session;\n            this.dataAttributes = dataAttributes;\n            this.dataRow = dataRow;\n        }","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/dbeaver/dbeaver/blob/1e5ee1042bc61661368942aece126f3e67049955/plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/transformers/DataTransferTransformerExpression.java#L35-L71","documentation":"Thrown by the expression-based attribute transformer when the options map does not contain an 'expression' key. The transformer uses Apache JEXL3 to evaluate per-attribute formulas during data transfer. Without an expression string there is nothing to evaluate, so getJexlExpression() throws immediately. The expression is only parsed once and cached in the jexlExpression field.","triggerScenarios":"Calling DataTransferTransformerExpression.getJexlExpression() (or transformAttribute()) with an options map where JSONUtils.getString(options, \"expression\") returns null. This happens when the transformer is configured without providing the expression parameter.","commonSituations":"Programmatically configuring a DataTransferTransformerExpression without setting the 'expression' option. Corrupted or incomplete task configuration that lost the expression value. User selected the expression transformer in the Data Transfer wizard but left the formula field empty.","solutions":["Ensure the options map passed to the transformer contains a non-null 'expression' key with a valid JEXL formula","Reconfigure the attribute transformer in the Data Transfer wizard and fill in the expression field","If configuring programmatically, validate the options map before passing it to transformAttribute()"],"exampleFix":"// before — missing expression key\nMap<String, Object> options = new HashMap<>();\ntransformer.transformAttribute(session, attrs, row, attr, null, options);\n// throws DBCException: \"Expression property not specified\"\n\n// after — provide the expression\nMap<String, Object> options = new HashMap<>();\noptions.put(\"expression\", \"ROW_NUM * 100 + ID\");\ntransformer.transformAttribute(session, attrs, row, attr, null, options);","handlingStrategy":"validation","validationCode":"// Validate options map before invoking the transformer\nString expr = JSONUtils.getString(options, \"expression\");\nif (expr == null || expr.isBlank()) {\n    throw new IllegalStateException(\n        \"Expression transformer requires a non-null 'expression' option\");\n}\ntransformer.transformAttribute(session, attrs, row, attr, value, options);","typeGuard":null,"tryCatchPattern":"try {\n    transformer.transformAttribute(session, attrs, row, attr, value, options);\n} catch (DBCException e) {\n    if (e.getMessage().equals(\"Expression property not specified\")) {\n        // configuration error — provide the expression and retry\n        options.put(\"expression\", \"DEFAULT_VALUE\");\n    } else {\n        throw e;\n    }\n}","preventionTips":["Always set the 'expression' key in the options map when using DataTransferTransformerExpression","Validate the options map programmatically before passing it to transformAttribute()","In the Data Transfer wizard UI, ensure the expression field is filled before saving the task"],"tags":["data-transfer","jexl","transformer","configuration"],"backgroundTag":null,"analyzedSha":"1e5ee1042bc61661368942aece126f3e67049955","analyzedAt":"2026-08-13T23:31:13.467Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}