Calling PeopleTools APIs 调用PeopleTools API

Calling PeopleTools APIs
调用PeopleTools API

You can call all of the PeopleTools APIs from an Application Engine program. When using APIs, remember that:

您可以从应用程序引擎程序调用所有PeopleTools API。使用API时,请记住:

  • All the PeopleTools APIs contain a Save method.
  • 所有PeopleTools API都包含一个Save方法。

However, when you call an API from your Application Engine program, regardless of the Save method of the API, the data is not saved until the Application Engine program issues a commit.

但是,当您从应用程序引擎程序调用API时,无论API的Save方法如何,数据都不会保存,直到应用程序引擎程序发出提交。

  • If you called a component interface from an Application Engine program, all the errors related to the API are logged in the PSMessage collection associated with the current session object.
  • 如果您从应用程序引擎程序调用组件接口,所有与API相关的错误都会记录在与当前会话对象关联的PSMessage集合中。
  • If you sent a message, errors are written to the message log and the Application Engine message log.
  • 如果您发送了消息,错误将写入消息日志和应用程序引擎消息日志。
  • If an Application Engine program called from a message subscription PeopleCode encounters errors and the program exits (with Exit (1)), the error is written to the message log and is marked as an error
  • 如果从消息订阅PeopleCode调用的应用程序引擎程序遇到错误并且程序退出(使用Exit(1)),则错误将写入消息日志并标记为错误
Using the CommitWork Function
使用CommitWork函数

This function commits pending changes (inserts, updates, and deletes) to the database. When using CommitWork, remember that:

此函数向数据库提交挂起的更改(插入、更新和删除)。使用Commit Work时,请记住:

  • This function can be used only in an Application Engine program that has restart disabled.
  • 此功能只能在已禁用重新启动的应用程序引擎程序中使用。
  • The CommitWork function is useful only when you are processing SQL one row at a time in a single PeopleCode program, and you need to commit without exiting the program.
  • CommitWork函数只有当您在单个PeopleCode程序中一次处理一行SQL,并且您需要在不退出程序的情况下提交时才有用。

In a typical Application Engine program, SQL commands are split between multiple Application Engine actions that fetch, insert, update, or delete application data. You use the section or step level commit settings to manage the commits.

在典型的应用程序引擎程序中,SQL命令在多个获取、插入、更新或删除应用程序数据的应用程序引擎操作之间拆分。使用节或步骤级别提交设置来管理提交。

Related Links

“CommitWork” (PeopleCode Language Reference)

相关链接"CommitWork"(PeopleCode语言参考)

Calling WINWORD Mail Merge

调用WINWORD邮件合并

If the Process Scheduler is booted using a shared drive on another machine and you intend to call a WINWORD mail merge process from Application Engine, then you must do one of the following to ensure successful completion:

如果进程计划程序是使用另一台计算机上的共享驱动器启动的,并且您打算从应用程序引擎调用WINWORD邮件合并进程,则必须执行以下操作之一以确保成功完成:

  1. Configure the Process Scheduler to run Application Engine programs using psae instead ofpsaesrv.

将进程调度程序配置为使用psae而不是psae srv运行应用程序引擎程序。

  1. Ensure the generated document is saved locally, not on a shared network drive.

确保生成的文档保存在本地,而不是共享的网络驱动器上。

Using PeopleCode Examples 使用PeopleCode示例

The following topics provide examples of common ways that you can use PeopleCode within Application Engine programs.

以下主题提供了在应用程序引擎程序中使用PeopleCode的常用方法的示例。

Do When Actions

Do When 操作

Instead of a Do When action that checks a %BIND value, you can use PeopleCode to perform the equivalent operation. For example, suppose the following SQL exists in your program:

与检查%BIND值的Do When操作不同,您可以使用PeopleCode执行等效的操作。例如,假设您的程序中存在以下SQL:

%SELECT(EXISTS) SELECT 'Y' FROM PS_INSTALLATION WHERE %BIND(TYPE) = 'X'),

Using PeopleCode, you could insert this code:

使用PeopleCode,您可以插入以下代码:

If TYPE = 'X' Then

   Exit(0);

Else

   Exit(1);

End-if;

If you set the On Return parameter on the PeopleCode action properties to Skip Step, this code behaves the same as the Do When action. The advantage of using PeopleCode is that no trip to the database occurs.

如果将PeopleCode操作属性上的On Return参数设置为Skip Step,则此代码的行为与Do When操作相同。使用PeopleCode的优点是不会发生对数据库的访问。

Dynamic SQL

动态SQL

If you have a Select statement that populates a text field with dynamic SQL, such as the following:

如果您有一个Select语句,该语句使用动态SQL填充文本字段,如下所示:

%SELECT(AE_WHERE1)

SELECT 'AND ACCOUNTING_DT  <= %Bind(ASOF_DATE)'

You can use this PeopleCode:

