State of Shared Objects Using PeopleSoft Pure Internet Architecture

Consider the following scenario:

  • A local and a global variable refer to the same object.

  • That object is used in a modal component.

  • Instead of completing the modal component, the user clicks the browser Back button.

In general, the global state of the object is restored. If the object has not been destroyed from the global state, the global state of the object is used for local references; otherwise, the local state is used for local references.

Here is an example:

Global array of number &Global_Array;
Local array of number &Local_Array;

&Global_Array = CreateArray(1, 2, 3);
&Local_Array = &Global_Array;
DoModal(Page.PAGENAME, "", - 1, - 1, 1, Record.SHAREDREC, 1);

/* return to here */
&Local_Array [1] = - 1;
&Global_Array [2] = - 2;
WinMessage(&Local_Array | " is " | &Local_Array.Join());
WinMessage(&Global_Array | " is " | &Global_Array.Join());

The following program, program 2, is located on the modal page the user is transferred to:

Global array of number &Global_Array;
&Global_Array[3] = -3;

The following program, program 3, is also located on the modal page:

Global array of number &Global_Array;
&Global_Array = CreateArray(1, 2, -3);

If program 2 is run, the output is the following:

&Local_Array is -1, -2, -3 
&Global_Array is -1, -2, -3

However, if program 3 is run, thereby destroying the original global state, the output is the following:

&Local_Array is -1, 2, 3
&Global_Array is 1, -2, -3