Solved

Using FeatureReader with generic output causes ListElementCounter transformers to be invalid.

  • 28 February 2018
  • 4 replies
  • 13 views

Badge

I have a FeatureReader for WFS. Because I want it to work with any WFS source I have parameterised the Dataset and "Feature types to read" fields and set the output to Single Output port.This means that I have to use the Generic output port.

Further down the workspace I have some transformers that do logging. I have a ListBuilder followed by a ListElementCounter, so I can log the number of records returned by the WFS service. I also have an UpdateDetector with the same arrangement.

Before I started using the generic output port, everything was OK. But since I have used the Generic port, some ListElementCounters are showing problems. (The one connected to the WFS reader and also the one connected to the Unchanged port of the UpdateDetector. Others are OK.) The ListAttribute fields are showing up as red and they don't seem to be able to read the _list{} attribute that should be supplied by the ListBuilder.

If I run the workspace, it seems to still work, but of course I get a warning about invalid parameters.

I'm guessing the problem might be that since I stopped using a strongly-typed reader the ListBuilder doesn't know what its input is and whether it can be turned into a list. Is there anything I can do to get rid of the red fields?

icon

Best answer by takashi 1 March 2018, 08:22

View original

4 replies

Userlevel 2
Badge +17

Hi @rohan, FME Workbench won't automatically expose attribute names under the <Generic> port of the FeatureReader, since the schema of unknown feature type cannot be detected when creating the workspace. In the situation, the ListBuilder too doesn't expose list name and therefore it makes the List Attribute field in the following ListElementCounter red. I think it's the reason for the symptom you have encountered.

To resolve the symptom, try exposing one or more known attribute name manually with the Attributes to Expose parameter in the FeatureReader (see Output / Attribute and Geometry Handling / <Generic> Port section in the parameters dialog).

Userlevel 2
Badge +17

Hi @rohan, FME Workbench won't automatically expose attribute names under the <Generic> port of the FeatureReader, since the schema of unknown feature type cannot be detected when creating the workspace. In the situation, the ListBuilder too doesn't expose list name and therefore it makes the List Attribute field in the following ListElementCounter red. I think it's the reason for the symptom you have encountered.

To resolve the symptom, try exposing one or more known attribute name manually with the Attributes to Expose parameter in the FeatureReader (see Output / Attribute and Geometry Handling / <Generic> Port section in the parameters dialog).

Here. Nesting of the parameter groups here might be too deep... @DanAtSafe, how do you think?

 

Badge +16

That is correct, the generic port does not automatically expose the attributes and manually entering them usually solves this kind of issues.

Badge

Thanks for the suggestion. I think it has solved my problem.

Reply