C4H341_EN_Col24
C4H341_EN_Col24
Some Necessities
= Participant List
= Course Material
© SAP SE C4H341
We will learn about:
Training Overview
Vv
Training Overview
2 C4H341 © SAP SE
Personal Introduction
Spring/JEE
Role . .
Project experience
Company
Previous SAP
Commerce
Hobbies experience
Training Content
= Instructor-led exercises
— give you the opportunity to complete the creation of a store with basic functionality
— the instructor can answer your questions and assist you with the lab exercises
= It will not cover the following topics:
— Customer-specific problems
— System Administration
° for that, we offer the live session series: SAP Commerce Cloud — System Administrator
— Dynatrace / APM for SAP Commerce Cloud
* for that, we offer the live session: Monitoring Commerce Cloud with Dynatrace
© SAP SE C4H341
Instructor-Led Hands-On
4 C4H341 © SAP SE
Working Hours — Day 1
9:00 Overview
Exercise — Setup
Day1 Backoffice
Exercise — Backoffice
12:30
Lunch
13:30
. Validation
Exercise — Validation
17:00 Personalization
9:00
Exercise — Personalization
Day 2
. Search & Navigation
12:30
Lunch
13:30
Exercise — Search & Navigation
© SAP SE C4H341
Working Hours — Day 3
Lunch
13:30
10. Event System
C4H341 © SAP SE
The SAP Commerce Cloud - Platform
=» An extension:
— Is the packaging mechanism for a Commerce feature
— Contains business logic, type definitions, RESTful web service customization, etc.
Architecture Overview
Client TT Back Office a
cohen MINKE
composable
RESTful
WebSvc
F
Adaptive Search
,
Order fulfillment
SmartEdit SAP BTP
storefront Product etc... Integration Suite
APIs
SAP BTP
Ext.
Kyma Runtime
Infrastructure Services (Authentication, User, i18n, ...) Core Platform Intelligent Selling
ee Apache
Server
App
Tomcat
© SAP SE C4H341 7
Architecture Review — SAP Commerce Cloud Service Layer
. 5 Web
= The Commerce architectural layer Web Shop | | Backotfice | | services
where you implement your logic g g g
. . Presentation
= Provides a number of services, MVC Model-View-Controller Oat
ata
each with well-defined Objects
responsibilities
|
Commerce ServiceLayer
= Service-oriented architecture
ModelSve, FlexibleSearchSvc,
Cache, Interceptors, Events
Business Services
based on the Spring framework Services, Strategies
Infrastructure Services
= Provides hooks into model life- EmailService, CronjobService, ValidationService, etc
Database
INTERNAL SAP ane Partners Only 15
Extensions Review
8 C4H341 © SAP SE
Data Modeling Review
Tenants Configuration System Logging Extensions [nitialialtion’ Update SQL Scripts License Support PK Analyzer Classpath Analyzer
Ny
System Initialization:
= Entire type system is created from scratch.
= ALL database tables are dropped, both SAP Commerce Cloud data and type data
= Type Data is created from scratch as defined in the items. xm1 files.
= New tables with initial dataset are created
System Update:
= Existing tables are updated to match changes in the domain model.
= No loss of data!
= Two major aspects:
— Adding newly defined types to the type system definition in the database
— Modifying type system definition in the database to match the definition in the domain model
© SAP SE C4H341 9
Essential Data vs. Project Data
Essential Data
~ mobdileservices
~ oms2
How to include:
= Hook Service Layer code into Commerce initialization and update life-cycle events using the
@SystemSetup annotation
10 C4H341 © SAP SE
Further Suggestions for Discussion
Flexible Search
ImpEx
Facades
Composable Storefront
WCMS
Cloud Portal
Security management
© SAP SE C4H341 11
What you have done in Part |
: Our starting point: the OOTB commerce shop with composable storefront
« You should see a electronics shop where you can browse and search for electronics products
« You have extended the shop regarding different aspects (cf. next slides)
Product User
T (ebooks), *
EBook
edition: Integer[@..1]
ISBN1@ : String[@..1] (authors), *
ISBN13 : String[@..1] - EBook2AuthorRelation
language : String[@..1]
publication : String[@..1]
publishedDate : Date[@..1]
publisher : String[@..1]
12 C4H341 © SAP SE
Classification System
Electronics onan Electronics
Classification s
mal Catalogue
Product
Catalog
Data
Storage
Advanced
Audio Hand-held
Camcorders
classifies
L L \ Camcorders_Red
E ya Camcorders_Blue
Gore ee SP
de BoPro HERO — 2018_blue
:
i GoPro HERO — 2018_red
Data Access
© SAP SE C4H341 13
Miscellaneous:
« Wrote ImpEx
« Configured security —_
Exercise How-To
14 C4H341 © SAP SE
General Information
D Documents | build-tools
< > @ Home = c4h341_2211 ~
© Recent N dd Music s
= : | hybris-sbg
W® Starred Exercises G Pictures
wm Videos installer
2 Home ~ | Handouts
« For each exercise, we have provided an XML ant script. You can either:
— run it from command line
— drag the ant file to the ant view in your IDE
« Each ant file includes a solution target you can use if you can’t finish the exercise
© SAP SE C4H341
Training Lab Tools
y me TrainingLabTools (C4H134% iIt23updste)
> BB JRE System Library [JRE [7 05)) DON’T change the content of any file inside the
——< TrainingLabTools folder
> Giyexercise_Addon
> Gyexercise_Backottice
[Stmwe — s Contains every file and data you'll
-faaltaeir aera = need to complete the exercises
JaultMultiCurreneyPricing java
(Gj MockCurrencyRateProvider.java
MutticurrencyPricing java
(1) projectdata-cronjobs.impex
% trainingcronjobs~spring.xm!
UpdateCurrencyPricesJob.java
Contains the files needed by setup ant target to
prepare the environment for this exercise
sp config.json
() CurrencyRateProvider.java
(Gj DefaultMultiCurrencyPricing
java
Ui[Gj eceisrerey
MutticurreneyPricing teenies
java Contains
ontains the the filTlles used d byby th the solution
luti ant tt target tt to complete
lete th the
1 elects crete impex exercise. You can compare your solution with them
/, trainingcronjobs-spring.xmi
A. Updat neyPricesJob java
> Gyexercise_Exampie
> Gyexercise_occe
> @yexercise_Orders Contains the ant target definitions
> Gyexercise_Personalization
> Gyexercise_PromotionsAndCoupons
> @yexercise_SearchAndNavigation
Gy exercise_Validation Properties (such as the location of the platform on the file system) |
> Qyexercise_Worktiows
~ Glib
pero USF 32
: Verification scripts are loaded by setup ant task (© hybris administration console
16 C4H341 © SAP SE
What’s next...
In part 2 we'll focus on the store and user experience. You will:
Setup Exercise
— ©
J
—
i.
© SAP SE C4H341 17
SAP Customer Experience
Thank you.
©2023 SAP SE or an SAP affiliate company. All rights reserved. Soe Legal Notice on wa". sap comilegal-notice for use terms, disclaimers, disclosures, of restrictions relate’ to SAP Materials for genoral audiences
Backoffice
18 C4H341 © SAP SE
What we will cover in this topic
Pr Search Framework
WCMS Facade Cronjobs
en P Installation
Validation Security Gonteurnttan
occ Service Process
Engine
2
Event Cache Update and
. System Initialization
occ Workflows
| Scripting
> Overview
© SAP SE C4H341 19
The Context
= Tool for technical business users, " Cockpits available: Single, easy to use and role based
developers and administrators interface for all business and
— Product Cockpit — Product & administrative users
" Highly generic, component-based category administration
Highly extensible and configurable via
" Database-oriented view — WCMS Cockpit —- Web XML
administration
" Easy to configure and customize Application mashup can be designed
— Customer Service Cockpit — at runtime
using XML configuration
Call center activities
" Manage Product, Order, Customer Cockpits/Perspectives available:
— Import Cockpit - Manage data
data and business processes imports - Backoffice Administration Cockpit
" Manage users and access rights — Report Cockpit — Access to - Backoffice Adaptive Search Cockpit
operational reports
— Backoffice Customer Service Cockpit
— Admin Cockpit — Manage
validations & B2B data - Backoffice Data Hub Cockpit
20 C4H341 © SAP SE
Overview
© SAP SE C4H341 21
Key Concepts of Backoffice
=" By combining and connecting widgets, a backoffice business process can be quickly designed
and put together.
= The mashup can also be designed at runtime using the Application Orchestrator interface and
XML configuration.
= Users will only see the set of widgets made available to their user roles. For example, OMS
widgets are only visible to fulfilment users.
Products a mM &
Cunlogs seas 5000 + EFS 38-55 IS ago Eiectrorics Product Catalog : Onin
~~ s203775 ALP IOAN ava hectronics Product Catalog : Oniine
Catalog versions
2 (th > 542 ters
Categoring
Prides EasyShare M531 [5864583] - Electronics Product Catalog : Online a
Kerwords
Essential a
Saved queries v
wea wees hr © conta ver? ree
‘5864583 ‘EasyShare M631, Blectronics Product Catalog : Online check
22 C4H341 © SAP SE
Backoffice Framework Extensions
= backoffice extension:
— Backoffice framework and Administration Cockpit with standard widgets
— Single web application which is a container for all Backoffice modules
— Contains the Application Orchestrator (F4) to design your custom mashup
— Accessible by default at https: //localhost:9002/backoffice
Application Orchestrator
© SAP SE C4H341 23
Application Orchestrator — key features
Main view
The main widget view is a place where you should add widgets and design a mash-up of your
application. Here you can see two types of components: widgets and slots/children.
Oumar level
Salact Authorty Gecup . ° ——«> Symbolic witgets Wager Cipdoars =
pespectves) +
edminarea name name
{Mews} + perspectives}, +
24 C4H341 © SAP SE
Symbolic widgets view
The symbolic widgets view helps to get an overview of your application’s mash-up. It shows
widget dependencies and how connections are established. You can also add widgets here.
‘Select Aumorty Group » © [Y) sympmcwages [Y) snow stotias [7] stow conrections i=
{7 Show tabets [| Show input connections
=
Aackotfice Main Layout cocipiewicgesChidrerirnisibie pander
eats
compfrWiogerChicrertrnisiole detiViewContent
© SAP SE C4H341 25
Custom Backoffice Extensions
= Acustom backoffice extension can contribute to the whole and unique Backoffice web app with
new modules (areas), widgets and/or UI configuration
= Create a new backoffice extension:
— Create the extension with ant
ant extgen
ant all
— trainingbackoffice/resources/trainingbackoffice- ; areos
backoffice-config.xml: Configuration of custom context > Boclasses
components. It can be reloaded at runtime by doing a
reset in the Application Orchestrator. > Eebackottics
> Boockpitng
— trainingbackoffice/resources/ trainingbackoffice- > Blocalization
backoffice-widgets.xml: Configuration of custom widget 5 Mee
a omneemarnnnn
components and their connections. It can also be [S| beans.xsd
reloaded at runtime by doing a reset. ners.
rainins
\X) trainingbackoffice-backoffice-config.xml
— trainingbackoffice/resources/ trainingbackoffice- 2) trainingbackoffice-backoffice-spring.xml
backoffice-spring.xml: Contribution to the Widget 2) traininabackoffice-backoffice-widgets.xml
26 C4H341 © SAP SE
Backoffice Configuration
© SAP SE C4H341 27
UI Configuration
= SARA Administration Cockpit ~ a
Bl js Golar vari <context type="ELectronicsColorvaritantProduct " =
Fate ree (at Oo ropa) lectronics Color Variant component="advanced-search"> [#] &
[2] Secale * Electronics Color Variant Q = Globaloperstor: and =» [7] ncwae suneypes. i=
© __rternationatization > Product variants type Enaale ~ aw x
“J _ Rule Engine 2 fo 6] 1978440_green DSC-H20 Green ave Blacionick Product Cutalog <-Ontima |
Propertios Attributes Gategory System Prices Multimedim Variants Extended Attributes Reviews Stock Administration
<context Essential a
component=
n n Article Nurmiber* Idencifier 9] Catalog version® Approval*
explorer-tree">
1978440_green DSC-H20 Green
<context type=”ElectronicsColorVariantProduct "
component="editor-area"> =
Internationalization >
Explorer Tree Configuration: ©
Marketing >
<n:type-node id="ElectronicsColorVariantProduct"
: : Deeplink Uris >
code="ElectronicsColorVariantProduct" /> 2 7
my :
25 Personalization >
INTERNAL SAP and Partnors Only 22
28 C4H341 © SAP SE
UI Configuration * Advanced Search (for Product)
<context type="Product" Component="advanced=search"” merge-by="type" parent="GenericItem">
<as:advanced-search>
<as:field-list>
<as:field name="EuropelPriceFactory_PDG"/>
<as:field name="EuropelPriceFactory_PPG"/>
<as:field name="EuropelPriceFactory_PTG"/>
<as:field name="approvalStatus"/>
<eac'field name="articleStatuc" />
Products
a
Article Number Contains ~ .
Identifier Contains
A » en -
ass
Alternative 1D ’ Equals a
© SAP SE C4H341 29
Create New Product x
</wziprepare>
<wz:step id="step1" label="create.product.essential. label"
sublabel="create.product.essential.sublabel">
<wz:content id="step1.content">
<wz:property-list root="newProduct”>
<wz:property qualifie "code" type="java.lang.String"/>
<wz:property qualifie approvalStatus"/>
<wz:property qualifie "catalogVersion"/>
</wzistep>
<wz:step id="step2" label="create.product.descriptions.label"
INTERNAL SAP and Parners Only sublabel="create.product.descriptions.sublabel"> 25
& @ csc
Properties Attributes Category System Prices Multimedia Stock
Essential
30 C4H341 © SAP SE
UI Configuration ¢ Editor Area (for Product)
G6 8 2 t 4 Refresh
Essential a
? Okay, then how do we persist the dynamic configuration we created in the Orchestrator?
OQ The recommended approach is to use the Orchestrator to design the widget mashup, then copy
the generated configuration (from “Show widgets.xml") to your custom extension to persist it.
© SAP SE C4H341 31
Useful Reading
« https://training.sap.com/course/c4h365
Key Points
1. Backoffice is the major UI for SAP Commerce Cloud to manage any data.
3. You can extend Backoffice by creating a custom Backoffice extension with the ybackoffice
template.
4. You can visually configure Backoffice UI widgets using the Application Orchestrator
5. Don’t forget to save your UI context configuration and widget configuration to your local
backoffice-config.xml and backoffice-widgets.xml, respectively, to persist your changes.
32 C4H341 © SAP SE
Backoffice Exercise
Thank you.
© SAP SE C4H341 33
SAP Customer Experience
Validation Framework
ee REE ere
nin
f— General Services. § ———
Ea a [ow |
34 C4H341 © SAP SE
We will learn about:
The Context
© SAP SE C4H341 35
Overview
= SAP Commerce provides a Data Validation Framework based on the JSR 303 Java validation
specification
= You can provide user-friendly and meaningful notifications when allowing users to provide or re-
enter valid input
sans
4
36 C4H341 © SAP SE
Overview (continued)
= Constraints can be defined in Java code, XML, the Backoffice, or imported with ImpEx
— The Validation Service is a service in the ServiceLayer which defines constraints and
performs data validation
— The Backoffice allows you to create and manage constraints
— Feedback integration provides validation feedback to the user
ac io s staan Renew
EE 62037 1.728.460
82s coedbAsICHA
ae a cl pinot YO im 4
easeprermumeengncembors or ete easeprereneae Neenresewerzo.@
hier com /
Deumasenayeumussicorss oA, en ve ee Cae eee NCO #
cornea | ro eo propniies /
tecinsoanen ot mes Atay i
revcenamcernare | rele reper ume . ?
Saved guecnn v Eevconscorreconeruréartvwretbartgeentcn forte EveceCertgnatecoradel I fesmomergoun]
nego econo mecatactn ow eke seecuhopenytuingenenne 4
f ‘Ste Preteences© \
1I + Creat Ste Preferences - \\
| . . }
\ Validation Framework /
AN NY =
Validation Engine
4 “
7
_— Peat
~ ~ a “—
se ValidationService ae
© SAP SE C4H341 37
Validation Service
Key Features
= All direct or indirect modelService. save calls are intercepted, aborting save operations where
necessary, in e.g.:
Load
Database
(Constraints) — ValidationService
onstraints
38 C4H341 © SAP SE
Architecture
Example
Validati roups
interface ValidationService {
void reloadValidationEngined);
<T> Set<HybrisConstraintViolation> validate(T object, Collection<ConstraintGroupModel> g);
}
Example Client (for explicit validation) usage:
© SAP SE C4H341 39
Validation Engine
= New constraint types may be created via new type definitions (in *-items.xml),
recompilation and a system update.
Constraints
Java annotation:
NotNullConstraint
public class User {
@NotNull
OQ JSR-303 was intended for in-code annotations, i.e. . . .
not suitable for annotating model classes, since they private String firstname;
are automatically generated. }
40 C4H341 © SAP SE
OOTB Constraints
The Data Validation framework provides implementations of all constraint types defined in the JSR 303
specification, and a few additional ones:
AttributeConstraint
* PatternConstraint, RegExpConstraint
* PastConstraint, FutureConstraint Customizing new constraint type
is covered in “SAP Commerce
* DecimalMinConstraint, DecimalMaxConstraint
Cloud - Additional Technical
*MinConstraint, MaxConstraint Essentials”
* SizeConstraint (for String, Collection, Map, and Array) |
* DigitsConstraint (for integers)
* AssertTrueConstraint, AssertFalseConstraint
*NullConstraint, NotNullConstraint
* NotBlankConstraint, NotEmptyConstraint
Tt + Refresh sve
Constraint types
You have 3 Validation Messages X
= Severity
_ . . . aA ow SNES MI GaRRREBE
Each constraint can be assigned an Error / Warning / Info “hp
severity level blank.
— Error constraints cause a save operation to be aborted re
— Users may choose to ignore Warning constraints and save iS gl la al
anyway 1
A Site
The site of the customer is no
t supposed to be null
= Groups isi
~The engine can be told which constraint group(s) to use for Is used in the following constraint groups
validation
Constraint groups @
© SAP SE C4H341 4
Validation in the Backoffice
Gruen Constraints
SB saem .
Vatication v Sev... IT En. It Needs Reload... Class
To Validate
Chesaih gitias Waming tmue — false CategoryModel
hy Error tue ConsumadCertificataCredentialModel
I Constraints ] v
Error tue false CustomThemeModet
PO.p Only Constraints
Error tue false ‘CustomerModet
Error tue false CustomerModet
tue false CustomerModet
tue —talse CxSegmentModet
false ConsumedDestinationModel
false ProductModel
EmployeeModet
No queries ‘onfigurationModet
. . v . . . .
List constraints
INTERNAL SAP and Parners Only
Create new constraints Reload the validation engine
42 C4H341 © SAP SE
Features
Feedback Integration
© SAP SE C4H341 43
Feedback Integration
Steve Reviewer [keenreviewer4 @hybris.com]
oA Tt + Refresh [save ]
Sed
General Addresses Password Payments Orders Reviews Prices You have 3 Validation Messages
Aa oo
Essential The attribute "ID" cannot be
blank.
Name ae B customerio Origin,
A Name
7'382d96a-1057-4903-95 12-feedObaaci02 keen! beTies blank
aioe Fuse” canetct
LR a a ‘im
‘The site of the customer is no
[email protected] t supposed to be null
Close
Properties a
Key Points
1. SAP Commerce Cloud provides a Data Validation Framework based on the JSR 303 Jav: a
validation specification
2. The data validation framework includes the ValidationService, Backoffice integration, and
Feedback integration.
44 C4H341 © SAP SE
References
= https://icp.org/aboutJava/communityprocess/final/jsr303/index.html
= “SAP Commerce Cloud - Additional Technical Essentials” Live Sessions in SAP Learning Hub
= https://blogs.sap.com/2021/07/22/introduction-to-the-live-session-series-sap-commerce-cloud-
additional-technical-essentials/
Validation Exercise
© SAP SE C4H341 45
SAP Customer Experience
Thank you.
©2023 SAP SE or an SAP affiliate company. All rights reserved. Soe Legal Notice on wa". sap comilegal-notice for use terms, disclaimers, disclosures, of restrictions relate’ to SAP Materials for genoral audiences
Personalization
46 C4H341 © SAP SE
What we will cover in this topic
qt Methodology
Pr Search Framework
WCMS Facade Cronjobs
en P Installation
Validation Security Confi ti
occ Service Riles
Engine
—
Event Cache Update and
. System Initialization
Backoffice occ Workflows
Scripting
© SAP SE C4H341 47
The Context
Preparation
-!
O5EOO O
(The setup ant target will compile your system during the
lecture)
48 C4H341 © SAP SE
Personalization Overview
© SAP SE C4H341 49
Solution: Personalization
Personalization
Ce |
ee Ls Ne hs Es
|
—
!
|
araran Content I
UQUGUQUE
Restrictions
= Date/time
>|
!
| + a
PP
oY
pers
6. "
= »
»
= Usergroup
| |
Received Promotions
Segments As our VIP customer you receive a 10% discount
Ex: Personalized Promotions
=~ = VIPGoldStatus
= CameraLensEnthusiast Customization (Ex: Spring Sale) Shop by Brand
» Use SmartEdit to configure and see the customer’s personalized experience in real-time
Ea” smarteait
English v
50 C4H341 © SAP SE
Available Personalization Options
3. Custom
= Create custom strategies for providing personalization to customers
= Example: Customers who achieve Silver reward status will see a special homepage banner
INTERNAL SAP and Partnors Only 10
: Dedicated preview to observe changes in the appropriate context (different users, date range,
)
« Consent checks for registered and anonymous users to collect and process personalized data
« Supports annotation and retention of personal data for report generation or anonymization
© SAP SE C4H341 51
Other Complementary Tools/Systems
Emarsys
= With Emarsys Personalization Service, you can create tokens that are reusable across different channel campaigns.
= Emarsys Scripting Language (ESL) lets you personalize your content based on external factors, as opposed to the standard
personalization options.
= The Visual Content Editor (VCE) provide conditional text, link tracking, block targeting and other features to create a
personalized block-based email campaign.
Backoffice/ImpEx
= Manually create and manage:
— Segments
— User-segment relationships
— Instances of custom triggers
— Customizations and variations (SmartEdit more recommended though)
= Link custom personalization actions to variations and customizations
= Provides personalized experience in various product recommendation with machine/deep learning mechanism
INTERNAL SAP and Parners Only
52 C4H341 © SAP SE
Personalization Module Terminology
«= Segment
— Group of customers who share common characteristics (e.g. women, teen13-18, BurtonLover)
— Each customer has an affinity associated to a segment (a number between 0 and 1 indicating the
weight given to the relationship)
— Can be created automatically based on data from external systems like SAP Marketing Cloud or SAP
Commerce Cloud Context-Driven Services
«= Customization
— Contains one or more variations and represents a storefront event (e.g. Winter Sale)
— Example: The WinterSale customization has three variations, childWinterSaleLover,
teenWinterSaleLover, and adultWinterSaleLover. Each of these variations shows different but relevant
content for the same Winter Sale.
INTERNAL SAP and Parners Only 14
« Action
— Represents something changed from the typical display on the storefront
— Shows a different CMS component, activates a promotion, or activates a custom search profile
— Associated with a variation. Action takes place when a trigger activates its associated variation
— Example: Customers with Gold reward status will see a banner for Free Express Shipping during the
Winter Sale
« Trigger
— Represents the conditions for the activation of one variation
— Types of triggers include default, segment, and expression-based
— Example: An expression trigger is configured to activate its variation when the customer is in both of
the segments ShortsLover and Age30-39, but not in the segment VIPGold
© SAP SE C4H341 53
Personalization Terms and their Relationships
Customization
ym Variation Trigger OR
Segment B
numene ction 3_|
smmene Action 4 |
54 C4H341 © SAP SE
User Experience Calculation Flow When a Customer Logs In
j j ASYNCHRONOUS
= Login = Evaluation
SYNCHRONOUS
Update Segments
Evaluate Triggers
! !
Evaluate Triggers
Store results in session
s Store results in
database
Configurable in Backoffice/ImpEx
= Configuration stored in CxConfig item
© SAP SE C4H341 55
Calculation Tab
Calculation process name* @ Minimum affinity* @
defaultPersonalizationCalculationProcess 0.50000000
= General:
= Calculation process name
Initial actions
= Minimum affinity
User login actions @ New session actions @ Actions when user gives consent ®
» Initial actions ASYNC_PROCESS RECALCULATE
— UserChangedActions
(User Login actions)
set of actions to be executed after a userChangedEvent (i.e. a user logs in)
— AnonymousUserDefaultActions (New session actions)
set of actions to be executed when anonymous user is detected
— ConsentGivenActions (Actions when user gives consent)
Set of actions to executed when consents were given
= Available Actions: UPDATE, RECALCULATE, LOAD, ASYNC_PROCESS, IGNORE (covered later)
SYNCHRONOUS —I
ASYNC_PROCESS
RECALCULATE UPDATE
CxSerice.
Fi CxSegmentService.
startPersonalizationCalculationProcesses() CxService.
calculateAndLoadPersonalizationInSession() [1] updateUserSegments()
CxProcessService. 1
startPersonalizationCalculationProcess() v UpdateUserSegmentStrategy.
5 ---& CxVariationService.getActiveVariations() ——_§_|—]2] updateUserSegments()
- Gets process definition name from CxConfig
calculationProcess attribute
CxTriggerService.getVariationsForUser()
BusinessProcessService. » Get all registered trigger strategies
a
createProcess()
startProcess() - For each trigger strategy: call getVariations{) LOAD
' (6)
Le
+—#- CxVariationService. calculatectionsResults()«—| | 3 ] CxService.
loadPersonalizationInSession()
CxActionService.getActionsF orVariations()
a CxSegmentService.
174 updateUserSegments(user) For each action: call executeAction()
i I
ActionResultService.
loadActionResultsInSession()
i
¥1 || CxService. | ActionResultService.setActionResultsinSession() | 4
ol
calculateAndStorePersonalization(user) 71
\Le ActionResultService.storeActionResults(}
SE PTT ON 22
56 C4H341 © SAP SE
Voters
» Classes that determine when and how the recalculation of user experience results is triggered
« Help maintain faster performance of customer experience calculation
«Each voter
— Extends AbstractVoter (which implements Voter)
— Overrides the getVote(...) method
— Has access to the HttpServietRequest and HttpServietResponse
— Can set the following properties on the returned Vote object:
* recalculateActions — set of actions to be executed (values from RecalculateAction enumeration)
* conclusive — if true, the vote is final and no other vote is considered
— Gets automatically registered with CxPersonalizationFilter
» Logic of handling voters and votes is in CxPersonalizationFilter
1. Evaluates voters according to their order (member variable of AbstractVoter)
2. For each voter, checks if the returned Vote is conclusive
¢ If conclusive, only this specific vote is considered
¢ If not conclusive, the actions returned by each voter are merged into one set of actions to execute
INTERNAL SAP and Parners Only 23
Types of Voters
* PreviewVoter
— Triggers recalculation if a preview ticket exists
— Experience can be calculated for a user other than the logged in user
— Conclusive by default
» AnonymousVoter
— Defines the recalculation behavior for the anonymous user
— Uses the configuration from the Anonymous User tab of the CxConfigModel in Backoffice
* Periodic Voter
— Triggers periodic recalculations
— Configuration stored in CxPeriodicVoterConfigModel
= ConfigurableUrlVoter
— Triggers recalculation if the request URL contains one of the configured patterns
— Configuration for each ConfigurableUrlVoter is stored in the CxConfigModel using a CxUrlVoterConfigModel object
— If arequested URL matches more than one ConfigurableUrlVoter configuration, the actions will be merged
© SAP SE C4H341 57
User Experience Calculation Flow - On Each Page Request
CxPersonalizationFilter CxRecalculationService.
recalculate{, )
Hiultateaiee!
oo,
PreviewVoter RECALCULATE ! Execute each action
15t ‘conclusive’ i in order
Action Hl
|
PeriodicVoter \
OR \
ii
ConfigurableUnVoter Merged |
Actions |
List
NewSessionVoter RECALCULATE F—— |__ 4
= Each trigger Item (instance) represents the conditions for the activation of one variation
58 C4H341 © SAP SE
Cleanup of Personalization Calculation Results
« Problem
— Database table could easily grow to an unmanageable size and reduce performance
« Solution
— Clean old personalization calculation results (particularly for anonymous users)
+ Use a ‘session close’ listener or the CxResultsCleaningCronJob
— Clean old business processes from asynchronous personalization calculations
« Use the CxPersonalizationProcessCleanupCronJob
INTERNAL SAP and Parners Only a7
© SAP SE C4H341 59
Manage Segments in Backoffice
was , toss
&
| 1 enmoriaaas pcccae n mio a etad on
i leowlcen LD CATEGORY 57? Us who browse Weeticaria predate otter |
on ,
inten
A &
ae | fe + + [om]
ore eon 2 Properties Adhrenistration
ser Attributes &
esr con onion = ia ts
hacia CATEGORY brand 16 Vier who berms Caman prods ater WeaerO8 (caromLover) | Sunged
aca
60 C4H341 © SAP SE
Demo
Personalization of Content
© SAP SE C4H341 61
Personalization — SmartEdit Interface
on this page
5 my —_— - 3. Use the Library tab to create and
y, manage your customizations
SAVE 4. Use Combined View to visualize the
effect of personalization when
multiple variations are applicable
SPA Electronics Content Catalog - Staged | Customizations (3) Search Customizatic Q All Statuses ~ Create New Customization
I
|. CategoryLovers 2 Enabled
I
I
I
; canonLover 1 Enabled
cameraLensesLover 1 Enabled
62 C4H341 © SAP SE
Create A New Customization
Customization x
Basic Information
Name*
Description
Status Configuration
a
Configure Date For Activation
Date settings only apply if the customization is enabled. If the customization is disabled the date
configuration will have no effect.
| Next | Cancel
Customization x
SpringSale Enabled
| Save Cancel
© SAP SE C4H341 63
Commerce Customizations
Y CategoryLovers:
canonLover st Enabied
cameraLensesLover
target group
CategoryLovers (Enabled) > canonLover (Enabled)
= SAP Commerce Cloud supports two types of
commerce customizations Commerce Customization Action
Navigation Pages == Storefront SPA Electronics Content Catalog - Staged | English | Electronics Prod, " Visualize personalization effects for
Personalization Y 4 Customize [[) Combined View | Ubray multiple customizations and their
target groups (variations)
Combined View @
Edit | Clear All " You can even select a specific target
group from the list to see its effect on
SummerSale
SummerSaleDetault personalization
BRANDS ~ DIGITAL CAMERAS y FILM
CategoryLovers
canonLover
ViPCust
ViPDefault
SHOOT BIG
TRAVEL LIGHT
64 C4H341 © SAP SE
Demo
Exercise How-to
© SAP SE C4H341 65
Business Requirement
Show the following banner to customers who have placed multiple orders:
Hi, Alistair
SAP Enter product name or SKU Q
My Account v
Exercise preparation
The preparation script for this exercise has created most of the elements in the framework needed:
3. A OrderCountTrigger type (in *-items.xml) with a single property, orderCountThreshold (we will set it to 3
when we create the Trigger instance)
= The new trigger strategy has to have a type that corresponds to it. Using Java Generics, we pass this
trigger type to the strategy interface we are implementing
4. The Backoffice configuration was updated to make it possible for you to create this trigger there (you can
also use ImpEx)
5. The logic for our trigger is placed in the DefaultOrderCountTriggerDao class, within our FlexibleSearch
Query, which implements the OrderCountTriggerDao interface. It has a single method:
Collection<CxVariationModel> findApplicableVariations(int orderCount,
CatalogVersionModel
catalogVersion)
{ //use FlexibleSearchQuery to find variations }
66 C4H341 © SAP SE
Exercise Object Structure
Interface
CxTriggerStrategy
rN
|
; i
| DefaultOrderCountStrategy po -—-m! DefaultOrderCountTriggerDAO
T
| findApplicableVariations(orderCount,
catalogVersion)
userService
getVariations (user, catalogVersion)
electronicsCustomizationGroup
Customization Customer X
_ Trigger
Marston : Customer Y
orderCountTrigger
variationFor3Orders OrderCount: 3
homeSpeedMVCBannerComponent OrderCount: 1
XY y,
© SAP SE C4H341
Key Points
* Personalized Promotions — e.g. 10% off cart for the VIP Customer group (to be covered in Promotions &
Coupons)
¢ Personalized Search Results — e.g. show Canon cameras at the top of search results for Canon lovers (to
be covered in Search & Navigation)
Personalization Exercise
68 C4H341 © SAP SE
SAP Customer Experience
Thank you.
©2023 SAP SE or an SAP affiliate company. All rights reserved. Soe Legal Notice on wa". sap comilegal-notice for use terms, disclaimers, disclosures, of restrictions relate’ to SAP Materials for genoral audiences
© SAP SE C4H341 69
What we will cover in this topic
qt Methodology
eae . Installation
Validation Security Confi ti
occ Service Riles
Engine
—
Event Cache Update and
. System Initialization
Backoffice Occ Workflows
Scripting
> Searching
70 C4H341 © SAP SE
The Context
© SAP SE C4H341 71
SAP Commerce Search Mechanisms
FlexibleSearch
Solr Facet Search
¢
coococogcsococcsssgcccossssoad)
ee} Lucene
1\\ | Index
Ee Mi 4
> Advanced-
s
SearchQuery Backoffice
Sa
(ae
Lucene-based Search
“1, Lucene
*> GenericSearch ‘Index
= Independent from
Price - Stores Stores +
A Stores -
catalog structure $0-$49.99 (7) Price + Price +
72 C4H341 © SAP SE
Search & Navigation Module Asibis GB Version 8.11.2 is used in
SAP Commerce Cloud 2211
Solr —
Extension name Content
Configured Solr server: includes a standalone Solr server which may be configured
to automatically start and stop alongside the platform.
solrserver
This extension is not required by default, but is very convenient in developer
environments.
Solr core functionality: Provides faceted search and navigation functionality based
solrfacetsearch on the Apache Solr server. It enables you to do a faceted search over SAP Commerce
Cloud items such as products and WCMS content.
Adds the Apache Solr Search to Backoffice. With Apache Solr Search, Backoffice
backofficesolrsearch enables faster, more efficient, and more optimized search functionality with faceted
navigation and near-real-time indexing.
Key Features
= Boost Rules
© SAP SE C4H341 73
Indexing Process
Indexing Process
74 C4H341 © SAP SE
Indexing: Extraction Stage
= Atthe extract stage, data items can be loaded with flexible search in different modes:
= FULL: Recreates the index, all items are indexed based on a FULL index query
= UPDATE: Updates specific items in the index. Items to be indexed/updated are typically selected by an
UPDATE query
=» PARTIAL_UPDATE: Like UPDATE operation, but allows to select the fields to be updated (for faster
updates)
= DELETE: Deletes documents from the index. Items to be deleted are typically selected by a DELETE
query
= Only configured properties and classification attributes are indexed using SolrlndexedProperty
= Property and classification attribute can be configured to support localization and multi-values
= ValueResolvers are used to add field values to Solr index out of each product item
“ D nsom } _
© SAP SE C4H341 75
Indexing: extract load
Indexed Properties
Properties@
Name IT Type it Facet it MultiValue 41 Use For Spell Checking f Use For Auto-Complete 11 include
In Response IT
+ Create Property
[ Lr |
facet; facetType(code); facetSort (code) ;useForAutocomplete; fieldValueProvider 5 valueProviderParameter
-— facetSort(code)
= Alpha
= Custom
— facetType(code)
=" Refine
= MultiSelector
= MultiSelectAnd
76 C4H341 © SAP SE
Indexing: Classification Attributes (solr.impex)
$classSystemVersion=systemVersion(catalog(id[default=‘ElectronicsClassification' ]},version[default='1.0'])}
$classCatalogVersion=catalogVersion(catalog(id[default=‘ ElectronicsClassification' ]},version[default='1.0'])}
$classAttribute=classificationAttribute(code, $classSystemVersion)
$classClass=classificationClass(code,$classCatalogVersion)
$classAttributeAssignment=classAttributeAssignment($classClass ,$classAttribute, $classSystemVersion)
fieldValueProvider 3 $classAttributeAssignment
—_—~
$classAttributeAssignment is classAttributeAssignment(classificationClass({code, catalogversion(catalog(id),version))),
classificationAttribute(code,systemVersion(catalog(id),version))),
systemVersion(catalog(id), version)
(The classificationClass is the classification category, and the classificationAttribute is the feature descriptor)
Using defaults, simplifies to: <classificationCategory>:::<featureDescriptor>::::
extract load
= In order to add field values to the Solr index, we need to fetch them out of the model during our indexer
operations. For the transformation, ValueResolvers should be used.
= The recommended way for creating a custom ValueResolver is to extend AbstractValueResolver class.
© SAP SE C4H341 77
Indexing: Localization and Multi-Values
ous E> ws
<arr name="brandName_text_en_mv"™>
language
extract transform y= J
» Atthe load stage, Solr service is invoked to feed each transformed SolrlnputDocument into Solr
=» Meanwhile, solr server will use schema.xml and other configurations to setup
index/synonym/stopwords, verify data type, etc.
78 C4H341 © SAP SE
Searching
Fulltext Search
Chiba (51)
Choshi (43)
Fukuoka Best Western
Fukuoka Nakasu Inn (48)
Fukuoka Canal City
Fukuoks Washington
Hotel (47)
Fukuoka Milton Fukuoka
Sea Havek (45)
Fukuoka Hotel Monterey
La Soeur Fukuoka (42)
tania
INTERNAL SAP ane Partners Only 24
© SAP SE C4H341 79
Configurable Search Box Component
Website SmartEdit
~~
camcorders
BRANDS DIGITAL CAMERAS ~ FAM CAMERAS CAMCORDERS WEBCAMS ACCESSORIES ©
i
camileo btapiy Produc
@
camcordertape
Display Suggestions
| Mini T-Cam @
$34.53 ‘Max Products
1! $165.97
As-you-type lait Time Before Request
ACK-EZ results
7 sort
Search API
» FacetSearchService is the service by which we interact with the underlying Solr, it provides the
following functionalities:
— Creating Search Queries
— Populating Search Queries
— Executing SearchQuery
— Using Search Result
» Use FacetSearchListener interface to intercept and notify user about search process
80 C4H341 © SAP SE
Search APIs for Customization - FacetSearchListener
You will need to go through the following 3 steps to implement a new FacetSearchListener:
2. Declare the custom implementation as a new listener bean in <yourExtension>- spring. xml
import de.hybris.platform.commerceservices.search.resultdata.SearchResultValueData;
import de.hybris.platform.commercefacades.product.data.ProductData;
@Override
public void populate(SearchResultValueData source, ProductData target)
{
© SAP SE C4H341 81
Adaptive Search - Overview
Index Configuration in
. . : z Search in category: Global
A dedicated Backoffice view. cacti ec
Q
Index Type
Change the order in which search items electronicsProductType y
or facets are displayed. Catalog Version Alia: > “Sistem eine
Electronics
Product Catalog:On ~
82 C4H341 © SAP SE
Where Do We Start? - Search Profiles
© SAP SE C4H341 83
Adaptive Search - Configuration
The Adaptive Search Cockpit allows you to manage simple and category-aware Search Profiles:
" Manage facets and facet values " Manage sorting related criteria
= Promote or exclude individual items « Group products according to selected property
" Define attribute-related boost rules to adjust values
the boost score of multiple items
Navigation Context a Search profile context: Bcost_in Stock- Simple Global @ cof o Retresh
Categories Search
in category: Giobal ! Open Catalogue
/ Binoculars a ee em aw
Language Currency —
© Globe ®1 a English fen ~ JapaneseYen ey)
Boost Rules z
y Open Cotsiogue a
Page sew Sortby
VRE £052 2resutfs toon a Ss panes s
Data stomwen
Flash Memory
> Camara |(==200 Listed
sass a ee oe
Binoculars \-} ¥29,600
cca Binocular 1S 10X30
>: Color es Pv Thank otek uve corpas ond eho Geigy. tee re the mont path noc to beret here _ basa Kens 2
¥35,730
84
Facets Boosts Sorts Group
Facet Management —_
Facets a
l > was
wt co | ed
r _ i}
Excluded © \
1 Create newer
INTERNAL SAP and Partnors Only 7
a) 138
singunded on Gtiotinmrassgmd
Telophote Zoom SS 200mm F458). Superb optical
|=| |!
quality from wide angie to telephoto covers wide ! Promote |!
range of shooting situations, Black camera body I !
¥158,980 | eciude | |
INTERNAL SAPandPariersOny = TT DT a 38
© SAP SE C4H341 85
oS 1
| Create New Boost Rule | x
1
Boost Rules a
iee oe
1 = -
|
sas boos ee” | You can extend or sue"
mea Pp i ¥
| exclude boost rule
4 . . .
| =
| configurations inherited |
Boost rules from parent categories | dissecans
InStockFlag= te 520. ser poms =
1
f Multiplicative
| new item
++ Create
! ——— =| Boost"@
Boost Items a =
Adda boost items”
Back
After inherited Pa
Sa I oO a en aL : Saat a 4
Domed D | Each Boost Rule can increase the boosting value (aka. sorting weight) of multiple items |
+ Create
new iter | |
| Boost value is either Additive or Multiplicative }
Exciuded @ |
|
oy ere | Item order affected by each boost rule depends on the value of the selected Index Property. !
—
INTERNAL SAP and Partners Only 39
» Extend or exclude the sort configuration from parent categories Add sorts*
After inherited ¥
I promed® |
Sort configuration defines Create New Sor x LA Create new item
: hone : te - J
sorting criteria that will be Essential 2 Promoted nems a =
available for customers in =, , Default © !
" }
Category and Search Result pti Relevance 100 + |
pages Wanufacturerhiame ©) Top Rated 100 e+e
1
> Create
Sort Expression I TTT Ta —s
Excluded @ f
f~] so _-! ||
1
86 C4H341 © SAP SE
Grouping Products
»
« Group even unrelated products, as long as the selected attribute value
matches Group*
Inherit ¥.
« Keep or replace inherited group configurations
Group Expression
© SAP SE C4H341 87
Search Configuration - Additional Topic - Context Merging
Search Profile Activation Sets
1. an activation set
2. one or more active target groups (used for Essential
personalization)
Index Type* Catalog Version
Facets
Before inherited facets promoted in the current configuration appear above facets promoted by parent configurations
After inherited the promoted facets appear below inherited prioritized facets
Remove inherited the facet prioritization of parent configurations is ignored
Boost items
Before inherited items prioritized in the current configuration appear above items boosted by parent configurations
After inherited the prioritized items appear after inherited boosted items
Remove inherited only the items identified by the current configuration are boosted
Boost rules
Keep inherited current rules are added to the rules inherited by parent configurations
Remove inherited only the boost rules in the current configuration are used to promote returned search items
88 C4H341 © SAP SE
Search Configuration Merging Modes — Sorts and Groups
Sorts
Before inherited items prioritized in the current configuration appear above items boosted by parent configurations
After inherited the prioritized items appear after inherited boosted items
Remove inherited only the items identified by the current configuration are boosted
Groups
Inherit item groups defined in parent configurations will be inherited
Replace item groups defined in parent configurations will be replaced
= For category-aware profiles, the first stage is the internal merging of the profiles following the PCM
hierarchy. Each profile may include facet prioritization, item boosting, and boost rules
« For each category, the profile specifies the merge mode used to combine it with the configurations it is inheriting
« Boosted items appear only if present in the category being searched (or in one of its sub-categories)
Merging Direction
Categories
Global
configuration
Merged
configuration
Open Catalogue Merged Result:
pa bea soreee configuration configuration * Facet prioritization}
Cameras Boosted Items
Film cameras configuration Boost Rules
; Digital Cameras Sorts
e configuration Groups
© SAP SE C4H341 89
Merge Logic - Activation Set
electronicsProductType - Electronics Product Catalog : Staged
category-aware search profile
.
Groups
5
merge i]
hierarchically 1 Holiduys€iectronics
- Category Aware Seacch Profile i]
!
|, Generaletectronics -Catepory Aware Search Priile 1
Simpletlectrorics - Simple Search Prafte |
a i]
Demo
tmencee
90 C4H341 © SAP SE
Enhanced Search Experience with
Personalization
(2) variation
customization
BlackFriday2023 variation
promotion
Activation Set | ;
search configuration
Facet & Boost
Configuration
Note: Avoid activation of a Search Profiles both ways at the same time (Activation Set and Variation)
© SAP SE C4H341 91
Activate Search Profile for a specific Target Group
Manage Customization Library
SPA Electronics Content Catalog - Staged | Customizations (1) Search Customizatian Q All Statuses V Create New Customization
vy BlackFriday2023 Enabled
LI GG)
Joung_Men 0 Enabled
Mature_Men 0 Enabled
Edit
|
| After creating and configuring a Search Profile:
Disable
1) In SmartEdit, select a Target Group, and [———__,
Commerce Customization
I
click on Commerce Customization i
i]
Remove
Commerce Customization x
]
(9)
] Pick “Search” as Commerce Commerce Customization Action
]
] (rather than “Promotion”) |
Search profile
Select search profile
electronicsSimpleSearchProfile
| Search perspective
| save | Cancel
92 C4H341 © SAP SE
Activate Search Profile for a specific Target Group
SPA Electronics Content Catalog - Staged | Customizations (1) Search Customizatio Q All Statuses Vv Create New Customization
vy BlackFriday2023 2 Enabled
Demo
© SAP SE C4H341 93
Key Points
1. Search and Navigation Module is based on Solr, providing faster searching capability.
3. The indexing process includes three steps: Extract from DB, Transform, and Load into Solr.
4. To customize search results, various Search APIs are provided (SearchService, listeners, populators, etc.) .
5. Adaptive Search module enables direct and intuitive configuration of search functionalities.
6. You can configure facets, promote items, define boost rules, manage sort configurations and group products in a
search profile.
7. Search Profiles can be activated either via an search profile activation set or for a specific Target Group (via commerce
customization).
8. Multiple search profiles can be active at the same time according to the context merging logic.
Custom value resolver for indexing is covered in the Live Session ‘Search and Navigation - Value Resolver’. Details cf. “SAP
Commerce Cloud — Additional Technical Essentials”
94 C4H341 © SAP SE
SAP Customer Experience
Thank you.
©2023 SAP SE or an SAP affiliate company. All rights reserved. Soe Legal Notice on wa". sap comilegal-notice for use terms, disclaimers, disclosures, of restrictions relate’ to SAP Materials for genoral audiences
© SAP SE C4H341 95
What we will cover in this topic
qt Methodology
Pr Search Framework
WCMS Facade Cronjobs
en P Installation
Validation Security Confi ti
occ Service Riles
Engine
—
Event Cache Update and
. System Initialization
Backoffice occ Workflows
Scripting
> Coupons
96 C4H341 © SAP SE
The Context
Preparation
coupons exercise
oo
Or
© SAP SE C4H341 97
Promotions & Rule Engine
98 C4H341 © SAP SE
Feature Highlights
Out-of-the-box Extensibility
DECLARATIVE )
Rule engines allow you to say "What to do,” rather than "How to do it"
PROGRAMMING
TOOLING AND ) Rules are human-readable and can be translated into data objects, which
READABILITY facilitates building business tooling on top of rules
SEPARATION OF CODE ) The logic is much easier to maintain as it is expressed in readable rules
AND BUSINESS LOGIC vs. machine code
SPEED AND Rule engine builds a knowledge base of facts in memory which is
SCALABILITY processed much more efficiently when compared to database access
© SAP SE C4H341 99
Promotions — A Business Users’ View
Rulesfemplates nn oy
Y Vv
_— a
Commerce (JSON) (Drools)
— Qe
@ ae SHIPPING CUSTOMER CART
Promotion Rule
& no .
==> ACTION vant ot
Apply 10% discount on
« Product perfect partner percentage discount « Order threshold percentage discount on products
= Coupon code fixed discount = Customer-specific fixed price discount with order
threshold
«= Coupon code free gift with order threshold
Creating a Promotion
coupon_code_percentage_discount_on_products_potential_0...
€38_percentage_discount_on_products
dragonboatcouponbasedpramotion
Promotion Modules
midautumncouporbasedpromotion
order_threshold_fixed_discount_potential_001
Promotion Planning
INTERNAL SAP and Partnors Only 16
Target CONTAINS ANY customer groups [] or customers [] AND Coupon code from {] coupon applied
Available Conditions
> Target customers
~ Cart
x 2 eaten
» Coupon code
wa Qualifying products
7 "
Qualifying
KA fying categories
categ
Drag and Drop Conditions Here + ——
Cart total *“~-"----4 Product price threshold
Coupon code
~ Customer
Promotion Messages
You can define a rule fired message for each Promotion Template or Promotion Rule.
Sete eee sunt Buy over <$forderThreshold}> and get Buy over $100 and get 10%
a cart g <${percentageCartDiscount}%> discount on cart discount on cart
Info Message
Message ©
Buy over {fd76d28e-66ad-4daa-aaGe-Oe0f07a6d5e6} get {f2de1179-37b3-4646-8c2a-d4f77d5e64b5}% off on cart
$catalogVersion=catalogVersion(catalog(id),
version) [unique=true]
$productCatalog=...
INSERT_UPDATE
CatalogVersionToRuleEngineContextMapping; context (name) [unique=true] ;$catalogVersion
3;promotions-context ;$productCatalog:Online
3; promotions -preview- context; $productCatalog:
Staged
« To ensure that changes to active promotions do not affect existing carts/orders, published
promotions cannot be directly modified.
» You can edit them in Backoffice, but the save action instead creates a new promotion with the
same name, but with an incremented version number.
= The newly-created promotion automatically has a status of inactive
» When you publish this new promotion, making it active, the previous version becomes inactive.
Evaluation Criteria
= Promotion Website Group — promotions belong to a group that can be assigned to a CMS site, determining
when the promotion is applicable.
= Promotion rule priority — determines which promotion is applied first. A numeric field, where a high number
means higher priority.
" Product-level promotions should always be set with a higher priority than order-level promotions.
x
= Promotion rule group — groups promotions together to support applying multiple promotions. f) 5
" Exclusive rule group: only the applicable promotion with the highest priority is applied =
" Non-exclusive rule group: all promotions may be applied
= Halt Rule Execution - Halt rule execution action stops Promotion Engine from applying any lower-priority
promotions to the cart.
$550
ee oe eo /
Order tireshold 6300. oe All 300 $40 $360 4
@ Data (ImpEx)
Data Model
ral
far
=
SAP Commerce Cloud mi
SN
Promotion Rule
If the cart total is >= $150 then give 10% discount on the cart
( -
(,---
f \ {
1 ! ' [
H "definitionId": "cart_total", H i
H "parameters": { ! Underlying t "cart_discount",
' "value": 156, t data '
H "currency": "USD", H representation '
t “operator”: "GREATER_THAN_OR_EQUAL" H in H
! ! JSON i }
1} : 1]
ro] ! H
INSERT_UPDATE PromotionSourceRule |
Last but not least, let’s also check 3; code[unique=true] snane[ lang-en] ;Condit.ions; Actions; tee
3eduDemoPromotion ;”Buy over 150% and ge 4 discount";
how a promotion is backed up as
ImpEx (which can also be used for
importing/exporting):
Coupons
eg Order/Cart
Only VIP customers can use a
coupon
» Buy anything from a promoted brand,
a discount coupon can be used.
INTERNAL SAP and Parners Only 29
Coupon Types
Single-Code coupon
— Contains a single, invariable code
— Redeemable multiple times (a limit can be set)
Multi-Code coupon
— Coupon codes are generated using a coupon code generation configuration that includes:
=" Configuration name
=" Code separator
=* Coupon Part Count
= Coupon Part Length
— Each code can be used once only
Once you create a new coupon item, you can generate coupon codes.
Single-code coupon
Multi-code coupon
‘Coupon vauidry
INTERN) rl 3
Coupon Code
»
A Multi Code Coupon g a prefix and a selected code generation configuration. Each coupon code can only be redeemed once. The coupon can la ter be used in a promotion
tule as a conditio
Coupon Validity
»
Coupon Redemption
ORDER SUMMARY
Subtotal after $1,046.18
discounts:
Cart #00001002 Estimated TaD
Buy over $200.00 get $20.00 discount on cart shipping:
[| ronocee [ary]=
iD 2054947 1 $1,066.18 Remove =|Maveacoupon? ___
$1,066.18
Potential Promotions
Z| Order_threshoid_fhud_discount_main Get total $20 off al orders over $200 sisctroncsPromocrp [301-1
. Increases the probability of product_percentage discount 10% off on EOS 4500 electronicsPromoGrp 75 '
customers purchasing product_perfect_pariner_percentage_discount_main Buy any Samsung PL6O camera and get memory card for 25% less electronicsPromoGrp 130 | q
products or taking PENNE
SSN HIN SAAN SON (PNR RAN PSA PLAD EAN NN: eNO H q
ae | Ofder_shreshotd_fixed_ciscount_potential_001 Potential promation - Get total $20 off ail orders over $200 slectronicsPromocrp
| 0 [=~ ft
advantage of existing '
promotions The actual Promotion Rule must have a higher priority |le
. | value than this potential Promotion Rule! |
« Customers receive a ae ae ae
message advising them of
an available promotion
when they perform certain Stuns sitar, eee MAY cass
actions |Cart #00001002 I ae
I Estimated Teo
Spend another $9641 toget $20dlscountoncart | shipping:
$34.53
The Promotion Engine allows for the planning of a list of promotions to be activated at a specific
time as part of a campaign:
« The plan can also contain CMS Campaign Restrictions that will be activated with
promotions
« This allows Promotion Plans to coordinate the activation of promotions and the modification
of components and pages on a storefront.
Customer Coupon
Customer Coupon allows specific coupon codes to be created and activated only for selected customers for
marketing campaigns, or assigned ad-hoc to satisfy a business need.
Customer coupons:
» are created and managed in Backoffice =P eedues anes $
= can be activated wane eee vices nese . Wer us
H BRANDS ~ DIGITAL CAMERAS ~ FILM CAMERAS CAMCORDERS WEBCAMS ACCESSORIES ~ Greer ton,
. Saved carts
* through manual assignment by customer support sty coupons Nien
* when actively claimed by customers Siuil aaa . _—
= can be applied on the storefront directly Peswoes
HAPPYDAY. 2 happy
day customer coupon EFFECTIVE
conser Maas
Emaar:
7 Effective: censiaueneen
Jan t, 1970, 1:00:00
AM - Dec 31, 9999, 12:59:59
AM My interests
Unbound Read more Notification Preference
WAPPYDAY test test RestePsap com] Just for edu commerce Dec 31, 8999 1259.59 AM 8
2DN
& s% Customizing Promotions
KS
e@
The Promotion Engine lowers implementation costs for creating highly-customized promotions
Customized
+ Cort total
parameter
°
(optional)
|
1
Rule Context |
1
|
1
| RuleConditionDefinition/
1 RuleC onditionDefinitionP
1 arameter
if £
1
1
U
—_——_ ImpEx
converter al, itemRAO | RuleCondition
TERETE A
se
RuleConditionDefinition
eq .
- jopulator rae | !
pep vot a
fo}
i
y
‘ i
RAOFactExtractor | //
a
Se” Optional
Condition
RulesEngine
We would like to create a promotion that triggers only if the customer is happy.
« Weill leave difficult philosophical questions to the experts, and simply determine that a
customer is happy if they belong to the HappyUsers group.
« The isHappy property will be added to the userRAO provided to the Rules Engine context
by extending the OOTB structure of converters and populators.
oe
CoA Extend/Create RAO tial
{erp ae 3 , «
Implement Condition Translator
*-beans .xm1
userRAO
© istappy Happiness is to continue to desire what one possesses
Saint-Augustine (354-430 AD)
userRAO
@ istappy
Write a populator that computes whether a user belongs to the group happyUsers.
defaultCartRaoConverter
<bean parent="modifyPopulatorList">
<property name="list" ref="userRaoConverter” /> populators: [cartRaoPopulator]
<property name="add" ref="userRaoHappyPopulator” />
</bean> defaultCartRaoPopulator
discountConverter: ...
entryConverter: ...
userRaoConverter userConverter: userRaoConverter-
paymentModeConverter: ...
| UserRaoPopulator
userRaoConverter
\_@ userRacHappyPopulator
populators: [userRaoPopulator,
Configure the populator userRaoHappyPopulator]
*-beans .xm1 in Spring, and add it to
the converter userRaoPopulator
userRAO
@) istappy userRaoHappyPopulator
Tests HappyUsers
INTERNAL SAP and Parners Only group membership 46
return isUserHappyCondition;
}
<yourExtension>-spring. xml
UserRAO ruleUserHappyTranslator
| UserRaoPopulator
\_@ userRacHappyPopulator
*-beans .xm1
userRAO
@) istappy
@Override
public RuleIrCondition translate(final RuleCompilercontext context,
final RuleConditionData condition,
final RuleConditionDefinitionData conditionDefinition)
// Use rule author's radio button selection to check against; by default, check that happy property is true
final Boolean isHappy = (valueParameter != null &&
valueParameter.getValue() != null) ? (Boolean) valueParameter.getValue() : new
Boolean. TRUE;
return isUserHappyCondition;
RuleConditionDefinition
Parameter
| UserRaoPopulator
L@ userRacHappyPopulator
<yourExtension>-spring. xml
RuleConditionDefinition
Parameter
I
Impex
Joe | RuleCondition
L4 UserRacPopulator
\@ userRacHappyPopulator
INSERT_UPDATE RuleConditionDefinitionRuleTypeMapping
;definition(id) [unique=true]; ruleType(code)[unique=true ]
, scustomer_isHappy ;PromotionSourceRule
fa 5is_customer_Happy;PromotionSourceRule ---~~ s
\ \
N \
x — ustomer Happiness is false
Custe .. 1 Happy ~~ ~.
Available Condit...
Available Conditi. © Is Customer Happy? bad
Customer is Happy x cust
+ Customer
Customer )
— , true @ Fase Customers Happy
‘Customer is Happy [ |
Drag and Drop Conditions Here fetta | J I ls Customectsppyt |
For more information on extending the promotion engine with your own custom RAOs, condition,
actions, and rules, try the Promotion Engine Trail:
https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/e1391e5265574bfbb56
ca4c0573ba1dc/39b59b51¢c229400099d8ee0d0a7 9cdf5.html?q=Promotion%20Engine%20Trail
References
» Rule Engine
https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/e1391e5265574bfbb56
ca4c0573ba1dc/e30ec2e429e84d22b9045b84c366ab76.html?q=rule%20engine
« Promotion Engine
https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/e1391e5265574bfbb56
ca4c0573ba1dc/e7e7a2ef7d97405983ca0cb60e8f380a.html?q=promotion %20engine
Key Points
1. The Promotion module is based on the rule engine, which provides separation between business logic
and code
2. Every promotion rule is composed of conditions and actions, using the rule builder, and compiled into
Drools rules by the rule compiler
3. You can create a promotion rule from a promotion rule template or from scratch
Thank you.
SAP Commerce
Cloud
Composable Affiliates,
Storefront non-java,
Commerce Business
INTERNAL. SAP ane PtsOn Services 5
OCC v2 OCC v2
Addon Extension
Deprecation details here:
Addons-based OCC v2 on //help.sap.com
INTERNAL SAP and Partnors Only 6
The OCC exposes the following key commerce functionality to API clients:
= Managing
— Product information and reviews
— Cart and Order details
— Promotions and Coupons
— Consents and consent templates
— User data
= Check available points of service and verify stock levels
= Ensure fast and optimized search
= Provide access to CMS content structures and data
(OpenAPI Specification) to
document endpoints and enable inc EDED
: . 1 Commerce Webservices
testing functionality: pecttapiaos
https: /fi] ocalhost:9002 foce, AQ. sw “These services manage al of the common commerce tusctionallty and alec include <ustorsizations from installed AddOns. The implementing exiension is called conmervewsbsenices
. Use of this file is subject 10 the terms of your agreement with SAP SE or its affiliates respecting the use of the SAP product for which ths file relates.
aqger-ui.html AP Commerce Cou
a :
[ napactiocathost900aiocsh2
Generated soverui_~ | Autvorion
Address a
GS (rasesivera) /asera/{usert4} /addreases Get usar sitvome va
({easndsteta) /eners/ {userid} /addconsen Crus
snow cise va
(SI (to anesitora) /csers/jusertsy /nddrosses/{adaressté) Gee
htu snost assess ve
filters
ey webservices
controller
URL to
REST API call OAuth2 method
resolver
validation
DTO mapping
OAuth 2.0
= Access on user resources depends on roles granted by OAuth2 using the @Secured annotation
Anonymous users who provided their own e- Access only its own
ROLE_GUEST ~
- mail address resources
User authenticated by using the OAuth2 token Can access only its own
ROLE_CUSTOMERGROUP :
- in the password flow resources
User authenticated by using the OAuth2 token Can access all users and
ROLE_CUSTOMERMANAGERGROUP_~.
- in the password flow their resources
Client application (e.g. mobile app): Can access only resource
ROLE_CLIENT Makes protected resource requests on behalf of owner resources
the resource owner and with its authorization
Can access all users and
ROLE_TRUSTED_CLIENT Trusted client application (e.g. Adobe CQ5)
their resources
= Create OAuth Clients using the Administration Cockpit: System | OAuth | OAuth Clients
= OAuth Client information is stored in the database using the OAuthClientDetails type, so it can
also be created via impex
= Implementation of Roles in Spring MVC Controllers
UsersController. java
@Secured(
{ "ROLE_CUSTOMERGROUP", "ROLE_TRUSTED_CLIENT", "ROLE_CUSTOMERMANAGERGROUP” })
@RequestMappingCvalue = “/{userId}", method = RequestMethod.GET)
@ResponseBody
public UserWsDTO getUser(@RequestParamCdefaultValue=DEFAULT_FIELD_SET) final String fields)
{
final CustomerData customerData = customerFacade.getCurrentCustomer();
return getDataMapper().mapCcustomerData, UserWsDTO.class, fields);
}
Security Roles allowed to access this method
PRIVATE The response message is intended for a single user and MUST NOT be stored by a shared cache
NO_CACHE The response MUST NOT be used to satisfy a subsequent request without successful validation
on the origin server.
NO_STORE Acache MUST NOT store any part of either the immediate request or response
MUST_ Once it has become stale, a cache MUST NOT use the response to satisfy subsequent requests
REVALIDATE — without successful validation on the origin server.
@Controller java
UsersController.
@RequestMapping(value = "/{baseSiteld}/users")
@CacheControlCdirective = CacheControlDirective. PRIVATE)
public class UsersController extends BaseCommerceController ' ;
{ Don't store method results in a
shared cache(eg. proxy servers)
}
INTERNAL SAP and Partnors Only 13
=» Anew WsDTO model was introduced in OCC v2 to add stability to REST API calls by removing any
dependency to the commerce services data model
— Changes in the commerce data model no longer directly affect the REST API
— Improved flexibility by introducing a mechanism that allows control of returned fields
— Consumers can influence what the returned WsDTO will look like by requesting that specific fields be filled
in the object or by using a predefined set of fields
=" WsDTO objects are initially created to be closely similar to commerce services data objects, simplifying data
mapping, which is done automatically by the Orika bean mapper
— Created in the commercewebservices-beans.xml file as regular bean objects
— When adding a new WsDTO object, we recommend you also add a field-level mapping configuration in
Spring
= The Data Mapping Mechanism facilitates mapping of data between the source and destination objects.
It can be used in Web Services for:
— Mapping of the data between the model objects and WsDTO objects
— Mapping of the data between the commerce layer data/DTO objects and WsDTO objects
= Core functionality is exposed by the DataMapper Java interface and its map methods
— Supports simple objects, lists, sets and generics
= Declarative field mappings can map one field to another field with a different name.
= Use Spring XML configuration and specify simple mapping for those fields
dto-mappings-v2-spring.xml
<bean id="userFieldMapper" parent="fieldMapper">
<property name="sourceClass"
value="de.hybris.platform. commercefacades.user.data.CustomerData"/>
<property name="destClass"
value="de.hybris.platform. commercewebservicescommons.dto,.user,UserWsDTO" />
<property name="fieldMapping">
<map>
<entry /key="defaultShippingAddress" value="defaultAddress"/>
</map>
</property>
</bean>
Direct Field mappings between the Data object and WsData object
= Customize or extend data mapping behavior by creating converters, mappers and filters in Java classes
— Annotate your custom converters, mappers and filters with WsDTOMapping annotation and register your
custom converters, mappers and filters in Spring XML files
@WsDTOMapping
public class Special CustomerAddressMapper extends AbstractCustomMapper<CustomerData, UserWsDTO> {
@0verride
public void mapAtoBCfinal CustomerData a, final UserWsDTO b, final MappingContext context) {
ifCshouldMapCa, b, context)){
String formattedAddress = specialAddressFormatter. formatAddressCa.getAddress());
b. setAddress(formattedAddress);
}
INTERNAL SAP and Parners Only 20
Extension Description
webservicescommons Includes the web services common functionality, which can be helpful for
REST Web Services based on standard Spring MVC.
1. The Omni Commerce Connect (OCC) module is a set of customizable extensions providing
commerce-driven RESTful web services.
It's recommended to use yocc extension template to extend existing OCC web services
YY
Data is transferred via WsDTOs (Web services DTO) to decouple from service layer models
FF
Thank you.
©2023 SAP SE or an SAP affiliate company. All rights reserved. Soe Legal Notice on wa". sap comilegal-notice for use terms, disclaimers, disclosures, of restrictions relate’ to SAP Materials for genoral audiences
CronJobs
cee SS
rs a
Cronjobs
we |
INTERNAL SAP and Parners Only
The Context
= Automated tasks
= Performed at a certain time (such as 16:05), or at fixed intervals (such as every five minutes)
— Backups
— Imports / Exports
Re-calculating prices
- etc...
Trigger
= ACronJob consists of a: date and time
— CronJob: Runtime information
4
CronJob
— Job: What to do
runtime information
— Trigger: When to run 4
ServiceLayerJob
= Allows re-using code and items
Commerce-aware wrapper
= CronJobs always run in a SessionContext
(i.e. they have a user assigned) program logic
JobPerformable<CronJobModel>
Spring bean
Class Constants
= Step 1 - Define the business logic
— Write a Java class implementing JobPerformable<CronJobModel> CronJobResult
or extending AbstractJobPerformable<CronJobModel > ERROR
FAILURE
SUCCESS
public class MyJob
extends AbstractJobPerformable<CronJobModel > ONS
{ CronJobStatus
public PerformResult perform(final CronJobModel cronJob) ABORTED
: // Do something... FINISHED
return new PerformResult(CronJobResult.SUCCESS, PAUISIED)
CronJobStatus.FINISHED) ; RUNNING
} RUNNINGRESTART
} UNKNOWN
— Configure extensionName/resources/extens
tonName- spring. xml
- Either run a system update (for essential data) to create a ServiceLayerJob item for each bean implementing
JobPerformable
= In Addition:
* A built-in timer checks regularly if any trigger should be fired. It can be adjusted with:
cronjob.trigger.interval=30
* At startup, the system will determine whether it should fire overdue Triggers. Any Trigger overdue by
fewer seconds than the value of its maxAcceptab/eDelay attribute will be fired.
|) b> &
* Or use Ant
ant runcronjob -Dcronjob=myCronJob
= Email template
— notify certain user using given email template
myCronJob.setSessionUser (mySessionUserMode1) ;
myCronJob.setSessionLanguage(mySessionLanguage) ;
myCronJob.setSessionCurrency(mySessionCurrency) ;
=" Node Group
— to specify server node group for job execution
« A trigger is used to schedule a CronJob, but it can also be directly related to a Job.
« Furthermore, there are many ways to start a CronJob directly:
* ImpEx, Ant, CronjobService API, manually in the Backoffice
| ro) Furthermore, a CronJob can be created dynamically at runtime via scripting - covered |
' in Introduction to the Live Session Series "SAP Commerce Cloud - Additional '
! Technical Essentials” |
INTERNAL SAP and Parners Only
CronJobs Exercise
Thank you.
©2023 SAP SE or an SAP affiliate company. All rights reserved. Soe Legal Notice on wa". sap comilegal-notice for use terms, disclaimers, disclosures, of restrictions relate’ to SAP Materials for genoral audiences
Event System
en P Installation
Validation Securi "i 5
: Procaes iy Configuration
occ Service A
Engine
Event Update and
: Gartns Initialization
Backoffice occ Workflows
Scripting
What is an Event?
— One or more properties expressing the event message(s) to be communicated. (e.g., the customerUID above)
— 2constructors:
* one without an argument for easy instantiation. (e.g., the CustomerCreatedEvent() constructor above)
* one with a Serializable source object, which can be passed at creation time (e.g., the
CustomerCreatedEvent(Serializable source) constructor above)
INTERNAL SAP and Parners Only
=» You can implement a new event class by directly extending AbstractEvent or a subclass (as shown on the
previous slide).
= More typically, you would do that using bean generation in *-beans. xml:
<bean
class="my.package.events.CustomerCreatedEvent" ty
pe="event">
* Fully qualified class Wainé is neteRSary4h tAESVeEnt bean declaration.
type="String"/>
* Add a typeszevent” attribute to the <bean> tag.
¢ Add any property/properties the event needs.
¢ An “ant all’ generates the event class. (e.g., the above bean declaration generates the following Event
Class, which is identical to the class shown in the previous slide)
public class CustomerCreatedEvent extends AbstractEvent {
private String customerUID;
public CustomerCreatedEvent() { super(); }
public CustomerCreatedEvent (Serializable source) { super(source); }
public void setTypeCode(String customerUID) { this.customerUID = customerUID; }
public String getCustomerUID() { return customerUID; }
INTERNAL SAP and Partnors Only } 9
= Please note:
* OOTB/existing event classes in SAP Commerce Cloud are defined using the same automatic
generation mechanism using the definition in their respective extension’s <extensionName>-
beans.xml file.
e.g., in core-beans.xml
<bean class="de.hybris.platform.servicelayer.event.events.AfterSessionCreationEvent” type="event"/>
* Therefore, you can add properties to the OOTB event classes by adding new properties to the bean
definition in your custom extension’s <CustomExtensionName>-beans. xml file.
In CustomExtensionName-beans.xml
Asynchronous events
= By default:
— Events are processed synchronously (the most data-safe option)
— Events are handled on the same node from where they're fired
= However, handling events synchronously can sometimes be undesirable for performance reasons, as the
main thread waits until events are processed
To make an event Cluster-Aware, have the event class implement the ClusterAwareEvent interface
The canPublish() callback method allows the platform to inquire whether the event should be published to nodes of
specific node groups in the running cluster or not, e.g.
@Override
public boolean canPublish(PublishEventContext publishEventContext)
{
return return publishEventContext.getTargetNodeGroups().contains("backoffice_node_group");
}
— If you want the event to be handled asynchronously (i.e., a cluster-aware event) but only on the node where the event
was fired (like a non-cluster-aware event), the following method implementation lets you have it both ways:
@Override
public boolean canPublish(PublishEventContext publishEventContext)
{
return (publishEventContext.getSourceNodeld(}
== publishEventContext. getTargetNodelId()});
weal sePane pavers
Transaction-Aware Events
Vy
les 7 ‘ |
— Multiple, "identical" events published inside a transaction can be treated as a single event
boolean publishOnCommitOnly(): If this method returns true, event will be published upon the successful
commit of the current transaction
Object getId(): Returns a programmer-determined event ID. Two event instances with the same id will be
published only once as a single event at the end of the transaction
« All persistence events (i.e. AfterltemCreationEvent and AfterltemRemovalEvent) implement both ClusterAwareEvent
and TransactionAwareEvent, because these persistence events
— are published only after the persistence operation is committed.
— should be handled asynchronously, so their handling doesn’t block the current thread.
INTERNAL SAP and Partnors Only 18
Key Points
= To use the event system, you can oO Loose coupling of event system
facilitates linking components
« Use one of the many predefined event classes, or extend one , :
from different extensions
* Define an event listener class and register it as Spring bean Easierto maintain than a direct
* Use the EventService to publish events call to a Spring-injected service
= The event system is synchronous by default; you can make it asynchronous in two ways:
* configuring the PlatformClusterEventSender
2 to send all non-cluster-aware events asynchronously to the same/local server node
= Events can be published at the end of a transaction by implementing the TransactionAwareEvent interface
* Covered in the live session “Scripting Support” of “SAP Commerce Cloud - Additional Technical
Essentials”
Thank you.
©2023 SAP SE or an SAP affiliate company. All rights reserved. Soe Legal Notice on wa". sap comilegal-notice for use terms, disclaimers, disclosures, of restrictions relate’ to SAP Materials for genoral audiences
Process Engine
General
Services |
The Context
d
Process Engine = Process Definition
= The Process Engine extension allows you to model, support and monitor business processes
= The Process Engine interprets a process definition comprising Nodes and Transitions
= A Process is defined in a lightweight XML file (introduced later), which can be easily modified
= Actions are performed in a certain order and are only carried out if all predefined conditions are
met
= You can wait for events, notify users or user groups and use Split Nodes for parallel processing
(details later)
INTERNAL SAP and Partnors Only 6
Business analysis
= The first step in working with the process engine extension typically consists of conducting a
business analysis
Not OK
Action1 > Actions —— Action4
OK
Action2
7 The workflow from the analysis is translated into a process definition XML file:
E.g. example-process.xml:
Node Types
= Action nodes - carry out process logic and decide transitions to the next nodes
</action>
= Wait nodes - used for communication, typically wait for another process result.
= End nodes - end the process and store state in a process item
Process Actions
= The next step consists in defining all actions specified in the bean attribute of individual action nodes
= Actions are the most important part of the process engine extension and implement logic or call
specialized services
= Anaction performs a single piece of work and produces an action result which is directed as input to the
next action
= All actions from the process definition XML file are implemented as actions classes
= If an action cannot perform or complete its work, it may signal that the current task should be put back into
the queue of due tasks to be processed again later by throwing a RetryLaterException exception or
returning Action. RETRY_RETURN_CODE
— Inability to complete task may be due to temporary Actions are “isolated”, self-contained components.
problems (e.g. unreachable web service) There is often no call stack to properly handle
exceptions higher up the hierarchy.
— Action may specify time to wait before task is tried
Action should handle its own exceptions, and if
again problem is deemed temporary, request a retry later
{
@Override
public Transition executeAction(BusinessProcessModel process)
{
if(...)
return Transition.NOK;
else
return Transition.OK;
}
}
= To create a new process instance, you need to call the BusinessProcessService method:
— For Example:
BusinessProcessModel process = businessProcessService.createProcess("myProcID",
"exampleProcessDef" )
businessProcessService. startProcess(process)
= Do both at once:
Task Service:
Key Points
1. Process engine allows you to model, support and monitor business processes
* You need to define a Spring bean to register the business process itself
3. You can create and start a business processes by using the BusinessProcessService
Dynamic Process with scripting is covered in the live session “Scripting” in the series of
“SAP Commerce Cloud - Additional Technical Essentials”
Thank you.
©2023 SAP SE or an SAP affiliate company. All rights reserved. Soe Legal Notice on wa". sap comilegal-notice for use terms, disclaimers, disclosures, of restrictions relate’ to SAP Materials for genoral audiences
Orders
qt Methodology
Pr Search Framework
WCMS Facade Cronjobs
en P Installation
Validation Security Confi ti
occ Service Riles
Engine
—
Event Cache Update and
. System Initialization
Backoffice occ Workflows
Scripting
Preparation
— yacceleratorfulfilmentprocess
— Template for custom code base with predefined order related processes
order-process
¢os :: T_&
N ke °
authorize reserve Lis
payment amount
ote % ,
tO t internal ua
au fraud check ie
van '
i
Had
{ ‘4 \ i .
consignment rder lool
sock stat
id a iv
Order . reserve fraud queue warehouse notify
——> authorize ——>
amount checking order integration customer
Entry
xt xt xy? t |
. v
A a
cart items w wi
email email Notify send & ‘~ w
payment customer customer Customer order placed
notification
shipping ]
Payment Check
manual check
byCSA
xt
wy Cancel
Order
Fraud Detection
INTERNAL SAP and Parners Only
Payment Check
internalFraudServiceProvider
@ BlacklistSymptom WA
@ OrderThresholdSymptom >¢
=
50 points
120 points
commercialFraudServiceProvider
fraudService mSymptomA
@ Symptom B A
z.. 4
70 points
Fraud Service
item item
Product Order
products | * order
productOrderLimits | + fraudReports | +
us: item item
[ alatetataietetetatateietatetetetetsteletataneetetetetatal > ProductOrderLimit FraudReport
H
i
DefaultFraudService }+—)> FraudService 9
+ k providers
i
AbstractFraudServiceProvider }—? — FraudServiceProvider
T
Hi
\ produces.
1
1
v
DefaultHybrisFraudServiceProvider FraudServiceResponse
+ 4 symptoms + P symptoms
i
od crcrmmcenoeen] FraudSymptom
Splitting Strategies
= SplitByDeliveryMode:
— splitting an order according to different delivery modes in an order
= SplitByNamedDeliveryDate:
— splitting an order according to different delivery dates in an order
= SplitByEntryDeliveryAddress:
— splitting an order according to different delivery addresses in an order
= SplitByAvailableCount:
— splitting an order according to available count for all stock levels
= SplitByWarehouse:
— choses a warehouse that can process the order based on the stock level in the database (do
not split if not necessary).
= SplitByPOS
— Splitting an order according to stores selected for Pick Up
= Methods:
— splitOrderForConsignment
— splitOrderForConsignmentNotPersist
<property name="strategiesList">
<list>
</list>
</property>
</bean>
<<item>> <<item>>
AbstractOrder Employee
employee 0.1
order historyEntries
<<item>>
Order *
lversionID : String | previousVersion
Icode : String
0../\ 0..1
1
originalVersion '
1
1
1
create version snapshot
1
'
'
1
<<iInterface>>
OrderHistoryService
del). O1
IgetHistorySnapshots(OrderModel) : Collection<OrderModel>
Consignment Fulfillment
tes backorder backorder
warehouse
not allowed | items to
' partial customer
H ¥ delivery?
ii .
backorder wait for
cancalled 1 "@) dativery x
1 v send wait for
' Y consignment — payment ship
receive { pick & items in update update
consignment H pack stock? | . a
H 1 >
Zz H H ves
n i ' H
t ' " 1 to store for
' ' H pick-up
warehouse send H receive calculate \
integration consignment t warehouse Ph ent 1
| to warehouse i status. Pay! i we
| 1! ;
|
iv
ro
H
split order i canes) | \ I send
by Ly cancel ! payment Mi delivery
consignment consignment » OK? {1 nouication
'
' x! !
' | Lop ew
t '
¥ ¥ send
in-store
~ capture pickup
send cancel payment send
message payment failed
9 message
Payment Service Provider
INTERNAL SAPand Partnole win 19
| Take note: Business process events are different from the events introduced in the event system.
i)
1T
1
hey should be published with BusinessProcessService.triggerEvent(String event) instead of EventService
Warehouse Integration
vasecommercs
-
wat warehouse
extension
receive
consignment
status
Further OM Features
Live Session “Customer Services in Basecommerce” in the series of “SAP Commerce Cloud - Additional
Technical Essentials”
= Real-time inventory management across all stock locations (ATP using either Backoffice or OCC)
= Automated order process or workflow
= Order splitting, Sourcing & Allocation
= Ability to pick, pack, label, and confirm shipments through Backoffice Order Fulfillment Cockpit
= Self-service Cancellation
= Ability to create and manage returns (also with restock ability) and refunds
= Further details in the live session:
Live Session “Order Management Services Module” in the series of “SAP Commerce Cloud - Additional
Technical Essentials”
2. The basic steps in a typical OM process include (but are not limited to) payment check, fraud
detection, order splitting, warehouse integration, etc.
3. SAP Commerce provides many services, interfaces and mock implementations to support OM,
such as FraudService, OrderSplittingService, Warehouse adapters, etc.
4. Consignment fulfillment subprocess (of Order management) exists for warehouse integration
and is also customizable.
Orders Exercise
Thank you.
©2023 SAP SE or an SAP affiliate company. All rights reserved. Soe Legal Notice on wa". sap comilegal-notice for use terms, disclaimers, disclosures, of restrictions relate’ to SAP Materials for genoral audiences
© SAP SE C4H341