Defaults
- Client Name (Site Name): Contact to Annex Cloud
- Site ID: Contact to Annex Cloud
- Access Token (Site Token): Contact to Annex Cloud
Java version
- SAP Commerce Cloud Version: 2205
- JAVA Version: Java 17
Connector Base Code Installation Steps
- Get Annex Cloud code base. It will consist of five extensions:
o annexcloudaddon
o annexcloudbackoffice
o annexcloudv3fullfillmentprocess
o annexcloudv3facades
o annexcloudv3services
- Copy all five extensions inside {base_directory}/hybris/bin/custom.
- Include all five extensions in the localextensions.xml file and add the “addonsupport” OOTB extension which is required for the Add On installation.
- Install the following Add On:
o annexcloudaddon
- Now, go to {base_directory}/hybris/bin/platform directory and execute the following Add On install commands.
ant addoninstall -Daddonnames="annexcloudaddon" -DaddonStorefront.yacceleratorstorefront="<Name of the storefront extension>"- Define dependency by updating the extensioninfo.xml of annexcloudv3facades extension.
<requires-extension name="annexcloudv3services"/>
<requires-extension name="Here you need to add name of your core extension"/>
<requires-extension name="acceleratorfacades"/>For example, If the name of your accelerator core is annexcloudcore, then put the same name above. After the Add On installation, your storefront will get updated.
Installation
To update system from HAC. Select only create essential data as shown below.
Steps:
- Go to HMAC/console.
- On Platform tab, click Update. It will display the following window:
- Execute Electronic catalog sync job so that the components get copied from staged to Online.
- After the system update from HAC, your database will get updated.
Steps to modify the order
If you are using yacceleratorordermanagement then refer below steps:
- Add the following bean definitions to order-process.xml
<bean id="sendOrderDetailToAnnexCloud" class= "com.annexcloud.actions.order.SendOrderDetailToAnnexCloudAction" parent="abstractAction">
<property name="annexCloudLoyaltyService" ref="acV3LoyaltyService"/> </bean>Changes need to be done in projectdata-dynamic-business-process-order.impex
<action id='takePayment' bean='takePaymentAction'>
<transition name='OK' to='sendOrderDetailToAnnexCloud'/>
<transition name='NOK' to='sendPaymentFailedNotification'/>
</action>
<action id='sendOrderDetailToAnnexCloud' bean='sendOrderDetailToAnnexCloud'>
<transition name='OK' to='completeOrder'/>
<transition name='NOK' to='error'/>
</action>
<action id='completeOrder' bean='completeOrderAction'>
<transition name='OK' to='success'/>
</action>- Add the following dependency into extensioninfo.xml of yacceleratorordermanagement extension.
<requires-extension name="annexcloudv3services"/>- Do ant all and run the projectdata-dynamic-business-process-order.impex in HAC
Steps to modify return flow(yacceleratorordermanagement)
If you are using yacceleratorfulfilmentprocess then refer below steps
- Add the following bean definitions to return-process.xml
<bean id="annexCloudReturnOrderAction" class="com.annexcloud.returns.order.ACReturnOrderAction"
parent="abstractAction">
<property name="annexCloudLoyaltyService" ref="acV3LoyaltyService"/>
</bean>- Add the following actions to projectdata-dynamic-business-process-return.impex file.
<action id='inventoryUpdateAction' bean='inventoryUpdateAction'>
<transition name='OK' to='annexCloudReturnOrderAction'/>
</action>
<action id='annexCloudReturnOrderAction' bean='annexCloudReturnOrderAction'>
<transition name='OK' to='completeReturnAction'/>
<transition name='NOK' to='failed'/>
</action>
<action id='completeReturnAction' bean='completeReturnAction'>
<transition name='OK' to='success'/>
</action>- Do ant all and run the projectdata-dynamic-business-process-order.impex.
- After that, at the same directory, perform command ant clean all.
- Then, start hybris server.
New Installation
- After the system starts, go to hac (https://ClientURL/hac)
- If you haven’t initialized the system, then perform step 3. If you have initialized the system jump to step 5. 3.
Go to HAC → Platform → Initialization and keep all the options selected and click Initialize to do system initialization as shown below.

- Execute full solr indexing. To execute, go to System è Search and Navigate è Facet search configurations è Select solr profile è Click on index è Select full indexing option è Click start.
- Note: In solr profile, annexcloud has its own value provider for average rating.
- To update system from HAC. Select only create essential data as shown below.
- Execute electronic catalog sync job so that the components get copied from staged to online.
- Run below impex
Order Impex:-
# -----------------------------------------------------------------------
# [y] hybris Platform
#
# Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
#
# This software is the confidential and proprietary information of SAP
# ("Confidential Information"). You shall not disclose such Confidential
# Information and shall use it only in accordance with the terms of the
# license agreement you entered into with SAP.
# -----------------------------------------------------------------------
INSERT_UPDATE DynamicProcessDefinition;code[unique=true];active;content
;order-process;true;"<process xmlns='http://www.hybris.de/xsd/processdefinition' start='checkOrder'
name='order-process' processClass='de.hybris.platform.orderprocessing.model.OrderProcessModel'>
<!-- Check Order -->
<action id='checkOrder' bean='checkOrderAction'>
<transition name='OK' to='fraudCheck'/>
<transition name='NOK' to='error'/>
</action>
<!-- Fraud Check -->
<action id='fraudCheck' bean='fraudCheckOrderInternalAction'>
<transition name='OK' to='sendOrderPlacedNotification'/>
<transition name='POTENTIAL' to='manualOrderCheckCSA'/>
<transition name='FRAUD' to='cancelOrder'/>
</action>
<!-- Fraud Check : OK -->
<action id='sendOrderPlacedNotification' bean='sendOrderPlacedNotificationAction'>
<transition name='OK' to='geocodeShippingAddress'/>
</action>
<!-- Fraud Check : FRAUD -->
<action id='cancelOrder' bean='cancelOrderAction'>
<transition name='OK' to='notifyCustomer'/>
</action>
<action id='notifyCustomer' bean='notifyCustomerAboutFraudAction'>
<transition name='OK' to='failed'/>
</action>
<!-- Fraud Check : POTENTIAL -->
<action id='manualOrderCheckCSA' bean='prepareOrderForManualCheckAction'>
<transition name='OK' to='waitForManualOrderCheckCSA'/>
</action>
<wait id='waitForManualOrderCheckCSA' then='orderManualChecked' prependProcessCode='true'>
<event>CSAOrderVerified</event>
</wait>
<action id='orderManualChecked' bean='orderManualCheckedAction'>
<transition name='OK' to='sendOrderPlacedNotification'/>
<transition name='NOK' to='cancelOrder'/>
<transition name='CANCELLED' to='success'/>
</action>
<!-- Sourcing and Allocation -->
<action id='geocodeShippingAddress' bean='geocodeShippingAddressAction'>
<transition name='OK' to='sourceOrder'/>
</action>
<action id='sourceOrder' bean='sourceOrderAction'>
<transition name='OK' to='waitForOrderAction'/>
</action>
<!-- Wait to perform action on Order -->
<wait id='waitForOrderAction' prependProcessCode='true' then='failed'>
<case event='OrderActionEvent'>
<choice id='consignmentProcessEnded' then='verifyOrderCompletion'/>
<choice id='cancelOrder' then='processOrderCancellation'/>
<choice id='cancelled' then='success'/>
<choice id='reSource' then='sourceOrder'/>
<choice id='putOnHold' then='putOrderOnHold'/>
</case>
</wait>
<!-- Wait for order cancellation to be completed -->
<action id='processOrderCancellation' bean='processOrderCancellationAction'>
<transition name='OK' to='verifyOrderCompletion'/>
<transition name='WAIT' to='waitForOrderAction'/>
<transition name='SOURCING' to='sourceOrder'/>
</action>
<action id='verifyOrderCompletion' bean='verifyOrderCompletionAction'>
<transition name='OK' to='postTaxes'/>
<transition name='WAIT' to='waitForOrderAction'/>
<transition name='CANCELLED' to='success'/>
</action>
<action id='putOrderOnHold' bean='putOrderOnHoldAction'>
<transition name='OK' to='waitForOrderAction'/>
</action>
<!-- Tax and Payment -->
<action id='postTaxes' bean='postTaxesAction'>
<transition name='OK' to='takePayment'/>
</action>
<action id='takePayment' bean='takePaymentAction'>
<transition name='OK' to='completeOrder'/>
<transition name='NOK' to='sendPaymentFailedNotification'/>
</action>
<action id='completeOrder' bean='completeOrderAction'>
<transition name='OK' to='success'/>
</action>
<action id='sendPaymentFailedNotification' bean='sendPaymentFailedNotificationAction'>
<transition name='OK' to='failed'/>
</action>
<end id='error' state='ERROR'>Order process error.</end>
<end id='failed' state='FAILED'>Order process failed.</end>
<end id='success' state='SUCCEEDED'>Order process completed.</end>
</process>"
Return Impex:-
# -----------------------------------------------------------------------
# [y] hybris Platform
#
# Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
#
# This software is the confidential and proprietary information of SAP
# ('Confidential Information'). You shall not disclose such Confidential
# Information and shall use it only in accordance with the terms of the
# license agreement you entered into with SAP.
# -----------------------------------------------------------------------
INSERT_UPDATE DynamicProcessDefinition;code[unique=true];active;content
;return-process;true;"<process xmlns='http://www.hybris.de/xsd/processdefinition' start='initialReturnAction'
name='return-process' processClass='de.hybris.platform.returns.model.ReturnProcessModel'>
<action id='initialReturnAction' bean='initialReturnAction'>
<transition name='ONLINE' to='waitForConfirmOrCancelReturnAction'/>
<transition name='INSTORE' to='captureRefundAction'/>
</action>
<wait id='waitForConfirmOrCancelReturnAction' prependProcessCode='true' then='failed'>
<case event='ConfirmOrCancelRefundEvent'>
<choice id='cancelReturn' then='cancelReturnAction'/>
<choice id='approveReturn' then='approveReturnAction'/>
</case>
</wait>
<action id='cancelReturnAction' bean='cancelReturnAction'>
<transition name='OK' to='success'/>
</action>
<action id='approveReturnAction' bean='approveReturnAction'>
<transition name='OK' to='printReturnLabelAction'/>
</action>
<action id='printReturnLabelAction' bean='printReturnLabelAction'>
<transition name='OK' to='printPackingLabelAction'/>
</action>
<action id='printPackingLabelAction' bean='printPackingLabelAction'>
<transition name='OK' to='waitForGoodsAction'/>
</action>
<wait id='waitForGoodsAction' prependProcessCode='true' then='failed'>
<case event='ApproveOrCancelGoodsEvent'>
<choice id='cancelReturn' then='cancelReturnAction'/>
<choice id='acceptGoods' then='acceptGoodsAction'/>
</case>
</wait>
<action id='acceptGoodsAction' bean='acceptGoodsAction'>
<transition name='OK' to='captureRefundAction'/>
</action>
<action id='captureRefundAction' bean='captureRefundAction'>
<transition name='OK' to='successCaptureAction'/>
<transition name='NOK' to='waitForFailCaptureAction'/>
</action>
<wait id='waitForFailCaptureAction' prependProcessCode='true' then='failed'>
<case event='FailCaptureActionEvent'>
<choice id='bypassCapture' then='taxReverseAction'/>
<choice id='cancelReturn' then='cancelReturnAction'/>
</case>
</wait>
<action id='successCaptureAction' bean='successCaptureAction'>
<transition name='OK' to='taxReverseAction'/>
</action>
<action id='taxReverseAction' bean='taxReverseAction'>
<transition name='OK' to='successTaxReverseAction'/>
<transition name='NOK' to='waitForFailTaxReverseAction'/>
</action>
<wait id='waitForFailTaxReverseAction' then='inventoryUpdateAction' prependProcessCode='true'>
<event>FailTaxReverseEvent</event>
</wait>
<action id='successTaxReverseAction' bean='successTaxReverseAction'>
<transition name='OK' to='inventoryUpdateAction'/>
</action>
<action id='inventoryUpdateAction' bean='inventoryUpdateAction'>
<transition name='OK' to='annexCloudReturnOrderAction'/>
</action>
<action id='annexCloudReturnOrderAction' bean='annexCloudReturnOrderAction'>
<transition name='OK' to='completeReturnAction'/>
<transition name='NOK' to='failed'/>
</action>
<action id='completeReturnAction' bean='completeReturnAction'>
<transition name='OK' to='success'/>
</action>
<end id='failed' state='FAILED'>Return issue detected.</end>
<end id='success' state='SUCCEEDED'>Return process ended as expected.</end>
</process>"CopiedCustomer Loyalty
Loyalty Dashboard
- Add following in “local.properties” file:<site_code>.site.api.token=<Site token>
i.e., annexsapv3.site.api.token=QWEQWE121QWE - Import the annexclod-cms-content.impex file to SAP commerce.
$annexSiteId=ENTER_SITE_ID
$annexSiteCode=ENTER_SITE_CODE(SITE_NAME)
$annexorderProcessCode=order-process
$annexCheckoutFlowGroup=annexCloudCheckoutGroupNote: In the above code, replace the site id, site code, access token provided by annex cloud.
Attributes are explained below:
| Attribute | Description |
| Code (Site Name) | It should be unique. |
| Site ID | Shared by Annex team to the client. |
| Base Store | Site ID associated with the base store. |
| Loyalty Program Type | Site ID can be implicit or explicit. If the site ID is explicit, the business user needs to select explicit, otherwise, by default, it is selected implicit. |
| Point Redemption Type | coupon |
- The loyalty dashboard link will start displaying on the, my account bar, once the user gets registered on the Hybris E-commerce site.
- After the loyalty dashboard is set up, the user will see the loyalty dashboard link as shown below.
Custom Action
To award/deduct custom points:
| Parameter | Parameter Description | Parameter Type |
| ID (Mandatory) | Enter the member’s unique ID. | string |
| actionId (Mandatory) | Enter the action ID. (It is mandatory if the action id is set at the site admin) | string |
| activity (Mandatory) | Enter the activity as CREDIT or DEBIT | string |
| orderId (optional) | If the activity is DEBIT, pass the order ID. | string |
| credit/debit | Enter the number of credited/debited points | string |
| reason | Enter the reason for adding or removing the points (If the actionId is not passed then the reason is mandatory) | string |
- Call the following method from the class com.annexcloud.service. impl.DefaultAnnexCloudLoyaltyV3Service.
Method:
public ACResponse awardDeductCustomPointsAPI(final ACCreditDebitPointsJwtRequest requestParameter, final AnnexCloudModel annexSiteDetails)Loyalty Enrollment Program
- Import the following annexcloud-cms-content.impex to SAP commerce.
Qualified Path: D:\SAPHybris\hybris\bin\custom\annexcloudaddon\resources\annexcloudaddon\import\common\ annexclod-cms-content.impex
Controller Class: com.annexcloud.controllers.pages.ACLoyaltyPageController
URL: /my-account/loyalty-point
Jsp Page: annexcloudaddon/responsive/pages/account/annexLoyaltyPointDashboard.jsp
Impex File: annexcloud-cms-content.impex
- After the loyalty enrollment program is set up, if the program is implicit then the user will get enrolled in the loyalty program directly after creating an account.
- If the program is explicit, the user will have to join the loyalty program separately after creating an account as shown in the following image.
- After joining the loyalty program, the member will get to see the loyalty dashboard as shown in the following image.
Product Point
Precondition: Product point should be setup on Annex Cloud:
- In the Annex Cloud V3 setup, we have added annexProductLayout1Page.jsp page for the product details page template.
- Qualified Path: /annexcloudaddon/acceleratoraddon/web/webroot/WEB-INF/views/responsive/pages/product/annexProductLayout1Page.jsp
| Page | Out of the box file (earlier) | Annex files (updated) |
| Product Detail Page | productLayout1Page.jsp | annexProductLayout1Page.jsp |
| Controller | ProductPageController.java | ACProductPageController.java |
- JSP File: productPricePanel.tag
- Qualified Path: annexcloudaddon\acceleratoraddon\web\webroot\WEB-INF\tags\responsive\product
- Controller Class: ACProductPageController
-
Model Attributes: productPoints
- The member will get to see the points earned (the number of points they will earn after purchasing a particular product) on PDP as shown in the following image.
Cart Point
- In Annex Cloud V3 setup, we have added annexCloudcartTotalsDisplay.jsp page to display loyalty points on the cart page.
Qualified Path: /annexcloudaddon/acceleratoraddon/web/webroot/WEB-INF/views/responsive/pages/cart/annexCloudcartTotalsDisplay.jsp
| Page | Out of the box file (earlier) | Annex files (updated) |
| Cart Page | cartTotalsDisplay.jsp | annexCloudcartTotalsDisplay.jsp |
- Similarly, it can be applied on the cart page also as shown in the following image.
Point Redemption
- The user can redeem the loyalty points as a coupon. Refer to the following screenshot for this.
Coupon Redemption
- To redeem the available points, we have added one checkout step.
- JSP File: ac acPointRedemptionPage.jsp
- Qualified Path: /annexcloudaddon/acceleratoraddon/web/webroot/WEB-INF/views/responsive/pages/checkout/multi/acPointRedemptionPage.jsp
- Controller Class: ACPointRedemptionCheckoutStepController
- Checkout Group: annexCloudCheckoutGroup
-
Checkout group file at line 155: annexcloudaddon-web-spring.xml
- Redeem points using coupon on checkout page.
- After the coupon redemption setup, the user can redeem the coupon using the loyalty points on the checkout page using a drop-down menu as shown in the following image.

- After applying the coupon, it will be visible in the checkout as well as cart page. To remove the coupon, click X.

- Get the impex and then visit the following URL: https://localhost:9002/
- It will display the Hybris administration console.
o Go to console
o Import the impex
- The impex is given below.
# -----------------------------------------------------------------------
# [y] hybris Platform
#
# Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
# This software is the confidential and proprietary information of SAP
# ("Confidential Information"). You shall not disclose such Confidential
# Information and shall use it only in accordance with the terms of the
# license agreement you entered into with SAP.
# -----------------------------------------------------------------------
# ImpEx for Promotions for Electronics Store
#% impex.setLocale( Locale.GERMAN );
$defaultPromoGrp=apparelUKPromoGrp
$promotionsModule="promotions-module"
$previewModule="promotions-preview-module"
$ruleImportProcessor=processor=de.hybris.platform.ruleengineservices.impex.impl.ConditionalImportProcessor,condition=de.hybris.platform.ruleengineservices.impex.impl.RuleImportCondition
############################# PROMOTION RULES ##########################
INSERT_UPDATE PromotionSourceRule[$ruleImportProcessor];code[unique=true];priority;maxAllowedRuns;ruleGroup(code);conditions;actions;website(Identifier)[default=$defaultPromoGrp];excludeFromStorefrontDisplay[default=false];status(code)[unique=true,default=UNPUBLISHED]
;annex_cloud_multi_code_coupon_fixed_discount;30;1;couponPromotionRuleGroup;"[{""definitionId"":""y_qualifying_coupons"",""parameters"":{""coupons"":{""uuid"":""c4988a76-c0fc-4de3-a801-6f3f735e93ae"",""type"":""List(ItemType(AbstractCoupon))"",""value"":[""ACCOUPON5""]}},""children"":[]}]";"[{""definitionId"":""y_order_fixed_discount"",""parameters"":{""value"":{""uuid"":""4c21e41f-6933-471a-8cba-3f87cf83c97d"",""type"":""Map(ItemType(Currency),java.math.BigDecimal)"",""value"":{""GBP"":5}}}}]";;
############################# COUPON SAMPLE DATA ##########################
INSERT_UPDATE CodeGenerationConfiguration;name[unique=true];codeSeparator;
;default-configuration;-;
INSERT_UPDATE MultiCodeCoupon;couponId(id)[unique=true];codeGenerationConfiguration(name)
;ACCOUPON5;default-configuration
# Language
$lang=en
$ruleImportProcessor=processor=de.hybris.platform.ruleengineservices.impex.impl.ConditionalImportProcessor,condition=de.hybris.platform.ruleengineservices.impex.impl.RuleImportCondition
############################# PROMOTION RULES ##########################
INSERT_UPDATE PromotionSourceRule[$ruleImportProcessor];code[unique=true];name[lang=$lang];description[lang=$lang];messageFired[lang=$lang];status(code)[unique=true,default=UNPUBLISHED]
;annex_cloud_multi_code_coupon_fixed_discount;Get £5 discount on the cart using a coupon;A fixed discount is added to the cart when a valid multi code coupon code is entered;You have received Annex Cloud {4c21e41f-6933-471a-8cba-3f87cf83c97d} discount on cart using the coupon code {c4988a76-c0fc-4de3-a801-6f3f735e93ae}
INSERT_UPDATE MultiCodeCoupon;couponId(id)[unique=true];name[lang=$lang]
;ACCOUPON5;Get £5 discount on the cart using the coupon
- After importing the impex, go to the back office and follow the steps below.
o Select the impex and click on publish selected promotion rule for module as shown in the following image.


- After this, in marketing, go to coupon management and follow the steps below:
o Select the coupon and then go to General Coupon Codes
o Enter the total number of coupons required.
o Click Generate.
o A CSV file will generate consisting of the coupons.


Generate Rewards & Upload the Coupon Codes in Annex Cloud
- To create rewards, go to annexcloud.com and login.
- Navigate to Products è Customer Loyalty è Rewards è Add New. It will open the following window
- Enter the required details and click Save. It will create the reward.
- Now, to upload the csv file (coupons), navigate to Options → Coupon Groups → Add New. It will open the following window.
- Enter the required details and upload the csv file (generated in the above section) and click Save.
- It will upload the csv file.
Checkout Flow
- Annex Cloud Checkout Group:
o We have created annexCloudCheckoutGroup into annexcloud-multi-step checkoutconfig.xml file.
o Add the Transition Bean for any checkout step to link with previous, next and current step.
o Need to add the Redirects bean for the checkout step.
o Then, add the key_value pair in this Property
<property name =”checkoutStepMap”>.
o Add the key_value pair in this Property
<property name =”validationResultsMap”>.
o Add the key_value pair in this Property
<property name =”checkoutProgressBar”>.
o All these properties come under a Checkout Group i.e. annexCloudCheckoutGroup.
Order Flow
Annex Cloud Send Order Steps:
o Created an action class “SendOrderDetailToAnnexCloudAction.java” in annexcloudv3fulfilmentprocess extension
o Qualified Path: /annexcloudv3fulfilmentprocess/src/com/annexcloud/actions/order/SendOrderCompletedNotificationAction.java
o Need to add the bean for Class in the order-process-spring.xml file:
o Qualified Path:
/annexcloudv3fulfilmentprocess/resources/annexcloudv3fulfilmentprocess/process/orderprocessspring.xml
o Then create action bean for the same in annexcloud-order-process.xml
o Qualified Path:
/annexcloudv3fulfilmentprocess/resources/annexcloudv3fulfilmentprocess/process/annexcloudorder-process.xml.
o In action bean for Transition.OK, go to checkAuthorizedOrderPayment.
o Transition. NOK goes to error.
Annex Cloud Return Order Steps:
o Created an action class “AnnexCloudReturnOrderAction.java” in annexcloudv3fulfilmentprocess extension.
o Qualified Path:
/annexcloudv3fulfilmentprocess/src/com/annexcloud/actions/returns/AnnexCloudReturnOrderAction.java
o Need to add the bean for Class in order-process-spring.xml File.
o Qualified Path:
/annexcloudv3fulfilmentprocess/resources/annexcloudv3fulfilmentprocess/process/orderprocessspring.xml
o Then create action bean for the same in annexcloud-order-process.xml
o Qualified Path:
/annexcloudv3fulfilmentprocess/resources/annexcloudv3fulfilmentprocess/process/annexcloudorder-process.xml.
o In action bean for Transition.OK, go to transactionReviewStatus.
o Transition.NOK goes to error.