SAP Cloud for Customer Rule Editor的使用方法和底层工作原理-阿里云开发者社区

开发者社区> c位出道> 正文

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.png

and hide it for any other values:

image.png

In 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.png

When 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 url.


image.png

Inside this CalculationRule node there is one important sub node:

image.png

image.png

With this setting, whenever I change the UI element bound to Model field /Root/PriorityCode, the rule will be evaluated.

image.png

The rule represented in String format will be parsed into an Abstract Syntax Tree:

image.png

image.png

And its value gets evaluated:

image.png

The 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.png

The Navigation bar gets rerendered in line 623:

image.png

The Navigation bar has its dedicated renderer NavigationBarRenderer which does the actual rendering work ( see my blog for detail about UI5 control render)


image.png

image.png

This 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


版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
SAP Fiori Elements里Smart Link工作原理介绍
SAP Fiori Elements里Smart Link工作原理介绍
16 0
SAP Fiori Elements里的Smart Table工作原理解析
SAP Fiori Elements里的Smart Table工作原理解析
7 0
完整的个人博客指南:如何使用WordPress启动和发展个人博客
完整的个人博客指南:如何使用WordPress启动和发展个人博客 互联网上有足够的空间供所有人使用。人们喜欢分享想法,塑造他们的想法,甚至可能覆盖全球观众。如何让自己走上实现这一切的道路?一次,如何创建个人博客?由于几个原因,博客非常有效。
1486 0
Redis:Bitmaps使用场景和常用命令
Redis:Bitmaps使用场景和常用命令
2222 0
Angular rxjs里自定义operator的使用
Angular rxjs里自定义operator的使用
4 0
访问SAP C4C Business Configuration工作中心时遇到的错误信息
访问SAP C4C Business Configuration工作中心时遇到的错误信息
21 0
+关注
2316
文章
0
问答
来源圈子
更多
+ 订阅
文章排行榜
最热
最新
相关电子书
更多
《2021云上架构与运维峰会演讲合集》
立即下载
《零基础CSS入门教程》
立即下载
《零基础HTML入门教程》
立即下载