Using PeopleCode in Application Engine Programs在应用引擎程序中使用PeopleCode

news2024/9/24 5:21:59

This section provides an overview of PeopleCode and Application Engine programs and discusses how to:

本节概述了PeopleCode和应用程序引擎程序,并讨论了如何:

  • Decide when to use PeopleCode.
  • 决定何时使用PeopleCode。
  • Consider the program environment.
  • 考虑程序环境。
  • Access state records with PeopleCode.
  • 使用PeopleCode访问状态记录。
  • Use If/Then logic.
  • 使用如果/那么逻辑。
  • Use PeopleCode in loops.
  • 在循环中使用PeopleCode。
  • Use the AESection class.
  • 使用AESection类。
  • Make synchronous online calls to Application Engine programs.
  • 对应用程序引擎程序进行同步联机调用。
  • Use the file class.
  • 使用文件类。
  • Call COBOL modules.
  • 调用COBOL模块
  • Call PeopleTools application programming interfaces (APIs).
  • 调用PeopleTools应用程序编程接口(API)。
  • Use the CommitWork function.
  • 使用CommitWork功能。
  • Call WINWORD Mail Merge
  • 调用WINWORD邮件合并
  • Use PeopleCode examples.
  • 使用PeopleCode示例。
Understanding PeopleCode and Application Engine Programs 理解PeopleCode和应用引擎程序

Inserting PeopleCode into Application Engine programs enables you to reuse common function libraries and improve performance. In many cases, a small PeopleCode program used instead of Application Engine PeopleCode is an excellent way to build dynamic SQL, perform simple If/Else edits, set defaults, and perform other tasks that do not require a trip to the database.

将PeopleCode插入到Application Engine程序中使您能够重用公共函数库并提高性能。在许多情况下,一个小的PeopleCode程序用来代替应用程序引擎PeopleCod是一个很好的方式来构建动态SQL,执行简单的If/else编辑、设置默认值和执行其他不需要访问数据库的任务。

Scope of Variables

变量的作用域

This table presents the different types of variables typically used in Application Engine programs and their scope:

下表显示了应用程序引擎程序中通常使用的不同类型的变量及其作用域:

Type of Variable

Scope

Comments

State record (work record)

Transaction (unit of work)

Using a work record as your Application Engine state record means that the values in the work record cannot be committed to the database. Commits happen as directed, but any values in work records are not retained after a commit.

State record (database record)

Application Engine program

Using a database record as your Application Engine state record preserves the values in the state record on commit, and the committed values are available in the event of a restart.

Local PeopleCode variables

PeopleCode program

Local PeopleCode variables are available only for the duration of the PeopleCode program that is using them.

Global PeopleCode variables

Application Engine program

Global PeopleCode variables are available during the life of the program that is currently running. Any global PeopleCode variables are saved when an Application Engine program commits and checks points; therefore, they are available in the event of a restart.

Component PeopleCode variables

Application Engine program

Component PeopleCode variables act like global variables in Application Engine.

Action Execution Order

操作执行顺序

A step can contain only one PeopleCode action because no other types of actions are required within a step in conjunction with a PeopleCode action (or program). If you include other actions with your PeopleCode action within the same step, keep in mind the hierarchy when you run it.

一个步骤只能包含一个PeopleCode操作,因为在一个步骤中不需要与PeopleCode操作(或程序)结合的其他类型的操作。如果您在同一步骤中包含其他操作与您的People Code操作,请在运行它时记住层次结构。

With PeopleCode actions, Application Engine runs the PeopleCode program before the SQL, Call Section, or Log Message actions, but a PeopleCode program runs after any program flow checks.

使用PeopleCode操作时,应用程序引擎将在SQL、CallSection或日志消息操作之前运行PeopleCode程序,但在任何程序流检查之后运行PeopleCode程序。

Because multiple action types exist, they must execute in agreement within a system; therefore, the order in which actions execute is significant. At runtime, actions defined for a given step are evaluated based on their action type. All of the action types exist within a strict hierarchy of execution. For example, if both a Do When action and a PeopleCode action exist within a given step, then the Do When action always runs first.

由于存在多个操作类型,它们必须在系统中以一致的方式执行;因此,操作的执行顺序非常重要。在运行时,为给定步骤定义的操作将根据其操作类型进行评估。所有操作类型都存在于严格的执行层次结构中。例如,如果两个Do当操作和PeopleCode操作存在于给定步骤中时,则Do When操作总是第一个运行。

The following example shows the sequence and level of execution for each type of action:

下面的例子显示了每种作用方式的执行顺序和水平:

This is an example of action execution hierarchy.

Deciding When to Use PeopleCode 决定何时使用PeopleCode

Application Engine is not intended to run programs that include only PeopleCode actions. The primary purpose of Application Engine is to run SQL against your data.

应用程序引擎不用于运行仅包括PeopleCode操作的程序。应用程序引擎的主要目的是对数据运行SQL。

