- 如何在 SAP BTP 上创建以及消费 Business Rul
- SAP HANA Cloud 学习教程之二: 如何往SAP BT
- Fiori-like Prototype ( 2021 SAP
- Fiori-like Prototype ( SAP BTP 2
- SAP BTP 上 workflow 和 Business Se
- 在 CloudFoundry 环境下开发 multitenant
- 使用 cf push 部署应用到 SAP BTP 时遇到错误消息
- Fiori-like Prototype ( 2021 SAP
- 在 SAP BTP 里使用 SAP HANA Cloud 试用版
- 如何在 ABAP Development Tool 创建新的 A
官网链接: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的原创文章,尽在:"汪子熙":

网友评论