您可以使用此PeopleCode:

AE_WHERE1 = "AND ACCOUNTING_DT  <= %Bind(ASOF_DATE)";

Sequence Numbering

序列编号

If you typically use Select statements to increment a sequence number inside of a Do Select, While, or Until loop, you can use the following PeopleCode instead:

如果您通常使用Select语句在Do Select、While或Until循环内递增序列号,则可以改为使用以下PeopleCode:

SEQ_NBR = SEQ_NBR + 1;

Using PeopleCode rather than SQL can affect performance significantly. Because the sequencing task occurs repeatedly inside a loop, the cost of using a SQL statement to increment the counter increases with the volume of transactions your program processes. When you are modifying a program to take advantage of PeopleCode, the areas of logic you should consider are those that start with steps that run inside a loop.

使用PeopleCode而不是SQL会显著影响性能。因为定序工作在循环内重复发生,所以使用SQL陈述式递增计数器的成本会随程式处理的交易量而增加。当您修改程序以利用PeopleCode时,您应该考虑的逻辑区域是那些以在循环中运行的步骤开始的逻辑区域。

Note: You can also use the meta-SQL constructs %Next and %Previous when performing sequence numbering. These constructs may improve performance in both PeopleCode and SQL calls.

附注:您还可以使用元SQL构造%执行序列编号时,选择Next和%Previous。这些构造可以提高PeopleCode和SQL调用的性能。

Rowsets

行集

You can use rowsets in Application Engine PeopleCode; however, using rowsets means you will be using PeopleCode to handle more complicated processing, which degrades performance.

您可以在应用程序引擎PeopleCode中使用行集;但是,使用行集意味着您将使用PeopleCode处理更复杂的处理,这会降低性能。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/169899.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【机器学习】算法性能评估常用指标总结

考虑一个二分问题&#xff0c;即将实例分成正类&#xff08;positive&#xff09;或负类&#xff08;negative&#xff09;。对一个二分问题来说&#xff0c;会出现四种情况。如果一个实例是正类并且也被 预测成正类&#xff0c;即为真正类&#xff08;True positive&#xff0…

计算两个经纬度之间的实际距离(Haversine公式)----c++

来源:https://www.open-open.com/lib/view/open1430573897802.html 原理亦可参考:https://blog.csdn.net/gaocuisheng/article/details/126060795 #include <cmath> #define EARTH_RADIUS 6371.0;// 地球半径&#xff0c;单位千米static double HaverSin(double theta…

文献速递:人工智能在新生儿重症监护室:现在是时候了

人工智能在新生儿重症监护室&#xff1a;现在是时候了 01 文献速递介绍 文章介绍了AI的多学科特性&#xff0c;包括计算机科学、数学、神经科学和哲学。AI的目标是通过各种计算和算法技术创建智能机器。尽管早期对人类水平AI的预测未能实现&#xff0c;但对AI的期待仍然强烈…

OpenGL 图元赋色(Qt)

文章目录 一、简介二、实现代码三、实现效果一、简介 这里同样对OpenGL中的顶点赋色相关功能进行封装,便于我们后续的使用,具体内容可以阅读代码。 二、实现代码 这里我们需要改造一下我们之前的Drawable基类,这样后续的所有图元都可以通过它来进行顶点赋色。 Drawable.h #i…

ubuntu20.04配置OpenCV的C++环境

ubuntu20.04配置OpenCV的C环境 这里以opencv-3.4.16为例 复现https://github.com/raulmur/ORB_SLAM2此项目&#xff0c;需安装opencv及其他依赖&#xff0c;可见README.md详情 1.下载opencv源代码 https://opencv.org/releases/ 2.下载OpenCV的扩展包opencv_contrib&#x…

python安装redis库

天行健&#xff0c;君子以自强不息&#xff1b;地势坤&#xff0c;君子以厚德载物。 每个人都有惰性&#xff0c;但不断学习是好好生活的根本&#xff0c;共勉&#xff01; 文章均为学习整理笔记&#xff0c;分享记录为主&#xff0c;如有错误请指正&#xff0c;共同学习进步。…

杂货铺 | Windows系统上解压缩tgz文件

文章目录 &#x1f4da;快速终端打开实现 & 解压缩实现步骤&#x1f4da;环境变量的一般配置步骤 & 问题解决思路 &#x1f4da;快速终端打开实现 & 解压缩实现步骤 将对应的tgz文件放入对应的文件夹。快速在指定文件夹下打开终端 打开对应的路径 双击地址栏 然后…

计算机视觉面试题-01

计算机视觉面试通常涉及广泛的主题&#xff0c;包括图像处理、深度学习、目标检测、特征提取、图像分类等。以下是一些可能在计算机视觉面试中遇到的常见问题&#xff1a; 图像处理和计算机视觉基础 图像是如何表示的&#xff1f; 图像在计算机中可以通过不同的表示方法&…

