Software AG Products 10.7 | Integrating On-Premises and Cloud Applications | Service Development | 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.
Step 1: The value of String1 is set to “original value”
Step 2: Document1 is linked to Document2
Step 3: The value of String1 is changed to “modified” after the link executes
When this flow service executes, it returns the following results.
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.