Database Reference
In-Depth Information
Filtering Consumption for Messaging
Another practical use of the consumption model is to create a personalized message for users, as displayed in
Figure
7-11
. In this case, a filter allows the “Consumption Console” to narrow down to a very specific group of users
who visited a product that was also tagged with a keyword or phrase each user had explicitly used.
Figure 7-11.
The consumption console
Using
usersWithMatchingTags
found in the ProductService class and shown in Listing 7-43, the application
optionally provides a tag as a string and simply returns the product title and the user and tags that are a match.
Listing 7-43.
The
usersWithMatchingTags
Method in
ProductService
// getProductsHasATagAndUserUsesAMatchingTag
public List<MappedProductUserTag> usersWithMatchingTags(string tag)
{
List<MappedProductUserTag> mappedProductUserTags = null;
if(!String.IsNullOrEmpty(tag)){
mappedProductUserTags = _graphClient.Cypher
.Match("(t:Tag { wordPhrase: {wp} })")
.WithParam("wp", tag)
.Match(" (p:Product)-[:HAS]->(t)<-[:USES]-(u:User) ")