Question

What is pass by value and pass by reference in process model and the best practice to follow?

vivedhasri231123
June 15, 2026

Answer


Pass by Value : Most commonly used Method

In this, the values are updated in parent process by mappings.


When a process contains one or more subprocesses, the parent process variable values are commonly passed to the subprocess using Input Variable mappings.

1781524049310-8nvv3r0i62j.png









With this configuration, at runtime parent process variables are not immediately affected by changes made to a subprocess. The changes are only updated in the parent process when the two processes are synchronized, which occurs when the End Event of the subprocess activates.


Pass by reference : When data synchronization is needed, based on scenarios, It's like storing the pointer rather than a static value.

  1. To avoid this lag in synchronization is to use a reference. By passing a reference to the actual parent process variable instead of its value, the data remains synchronized at all times. Any changes made to the a process variable in the parent process immediately update all referenced subprocess parameter values. Similarly, changes to the referenced value in the subprocess are concurrently reflected in the parent. This synchronization is done by selecting the Pass as reference checkbox when mapping the parent process input variables to the subprocess variables on the Setup tab of the Subprocess Activity in the parent process model.


Restrictions

  1. If a process referencing data in another process is archived, it can be saved with the current value of the data, however, the reference is lost.
  2. If the process is unarchived, the Pass as Reference configuration is NOT restored.
  3. If multiple instances of a subprocess exist, mapping data as a reference still works.
  4. The only exception is when your instances are spawned based on an array Process Variable. (Accessible by selecting the Other tab, then Run one instance for each item in [PV].)
  5. Spawned instances can take references to specific parent process variables, but they cannot take a reference to the array upon which the spawning is based.
  6. Due to the way that form default values are stored and evaluated, the Pass as Reference configuration cannot be used to set the default value for a form element.
  7. If form designers wish to use values by reference, they can remove form fields mapped to subprocess parameters and use input mappings on the Setup tab instead.
  8. Any custom data types incorporated in a subprocess and mapped as a reference must exactly match the CDTs used in the parent process.
  9. This is especially pertinent when a CDT is deleted. If only the parent process or only the child process includes a restored or updated version of a deleted CDT, but not both, the Pass as Reference configuration fails.
  10. If starting a subprocess with autoscale enabled, data will not be passed by reference, even if the option is selected.







SeniorJuniorProcess Models
Loading comments...