Unless someone else replies, could you perhaps try rephrasing the question, I'm not sure I quite understand the issue. Perhaps even post a small sample workspace with a minimal dataset and describe what you'd like the output to be.
Unless someone else replies, could you perhaps try rephrasing the question, I'm not sure I quite understand the issue. Perhaps even post a small sample workspace with a minimal dataset and describe what you'd like the output to be.
Yes I am going to try to make it more clear with a simple example. Thanks David.
Well you can use @Value(SimWaterBodies_FN) in the AttributeManager (not AttributeCreator) and it will work. It won't expose the attribute, but you can see it in the Logger.
One additional problem (among many) is that you have two (or more?) attributes. So you would have to use a FeatureMerger/Joiner (match with a constant value so that all new attributes are added) to get all the new fields. But it would be *after* the AttributeManager, not before as you currently have it (maybe that's there for another reason).
Here's a sample workspace to show how it would work. The attribute xxxx records missing attributes (yyyy0, yyyy1, yyyy2). These are created and appended to the main set of data. The Logger shows that these are added to your five main features.
But the big issue is how to write this. You'll need to know what attributes are on the schema in advance else they won't get written - and if you knew that then you wouldn't need to go through the above process.
A dynamic workspace will get you so far, but again the schema has to exist somewhere. The only way I can see is to create the schema dynamically within the workspace. So you would need to create attribute{0}.fme_data_type = fme_varchar(40) (or whatever) and attribute{0}.name = Phosphate
Thinking about it, that's relatively straightforward. Just copy SimWaterBodies_FN to attribute{x}.name (maybe use an Aggregator to build up that list)
Anyway, unless I'm misunderstanding, I think that's the only way to do it.
The key is, if you know Phosphate and Ammonia are fields on the output, then you can just add them to the writer schema and get nulls. But if you don't know that, then you have to go through all of the above to get them on there.
Well you can use @Value(SimWaterBodies_FN) in the AttributeManager (not AttributeCreator) and it will work. It won't expose the attribute, but you can see it in the Logger.
One additional problem (among many) is that you have two (or more?) attributes. So you would have to use a FeatureMerger/Joiner (match with a constant value so that all new attributes are added) to get all the new fields. But it would be *after* the AttributeManager, not before as you currently have it (maybe that's there for another reason).
Here's a sample workspace to show how it would work. The attribute xxxx records missing attributes (yyyy0, yyyy1, yyyy2). These are created and appended to the main set of data. The Logger shows that these are added to your five main features.
But the big issue is how to write this. You'll need to know what attributes are on the schema in advance else they won't get written - and if you knew that then you wouldn't need to go through the above process.
A dynamic workspace will get you so far, but again the schema has to exist somewhere. The only way I can see is to create the schema dynamically within the workspace. So you would need to create attribute{0}.fme_data_type = fme_varchar(40) (or whatever) and attribute{0}.name = Phosphate
Thinking about it, that's relatively straightforward. Just copy SimWaterBodies_FN to attribute{x}.name (maybe use an Aggregator to build up that list)
Anyway, unless I'm misunderstanding, I think that's the only way to do it.
The key is, if you know Phosphate and Ammonia are fields on the output, then you can just add them to the writer schema and get nulls. But if you don't know that, then you have to go through all of the above to get them on there.
Thanks Mark. Very useful information. Your sample workspace was very clear too!