While dynamically changing a connection at run-time using expressions and variables in a ForEach Loop, the following error message is encountered.
"Invalid ..."
Example: "Invalid server host".When using an expression and a variable to specify a connection, or any other parameter or property, in a loop, the variable must be initialized prior to execution of the loop.
To resolve this error, provide an initial value for the variable you are using in your expression (e.g. for the server host in this example).
For scalability and performance, you might want to consider using COZYROC’s more advanced Parallel Loop Task, which can execute multiple iterations of the standard Foreach Loop Container concurrently. Based on actual tests, when a CPU-intensive process is run on a 4-core machine using this Parallel Loop Task, it executes 3 times faster as compared to running the same process sequentially.