Open topic with navigation

TIBCO Business Studio™ - BPM Edition 5.4.0

# Assignment by Value and by Reference

Assignments can be made either by reference or by value. For an assignment by reference, the entity to which the assignment is made refers to the entity being assigned. In other words, subsequent changes to the entity by either the new or existing reference is reflected in both places (there is only one entity; it isn’t copied). However, for a by value assignment, a copy of the assigned entity is made, and that is what is applied to the entity receiving the assignment. This results in two independent objects. Therefore, changes in one place do not affect the other.

Assignment Conventions
Assignment to... | ...of type... | ...behaves as follows:
--- | --- | ---
Business Object attribute or composition | BOM Native or Primitive Type (except Date, Time, DateTime) | Effectively by value. For efficiency’s sake, objects are only copied where they are mutable (where their internal value can be changed). In other words, by reference behavior is sometimes used, but always behaves like by value. See BOM Native Type or Primitive Type Object to Business Object Attribute.
BOM Class | By reference. Important note: Two BOM attributes can be programmatically set to refer to the same object instance, and the changes are reflected in both places. However, once the script is complete, the data and single value stored thereafter behave as two independent objects.
Process Data Field | BOM Class | By reference. See Assigning a Business Object.
Basic Type (except Date, Time, DateTime) | By value. See Assigning a Basic Type Object to a Process Data Field.

Subtopics

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Business Studio™ - BPM Edition

Copyright © 2015-2023. Cloud Software Group, Inc. All Rights Reserved.