当前位置:网站首页>SAP 业务技术平台(BTP) Workflow(工作流)功能介绍
SAP 业务技术平台(BTP) Workflow(工作流)功能介绍
2022-06-12 23:39:00 【华为云】
所谓工作流,是一种用于业务流程自动化的工具,由一系列步骤、任务或事件组成。
作为世界企业管理软件巨头,SAP 自然也有自己的工作流解决方案。历史最悠久最经典的,当然就是 SAP ABAP Workflow.
SAP CRM 一个经典的工作流用例,就是客户给某呼叫中心对应的邮箱地址发送一封邮件:
通过 SAP CRM 后台创建的工作流,该邮件的发送,会触发呼叫中心自动创建一条对应的条目,供座席处理:
以及 SAP Cloud for Customer 里的工作流:
前一篇文章 SAP 业务技术平台(BTP)上的 Business Rules Service 使用介绍,我们已经使用了 SAP BTP Cockpit Boosters 中的 Set up account for Workflow Management, 快速完成了在 SAP Business Technology Platform(下文简称 SAP BTP)上使用 Workflow 功能所需的配置。
该文章还介绍了如何一步步创建 SAP Business Rules 以及如何使用 HTTP POST 的方式,去调用该 Rule Service.
本文我们从 SAP API Hub 导入一个 SAP 发布的标准 Business Rules, 使用这个标准 Rules 来学习 SAP BTP Workflow 的用法。
进入 Manage Projects 应用,选择 Import Project from API Business Hub:
要从 API Business Hub 导入内容到 SAP BTP,需要首先在 SAP BTP 配置一个指向 API Hub 的逻辑系统,命名为 JerryAPIHub,包含一个 Destination:
Destination 名称为 BUSINESSRULES_APIHUB,这个 Destination 的名称在 SAP BTP Cockpit 里,选择 Basic Authentication 方式,输入登录 API Hub 的用户名和密码。
Destination 及逻辑系统创建完毕后,就可以从 API Hub 导入 SAP 标准发布的 Business Rule 了,名为 Equipment Determination Business Rules:
导入该 Rules 后,将其部署到 Cloud Runtime,这样其才能被本文后续创建的 Workflow 应用,通过 HTTP POST 方式消费。
这个 Business Rule 用于新员工入职场景(onboarding),可以根据员工模型上某些字段,决定出其应该使用什么型号的电脑设备(Equipment).
接下来,我们可以使用 Business Application Studio,开发一个 Workflow 应用。
关于这个 SAP BTP 开发工具的更多介绍,参考我的文章:SAP 新一代全栈开发工具:SAP Business Application Studio.
从 SAP Github 下载一个 Reference Workflow 应用到本地,再将其导入到 SAP Business Application Studio 中。
这是一个 SAP BTP MTA(Multi-Target Application)应用,更多细节参考我的文章:SAP云平台里的三叉戟应用。
这个应用的核心逻辑实现在文件 onboard.workflow 中,下面简要介绍其关键步骤。
Prepare Rules Payload:类型为 Script Task 的任务,其实现位于工程 scripts 文件夹下的 PrepareRulesPayload.js 文件里。
该任务的后续任务 Determine Equipment,我们会通过 HTTP Post 消费刚刚部署在 SAP BTP Cloud Runtime 上的 Business Service,因此需要在这个 Script Task 内进行一些简单的编码,组装 HTTP Post 远程调用 Business Service 所需的输入参数:
Determine Equipment:这是一个 Service Task,通过 Restful API 方式调用 Destination BUSINESS_RULE 指向的 Business Service.
Destination 这些字段的详细维护方式,在 Jerry 前一篇文章 SAP 业务技术平台(BTP) 上的 Business Rules Service 使用介绍 已经详细介绍过。
这个 Restful API 调用的输出,存储在名为 EquipmentsInfo 的 Data Object 里:
Change or Confirm Equipment: 这是一个 User Task,用户可以对调用 Business Rule 返回的结果包含的设备信息,进行调整和确认。这个任务的 UI,实现在文件夹 forms 的 ConfirmOrChangeEquipment.form 文件里。用户确认之后,进入下一步审批流程:
Approve Equipment:这也是一个 User Task,需要用户手动点击 Approve 或 Reject,进行电脑设备的批准或者拒绝。
将该应用 build 之后,生成一个 archive 文件,再将该文件使用右键菜单进行部署:
最后,我们来测试一下这个 Workflow 应用的运行效果。进入 Configure Visibility Scenarios 应用,创建一个新的 Scenario. Process Visibility Scenario 用于接收工作流事件,提供了可视化界面供用户浏览工作流的执行明细。
将我们之前导入到 SAP Business Application Studio 里的 id 为 onboard 的 Workflow 模型,导入到这个 Scenario 里来,能看到其步骤内所有的事件和上下文。
下面我们手动触发这个工作流应用,观察其执行细节。进入应用 Monitor Workflows:
选择 Start New Instance,创建一个新的工作流实例:
因为之前我在 SAP Business Application Studio 里进行 Workflow 建模时,曾经指定其 Start Event 支持 Sample Context,并配置了一个 json 文件作为 Sample Data:
所以每当创建新的 Workflow 实例时,其输入数据可以从 Sample Data 里自动带出来。选择 Start New Instance and Close:
回到 Fiori Launchpad,此时我的收件箱 Inbox 里,新增了一个条目:
这背后其实发生了很多事情:Workflow 应用里 Determine Equipment Service Task 得到执行,通过 HTTP POST,消费部署在 SAP BTP 上的 Business Rules Service,后者根据我们在 Start New Instance 里传入的 Sample Data,返回自动决定出的设备明细。
下图就是之前 Workflow 应用建模里的 User Task 的运行时界面。列表显示的内容,就是上图 HTTP POST 返回的 EquipmentsInfo 数据。这里我浏览这些返回结果,确认无误后,点击 Confirm 按钮,进入工作流下一个步骤即审批流程。
在审批流程,我可以选择 Approve 或者 Reject:
在 Monitor Workflows Instances 应用里,可以查看到目前为止该工作流任务的执行细节:
比如能观察到使用 HTTP Post 调用 SAP BTP Business Service 的 endpoint,和花费的时间:
至此,SAP Business Technology Platform 上的工作流使用介绍完毕。感谢阅读。
边栏推荐
- About three-tier architecture and MVC
- Develop a web office suite from scratch (5): mouse hover over text
- OpenCV源代码编译
- 細數攻防演練中十大關鍵防守點
- [issue 30] shopee golang development experience
- 2022 R2 mobile pressure vessel filling test questions and online simulation test
- Lua conditional statement
- The most widely used dynamic routing protocol: OSPF
- Ten key defensive points in the detailed attack and defense drill
- MySQL row to column, column to row, multiple columns to one row, one row to multiple columns
猜你喜欢
2022年危险化学品经营单位安全管理人员考试试题及在线模拟考试
Teach you how to grab ZigBee packets through cc2531 and parse encrypted ZigBee packets
The carrying capacity of L2 level ADAS increased by more than 60% year-on-year in January, and domestic suppliers "emerged"
[opencv learning] perspective transformation matrix
PostgreSQL 中文社区黑龙江分会和辽宁分会成立啦!
Model over fitting - solution (II): dropout
Deep learning neural network: implementation method of convolution [direct method (no loss of precision), GEMM (matrix multiplication, no loss of precision), FFT (Fourier transform, loss of precision)
LeetCode 890 查找和替换模式[map] HERODING的LeetCode之路
C language: how to give an alias to a global variable?
度量学习(Metric Learning)【AMSoftmax、Arcface】
随机推荐
China's new generation information technology industry "14th five year plan" special planning and innovation strategic direction report 2022 ~ 2028
Dry goods sharing | BitSet application details
Summary of MySQL foundation view
Develop a web office suite from scratch (5): mouse hover over text
Test platform series (97) perfect the case part
深度学习-神经网络:卷积的实现方法【直接法(精度没损失)、GEMM(矩阵乘法,精度没损失)、FFT(傅里叶变换,精度有损失)、Winograd(精度有损失)】
MySQL row to column, column to row, multiple columns to one row, one row to multiple columns
InfoQ geek media's 15th anniversary solicitation | brief introduction to the four challenges of building a micro service architecture
Deep learning neural network: implementation method of convolution [direct method (no loss of precision), GEMM (matrix multiplication, no loss of precision), FFT (Fourier transform, loss of precision)
Common message oriented middleware selection
2022年R2移动式压力容器充装考试题及在线模拟考试
Chapter 8 - shared model JUC
Access static variables within class in swift
2022年电工(初级)操作证考试题库及在线模拟考试
Theory + practice will help you master the dynamic programming method
For product managers, which of the two certificates, PMP and NPDP, is more authoritative?
[kubernetes guide ④] pod quick start
LeetCode —— 26. Remove duplicates from an ordered array
Zhengzhou University of light industry -- development and sharing of harmonyos pet health system
Huawei officially entered the "front loading" stage, and the millimeter wave radar track entered the "localization +4d" cycle