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

相关文章
|
1月前
|
安全 UED 开发者
SAP Commerce Cloud 配置项 refreshWithLock=false 的作用介绍
SAP Commerce Cloud 配置项 refreshWithLock=false 的作用介绍
22 0
|
1月前
|
Java BI API
SAP Cloud for Customer 里如何通过 ABSL 二次开发方式消费 SAP S/4HANA 系统的 API
SAP Cloud for Customer 里如何通过 ABSL 二次开发方式消费 SAP S/4HANA 系统的 API
21 0
|
3月前
|
前端开发 JavaScript 数据库
前端 富文本编辑器原理
前端 富文本编辑器原理
34 0
|
3月前
|
机器学习/深度学习 人工智能 监控
SAP Sales Cloud,Service Cloud 和 SAP BTP 平台上的 AI 集成场景
SAP Sales Cloud,Service Cloud 和 SAP BTP 平台上的 AI 集成场景
70 0
|
6月前
|
数据安全/隐私保护
SAP Commerce Cloud 的 DataIsolation flag
SAP Commerce Cloud 的 DataIsolation flag
26 0
|
6月前
|
数据管理 API
什么是 SAP Commerce Cloud 集成扩展包
什么是 SAP Commerce Cloud 集成扩展包
25 1
|
2月前
|
存储 Linux 编译器
vim编辑器和gcc/g++编辑器的使用讲解
vim编辑器和gcc/g++编辑器的使用讲解
55 2
|
2月前
|
Linux 编译器 开发工具
Linux:详解(yum的使用、vim编辑器命令集合以及gcc/g++编译器的使用)
Linux:详解(yum的使用、vim编辑器命令集合以及gcc/g++编译器的使用)
126 1
|
2月前
|
Linux Shell 开发工具
【linux】Linux编辑器-vim
【linux】Linux编辑器-vim
57 0
|
3天前
|
弹性计算 Unix Linux
Linux:文本编辑器 - vim
Linux:文本编辑器 - vim
10 1