Going back to our previous example, if we add a filter that checks if there is a 2 in the name:
Then the strategy looks like this:
And the outcome is that only recommendation 2 is shown:
Obviously, this isn’t the best example, because why did you load the recommendation in the first place if you are going to filter it out like this again. The real use case comes from basing the filter on the context for the strategy. Given that Recommendation is just a normal object we can also make extensions to this. I’ve extended the Recommendation object with a Category text field. This field I use to specify for which Case status I want to show the recommendation. The recommendations then could look like this:
Now we are going to look at context data, so for that you need to make sure you’ve linked the strategy to a certain object:
Once you’ve linked a strategy like this to an object and you place the Recommendations component on the Case detail page then you get access to the active case record through the variable $Record. Filtering on the fact that the category needs to match the status of the case will look like this in the Filter definition:
Keep in mind that the filter expression is evaluated per Recommendation on the input branch. For each recommendation it will check if the Status of the Case equals the Category field on the Recommendation, and all Recommendations that apply will continue after the Filter.