Hi,
try connecting a Terminator to the NotMerged output port of the FeatureMerger.
David
First the proclem is Terminator stops the whole process.
And Second, Actually the approach is to terminate the whole process when my interested values does not exists amongst existing attributes but when I do not have any input(existing attribute) I don't want to process the featuremeargure.
Is there any thing that just stop in this step and not terminate the whole process?
Mani
Hi Mani,
Another FeatureMerger could be one possible way.
The FeatureMerger_2 in the screenshot performs unconditional merging (Join On: 1 to 1).
If one or more Supplier feature passes the Tester, all the Requestor features will be output from the Merged port. Otherwise, all the Requestor features will be discarded here (go to NotMerged port).
If you have read the Suppliers first and set "Yes" to the "Supplier First" parameter of the FeatureMerger_2, it may be efficient since the transformer doesn't need to hold Requestor features.
Takashi
An improvement. You can send both Sampled and NotSampled Suppliers to the FeatureMerger instead of branching the data flow after the Tester. I think it's better since FME doesn't need to create copy of every Supplier.
Hi Takashi,
I just prepared some screenshot. Might be helpful:
In this example my input feature (feature attributes) is assigned as Requestor and the values(let's say my interested attribute names) are suppliers.
When I have the requestor everything works perfectly (here one of my interested attributes does not exist in this feature type)
But when I do not have any requestor definitely I have all suppliers as Unrefereneced.
In this situation I want to stop featuremerger or something similar because actually there is no need for it.
I also changed the place of requestor and suppliers (as explained before) and in this case you suggest me to add another featuremerger. I did not get how this thing will help me. Because In either case I am interested in either not merged or Unreferenced so do you think It still works?
Note that at the end I need to attach a terminator either to the notmerged or unreferenced(dependent on which one is supplier). Because it is an error in my resource file when such an attribute does not exist.
Thank you!
Mani
It seems that the situation cannot be determined before completion of the FeatureMerger process. The FeatureMerger cannot be stopped based on its own processing result, I think.
If you need to determine whether some processes following the FeatureMerger should be executed or not according to the result (e.g. whether there are one or more Referenced features), there could be a way.
I've read again your post. Perhaps the requirement is "if there is no Requestor (the second situation), the FeatureMerger should not output Unreferenced suppliers"?
If so, the way I mentioned first might be available reversing Requestor and Supplier.
Thank you Takashi.
I am not sure if I got your solution correctly but I think It works as far as I am interested in the match one.
In my case, I am only interested in those which are not matched(the values which are not given as the attribute for my input feature). Then I do not know how your approach can be applied correctly!!!
Why do you not simply compare the two lists of attributes before u send them to the FeatureMerger??
You could add a common attribute to both the lists, explode them both and then have them go to a listbuilder grouped by this common attribute (both exploded lists with the common attribute go into 1 listbuilder).
Then do a Histogram. Any attribute missing wil have a histogram count of 1.
Hi Gio,
What is the difference between your approach and featuremerger? and the problem is not if I can find the missing one... The problem is if I do not have any existing attribute I do not want to compare. So in the case I do not have one of the list coming to the listbuilder then It is obvious the output all have count=1 and this is my problem. I wanna avoid such a case.
So if the two list have nothing in common you wish not to execute any proces, but bypass them
To know if they have nothing in common, you must compare them somehow, do you not have to? Wether it be listbuilding or FeatureMerging. This seems pretty logical to me.
I just tought you wanted to avoid the merger, but now i understand you want to avoid procestime. You can't, you must compare....
If it is about an empty featureclass. literarily, it would be more easy. Or maybe if you had excluding attributes.....like if list a has only "apples" then it is no use to compare them to "pears"...;) Still you will have to check wether they are apples or pears...lol.
The FeatureMerger_2 in my approach works like a "railroad switch".
If there is a Supplier feature (just one is enough), all the Requestor features will be output from the Merged port. Because the Supplier will be merged unconditionally to every Requestor feature.
On the other hand, if there is no Supplier feature, all the Requestor features will be output from the NotMerged port. Result, the main FeatureMerger does nothing. i.e. any feature will not be output from any port.
If a Supplier exists, it will be merged to every Requestor feature by the FeatureMerger_2, but the merging itself is not the purpose in this case. The intention is to switch destination port (Merged or NotMerged) for Requestors; the main FeatureMerger does nothing if all the Requestors go to the NotMerged port of the FeatureMerger_2. That's the purpose.
Cannot it be applied to your workflow?
Thank you againTakashi for your explanation.
I have one question. In the case that I have both requestor and supplier. and there is for example one value which is not merged (in my case it is an error in the source file and I need to terminate the whole process because of that) how can I have it in the main feature merger?
Thank you Gio for your comments. The thing is I cannot compare (Well I can but this is exactly my problem). When I applied your approach (thank you at least I've learnt to work with histogram and so..) I had the same problem as I had with feature merger. The thing is I wanna see if for example "X" and "Y" exists as attributes or not. If I have even one attribute from the feature type then It is easy I can check it with featuremerger and say Ok I do not have e.g. X then terminate the rest of process. But when I do not have attributes at all (this is the output of a tester.... that is why I do not have attributes) just skip it because if I compare them then it is clear that I have X and Y not in the attributes and it terminates the process wrongly.
I do not have any control to know if I have attribute or not and It should work like a template for the user later to put whatever file(same format) as reader and check it.
BTW, because I was new to what you suggested me, I might misunderstand you.
Thank you again for your tips.
Well Thank you guys.
I was really stupid. because instead of creator I could simply attach the parameterfeature to my tester(from the image it can be also attributesplitter) and when I do not have anything the process will be stopped.
sorry for wasting your time but thank you Gio and Takashi I've learnt from you :)
Mani