Solved

Error: No DEF line could be found for feature type


Badge +1

Hi,

I have an FME Workbench that is writing to a dynamic schema.

I have set the fme_feature_type and fme_feature_type_name explicitly using an AttributeCreator, but I keep getting this error when trying to write to an Excel spreadsheet:

XLSX Writer: No DEF line could be found for feature type

Does anyone have any ideas as to what this error means and how to solve it?

I also get the following warning prior to the error, if this helps:

Cannot define schema for 'RP_100CC' as the feature does not contain schema information, and schema source is set to 'Schema from Schema Feature'. Please verify writer feature type configuration.

I am using FME Desktop 2017.1 64 Bit.

Thanks

icon

Best answer by takashi 30 January 2018, 15:17

View original

12 replies

Userlevel 4

My guess would be one of two things:

  • The schema name and the feature name doesn't match 100%
  • The data feature arrives at the FeatureWriter before the schema feature

I would suggest inserting a breakpoint (was called an inspection point earlier) on the connection that enters the FeatureWriter and see what comes, and in which order.

If you can post a small sample workspace, that would also be very helpful.

Userlevel 2
Badge +17

Hi @aquamarine, does the Schema Definition Name match the source feature type name? If you derived schema from the source dataset, the Schema Definition Name should be equal to the original source feature type name.

Badge +1

Hi @takashi.

I derived the schema in the AttributeManager using the attribute(0).name, attribute(0).fme_data_type, etc methodology. I have a number of source feature_types so how would I know which one to use as the 'Schema Definition Name'?

Badge +1

My guess would be one of two things:

  • The schema name and the feature name doesn't match 100%
  • The data feature arrives at the FeatureWriter before the schema feature

I would suggest inserting a breakpoint (was called an inspection point earlier) on the connection that enters the FeatureWriter and see what comes, and in which order.

If you can post a small sample workspace, that would also be very helpful.

I have added a breakpoint but all the information seems to come through at the same time. Does the order of the Attributes in the FeatureInformation matter?

 

 

I can't seem to recreate the error in a small sample workspace but I'll keep trying.

 

 

Userlevel 4
I have added a breakpoint but all the information seems to come through at the same time. Does the order of the Attributes in the FeatureInformation matter?

 

 

I can't seem to recreate the error in a small sample workspace but I'll keep trying.

 

 

It's really difficult to tell without any specific details of your workspace and your data. Can you post a few screenshots?
Userlevel 2
Badge +17

Hi @takashi.

I derived the schema in the AttributeManager using the attribute(0).name, attribute(0).fme_data_type, etc methodology. I have a number of source feature_types so how would I know which one to use as the 'Schema Definition Name'?

Usually "fme_feature_type" stores the source feature type name, and you can set it to the Schema Definition Name field.

 

However, if you have modified the "fme_feature_type_name" in the schema features output from the <Schema> port of the FeatureReader, "fme_feature_type" in the data features could not be used here any longer. In the case, you will have to add a new attribute which stores an appropriate schema definition name (= "fme_feature_type_name" in corresponding schema feature) to every data feature, and set it to the Schema Definition Name.

 

Badge +1
Usually "fme_feature_type" stores the source feature type name, and you can set it to the Schema Definition Name field.

 

However, if you have modified the "fme_feature_type_name" in the schema features output from the <Schema> port of the FeatureReader, "fme_feature_type" in the data features could not be used here any longer. In the case, you will have to add a new attribute which stores an appropriate schema definition name (= "fme_feature_type_name" in corresponding schema feature) to every data feature, and set it to the Schema Definition Name.

 

Hmmm...I don't have a FeatureReader. I tried to modify the fme_feature_type in an Attribute Creator as per my screen shot above. Perhaps I am not modifying the fme_feature_type in the correct place? Also, I don't quite understand what you mean by storing an appropriate schema definition name to every data feature - how do I do that?

 

 

Badge +1
It's really difficult to tell without any specific details of your workspace and your data. Can you post a few screenshots?
Yes sorry, I have attached a screen shot to Takashi's reply in this thread. Hopefully that helps a bit...

 

 

Userlevel 4

Thanks for the screenshot, that's very helpful.

Unless I'm mistaken you're missing the "fme_feature_type_name" attribute which should be equal to "fme_feature_type", e.g. "RP_100CC".

Userlevel 2
Badge +17

If my eyes work normally, it seems that you are using round brackets ( ) to surround the element indices of the "attribute" in the AttributeManager. You have to surround every list index with curly brackets { }. I think it's the direct reason for the error.

However, there could be another issue.

I think that you intend to create multiple different schema definitions with the AttributeManager depending on some attribute values, e.g. "_list{0}.FLDDEPTH", "_list{1}.FLDDEPTH".

If so, each schema definition should have unique name in the workspace and you have to set it to the Schema Definition Name field in the writer feature type.

How did you create the schema definition names and set them to the writer feature type?

Userlevel 2
Badge +17

If my eyes work normally, it seems that you are using round brackets ( ) to surround the element indices of the "attribute" in the AttributeManager. You have to surround every list index with curly brackets { }. I think it's the direct reason for the error.

However, there could be another issue.

I think that you intend to create multiple different schema definitions with the AttributeManager depending on some attribute values, e.g. "_list{0}.FLDDEPTH", "_list{1}.FLDDEPTH".

If so, each schema definition should have unique name in the workspace and you have to set it to the Schema Definition Name field in the writer feature type.

How did you create the schema definition names and set them to the writer feature type?

If I understand your intention correctly, this workspace would be a prototype to the solution.

 

none2xlsxw.fmw (FME 2017.1.2.1)

 

Badge +1

If my eyes work normally, it seems that you are using round brackets ( ) to surround the element indices of the "attribute" in the AttributeManager. You have to surround every list index with curly brackets { }. I think it's the direct reason for the error.

However, there could be another issue.

I think that you intend to create multiple different schema definitions with the AttributeManager depending on some attribute values, e.g. "_list{0}.FLDDEPTH", "_list{1}.FLDDEPTH".

If so, each schema definition should have unique name in the workspace and you have to set it to the Schema Definition Name field in the writer feature type.

How did you create the schema definition names and set them to the writer feature type?

Thanks @takashi

 

Yes the problem was that I used the round brackets instead of the curly brackets!. It seems to be working fine now.

 

Sorry it was such a silly mistake! Thank you all for your help.

Reply