public CalculatorMetaFunction(Repository rep, long id_step, int nr) throws KettleException {
    fieldName = rep.getStepAttributeString(id_step, nr, "field_name");
    calcType = getCalcFunctionType(rep.getStepAttributeString(id_step, nr, "calc_type"));
    fieldA = rep.getStepAttributeString(id_step, nr, "field_a");
    fieldB = rep.getStepAttributeString(id_step, nr, "field_b");
    fieldC = rep.getStepAttributeString(id_step, nr, "field_c");
    fieldD = rep.getStepAttributeString(id_step, nr, "field_d");
    fieldE = rep.getStepAttributeString(id_step, nr, "field_e");
    valueType = ValueMeta.getType(rep.getStepAttributeString(id_step, nr, "value_type"));
    valueLength = (int) rep.getStepAttributeInteger(id_step, nr, "value_length");
    valuePrecision = (int) rep.getStepAttributeInteger(id_step, nr, "value_precision");
    removedFromResult = rep.getStepAttributeBoolean(id_step, nr, "remove");
    conversionMask = rep.getStepAttributeString(id_step, nr, "conversion_mask");
    decimalSymbol = rep.getStepAttributeString(id_step, nr, "decimal_symbol");
    groupingSymbol = rep.getStepAttributeString(id_step, nr, "grouping_symbol");
    currencySymbol = rep.getStepAttributeString(id_step, nr, "currency_symbol");

    // Fix 2.x backward compatibility
    // The conversion mask was added in a certain revision.
    // Anything that we load from before then should get masks set to retain backward compatibility
    //
    if (rep.findStepAttributeID(id_step, nr, "conversion_mask") < 0) {
      fixBackwardCompatibility();
    }
  }
  public CalculatorMetaFunction(Node calcnode) {
    fieldName = XMLHandler.getTagValue(calcnode, "field_name");
    calcType = getCalcFunctionType(XMLHandler.getTagValue(calcnode, "calc_type"));
    fieldA = XMLHandler.getTagValue(calcnode, "field_a");
    fieldB = XMLHandler.getTagValue(calcnode, "field_b");
    fieldC = XMLHandler.getTagValue(calcnode, "field_c");
    fieldD = XMLHandler.getTagValue(calcnode, "field_d");
    fieldE = XMLHandler.getTagValue(calcnode, "field_e");
    valueType = ValueMeta.getType(XMLHandler.getTagValue(calcnode, "value_type"));
    valueLength = Const.toInt(XMLHandler.getTagValue(calcnode, "value_length"), -1);
    valuePrecision = Const.toInt(XMLHandler.getTagValue(calcnode, "value_precision"), -1);
    removedFromResult = "Y".equalsIgnoreCase(XMLHandler.getTagValue(calcnode, "remove"));
    conversionMask = XMLHandler.getTagValue(calcnode, "conversion_mask");
    decimalSymbol = XMLHandler.getTagValue(calcnode, "decimal_symbol");
    groupingSymbol = XMLHandler.getTagValue(calcnode, "grouping_symbol");
    currencySymbol = XMLHandler.getTagValue(calcnode, "currency_symbol");

    // Fix 2.x backward compatibility
    // The conversion mask was added in a certain revision.
    // Anything that we load from before then should get masks set to retain backward compatibility
    //
    if (XMLHandler.getSubNode(calcnode, "conversion_mask") == null) {
      fixBackwardCompatibility();
    }
  }