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

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千兆字节的内存。

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

队列的实现和OJ练习(c语言)

目录 概念 队列的实现 利用结构体存放队列结构 为什么单链表不使用这种方法? 初始化队列 小提示: 队尾入队列 队头出队列 获取队头元素 获取队尾元素 获取队列中有效元素个数 检测队列是否为空 销毁队列 最终代码 循环队列 队列的OJ题 …

git clone -mirror 和 git clone 的区别

目录 前言两则区别git clone --mirrorgit clone 获取到的文件有什么不同瘦身仓库如何选择结语开源项目 前言 Git是一款强大的版本控制系统,通过Git可以方便地管理代码的版本和协作开发。在使用Git时,常见的操作之一就是通过git clone命令将远程仓库克隆…

SHAP - 机器学习模型可解释性工具

github地址:shap/docs/index.rst at master shap/shap (github.com) SHAP使用文档:欢迎使用 SHAP 文档 — SHAP 最新文档 SHAP介绍 SHAP(SHapley Additive exPlanations)是一种用于解释预测结果的方法,它基于Shapley…

好的程序员有什么特质呢?

程序员想要提升自己,一定要关注到工作中的方方面面。而一个好的程序员,一般都有这些特质: 弱者抱怨环境,强者改变环境 不要试图通过抱怨环境来获得工作环境上的改变,这不仅不会给你带来任何实质性的改变,…

一文详解Vue生命周期

Vue是一种流行的用于构建用户界面的渐进式JavaScript框架。Vue框架在开发过程中,特别强调对生命周期的理解和管理。通过使用生命周期钩子函数,开发者能够精确地控制Vue实例的创建、挂载、更新以及销毁过程。本文将对Vue的生命周期进行详细的介绍&#xf…

Nginx模块开发之http handler实现流量统计(1)

文章目录 一、handler简介二、Nginx handler模块开发2.1、示例代码2.2、编写config文件2.3、编译模块到Nginx源码中2.4、修改conf文件2.5、执行效果 三、Nginx的热更新总结 一、handler简介 Handler模块就是接受来自客户端的请求并产生输出的模块。 配置文件中使用location指令…

微软发布最新.NET 8长期支持版本,云计算、AI应用支持再强化

11 月 15 日开始的为期三天的 .NET Conf 在线活动的开幕日上,.NET 8作为微软的开源跨平台开发平台正式发布。.NET 团队着重强调云、性能、全栈 Blazor、AI 和 .NET MAUI 是.NET 8的主要亮点。.NET团队在 .NET Conf 2023 [1]活动开幕式上表示:“通过这个版…

JSP过滤器和监听器

什么是过滤器 Servlet过滤器与Servlet十分相似,但它具有拦截客户端(浏览器)请求的功能,Servlet过滤器可以改变请求中的内容,来满足实际开发中的需要。 对于程序开发人员而言,过滤器实质就是在Web应用服务器…

不会代码也能拿高薪?掌握面试法宝,轻松10000+

快速排序(Quicksort)是对冒泡排序的一种改进。 快速排序由 C.A.R.Hoare 在 1962 年提出。 它的基本思想是:通过一趟排序将要排序的数据分割成独立的两部分,其中一部分的所有数据都比另外一部分的所有数据都要小,然后…

代码随想录算法训练营第五十二天|1143.最长公共子序列 1035.不相交的线 53. 最大子序和

文档讲解:代码随想录 视频讲解:代码随想录B站账号 状态:看了视频题解和文章解析后做出来了 1143.最长公共子序列 class Solution:def longestCommonSubsequence(self, text1: str, text2: str) -> int:dp [[0] * (len(text2) 1) for _ i…

Redisson分布式锁源码解析、集群环境存在的问题

一、使用Redisson步骤 Redisson各个锁基本所用Redisson各个锁基本所用Redisson各个锁基本所用 二、源码解析 lock锁 1) 基本思想: lock有两种方法 一种是空参 另一种是带参 * 空参方法:会默认调用看门狗的过期时间30*1000&…

从Discord的做法中学习 — 使用Golang进行请求合并

正如你可能之前看到的,Discord去年发布了一篇有价值的文章,讨论了他们成功存储了数万亿条消息。虽然有很多关于这篇文章的YouTube视频和文章,但我认为这篇文章中一个名为“数据服务为数据服务”的部分没有得到足够的关注。在这篇文章中&#…

redis运维(十九)redis 的扩展应用 lua(一)

一 redis 的扩展应用 lua redis如何保证原子操作 说明:引入lua脚本,核心解决原子性问题 ① redis为什么引入lua? lua脚本本身体积小,启动速度快 ② redis引入lua的优势 小结: 类似自定义redis命令 ③ redis中如何使用lua ④ EVAL 说明&#…

【性能优化】JVM调优与写出JVM友好高效的代码

📫作者简介:小明java问道之路,2022年度博客之星全国TOP3,专注于后端、中间件、计算机底层、架构设计演进与稳定性建设优化,文章内容兼具广度、深度、大厂技术方案,对待技术喜欢推理加验证,就职于…

2023年11个最佳免费WordPress主题

如果您刚刚开始使用 WordPress,您可能会很自然地认为,只要免费的WordPress主题看起来像您想要的网站主题,那么它就很合适。不幸的是,事情并没有那么简单。这就是为什么在今天的文章中,我们概述了一份可靠的标准清单&am…

旅行商问题(枚举,回溯,动态规划,贪心,分支界限)

文章目录 问题描述暴力枚举回溯法动态规划法贪心法分支界限法 问题描述 假设有一个货郎担要拜访n个城市,他必须选择所要走的路程,路程的限制时每个城市只能拜访一次,而且最后要走到原来出发的城市,要求路径长度。 旅行商问题将要…

爬虫逆向你应该懂得Javascript知识

背景 大家在学习爬虫逆向的时候,一般都会涉及到对js源文件进行代码扣去,但是有的时候,你最好有js基础,能发现加密或者解密在那个位置,或者是能用python改写js代码,这就对个人的Javascript的能力有一定要求…

python如何快速查找到想要的文档

字多不看版,直接体验 待补充 演示代码 # -*- coding:UTF-8 -*-# region 导入必要的依赖包 import os import subprocess from enum import Enum模块名 pyperclip try:import pyperclip # 需要安装 pyperclip 模块,以支持粘贴板操作 except ImportEr…

激光雷达与惯导标定 | Lidar_IMU_Init : 编译

激光雷达与惯导标定:Lidar_IMU_Init 编译 功能包安装安装ceres-solver-2.0.0 (注意安装2.2.0不行,必须要安装2.0.0) LI-Init是一种鲁棒、实时的激光雷达惯性系统初始化方法。该方法可校准激光雷达与IMU之间的时间偏移量和外部参数…

【Spring】 IoCDI

回顾 企业命名规范 大驼峰:BookDao(首字母都大写) 类名 小驼峰:bookDao(第一个字母小写) 方法名 蛇形:book_dao(小写下划线_) 数据库 串形:book-dao(小写连字符-) 项目文件夹 各种注解 学习Spring MVC, 其实就是学习各种Web开发需要⽤的到注解 a. RequestMapping: 路由…