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.

icon

Best answer by jdh 31 May 2016, 16:36

View original

8 replies

Badge +22

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.
Badge +22

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.

Badge +2

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.

Badge +22

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.

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.

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.

Badge +22

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

Badge +2

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

Reply