Skip to main content
Solved

Stop workflow if no input from 1 out of 2 transformers

  • June 13, 2024
  • 5 replies
  • 213 views

heidi_k
Contributor
Forum|alt.badge.img+1

Hi

I have 2 transformers (A and B) they have to provide a Sorter with inputs.
If there isn’t any output from A, then this workflow C has to stop, but not the entire workspace.  
If there is output from both A and B, it has to continue.
If there is only output from A and not B, it has to contiunue. 

Is it possible? 

 

 

Best answer by virtualcitymatt

My favorite to use the the FeatureFlowValve custom transformer. Inside it’s essentially just a FeatureMerger with 1==1 but I like it because I can choose whether it opens or closes what does through the Input

 

A+B == A+B

In this case A is the ValueControl and features will only go through in the case there is a feature coming out of ‘A’

 

No A = No C
A but no B = A but no B

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

jkr_wrk
Influencer
Forum|alt.badge.img+35
  • June 13, 2024

This is a double solution:

For a single solution like in your case you can stop after the FeatureMerger_3 in this example.

The Sampler is set to N=1. The Keeper to nothing and the FeatureMerger is set to merge on Requestor=1 Supplier=1.


andrewj74
Supporter
Forum|alt.badge.img+7
  • Supporter
  • June 13, 2024

How about this? put a 1 in both the key fields for the attribute merger. depending on the schema you may need to remove extra attributes from the merge fields so it only matches the requestors schema.

 

 


virtualcitymatt
Celebrity
Forum|alt.badge.img+47

My favorite to use the the FeatureFlowValve custom transformer. Inside it’s essentially just a FeatureMerger with 1==1 but I like it because I can choose whether it opens or closes what does through the Input

 

A+B == A+B

In this case A is the ValueControl and features will only go through in the case there is a feature coming out of ‘A’

 

No A = No C
A but no B = A but no B

 


heidi_k
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • June 18, 2024

Thank you very much for all the answers. The last one, where “FeatureFlowValve” was used, is perfect for the purpose. However, the other methods also worked :)


mark2atsafe
Safer
Forum|alt.badge.img+59

I thought it was time that we had a better solution for this type of scenario, so I created the DataLogicController transformer and uploaded it to the FME Hub.

I added a description to the latest What’s Up Wednesday newsletter.

Basically, for this scenario, the setup would look like this:

 

The logic to use is called “Projection”. It’s also capable of doing AND (must have both A and B data), OR (only needs one set of data), and a host of other logical operations.

I hope you find this interesting (even if you have a solution already).

Mark