Use PeopleCode primarily for setting If, Then, Else logic constructs, performing data preparation tasks, and building dynamic portions of SQL statements; rely on SQL to complete the bulk of actual program processing. Also use PeopleCode to reuse previously developed online logic. PeopleCode is the tool to use to take advantage of new technologies such as component interfaces and application classes.

PeopleCode主要用于设置If,Then,Else逻辑结构,执行数据准备任务,构建SQL语句的动态部分;依靠SQL来完成大量的实际程序处理。还可以使用PeopleCode重用以前开发的在线逻辑。PeopleCode是一种利用新技术(如组件接口和应用程序类)的工具。

Most programs must verify that a certain condition is true before they run a particular section. For example, if the hourly wage is less than or equal to X, do Step A; if not, fetch the next row. In certain instances, you must modify variables that exist in a state record. PeopleCode enables you to set state record variables dynamically.

大多数程序在运行特定的节之前必须验证某个条件为真。例如,如果小时工资小于或等于X,则执行步骤A;如果不是,则获取下一行。在某些情况下,必须修改存在于状态记录中的变量。PeopleCode允许您动态地设置状态记录变量。

Avoid rowset processing in an Application Engine program. Loading data into a rowset can use a significant amount of memory, which this formula approximates:

避免在应用程序引擎程序中处理行集。将数据加载到行集中可能会使用大量的内存,以下公式近似为:

mem = nrows * (row overhead + nrecords * (rec overhead + nfields * (field overhead) + average cumulative fielddata)) where

