Between BPD activities the data is passed by value: on entry the input mapping copies the value into the activity's variables (tw.local of the service), on exit the output mapping copies it back. Changing tw.local.order inside a service does not change the BPD variable unless it is mapped out.
Two places where it looks like by reference:
- Inside one script business objects are JavaScript objects, so var o = tw.local.order; o.total = 5 changes tw.local.order.total (same object).
- Nested services / linked processes that map the same variable in and out (the default when you use "auto map") - the copy back makes it behave like sharing.
// BPD activity implemented by a service: input mapping order -> tw.local.order
tw.local.order.status = "APPROVED"; // changes the copy inside the service
// without an output mapping order <- tw.local.order the BPD still has the old status
Consequences: (1) parallel paths of a gateway each work on their own copies, the last one to complete wins on the join (use a merge script or separate variables); (2) large business objects cost time on every mapping - map only what the activity needs, or pass identifiers and reload; (3) shared business objects (BAW 8.6+ Shared Business Object) are the exception: they are stored once and every reader sees the latest version.
References