Working with writing shape files I ALWAYS use the Generate Workspace to auto-create the correct Writers:
Hi Amit,
have you tried to manually add these extra attributes to the output feature type (feature type properties -> user attributes)?
That usually works.
David
Hi folks, thanks for the replies. Sig, I've tried the generate workspace, but it doesn't add the new attributes created in the workspace (unless I'm missing something!).
David, I can maunally add them in, no problem, but I only want the relevant ones depending on the geometry path. For example, for the writer points output I want x,y,z , I don't want these fields on the dataset if they are null, i.e. come from one of the other geometry types.
To explain another way, I only want to generate certain new attributes derived from transformers (different attributes for different geometries), not purely derive them from the reader. Is this possible?
In short, I don't think so, unless you test what you've got at the end and send the features where 'Attribute Exists', the Tester will do this, to a featuretype with the appropriate attributes already created on the target.
Hi David, thanks for the reply. I guess I can just write them out to different writers, was thinking more as a proof on concept, could see it being handy in different workbenches.
Thank you all for the help.
Hi Amit,
Even in a dynamic workspace, the schema has to exist somewhere. Generally it comes from the source feature types in the workspace. It could also come from an entirely unrelated dataset - eg using Readers > Add Reader as Resource, but I don't think it can come from a transformer.
I think it
*might* be possible to do this, but it would take a bit of effort.
The first thing I would try is reading the source data with a Schema Reader - appending that to a text file where you already have the additional fields defined. Then use that file as the schema source (using Reader as Resource). At a minimum you would have to control the flow of features so the text file was written before anything went to the dynamic writers.
You could also try a similar thing but having the Schema Reader in a custom format, and using that custom format as the source of the schema (add it as a reader resource again).
I don't guarantee these will work - in fact I give them a 10% chance of success - but it's the approach I would start out with.
Hope this is of use
Regards
Mark
Hi Mark,
Thanks for the reply, I was thinking a similar thing, but using the WorkspaceRunner to run subsequent workbenches. I've not had much experience of contolling the flow/order of writer output, something I need to read up on.
Thanks again.