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

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

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

相关文章

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

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

基于SSM的校园奶茶点单管理系统

基于SSM的校园奶茶点单管理系统的设计与实现~ 开发语言:Java数据库:MySQL技术:SpringMyBatisSpringMVC工具:IDEA/Ecilpse、Navicat、Maven 系统展示 主页 奶茶列表 登录界面 管理员界面 用户界面 摘要 随着社会的发展和科技的进…

ubuntu搭建phpmyadmin+wordpress

Ubuntu搭建phpmyadmin wordpress Linux系统设置:Ubuntu 22配置apache2搭建phpmyadmin配置Nginx环境,搭建wordpress Linux系统设置:Ubuntu 22 配置apache2 安装apache2 sudo apt -y install apache2设置端口号为8080 sudo vim /etc/apache…

paddle detection 训练参数

#####################################基础配置##################################### # 检测算法使用YOLOv3,backbone使用MobileNet_v1,数据集使用roadsign_voc的配置文件模板,本配置文件默认使用单卡,单卡的batch_size=1 # 检测模型的名称 architecture: YOLOv3 # 根据…

【CCF-PTA】第03届Scratch第05题 -- 统计出现次数最多的字

统计出现次数最多的字 【题目描述】 我国自古流传下来不少脍炙人口的诗歌,各具特色,别具一格。有些诗只用寥寥几个字,就能描绘出生动的意境。 请找出以下诗篇中出现次数最多的字,如果有多个字出现次数相同,则答案为…

Java中基于SSM框架的数据保存方法与日期处理

​ 一、详解 在SSM框架中,保存数据通常涉及到服务层和数据访问层。服务层处理业务逻辑,而数据访问层负责与数据库进行交互。 二、代码 Override public void save(Student student) { Date date new Date(); SimpleDateFormat format new Sim…

什么是LLC电路?

LLC电路是由2个电感和1个电容构成的谐振电路,故称之为LLC; LLC电路主要由三个元件组成:两个电感分别为变压器一次侧漏感(Lr)和励磁电感(Lm),电容为变压器一次侧谐振电容(Cr)。这些元件构成了一个谐振回路,其中输入电感…

【C/PTA】函数专项练习(四)

本文结合PTA专项练习带领读者掌握函数,刷题为主注释为辅,在代码中理解思路,其它不做过多叙述。 目录 6-1 计算A[n]1/(1 A[n-1])6-2 递归实现顺序输出整数6-3 自然数的位数(递归版)6-4 分治法求解金块问题6-5 汉诺塔6-6 重复显示字符(递归版)…

字母异位词分组

给你一个字符串数组,请你将 字母异位词 组合在一起。可以按任意顺序返回结果列表。 字母异位词 是由重新排列源单词的所有字母得到的一个新单词。 示例 1: 输入: strs [“eat”, “tea”, “tan”, “ate”, “nat”, “bat”] 输出: [[“bat”],[“nat”,“tan…

Android MemoryFile 共享内存

应用场景: 跨进程传输大数据,如文件、图片等; 技术选型: 共享内存–MemoryFile; 优点: 1. 共享内存没有传输大小限制,所以和应用总的分配内存一样(512MB)&#xff1…

Java 根据文件名获取文件类型

比如文件名是“测试文件.png”,则获取的文件类型就是 png 直接上一个通用的方法,拿去直接就能用。 // 比如入参文件名是“测试文件.png”,则出参就是 pngprivate String getFileSuffix(String fileName) {String[] fileStr fileName.split(&…

educoder中共享单车之数据可视化

第1关:绘制地图 <%@ page language="java" contentType="text/html; charset=utf-8"pageEncoding="utf-8"%> <html> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&…

专用设备上的SD卡插入电脑想读取数据,提示要格式化?

环境&#xff1a; Win10 专业版 车载感应数据专用SD卡 问题描述&#xff1a; 专用设备上的SD&#xff0c;现在把SD卡从设备取出&#xff0c;用读卡器插入电脑提示要格式化&#xff1f; 解决方案&#xff1a; 1.先进入PE查看SD分区情况&#xff0c;SD格式为ext4 查看文件…

lombok中使用@Builder构造器模式时的默认值问题

这里写自定义目录标题 问题case原因解决方案 文章参考来源&#xff1a;https://chenyongjun.vip/articles/107 问题case Lombok 使用广泛&#xff0c;这里分享一个 Lombok Builder 小 case&#xff0c;今天自己踩了坑。 Data Builder public class User {private String name…

MLP 有哪些可学习的参数

多层感知机&#xff08;MLP&#xff09;的参数是需要在训练过程中学习的。MLP是一种前馈神经网络&#xff0c;其结构包括输入层、多个隐藏层和输出层。在训练过程中&#xff0c;MLP通过反向传播算法来调整网络的权重&#xff0c;以最小化预测值与实际值之间的误差。 MLP的学习…

安卓开发——Android Studio常见报错与解决方法

1. No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-android 这个错误是由于较新版本的NDK的./toolchains目录中没有arm-linux-androideabi文件&#xff0c;解决办法是从旧的NDK版本里面复制到自己的NDK的版本里面&#xff0c;就可以了。 打…

WSL登录时提示nsenter: cannot open /proc/320/ns/time: No such file or directory的解决办法

在登录 WSL 的 Ubuntu 时&#xff0c;不仅要求 root 权限&#xff0c;还登录失败&#xff0c;提示“nsenter: cannot open /proc/320/ns/time: No such file or directory”。 解决办法是在 powershell 中执行 “wsl – sudo vi /etc/profile”命令&#xff0c;删除文件内容&a…

JavaWeb——感谢尚硅谷官方文档

JavaWeb——感谢尚硅谷官方文档 XML一、xml简介二、xml的语法1、文档申明2、xml注释3、xml元素4、xml属性5、xml语法规则 三、xml解析技术1、使用dom4j解析xml Tomcat一、JavaWeb的概念二、web资源的分类三、常见的web服务器四、Tomcat的使用1、安装2、Tomcat的目录介绍3 启动T…

初识Java 18-3 泛型

目录 边界 通配符 编译器的能力范畴 逆变性 无界通配符 捕获转换 本笔记参考自&#xff1a; 《On Java 中文版》 边界 在泛型中&#xff0c;边界的作用是&#xff1a;在参数类型上增加限制。这么做可以强制执行应用泛型的类型规则&#xff0c;但还有一个更重要的潜在效果…

如何在AD的PCB板做矩形槽孔以及如何倒圆弧角

Altium Designer 22下载安装教程-CSDN博客 如何在AD上创建完整的项目-CSDN博客 开始前&#xff0c;请先安装后AD&#xff0c;并创建好项目。 目录 1. 如何在AD的PCB板做矩形槽孔 2. 如何在AD的PCB板倒圆弧角 1. 如何在AD的PCB板做矩形槽孔 首先&#xff0c;我们进入上面创…