Skip to main content
Solved

How to validate Microstation file version


Is there a way to validate the file version aside from parsing the log file?

I am trying to validate if the file passed to the reader is the right version. If I pass to the reader a Microstation v7, but it expects v8 the job will fail with a message being written to the log file.

Best answer by jdh

I'm not familiar with the differences between microstation 7 and 8, but if you're using a reader then any validation would have to happen in a startup script.

 

 

I would suggest instead that you use a Creator connected to a pair of FeatureReaders (one for V7, one for V8) the correct version will output data, the incorrect version should send the trigger feature out the Rejected port.
View original
Did this help you find an answer to your question?

8 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • May 31, 2016

I'm not familiar with the differences between microstation 7 and 8, but if you're using a reader then any validation would have to happen in a startup script.

 

 

I would suggest instead that you use a Creator connected to a pair of FeatureReaders (one for V7, one for V8) the correct version will output data, the incorrect version should send the trigger feature out the Rejected port.

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • May 31, 2016
jdh wrote:

I'm not familiar with the differences between microstation 7 and 8, but if you're using a reader then any validation would have to happen in a startup script.

 

 

I would suggest instead that you use a Creator connected to a pair of FeatureReaders (one for V7, one for V8) the correct version will output data, the incorrect version should send the trigger feature out the Rejected port.

If you only want a specific version, just use the one feature reader, and you can do what you want to the rejected feature, rather than just have the workspace fail on read.


roland.martin
Forum|alt.badge.img+9

I've faced this problem before. I did pretty much what @jdh suggested above, except I was finding Workbench would bail completely rather than sending things to the Rejected port. This may no longer be true, so I'd try that first.

If you hit problems with that, what I would try now would be this:

  • Set up a workspace with two parameters: filename, and a choice between V7 and V8. Root a Creator into a Tester which splits the V7 and V8 into two different FeatureReaders, and add whatever workflow makes you happy after that
  • Run that workspace from a second Workbench using a WorkspaceRunner. If a feature fails the V8 version, try it with V7 instead

Also, there seem to be some cases when V8 files can be read by the V7 reader and/or vice-versa, which may (or may not) cause problems. Give some thought to whether you want to try a file as V7 or V8 first.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • May 31, 2016
roland.martin wrote:

I've faced this problem before. I did pretty much what @jdh suggested above, except I was finding Workbench would bail completely rather than sending things to the Rejected port. This may no longer be true, so I'd try that first.

If you hit problems with that, what I would try now would be this:

  • Set up a workspace with two parameters: filename, and a choice between V7 and V8. Root a Creator into a Tester which splits the V7 and V8 into two different FeatureReaders, and add whatever workflow makes you happy after that
  • Run that workspace from a second Workbench using a WorkspaceRunner. If a feature fails the V8 version, try it with V7 instead

Also, there seem to be some cases when V8 files can be read by the V7 reader and/or vice-versa, which may (or may not) cause problems. Give some thought to whether you want to try a file as V7 or V8 first.

According to the docs:

 

<Rejected> Upon reader error, outputs the original Initiator feature with the addition of the _reader_error attribute which contains the last error message from the reader.

jdh wrote:

I'm not familiar with the differences between microstation 7 and 8, but if you're using a reader then any validation would have to happen in a startup script.

 

 

I would suggest instead that you use a Creator connected to a pair of FeatureReaders (one for V7, one for V8) the correct version will output data, the incorrect version should send the trigger feature out the Rejected port.

Thanks. I failed to mention that I am trying to do this in FME 2014 and the FeatureReader has no rejected port. This works in 2016, but our server is still 2014.


roland.martin wrote:

I've faced this problem before. I did pretty much what @jdh suggested above, except I was finding Workbench would bail completely rather than sending things to the Rejected port. This may no longer be true, so I'd try that first.

If you hit problems with that, what I would try now would be this:

  • Set up a workspace with two parameters: filename, and a choice between V7 and V8. Root a Creator into a Tester which splits the V7 and V8 into two different FeatureReaders, and add whatever workflow makes you happy after that
  • Run that workspace from a second Workbench using a WorkspaceRunner. If a feature fails the V8 version, try it with V7 instead

Also, there seem to be some cases when V8 files can be read by the V7 reader and/or vice-versa, which may (or may not) cause problems. Give some thought to whether you want to try a file as V7 or V8 first.

Thanks for the details. Seems like the feature reader is different in 2014.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • May 31, 2016
maliiconstantin wrote:

Thanks. I failed to mention that I am trying to do this in FME 2014 and the FeatureReader has no rejected port. This works in 2016, but our server is still 2014.

In that case go with @rollo's suggestion of a workspaceRunner/fmeServerJobSubmitter


roland.martin
Forum|alt.badge.img+9
maliiconstantin wrote:

Thanks for the details. Seems like the feature reader is different in 2014.

Aha, in that case, definitely use multiple workbenches.

If you're having trouble with the FeatureReader, another approach to try would be:

  • Set up a V7 workbench and a separate V8 workbench
  • Set up a third workbench which uses the WorkbenchRunner to call the V8 one. If that succeeds, carry on. If it fails, call the V7 one

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