SAP Cloud for Customer Rule Editor的使用方法和底层工作原理

简介: SAP Cloud for Customer Rule Editor的使用方法和底层工作原理

In C4C it is very convenient to define rule to dynamically control the visibility of a given UI element. This blog mainly focus on how it works under the hood, so that in case you meet with trouble or this dynamical mechanism does not work as you expected, you can first do trouble shooting by yourself before creating a ticket to SAP.

For example I would like to enable FEED facet only in condition that the Priority equals to Immediate,image.pngand hide it for any other values:image.pngIn order to achieve this we can simply create one rule as below, which means the visibility of FEED tab equals to the value of expression “Root.PriorityCode” evaluated in the runtime.image.pngWhen this rule is created, the rule detail is stored as a CalculationRule node in UI Model. You can find it by appending “debugMode=true” in urlimage.pngimage.pngWith this setting, whenever I change the UI element bound to Model field /Root/PriorityCode, the rule will be evaluated.

image.pngThe rule represented in String format will be parsed into an Abstract Syntax Tree:image.pngimage.pngAnd its value gets evaluated:image.pngThe visibility of FEED tab is called as “DynamicProperty” as it is controlled dynamically by the rule I specified. The update on the visibility property will lead to the fact that the whole NavigationBar with internal ID ___bar1 is added to the invalidation queue whose elements will be invalidated later.image.pnghe Navigation bar gets rerendered in line 623:image.pngThe Navigation bar has its dedicated renderer NavigationBarRenderer which does the actual rendering work ( see my blog for detail about UI5 control render)image.pngimage.pngThis is the reason why finally you could not see FEED tab in UI as the corresponding DOM element is not rendered by NavigationBarRenderer due to the IF evaluation in line 78.image.png




image.png

相关文章
|
5月前
|
存储 UED
SAP Hybris Revenue Cloud 和 SAP Subscription Billing 这两个产品的关联
SAP Hybris Revenue Cloud 和 SAP Subscription Billing 这两个产品的关联
37 0
|
4天前
|
前端开发 JavaScript 数据库
前端 富文本编辑器原理
前端 富文本编辑器原理
7 0
|
1月前
|
XML JavaScript 数据格式
SAP UI5 XML Preprocessor 的工作原理和 instructions 指令详解
SAP UI5 XML Preprocessor 的工作原理和 instructions 指令详解
14 0
|
1月前
|
机器学习/深度学习 人工智能 监控
SAP Sales Cloud,Service Cloud 和 SAP BTP 平台上的 AI 集成场景
SAP Sales Cloud,Service Cloud 和 SAP BTP 平台上的 AI 集成场景
55 0
|
4月前
|
数据安全/隐私保护
SAP Commerce Cloud 的 DataIsolation flag
SAP Commerce Cloud 的 DataIsolation flag
17 0
|
4月前
|
数据管理 API
什么是 SAP Commerce Cloud 集成扩展包
什么是 SAP Commerce Cloud 集成扩展包
16 1
|
5月前
|
SQL 存储 Java
关于 SAP Commerce Cloud 开发环境的 HSQLDB
关于 SAP Commerce Cloud 开发环境的 HSQLDB
15 0
|
5月前
|
存储 前端开发 API
SAP Commerce Cloud 里的 smartedit webservices OCC API
SAP Commerce Cloud 里的 smartedit webservices OCC API
22 0
|
5月前
|
应用服务中间件 API 数据库
SAP ABAP 应用程序中的锁机制和工作原理介绍试读版
SAP ABAP 应用程序中的锁机制和工作原理介绍试读版
35 0
|
5月前
|
SEO
SAP Commerce Cloud 中的 SimpleResponsiveBannerComponent
SAP Commerce Cloud 中的 SimpleResponsiveBannerComponent
29 0