Add to Cart Enricher

Overview

The Cart Enricher reacts to these cart events:

  • Added to cart - In the graph database, when a user adds a product to the cart, the enricher draws an edge of type "ADDED_TO_CART" between the session node and the product node. This creates the product node and the session node, if either doesn't exist yet. Each edge of this type has a timestamp property. If, during a session, the customer adds the product to his cart multiple times, then the enricher draws multiple edges between the session and the product node.
  • Modified cart
  • Removed from cart


Events

The Cart Enricher is triggered by cart events, such as added to cart in the Context service:

Triggered by SchemaPayload example
context/commerce/RemovedFromCart
context/commerce/ModifiedCart
context/commerce/AddedToCart

The Cart Enricher draws an edge between the session node and the product node in the Secure Graph service documentation.

Node or Relationproperties
nodes/commerce/Session
nodes/commerce/Product
relations/commerce/Session/commerce/Product/commerce/ADDED_TO_CART
relations/commerce/Session/commerce/Product/commerce/ADDED_TO_CART/count


Metamodel

The following interactive graphic displays the schemas that invoke this enricher and the schemas the enricher can affect in the graph.


Glossary

TermDescription
authorizationThe process of determining whether a given microservice has permission to gain consent.
consentPermission to access (read, write) specific profile data, for example, permission to read/write age estimation or physical address. A consumer and a tenant can grant and revoke consent for subsets of their respective data.
consent classA string alias, defined by developers, that references a set of profile data (also called "schemas") for which consent can be granted and revoked. This string is exposed to users (consumers and tenants) as a reference through which they control consent. For example, the Consent Class "Purchases" might reference a set of data that includes items purchased, purchase dates, and purchase prices. Toggling consent for "Purchase" would enable and disable consent for that entire set of data.
consent referenceA unique, randomized string that serves as a passcode to decrypt data associated with one or more schemas. Various service calls require a consent reference. For example:
  1. A consumer purchases a product.
  2. Data is persisted in the profile graph according to the data"s schema.
  3. This data is encrypted using an encryption key.
  4. A consent reference is generated that associates the encryption key with the data"s schema.
  5. Subsequent submission of this same consent reference allows the schema"s data to be decrypted using the encryption key.
consumerThe end user whose actions yield profile data in the graph. A profile describes a single consumer.
contextData that affects the state of the graph. This data can be collected from consumer-triggered events or from third-party sources such as weather stations.
Context AdapterA microservice that receives data and, optionally, adapts it for entry into the graph. For example, a Context Adapter can adapt address data by adding a ZIP code and normalizing the street labels (for example, changing "St" to "Street"). The Context Adapter then passes the data through the Context service, which caches it so that enrichers can subsequently persist the data in the graph.
context repositoryA temporary cache for adapted context data, before it is further processed by enrichers and persisted in the graph.
context serviceAn internal microservice that manages the insertion of, and the retrieval of, context data in the Context Repository.
encryption keyA unique, randomized string used to encrypt and decrypt specific data in the graph. Each data element is encrypted with a different encryption key. Decryption, using this key, is required to access, view, and alter the data.
enricherA microservice that retrieves data from the Context Repository and/or Graph, possibly alters or extends it, and then persists data in the graph. An enricher can interpret data points, or sets of data points, to yield new data to persist. For example, an enricher can interpret purchasing data and contemporaneous weather station data to yield new data indicating that the consumer is a rainy-day shopper.
graphThe database that stores profile data as nodes, edges, and properties, and allows semantic queries. For example, the graph can represent a consumer"s shoe order as follows:
  • "Identity" node with the properties `Email=name@domain.com` and `Name=Tom`
  • "Order" node with the properties `Category=Shoes` and `Price=$10`
  • Edge called "HAS", pointing from the "Identity" node to the "Order" node
These three data elements together indicate that the specified Identity HAS the specified Order. A semantic query for "Identity nodes with HAS edges pointing to Order nodes" would return the above data set.
identityOne of many independent units of data used to identify a unique profile, such as an email address, browser type, or version.
profileTechnical definition: Data in the graph that is associated with a single consumer and is interdependent (in other words, it can be traversed through node-edge relationships).
Business definition: Data about a single consumer, collected and derived from events that are triggered by, or are logically associated, with that consumer.
schemaA string representation of a path in the graph which represents an abstraction, rather than a concrete instance, of a particular data structure. Schemas are used to define graph read/write permissions for Hybris Profile microservices. A microservice must explicitly register one or more schemas representing the graph structure(s) it intends to access and alter. A schema has one of the following two forms:
tenantA registered entity with a shared commercial goal that subscribes to SAP Hybris Profile services and packages to reach that goal. A tenant can also develop and contribute enrichers and context adapters to the SAP Hybris Profile suite. Within YaaS, a tenant is a project.


  • Send feedback

    If you find any information that is unclear or incorrect, please let us know so that we can improve the Dev Portal content.

  • Get Help

    Use our private help channel. Receive updates over email and contact our specialists directly.

  • hybris Experts

    If you need more information about this topic, visit hybris Experts to post your own question and interact with our community and experts.