Considering the Program Environment 考虑程序环境

When writing or referencing PeopleCode in a PeopleCode action, you must consider the environment in which the Application Engine program runs. Environment indicates the differences between online and batch modes. Application Engine programs usually run in batch mode; consequently, your PeopleCode cannot access pages or controls as it can while running in online mode. Any PeopleCode operations that manipulate pages will not run successfully. Even if you invoke your Application Engine program online from a record or a page using the CallAppEngine PeopleCode function, the Application Engine PeopleCode still does not have direct access to component buffers.

在PeopleCode操作中编写或引用PeopleCode时,必须考虑应用程序引擎程序的运行环境。环境指示联机模式和批处理模式之间的差异。应用程序引擎程序通常以批处理模式运行;因此,您的PeopleCode不能像在联机模式下运行时那样访问页或控件。任何操作页面的PeopleCode操作都不会成功运行。即使使用CallAppEngine PeopleCode函数从记录或页联机调用应用程序引擎程序,应用程序引擎PeopleCode仍然不能直接访问组件缓冲区。

Any record field references that appear in a PeopleCode action can refer only to fields that exist on an Application Engine state record. Component buffers, controls, and so on are still inaccessible even if you define the page records as state records in the Program Properties dialog box. An Application Engine program can access only state records or other objects you create in PeopleCode.

出现在PeopleCode操作中的任何记录字段引用只能引用应用程序引擎状态记录中存在的字段。即使在“程序属性”对话框中将页记录定义为状态记录,组件缓冲区、控件等仍不可访问。应用程序引擎程序只能访问状态记录或您在PeopleCode中创建的其他对象。

However, you do have several options for passing data from a component buffer to an Application Engine program: you can use the CallAppEngine PeopleCode function or you can define global variables.

但是,有几个选项可以将数据从组件缓冲区传递到应用程序引擎程序:可以使用CallAppEngine PeopleCode函数,也可以定义全局变量。

Passing Parameters Through the CallAppEngine Function

通过CallAppEngine函数传递参数

For individual page fields and simple PeopleCode variables such as numbers and strings, you can use the CallAppEngine PeopleCode function to pass values as parameters.

对于单个页字段和简单的PeopleCode变量(如数字和字符串),可以使用Call App Engine PeopleCode函数将值作为参数传递。

To use the CallAppEngine function:

要使用CallAppEngine函数,请执行以下操作:

  1. Declare a record object in PeopleCode.

在PeopleCode中声明一个记录对象。

For example, Local Record &MyRecord;.

  1. Assign record objects to any state record that you want to pass to the Application Engine program.

将记录对象分配给要传递给应用程序引擎程序的任何状态记录。

Record objects are parameters to the CallAppEngine function.

记录对象是CallAppEngine函数的参数。

  1. Set the appropriate values on that state record.

在该状态记录上设置适当的值。

  1. Include the record object in the function call.

在函数调用中包含记录对象。

After these values are set in the state record, all the actions in a particular program, not just the PeopleCode actions, can use the values.

在状态记录中设置这些值后,特定程序中的所有动作,而不仅仅是PeopleCode动作,都可以使用这些值。

Defining Global Variables 定义全局变量

You can define global variables or objects in PeopleCode before you call an Application Engine program.

Application Engine PeopleCode actions are able to access only the variables you define; however, the PeopleCode could set a state record field equal to a number or string variable for use by other Application Engine actions.

在调用应用程序引擎程序之前,可以在PeopleCode中定义全局变量或对象。应用程序引擎PeopleCode操作只能访问您定义的变量;但是,PeopleCode可以将状态记录字段设置为等于数字或字符串变量,以供其他应用程序引擎操作使用。

Also, an Application Engine PeopleCode program can read or update a scroll area or a grid using a global rowset object. When accessing a scroll area or a grid from Application Engine PeopleCode, the same rules apply and the same illegal operations are possible that you see with accessing PeopleCode not in an Application Engine program.

此外,应用程序引擎PeopleCode程序可以使用全局行集对象读取或更新滚动区域或网格。当从Application Engine PeopleCode访问滚动区域或网格时,与在Application Engine程序中访问PeopleCode时所看到的一样,同样的规则也适用,同样的非法操作也是可能的。

The parameters submitted in a CallAppEngine are by value. These parameters seed the specified

Application Engine state record field with a corresponding value. If that value changes within Application Engine by updating the state record field, then the component data will not be affected. The only way to update component buffers or external PeopleCode variables from Application Engine is to use global PeopleCode variables and objects.

CallAppEngine中提交的参数是按值计算的。这些参数为指定的ApplicationEngine状态记录字段添加相应的值。如果该值通过更新状态记录字段在应用程序引擎中更改,则组件数据不会受到影响。从应用程序引擎更新组件缓冲区或外部PeopleCode变量的唯一方法是使用全局PeopleCode变量和对象。

Related Links

“CallAppEngine” (PeopleCode Language Reference)

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

  • 7
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值