Skip to main content
Question

Custom reader: sync "SOURCE_DATASET" value with custom keyword value


Forum|alt.badge.img

Hi all,

question please regarding "SOURCE_DATASET" value.

My custom reader has its own dataset parameter, SB_DATASET.

I need to sync SB_DATASET with SOURCE_DATASET: SOURCE_DATASET <-> SB_DATASET 

The following way doesn't work:

SOURCE_SETTINGS
...
DEFAULT_VALUE SB_DATASET $(SB_DATASET)
GUI TEXT SB_DATASET Dataset Name:
...
END_SOURCE_SETTINGS
SOURCE_DATASET $(SB_DATASET)

when  IFMEReader::open(const char* datasetName,
                           const IFMEStringArray& parameters) - is called  - the datasetName is "."

The opposite doesn't work as well:

SOURCE_SETTINGS
...
DEFAULT_VALUE SB_DATASET $(SOURCE_DATASET)
GUI TEXT SB_DATASET Dataset Name:
--------OR-------->
DEFAULT_VALUE SB_DATASET $[SourceDataset]
GUI TEXT SB_DATASET Dataset Name:
...
END_SOURCE_SETTINGS
SOURCE_DATASET \"$[SourceDataset]\"

After creating the reader - SB_DATASET has "$[SourceDataset]" or empty value.

Any ideas how to sync these two variables will be very appreciated.

Thanks!

3 replies

trentatsafe
Safer
Forum|alt.badge.img+6
  • Safer
  • September 6, 2017
Hello @egorbaykovnn

 

 

I will take a look at this today, and try to have a response back to you for your workday!

trentatsafe
Safer
Forum|alt.badge.img+6
  • Safer
  • September 7, 2017

 

Hello @egorbaykovnn,

Here is some preliminary information I was able to find: it appears we use a single $(Dataset) parameter to avoid the parsing situation. The GUI label that is associated with that dataset can be different based upon the format. For the SQL Server non-spatial format, the dataset parameter is similar to the database name. An example can be seen in the mssql_connection metafile, located at <FME>\\metafile\\mssql_connection.fmi.

 

 

I apologize if this doesn't really answer your question, I will do some more investigation tomorrow to try and get a concrete method/answer to you. I hope this is enough to get your started.

 


Forum|alt.badge.img
trentatsafe wrote:

 

Hello @egorbaykovnn,

Here is some preliminary information I was able to find: it appears we use a single $(Dataset) parameter to avoid the parsing situation. The GUI label that is associated with that dataset can be different based upon the format. For the SQL Server non-spatial format, the dataset parameter is similar to the database name. An example can be seen in the mssql_connection metafile, located at <FME>\metafile\mssql_connection.fmi.

 

 

I apologize if this doesn't really answer your question, I will do some more investigation tomorrow to try and get a concrete method/answer to you. I hope this is enough to get your started. 

 

@trentatsafe, thanks for this info.

 

yeah - it doesn't help too much.

 

I see you are able to pass connection info to the settings dialog using

 

GUI NAMED_DB_CONNECTION_ENCODED NAMED_CONNECTION FAMILY:Microsoft<space>SQL<space>Server Connection
I'm not sure but this NAMED_DB_CONNECTION_ENCODED  seems to be connection specific UI. I didn't find any info about in metafile help(http://docs.safe.com/fme/html/FME_Metafiles/index.html). Based on other examples - the second parameter requires to be a connection type..just guessing.

 

Anyway it seems this is different then what I need.

 

 

I also tried $(Dataset) - doesn't work for me as well.

 

 

I think I could simplify my task: I need  to display the dataset value from main dialog (like "Generate workspace" dialog) into Parameters dialog.

 

I.e. no needs to edit the dataset on Parameters dialog; just display its actual value could be enough.

 

 

Thanks!

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