如何在 SAP BTP 上创建以及消费 Business Rule Service
官网链接:https://developers.sap.com/tutorials/cp-cf-businessrules07-ruleservice-ruleset.html
Create a rule service interface for an application to invoke the decision logic by associating the rule to a ruleset of the rule service.
创建 rule service interface 的目的:应用程序通过将规则与规则服务的规则集相关联来调用决策逻辑。
A rule service is an interface or an end point that enables an application to invoke a decision logic.
rule service 可以看成一个接口或者 endpoint,应用程序通过调用 rule service,可以触发 decision logic.
Rule set 是一系列 rule 的集合,工作于某个特定的场景。
A rule set can be linked to a rule service so that the set of rules in the rule set gets executed when the rule service is deployed.
规则集可以链接到规则服务,以便在部署规则服务时执行规则集内包含的所有规则。
创建一个新的 rule service:
从下拉菜单里选择 vocabulary:
语义是:通过 Employee 信息作为输入,决策出 EquipmentInfo 作为决策结果:
创建另一个 rule service,用于决策是否需要 approval:
激活整个项目:
点击 Deploy 按钮,部署 rule service:
如果部署失败,检查该 Rule Service 使用到的 entity 是否已经激活,或者是否已经添加到 Ruleset vocabulary 里:
很明显,这个 Equipment 维护错了,应该修改成 Employee:
SAP API Business Hub 上找到 SAP Business Rules Service:
使用 Rule Execution API for Cloud Foundry 调用 Business Service:
给 wm_businessrules 创建一个新的 service key:
抄下 clientid, clientsecret 和 url 字段,作为 SAP API Business Hub 里维护 environment 的输入值:
消费该 business rule service 的输入 payload:
{
"RuleServiceId": "f27730d10cce4525ae111e647054d8f7",
"Vocabulary": [
{
"Employee": {
"IsFullTimeEmployee": true,
"countryofCompany": "USA",
"jobTitle": "Engineer II",
"company": "2000"
}
}
]
}
更多Jerry的原创文章,尽在:“汪子熙”:
相关文章
- 如何在 SAP ABAP ALV 报表里以交通灯的方式显示某一列的值
- 如何使用 SAP UI5 V2 ODataModel 创建数据
- 使用Fiori Elements创建的SAP UI5应用,如何支持编辑功能
- 如何用 ABAP 代码创建 SAP CRM IBase
- SAP 云平台上的 ABAP 编程环境里如何消费第三方服务
- 如何在SAP Cloud for Customer中创建基于Opportunity的Registered Product
- 如何使用ABAP代码创建SAP Product Category
- 如何在SAP ABAP系统里创建和消费Web Service
- 如何在SAP WebClient UI里使用HANA Live report
- 如何隐藏SAP CRM WebClient UI配置页面的字段
- SAP ABAP实用技巧介绍系列之如何创建Maintenance view
- SAP Spartacus 自定义 Component 的使用 - SimpleResponsiveBannerComponent
- 如何通过代码获得当前SAP Spartacus Component渲染所基于的slot名称
- 如何使用SAP C4C Repository Explorer里的BO test shell
- 如何用SAP Cloud for Customer的手机App创建销售订单
- 如何用Postman创建SAP CRM的Opportunity业务数据
- 如何阻止SAP CRM订单创建好之后,自动被置为传输状态这一行为
- 如何在SAP里创建configurable material物料主数据
- 如何在Android平台上创建自定义的Cordova插件并使用SAP UI5消费
- SAP Analytics Cloud里如何基于一个已有的model创建Story
- 如何分析因为 SAP UI5 版本差异带来的问题试读版
- SAP UI5 应用开发教程之三十五 - 如何把本地开发的 SAP UI5 应用部署到 ABAP 服务器上试读版
- 使用自定义 HTTP Interceptor 记录 SAP Spartacus 发送的 OCC API 以及响应