Pass by reference example

A Score Level 1

Can someone explain me any scenario where we can use pass by reference under subprocess ? Is pass by reference valid only for asynchronous type sub process?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    The easiest example I can think of is, in the parent process you have a boolean PV value (initialized to FALSE) which would indicate when processing within a subprocess has completed (or passed a certain point).  You pass this boolean value by reference into the subprocess, and when the subprocess sets the value to TRUE instead, the parent process's PV value will also be updated - this could be used to drive a rule node to move some other process forward in the parent process.

    Passing by reference is definitely valid for synchronous processes most commonly, though apparently it can also be used for asynchronous process calls (i forget whether i've tried this myself).  Also per the documentation, note that values can't be passed by reference from the Start Process node (there aren't even any apparent configuration options close to it).

Reply
  • 0
    Certified Lead Developer

    The easiest example I can think of is, in the parent process you have a boolean PV value (initialized to FALSE) which would indicate when processing within a subprocess has completed (or passed a certain point).  You pass this boolean value by reference into the subprocess, and when the subprocess sets the value to TRUE instead, the parent process's PV value will also be updated - this could be used to drive a rule node to move some other process forward in the parent process.

    Passing by reference is definitely valid for synchronous processes most commonly, though apparently it can also be used for asynchronous process calls (i forget whether i've tried this myself).  Also per the documentation, note that values can't be passed by reference from the Start Process node (there aren't even any apparent configuration options close to it).

Children