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.pswp.cn/news/164753.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/164753.shtml
英文地址,請注明出處:http://en.pswp.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;我們進入上面創…