Me too!
Yes. Only strings are copied by value.
Keep in mind that there really isn’t a notion of “passing” a variable to a service in the same way one passes vars to a procedure/function/method on the call stack. The declared inputs and outputs are more geared to letting you know what variable name the service expects in the pipeline–and it will manipulate those.
That said, there are some things the runtime does that make the environment behave stack-like. For example, if a child service drops a var from the pipeline, the runtime will effectively restore it when control returns to the caller. Even so, most OO languages such as Java don’t automatically clone objects passed to methods. If you pass an object, say a HashTable, to a method and it manipulates that, you wouldn’t be surprised that when it modifies the var named “ht” (the var name the method refers to) that your var named “hashTable” reflects those changes, right?
So if you want a list, document, object to be left alone and a service to manipulate a copy of it, you need to make the copy of it yourself. You can either do this via FLOW steps and/or Java.
Not necessarily. Depending on the var you’re trying clone, a couple of FLOW steps may be sufficient. For larger vars, such as a document with nested structures and such, the IS Java API provides a deep clone method. You’ll want to use such a method diligently to make sure its usage isn’t a bottleneck.
#webMethods#Integration-Server-and-ESB#Flow-and-Java-services