Skip to main content
Solved

Filter original records after business rules are run on these records

  • February 2, 2018
  • 3 replies
  • 14 views

lottegis
Forum|alt.badge.img+1

I have a bunch records that I'm aggregating. After this, I'm applying business rules and based on what's outputted, I'll know which of the original records I want to parse differently (i.e. not through aggregation, business rules set #2). I want to go back to the beginning of the workspace to allow these specific records to pass through in its original format. How do I do that?

I'm thinking of aggregating the unique ids of the records I want, and use this value to test against the original records, like: ID in @Value(aggr_ids_to_keep), but then the record that has the aggr_ids_to_keep attribute will be its own record.

Here's another way to look at what I mean. The recordset would be like {0:n,m} where 0:n are the original records and m is the one with aggr_ids_to_keep. In this scenario, how do I get m to compare against 0:n?

Best answer by takashi

Hi @lottegis, if the requirement is to get records that don't match the business rules, a possible way is to merge the records that matched the business rules to the original records, with a FeatureMerger.

Send all the original records to the Requestor port, send the records that matched the business rules to the Supplier port, set ID to the Join On parameter for both Requestor and Supplier, and run. The records that don't match the business rules will be output via the UnmergedRequestor port.

Assuming that the original records have unique ID and also it will be preserved after applying the business rules.

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.

3 replies

takashi
Celebrity
  • Best Answer
  • February 4, 2018

Hi @lottegis, if the requirement is to get records that don't match the business rules, a possible way is to merge the records that matched the business rules to the original records, with a FeatureMerger.

Send all the original records to the Requestor port, send the records that matched the business rules to the Supplier port, set ID to the Join On parameter for both Requestor and Supplier, and run. The records that don't match the business rules will be output via the UnmergedRequestor port.

Assuming that the original records have unique ID and also it will be preserved after applying the business rules.


takashi
Celebrity
  • February 4, 2018

Hi @lottegis, if the requirement is to get records that don't match the business rules, a possible way is to merge the records that matched the business rules to the original records, with a FeatureMerger.

Send all the original records to the Requestor port, send the records that matched the business rules to the Supplier port, set ID to the Join On parameter for both Requestor and Supplier, and run. The records that don't match the business rules will be output via the UnmergedRequestor port.

Assuming that the original records have unique ID and also it will be preserved after applying the business rules.

Alternatively, if you have already created a single feature containing 'aggr_ids_to_keep' that stores comma-separated IDs, you can merge it to all the original records unconditionally with a FeatureMerger (set the same constant value e.g. 1 to the Join On) and then filter the resulting records with a Tester (using the In operator).

 

 


lottegis
Forum|alt.badge.img+1
  • Author
  • February 5, 2018

Hi @lottegis, if the requirement is to get records that don't match the business rules, a possible way is to merge the records that matched the business rules to the original records, with a FeatureMerger.

Send all the original records to the Requestor port, send the records that matched the business rules to the Supplier port, set ID to the Join On parameter for both Requestor and Supplier, and run. The records that don't match the business rules will be output via the UnmergedRequestor port.

Assuming that the original records have unique ID and also it will be preserved after applying the business rules.

Using FeatureMerger to join on ID worked! Thank you.