Support Article
Activity param pass-by-ref not working
SA-6537
Summary
When an inner activity designates a parameter for output on the Parameters tab, the calling activity expects that when specifying myPage.myProp as the value for that parameter, this will act as a pass by reference mechanism. In other words, when the calling activity writes to the parameter, the data should appear in the property myPage.myProp.
This is only working for some users, however.
Error Messages
Not applicable.
Steps to Reproduce
1. From calling activity, specify the output parameter value of inner activity as myPage.myProp.
2. Call the inner activity.
3. The inner activity writes the string "Yes" to the output parameter and returns.
Root Cause
In the case where the inner activity was altered to return an output parameter after the calling activity was assembled, the generated java will use an incorrect method call. In order for the pass by reference mechanism to work, the java generation for the parameter needs to use "GetProperty" to fetch myPage.myProp. The java generation was observed to sometimes be using "getString" instead. This "getString" is used when the parameter of the inner activity is not declared as out.
Resolution
By using the revalidate-and-save tool to reassemble the calling activity after the inner activity has been update with a designated output parameter, the property "getProperty" is observed in the java, and the pass by reference mechanism works.
Published January 31, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.