Skip to main content
Solved

dynamic writer output filename

  • October 10, 2017
  • 4 replies
  • 218 views

Forum|alt.badge.img

Hi,

I'm using FME Desktop 2017 to write features to a feature class in a geodatabase using a dynamic schema definition. The dynamic schema is necessary as I'm using an AttributePivoter transformer. When I selected "Dynamic Schema Definition" in the Feature Type Parameters, FME automatically changed the Feature Class name to the attribute "fme_feature_type". Whenever I try to change anything about this, my workbench doesn't work anymore. Can I change anything about this? It'd be quite useful to assign a name different from fme_feature_type...

Any hint is appreciated ;-)

Best answer by trentatsafe

Hello, @kgt_lena

The most likely reason for the workspace failing after adjusting the Feature Class/Table name is due to naming conflicts(possibly duplicates as an example). The fme_feature_type attribute will write each feature to the feature class that matches the fme_feature_type value. You are able to change the Feature Class/Table name to another attribute other than fme_feature_type.

What error are you receiving when changing the fme_feature_type to a different attribute, would you mind posting the error, please?

 

 

Here is the Dynamic Tutorial that may assist solving the issue: https://knowledge.safe.com/articles/1050/dynamic-workflow-tutorial-introduction.html
View original
Did this help you find an answer to your question?

4 replies

trentatsafe
Safer
Forum|alt.badge.img+6
  • Safer
  • Best Answer
  • October 10, 2017

Hello, @kgt_lena

The most likely reason for the workspace failing after adjusting the Feature Class/Table name is due to naming conflicts(possibly duplicates as an example). The fme_feature_type attribute will write each feature to the feature class that matches the fme_feature_type value. You are able to change the Feature Class/Table name to another attribute other than fme_feature_type.

What error are you receiving when changing the fme_feature_type to a different attribute, would you mind posting the error, please?

 

 

Here is the Dynamic Tutorial that may assist solving the issue: https://knowledge.safe.com/articles/1050/dynamic-workflow-tutorial-introduction.html

Forum|alt.badge.img
  • Author
  • October 11, 2017
trentatsafe wrote:

Hello, @kgt_lena

The most likely reason for the workspace failing after adjusting the Feature Class/Table name is due to naming conflicts(possibly duplicates as an example). The fme_feature_type attribute will write each feature to the feature class that matches the fme_feature_type value. You are able to change the Feature Class/Table name to another attribute other than fme_feature_type.

What error are you receiving when changing the fme_feature_type to a different attribute, would you mind posting the error, please?

 

 

Here is the Dynamic Tutorial that may assist solving the issue: https://knowledge.safe.com/articles/1050/dynamic-workflow-tutorial-introduction.html
Thanks @trentatsafe! I think I didn't describe my problem properly, sorry - I try to be more specific. What I understand from your answer is that my FeatureClass name must be derived from an attribute value and cannot be assigned by simply typing it in that field "Feature Class or Table Name" in the Writer Parameters.

 

In a further step, I'd like to not only assign a simple string as the FeatureClass name, but even name the output something like "gender_2017", "gender_2016", "gender_2015" and so on. The first part ("gender_") will be static, the year will be depending on user input and is already used in a published parameter. So it'd be no problem to concat these two strings to get the desired FeatureClass name, but until now I just thought I can to this concatenation "on the fly". Instead, I now think I have to create an attribute with this value to use it as my FeatureClass name. Is that correct? Thanks in advance for any further help :-)

 


trentatsafe
Safer
Forum|alt.badge.img+6
  • Safer
  • October 11, 2017
kgt_lena wrote:
Thanks @trentatsafe! I think I didn't describe my problem properly, sorry - I try to be more specific. What I understand from your answer is that my FeatureClass name must be derived from an attribute value and cannot be assigned by simply typing it in that field "Feature Class or Table Name" in the Writer Parameters.

 

In a further step, I'd like to not only assign a simple string as the FeatureClass name, but even name the output something like "gender_2017", "gender_2016", "gender_2015" and so on. The first part ("gender_") will be static, the year will be depending on user input and is already used in a published parameter. So it'd be no problem to concat these two strings to get the desired FeatureClass name, but until now I just thought I can to this concatenation "on the fly". Instead, I now think I have to create an attribute with this value to use it as my FeatureClass name. Is that correct? Thanks in advance for any further help :-)

 

Hello @kgt_lena

 

 

I believe your last point is correct. You are able to concatenate your feature names when using a Dynamic writer. You mention wanting to have just the last portion of the feature type change. In your case, Gender_ would be the unchanging part, while the year would change. I don't believe you could use a Parameter as you would need to differentiate the features from one another. However, if you can use an Attribute that would work.

 

 

So if the Year attribute contains 2015, 2016 and 2017 in different features. Your writer feature type name would look like:

 

Gender_@Value(Year).

 

Which would output three different feature types with the names Gender_2015, Gender_2016, and Gender_2017.

 

 

Does that help?

 


Forum|alt.badge.img
  • Author
  • October 12, 2017
trentatsafe wrote:
Hello @kgt_lena

 

 

I believe your last point is correct. You are able to concatenate your feature names when using a Dynamic writer. You mention wanting to have just the last portion of the feature type change. In your case, Gender_ would be the unchanging part, while the year would change. I don't believe you could use a Parameter as you would need to differentiate the features from one another. However, if you can use an Attribute that would work.

 

 

So if the Year attribute contains 2015, 2016 and 2017 in different features. Your writer feature type name would look like:

 

Gender_@Value(Year).

 

Which would output three different feature types with the names Gender_2015, Gender_2016, and Gender_2017.

 

 

Does that help?

 

Hello @trentatsafe

 

Yes, thanks, that does help indeed!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings