Mapping Business Variables from Called Processes

My processes sequentially calls two Called Processes. The main process uses a defined mapping to map the business variable to the Called Processes. If I also provide a mapping to return the business variable from the Called Processes I get a StaleObjectStateException when the second Called Process tries to update the business variable.

Since all of the variables share the same database records, it seems to me that it would be unnecessary to return the business variable from the Called Process, but I don’t understand why doing so would throw an exception. This is either a bug, or needs to be prevented or documented.

My original assessment was overly optimistic. The StaleObjectStateException went away in one Called Process, but remains in others. I can see how this error could occur in a production system when multiple user are accessing the same data, but I am getting them in the developer studio.

It would be very helpful if someone could explain how business objects are passed to and from called processes.

There appears to be a bug in the passing back of business variables. In one instance I am accessing a parameter on a complex business variable that was set in the Called Process before and after the process returns. The parameter exists before the return and is null when accessed from an operation in the parent process.