Question

Renaming attributes after listexploder?


Badge

For validation purposes I need the attributes to be exactly like our schema in GIS. So I set it to do just that. After the validation I used the listexploder to extract the failed attributes. But in the CSV file I would like the original attribute names.

For example Polyvinyl Chloride (PVC) is the original attribute then I set it to PVC to run thru the validator and then would like it back to Polyvinyl Chloride (PVC) after it is valid/failed .on the CSV file. Is this possible?

Can some one please help me out with this. . Thanks in advance.


11 replies

Userlevel 2
Badge +17

Hi @mikesando, in your current setting for the second AttributeValueMapper (MATERIAL_4), the original attribute value (e.g. "Polyvinyl Chloride (PVC)") will be assigned to a new attribute called "_fme_validation_message_List{}". It's just a regular attribute which contains "{}" within its name. What do you want to achieve using the second AttributeValueMapper?

Badge +16

Hi @mikesando, The validation in the rwMain_Attribute_Validator transfomer will result in a list (fme_validation_message{}) so its unclear to me, as @takashi mentions, why you are mapping the values in the MATERIAL_4 transformer into an attribute with the same name.

Badge

Hi @mikesando, in your current setting for the second AttributeValueMapper (MATERIAL_4), the original attribute value (e.g. "Polyvinyl Chloride (PVC)") will be assigned to a new attribute called "_fme_validation_message_List{}". It's just a regular attribute which contains "{}" within its name. What do you want to achieve using the second AttributeValueMapper?

The first Attribute value mapper (MATERIAL_11) is to validate exactly what is in our database, but the second Attribute value mapper (MATERIAL_4) is where I would like it to switch back to the original attribute with the error (list) and send to the writer (CSV file). The reason for this is with our as-built standards the surveyor/contractor never sees the "PVC" and only sees "Polyvinyl Chloride (PVC)" so when I export the error report and send to them they will be familiar with what the material is.

 

 

Badge

validationreport.csvI am trying to get the fme_validation_message{} to switch back to

Polyvinyl Chloride (PVC) instead of the abbreviations i.e. PVC in the CSV file attached.

Userlevel 2
Badge +17

validationreport.csvI am trying to get the fme_validation_message{} to switch back to

Polyvinyl Chloride (PVC) instead of the abbreviations i.e. PVC in the CSV file attached.

@mikesando, why not validate the MATERIAL value by non-abbreviations (e.g. 'Polyvinyl Chloride (PVC)' etc.) with the AttributeValidator, before the first AttributeValueMapper?
Badge
@mikesando, why not validate the MATERIAL value by non-abbreviations (e.g. 'Polyvinyl Chloride (PVC)' etc.) with the AttributeValidator, before the first AttributeValueMapper?
attributes.jpgThank you @takashi for you time. The other reason I have to map the attributes to the abbreviations when trying to do it the way you suggested and if it had any &, ', / characters it would not output the attribute?

 

 

 

Userlevel 2
Badge +17

validationreport.csvI am trying to get the fme_validation_message{} to switch back to

Polyvinyl Chloride (PVC) instead of the abbreviations i.e. PVC in the CSV file attached.

@mikesando, I don't think those characters (& /) cause any problem even if you validate MATERIAL values with non-abbreviations. See the attachment (FME 2016.0+): attributevalidator-example.fmw
Badge
@mikesando, I don't think those characters (& /) cause any problem even if you validate MATERIAL values with non-abbreviations. See the attachment (FME 2016.0+): attributevalidator-example.fmw
size-test.fmwThanks again @takashi. Due to your example I was able to get it to work, but it still rejects the inch symbol (") in the SIZE of main. Please see example and is there a work around for this?

 

 

Userlevel 2
Badge +17

validationreport.csvI am trying to get the fme_validation_message{} to switch back to 

Polyvinyl Chloride (PVC) instead of the abbreviations i.e. PVC in the CSV file attached. 

Hi @mikesando, the double quotation mark and comma are special characters in FME string functions. If a parameter string contains a quotation mark or a comma, the string should be surrounded by double quotations and a double quotation mark within the string should be escaped by another double quotation. e.g. this rule configuration for the In operator will check if the SIZE matches 10" or 8".

 

"10""","8"""
It works for the validation itself, but in my test, the rule configuration was written into the validation message string literally, like this.

 

Attribute 'SIZE' with value '20"' fails check for in '"10""","8"""'
If it's not allowable, a possible workaround I can think of is:
  1. Replace every double quotation mark in the SIZE values with a special string. e.g. '<quote>'
  2. Validate the SIZE values with | SIZE  | In | 10<quote>,8<quote> |
  3. Replace every '<quote>' within the validation message string with double quotation mark.
Badge

Okay let me try that and see what I can come up with. Thank you SO much for your time and help!

Badge

That worked!!!! Thank you!

Reply