Question

Passing an attribute field processing logic from the configuration file to a dynamic workspace

  • 26 January 2023
  • 4 replies
  • 1 view

I'm creating a dynamic workspace which reads Excel sheet as a configuration and extracts data from a Feature Service. Configuration file looks like this:

imageFME workspace looks like this:

imageFeature reader reads every row in configuration file and extracts data for the listed Feature services. imageIt outputs everything through the generic port.

 

In the configuration file I have field mapping information where attribute fields in a feature services are mapped with the output fields I need:

 

imageFME evaluates and extracts attributes using such logic:

image 

It works well and I'm getting what I need:

imageimage 

But I have a question what to do when I have some more specific logic. For example, I have cases when I need to concatenate the fields into one field. How to pass this to FME to evaluate such expression?

 

image.png 

 

 


4 replies

Userlevel 3
Badge +26

You should be able to do this in the AttributeCreator's text editor.image

Hi and thanks. The question is a bit more complex. In a configuration file we have a Feature Service field names from which we have to take values and then concatenate them. municipality_name is a column in a configuration file, and MUNICIPALITY is a field name which exist in a Feature Service. It is an example, so don't look into municipality_name and municipality_id. I have updated the picture.

I was able to solve the puzzle in such way:

imageI can't say that I like it, as it is not very dynamic, but in any case it is more or less what I need. In configuration file I have added such description of the

data processing needed:

imageAnd in the FME I have added additional logic to process the data according to the description in the configuration.

Probably it could be interesting to test the option with writhing the python code in the configuration file and after that execute it using PythonCaller.

This could be more dynamic approach (not sure).

I have tested the python way to do the same. It looks much better and more dynamic:

imageConfiguration line in a file looks like this:

imageIn PythonCaller it looks like this:

 

image

Reply