The Dynamic Properties part of the feature type dialog includes a setting for Schema Source and underneath that, a setting for Schema Definition Name:
The Schema Sources setting we know can point to a different dataset, one that defines a schema we wish to use. The Schema Definition Name defines which feature type to use in that dataset to define our attributes.
By default the feature type name defined in the General Parameters is used to define both the layers to be created and the attributes to be used for those layers.
However, the Schema Definition Name can be set to define attributes from different feature types than those that are being used to define output layers.
Because it is possible to set this parameter using an attribute, each different feature can point to a different attribute definition.
Here, for example, the user has set up a custom set of feature types to be written by adding a new schema source and setting the output feature type name to point to feature types in that dataset.
However, the output will NOT contain the attributes from that dataset. Instead the user is choosing to create attributes from another Reader feature type, called Parks.
|Sister Intuitive says…|
Yes, it's very complex and sometimes hard to grasp what all this means.
Basically, all of these settings allow us to create an output dataset whose schema is defined in multiple ways. These aren't functions to be used every day, but are vitally important in particular scenarios.
But if you don't understand, then don't worry. Just keep the idea of dynamic translations in your head so that you know to use it when faced with schema handling beyond the usual static workspace.
Adding or Deleting Attributes
Besides specifying which set of attributes to use, sometimes - even in a dynamic translation - you need to add or delete specific attributes. This is very simple to do.
Adding a New Attribute
Adding a new attribute to all output on a dynamic feature type is just a case of editing the feature type definition to add that attribute.
In other words, any attribute you add to the feature type definition will get added to all features output through there – regardless of source or resource schemas.
For example, I might add an attribute if an AreaCalculator transformer was in the workspace and I wished to store the result.
Deleting an Attribute
Deleting an existing attribute is done through the dynamic Schema Definition dialog. At the foot of that dialog is a field for removing attributes:
The edit [...] button opens a dialog in which to select attributes that are in the source schema but that you don’t want in the output:
You can select existing attributes to remove or you can manually enter attribute names. That way you can choose to remove attributes even when the schema is coming from outside of the workspace.