Skip to main content
Solved

Writing all records to two different formats depending on a Test


jeroen_hack
Contributor
Forum|alt.badge.img+7

Hello fellow FME enthousiasts,

I have a case which i can't seem to find a solution for.

We have a process that adds a score to incoming records based on certifications added as hyperlinks in a table.

During several steps these certifications have to be manually checked by an employee. Finally when everything has been approved the records are written to a central database (this can only be done when all the records have been approved, so the whole dataset has to be kept together during the whole process). 

Right now i have the process setup to output all data to an Excel table (with a template to make it readable for the employee). Here the employee can select if a certification is approved or not. This Excel table is then put back into the next process untill all necessary checks have been done.

Each time a proces is run i would like to check at the end if all records are approved or not. Depending on the outcome two things can happen

  • If ANY are not approved, ALL records needs to be output to the Excel table.
  • If ALL records are approved, they can ALL be written to the database

I can check with a Tester if any records are not approved, but how do i build in that all records are either written to the Excel or Database depending on the outcome?

Any help would be much appreciated!

Cheers!

Best answer by nielsgerrits

How I do this:

  • Fork the stream with features.
  • Do the test in the second stream.
  • Sampler, 1st featre.
  • Keeper, no attributes.
  • FeatureMerger, 1=1. First stream are requestors, second stream suppliers.

So, if any of the records validate the test, all features will be output from the merged output port and should be returned to excel. If no records validate the test, all features will be output from the not merged port and can be processed.

 

View original
Did this help you find an answer to your question?

3 replies

nielsgerrits
VIP
Forum|alt.badge.img+54
  • Best Answer
  • March 29, 2024

How I do this:

  • Fork the stream with features.
  • Do the test in the second stream.
  • Sampler, 1st featre.
  • Keeper, no attributes.
  • FeatureMerger, 1=1. First stream are requestors, second stream suppliers.

So, if any of the records validate the test, all features will be output from the merged output port and should be returned to excel. If no records validate the test, all features will be output from the not merged port and can be processed.

 


jeroen_hack
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • March 29, 2024

Thank you @nielsgerrits. This is exactly what i was looking for!


nielsgerrits
VIP
Forum|alt.badge.img+54
jeroen_hack wrote:

Thank you @nielsgerrits. This is exactly what i was looking for!

Cheers :)


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