Mem = n 行*(行开销+ n 记录*( rec 开销+ nfields +*(现场开销+平均累计现场数据))

  • mem is the amount of memory required to store the rowset.
  • 其中·mem是存储行集所需的内存量。
  • nrows is the number of rows.
  • nrows是行数。
  • row overhead is the overhead per row.
  • 行开销是指每行的开销。
  • nrecords is the number of records per row.
  • n record是每行的记录数。
  • rec overhead is the record overhead (approximately 40 bytes).
  • rec开销是记录开销(大约40字节)。
  • nfields is the number of fields in the record.
  • nfields是记录中的字段数。
  • field overhead is the overhead per field (approximately 80 bytes).
  • 字段开销是每个字段的开销(大约80字节)。
  • average cumulative fielddata is the average amount of data per field.
  • 平均累积字段数据是每个字段的平均数据量。

Using this formula, a rowset containing 500,000 rows with one record per row, 50 fields, and 200 bytes per field would require approximately 2.3 gigabytes of memory.

使用这个公式,包含500,000行,每行一条记录的行集,50个字段,每个字段200字节将需要大约2.3千兆字节的内存。

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

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

相关文章

【从零开始实现意图识别】中文对话意图识别详解

前言 意图识别(Intent Recognition)是自然语言处理(NLP)中的一个重要任务,它旨在确定用户输入的语句中所表达的意图或目的。简单来说,意图识别就是对用户的话语进行语义理解,以便更好地回答用户…

2020年12月 Scratch(三级)真题解析#中国电子学会#全国青少年软件编程等级考试

Scratch等级考试(1~4级)全部真题・点这里 一、单选题(共25题,每题2分,共50分) 第1题 关于广播消息,以下说法正确的是? A:只有角色,可以通过“广播消息”积木,向其他角色或是背景发送消息 B:只有背景,可以通过“广播消息”积木,向其他角色或是背景发送消息 C:背…

远端WWW服务支持TRACE请求

安全扫描的时候,扫出来的问题,这里不分享如何处理,就只分享下,如何找到有问题的端口。 通过命令 curl -v -X TRACE -I ip:port,这里的ip和端口就是扫描出有问题的服务器地址ip以及开放的服务端口。 观察返回值&#x…

建设数字工厂管理系统对企业来说有哪些优势

随着科技的飞速发展,数字化转型已成为企业持续发展的必由之路。在这一背景下,建设数字工厂管理系统显得尤为重要。本文将详细分析数字工厂管理系统给企业带来的优势,以及企业如何选择合适的管理系统和成功实施数字化转型。 一、数字工厂管理系…

【华为数通HCIP | 网络工程师】821-IGP高频题、易错题之OSPF(1)

个人名片: 🐼作者简介:一名大三在校生,喜欢AI编程🎋 🐻‍❄️个人主页🥇:落798. 🐼个人WeChat:hmmwx53 🕊️系列专栏:🖼️…

【AIGC重塑教育】AI大爆发的时代,未来的年轻人怎样获得机会和竞争力?

目录 AI浪潮来袭 AI与教育 AI的优势 延伸阅读 推荐语 ​作者:刘文勇 来源:IT阅读排行榜 本文摘编自《AIGC重塑教育:AI大模型驱动的教育变革与实践》,机械工业出版社出版 AI浪潮来袭 这次,狼真的来了。 AI正迅猛地…

【c语言】重温一下动态内存,int数组过大会造成栈错误

项目场景: 项目场景:互助群同学在刷题的过程中,遇到的一个题目,需要申请一个很大数组,于是这个同学就写了int[1000000],其实这样写也没有错,可是运行后却显示栈错误。于是就找到我来请教,我想就…

mapTR环境配置和代码复现

MAPTR: STRUCTURED MODELING AND LEARNING FOR ONLINE VECTORIZED HD MAP CONSTRUCTION 论文 :https://arxiv.org/pdf/2208.14437.pdf 代码:https://github.com/hustvl/MapTR MapTR,是一个结构化的端到端框架,用于高效的在线矢量化高精地图构建。我们提出了一种基于统一…

Linux开发工具(含gdb调试教程)

文章目录 Linux开发工具(含gdb调试教程)1、Linux 软件包管理器 yum2、Linux开发工具2.1、Linux编辑器 -- vim的使用2.1.1、vim的基本概念2.1.2、vim的基本操作2.1.3、vim正常模式命令集2.1.4、vim末行模式命令集 2.2、vim简单配置 3、Linux编译器 -- gcc…

数仓成本下降近一半,StarRocks 存算分离助力云览科技业务出海

成都云览科技有限公司倾力打造了凤凰浏览器,专注于为海外用户提供服务,公司致力于构建一个全球性的数字内容连接入口,为用户带来更为优质、高效、个性化的浏览体验。 作为数据驱动的高科技公司,从数据中挖掘价值一直是公司核心任务…

佳易王羽毛球馆计时计费软件灯控系统安装教程

佳易王羽毛球馆计时计费软件灯控系统安装教程 佳易王羽毛球馆计时计费软件,点击开始计时的时候,自动打开灯,结账后自动关闭灯。 因为场馆每一场地的灯功率都很大,需要加装交流接触器。这个由专业电工施工。 1、计时计费功能 &…

玻色量子“揭秘”之多项式回归问题与QUBO建模

摘要:多项式回归(Polynomial Regression)是一种回归分析方法,通过拟合一个多项式方程来模拟自变量与因变量之间的非线性关系。多项式回归的目标是找到一组多项式系数,使得拟合曲线尽可能地接近数据点。这种方法可以用于…

Arm64版本的centos编译muduo库遇到的问题的归纳

环境:Mac m2 pro下的VMware虚拟机中Arm64 centos ./build.sh 执行后提示如下 cmake -DCMAKE_BUILD_TYPErelease -DCMAKE_INSTALL_PREFIX…/release-install-cpp11 -DCMAKE_EXPORT_COMPILE_COMMANDSON /root/package/muduo-master – Boost version: 1.69.0 – Co…

12.docker的网络-host模式

1.docker的host网络模式简介 host模式下,容器将不会虚拟出自己的网卡、配置IP等,而是使用宿主机的IP和端口;也就说,宿主机的就是我的。 2. 以host网络模式创建容器 2.1 创建容器 我们仍然以tomcat这个镜像来说明一下。我们以h…

Java之《ATM自动取款机》(面向对象)

《JAVA编程基础》项目说明 一、项目名称: 基于JAVA控制台版本银行自动取款机 项目要求: 实现银行自动取款机的以下基本操作功能:读卡、取款、查询。(自动取款机中转账、修改密码不作要求) 具体要求: 读卡…

CSS实现三角形

CSS实现三角形 前言第一种:bordertransparent第二种borderrgb使用unicode字符 前言 本文讲解三种实现三角形的方式,并且配有图文以及代码解说。那么好,本文正式开始。 第一种:bordertransparent border是边框,而transparent是透明的颜色&a…

计数排序+桶排序+基数排序 详讲(思路+图解+代码详解)

文章目录 计数排序桶排序基数排序一、计数排序概念:写法一:写法二: 二、桶排序概念代码 三、基数排序概念1.LSD排序法(最低位优先法)2.MSD排序法(最高位优先法) 基数排序VS基数排序VS桶排序 计数…

C++语法知识点-vector+子数组

C语法知识点-vector子数组 一维数组定义无参数有参数迭代器扩容操作reserve 二维数组 vector 定义创建m*n的二维vectorvector< vector<int> > v(m, vector<int>(n) ) 初始化定义vector常用函数的实例分析访问操作resize 函数push _back ( )pop_back()函数siz…

宣传技能培训1——《新闻摄影技巧》光影魔法:理解不同光线、角度、构图的摄影效果,以及相机实战操作 + 新闻摄影实例讲解

新闻摄影技巧 写在最前面摘要 构图与拍摄角度景别人物表情与叙事远景与特写 构图与拍摄角度案例 主体、陪体、前景、背景强调主体利用前景和背景层次感的创造 探索新闻摄影中的构图技巧基本构图技巧构图技巧的应用实例实例分析1. 黄金分割和九宫格2. 三角型构图3. 引导线构图4.…