The copy cycle is the processing cycle that occurs when the application executes an copy ispec or copy event transaction. It is controlled by the segment and defines the order in which built-in methods are called.
Note: In the following text of this topic, the term ispec should be read to denote both ispecs and events.
The copy cycle is similar to the segment cycle, except that it consists of three phases – the validate, update, and refresh phases; and each phase is performed multiple times for each copy ispec.
Requesting a copy ispec
When a copy ispec is requested, the following process occurs before it is ready to accept input (this corresponds with its display to the application client).
Segment and copy ispec attributes without defined initial values are initialized to their corresponding values from the input message. This occurs for the first copy of the copy ispec only.
The construct method is called once for each copy of the copy ispec.
The graphical presentation is displayed.
A copy ispec can be requested similarly to an ispec. Refer to Requesting an ispec in Segment Cycle for more information.
Transmitting a copy ispec
Upon transmission of a copy ispec, two passes through the logic of the copy ispec are performed - the first pass is the validate phase, and the second pass is the update phase.
The update phase is only performed if there are no errors in the validate phase.
Validate Phase
The validate phase consists of the following process steps (indicated in the diagram above by the green arrows):
Segment and copy ispec attributes without defined initial values are initialized to their corresponding values from the input message. This occurs for the first copy of the copy ispec only.
The following loop is performed once for each copy of the copy ispec. Any errors that occur in one copy never affect the processing of other copies:
Non-copied attributes (those without graphical presentations, or with their corresponding graphical object's Is Copied presentation property set to false) are set to their corresponding values from the input message.
Automatic edit occurs. If an error occurs, the remainder of the loop is not performed for the current copy.
The prepare method is called. If an error occurs, the remainder of the loop is not performed for the current copy.
Automatic validation occurs. If an error occurs, the remainder of the loop is not performed for the current copy.
The edit method is called. If an error occurs, the remainder of the loop is not performed for the current copy.
At this point, one of the following process steps occurs:
If any errors were detected in any copy, they are returned to the application client. All error messages are stored until all copies have been processed.
If a Recall logic command was invoked in any copy, the specified ispec is requested. Only the last invoked Recall logic command is executed (after all copies have been processed).
If no errors occurred, no Recall logic commands were invoked, and the Glb.Error built-in segment attribute is set to Glb.Spaces, processing proceeds to the update phase.
Update Phase
The update phase effectively repeats the validate phase, except that it also calls the main method and performs automatic update for each copy. It consists of the following process steps (indicated in the diagram above by the blue arrows):
Segment and copy ispec attributes without defined initial values are initialized to their corresponding values from the input message. This occurs for the first copy of the copy ispec only.
The following loop is performed once for each copy of the copy ispec.
Non-copied attributes (those without graphical presentations, or with their corresponding graphical object's Is Copied presentation property of set to false) are set to their corresponding values from the input message.
Automatic edit occurs again.
The prepare method is called again.
Automatic validation occurs again.
The edit method is called again.
The main method is called.
If the Glb.Error built-in segment attribute is set to Glb.Spaces, automatic update occurs.
At this point, one of the following process steps occurs:
An ispec is requested.
The current copy ispec is refreshed.
The Select Ispec dialog box is displayed.
An EndExit logic command terminates processing for the current method only (prepare, edit, or main) for the current copy. It has no effect on the processing of subsequent copies.