Ansible的错误处理

环境 管理节点&#xff1a;Ubuntu 22.04控制节点&#xff1a;CentOS 8Ansible&#xff1a;2.15.6 ignore_errors 使用 ignore_errors: true 来让Ansible忽略错误&#xff08;运行结果是 failed &#xff09;&#xff1a; --- - hosts: alltasks:- name: task1shell: cat /t…

新手如何买卖可转债,可转债投资基础入门

一、教程描述 什么是可转债&#xff1f;可转债是可转换债券的二次简称&#xff0c;原始全称是可转换公司债券&#xff0c;这是一种可以在特定时间、按特定条件&#xff0c;转换为普通股票的特殊企业债券&#xff0c;可转换债券兼具债权和股权的特征&#xff0c;其英文为conver…

[网鼎杯 2020 朱雀组]Nmap

启动环境 结合题目首先就是要知道关于关于nmap命令 相关的命令-oN 标准保存 -oX XML保存 -oG Grep保存 -oA 保存到所有格式 -iL 读取文件内容&#xff0c;以文件内容作为搜索目标 -o 输出到文件 -sP Ping 扫描 还有许多 nmap命令https://blog.csdn.net/weixin_735627…

基于OGG实现Oracle实时同步MySQL

&#x1f4e2;&#x1f4e2;&#x1f4e2;&#x1f4e3;&#x1f4e3;&#x1f4e3; 哈喽&#xff01;大家好&#xff0c;我是【IT邦德】&#xff0c;江湖人称jeames007&#xff0c;10余年DBA及大数据工作经验 一位上进心十足的【大数据领域博主】&#xff01;&#x1f61c;&am…

学习Pandas 二(Pandas缺失值处理、数据离散化、合并、交叉表与透视表、分组与聚合)

文章目录 六、高级处理-缺失值处理6.1 检查是否有缺失值6.2 缺失值处理6.3 不是缺失值NaN&#xff0c;有默认标记的 七、高级处理-数据离散化7.1 什么是数据的离散化7.2 为什么要离散化7.3 如何实现数据的离散化 八、高级处理-合并8.1 pc.concat实现合并&#xff0c;按方向进行…

安卓用SQLite数据库存储数据

什么是SQLite&#xff1f; SQLite是安卓中的轻量级内置数据库&#xff0c;不需要设置用户名和密码就可以使用。资源占用较少&#xff0c;运算速度也比较快。 SQLite支持&#xff1a;null&#xff08;空&#xff09;、integer&#xff08;整形&#xff09;、real&#xff08;小…

Linux基本指令(前篇)

目录 1.ls指令 2.pwd指令 3.cd 指令 4.touch指令 5.mkdir指令&#xff08;重要&#xff09; 6.rmdir指令 && rm 指令&#xff08;重要&#xff09; 7.man指令&#xff08;重要&#xff09; 1.ls指令 ls 选项 目录或文件 对于目录&#xff0c;该命令列出该目录下的所…

【SpringCloud】微服务的扩展性及其与 SOA 的区别

一、微服务的扩展性 由上一篇文章&#xff08;没看过的可点击传送阅读&#xff09;可知&#xff0c; 微服务具有极强的可扩展性&#xff0c;这些扩展性包含以下几个方面&#xff1a; 性能可扩展&#xff1a;性能无法完全实现线性扩展&#xff0c;但要尽量使用具有并发性和异步…

OD机考真题搜集:查字典

题目 输入一个单词前缀和一个字典,输出包含该前缀的单词 输入 单词前缀+字典长度+字典字典是一个有序单词数组 输入输出都是小写 输出 所有包含该前缀的单词,多个单词换行输出若没有则返回-1 示例 1 输入: b 3 a b c 输出: b示例 2 输入: abc 4 a ab abc abcd 输出: …

4.28每日一题(二重积分比较大小:被积函数的大小、正负性、积分区间奇偶性)

一般比较大小的题目我们不需要把结果全部计算出来 &#xff0c;而是通过奇偶性或者被积函数的大小或大于0、等于0、小于0等方法判断比较

【Android Gradle】之Gradle入门及 wrapper 生成(一)

&#x1f604;作者简介&#xff1a; 小曾同学.com,一个致力于测试开发的博主⛽️&#xff0c;主要职责&#xff1a;测试开发、CI/CD 如果文章知识点有错误的地方&#xff0c;还请大家指正&#xff0c;让我们一起学习&#xff0c;一起进步。 &#x1f60a; 座右铭&#xff1a;不…

机器学习-激活函数的直观理解

机器学习-激活函数的直观理解 在机器学习中&#xff0c;激活函数&#xff08;Activation Function&#xff09;是用于引入非线性特性的一种函数&#xff0c;它在神经网络的每个神经元上被应用。 如果不使用任何的激活函数&#xff0c;那么神经元的响应就是wxb&#xff0c;相当…