Problems with Component Interface and COBOL remotecalls

Unfortunately, Peoplesoft still uses COBOL throughout the application. Even worse there can be online components that call COBOLs from the component processor on pages (looking at you Student Admin). There are several different ways that REMOTECALLs may be initiated but we will focus on one here that can cause problems with Component Interfaces.

Lets say you have a page with a level 1 grid mocked up like this.

PeopleSoft Grid with Push Button

  • The user enters values in Edit Boxes labeled “value 1” and “value 2.”
  • The user then presses the push button labeled “calculate.”
  • On FieldChange of the push button, a DoSaveNow is called to commit the data to the database
  • Then after the save processing completes, the RemoteCall is fired with parameters pointing to the new database rows that were just committed
  • The COBOL run and picks up those values and calculates a result and the result is display on the page.

This model works fine when the user is interacting with the component using a web browser. However, this structure can cause problems when you want to create a component interface based off that Component and want to mimic that same push button behavior in code.

So lets say you want to do the following:

  • You have an application engine processing some batch results from a file.
  • The application engine calls a component interface based on the logic described above.
  • The Edit Box values for 1 and 2 are entered using the CI.
  • Then the Application Engine “presses the button” by changing the value of the field tied to the push button in the CI.

There are two things that may happen here.

  1. You may get some kind of error
  2. You may get an unexpected or no result

Why is this? Well as documented in PeopleBooks section titled Understanding PeopleCode Behavior and Limitations, when a Component Interface is called from an application engine all the database commits are actually controlled by the application engine. So in the structure of the component, the logic assumes that the dosavenow will actually trigger a commit. However, in the case of the AE calling the CI the commit did not occur when the button was pushed.

For components like this you have to do some customization to get it to work. In a situation like this I would add a simple piece of code in the push button fieldChange peoplecode. This code basically says “if this code is being triggered by a component interface then do NOT run the remotecall.” It looks like this.

 If %CompIntfcName <> "" Then
    /* Run  the remotecall stuff */
 End-If;

Then in the application engine I would actually trigger the remotecall passing in the same information but pulling the appropriate values out of the CI properties and passing them as parameters to the CI.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值