0 votes
975 views
in IBM BPM Infrastructure by (140 points)

1 Answer

0 votes
ago by (30.6k points)

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

Related questions

0 votes
1 answer 2.1k views
0 votes
1 answer 1.4k views
0 votes
1 answer 1.8k views
0 votes
1 answer 1.5k views

723 questions

807 answers

98 comments

4.9k users

Join BPM Community Discord Channel

Welcome to BPM Tips Q&A, Community wiki/forum where you can ask questions and receive answers from other IBM BPM experts and members of the community. Users with 2000 points will automatically be promoted to expert level.
Created by Dosvak LLC
Our Youtube Channel
...