Question

We have to plugins for the FME a writer- and a FeatureTypeImporter plugin. In the writer plugin it is possible to select a file from the hard disc in the parameters dialog. Is it possible to share this file with the FeatureTypeImporter plugin?

  • 17 January 2023
  • 4 replies
  • 2 views

For example:

In the parameters dialog of the writer-plugin a file was chosen from the hard disc and the filename is availiable in the parameters list.

Now if we add the FeatureTypeImporter in the FME via Writers - Import Feature Types ... and select in the Format: field the FeatureTypeImporter we want to have this file displayed in the Dataset: field.

The Dataset field is defined in the fmf file of the FeatureTypeImporter and a default value is set there.

There also exists a parameter in the writer fmf file for this file.


4 replies

Userlevel 2
Badge +17

Hi @pehrs​,

I don't think you can propagate the file name from the writer to the FeatureTypeImporter. What you can do is recommend that the user link both parameter to the same User Parameter, so they only need to choose the file once to have it applied to both.

This is a common step for some translations. For example, when doing a DWG -> DWG conversion, the template file for the writer is often link to the same parameter as the source file.

Is there an example in FME Desktop 2021 for this issue (using the same parameter in both) or do you have an example for DWG?

What I have tried so far is to use the metafiles.

I have one metafile called s-101_gui.fmi that contains:

DEFAULT_VALUE FEATCAT_FILE $(FME_HOME)runtime\\nautilus\\Products\\FeatCats\\S-10110.xml

GUI FILENAME_MUSTEXIST FEATCAT_FILE Feature_Catalog_Files(*.xml)|*.xml Feature Catalogue

 

And two other metafiles s-101-writer.fmf and s-101FeatureTypeImporter.fmf

My idea was to use the same gui and variable from s-101_gui.fmi in both meta files.

I have included the s-101_gui.fmi in s-101-writer.fmf on the position where the gui is used and also for the s-101FeatureTypeImporter.fmf.

In s-101FeatureTypeImporter I have the line

DEFAULT_VALUE DATASET $[FEATCAT_FILE]

But this does not work so far (The writer has the value for FEATCAT_FILE but it is not available in s-101FeatureTypeImporter).

Is this a possible solution and if yes what is missing/ wrong here?

 

This is solved now.

We decided to add a user parameter to select the file by the user if he wants another then the default

Reply