Trading Networks 10.3 | Administering and Monitoring B2B Transactions | Service Development Help | Mapping Data in Flow Services | About Linking Variables | What Happens When Integration Server Executes a Link? | Example of Copying By Reference
 
Example of Copying By Reference
The following images show a series of MAP steps in a flow service. In this example, the value of the source variable is changed after the link to the target variable executes. This action changes the value of the target variable as well.
Figure 57. Step 1: The value of String1 is set to “original value”
Figure 58. Step 2: Document1 is linked to Document2
Figure 59. Step 3: The value of String1 is changed to “modified” after the link executes
When this flow service executes, it returns the following results.
Figure 60. Results of flow service
In Step 3, the value of the String1 in Document1 was set to “modified.” However, the value of String1 in Document2 changed also. This is because in Step 2 of the flow service, the value of Document1 was copied to Document2 by reference. Changes to the value of Document1 in later flow steps also change the value of Document2.