\r\n\r\n\r\n\r\n javascript\r\n void\r\n void\r\n \r\n \r\n\r\n```\r\n\r\nInside each operation, I have some initial checks that should be performed if I call the operation directly, but if I call it from another operation, then the checks shouldn't be executed. I have created a parameter named \"skipInitialChecks\" for that.\r\n\r\nIn the example code, I call to **Operation.One** with parameter skipInitialChecks set to **false** (initial checks will be performed in Operation.One). But then from this operation I call to **Operation.Two** with skipInitialChecks set to **true** (so initial checks won't be performed in Operation.Two).\r\n\r\nBut the operation ignores my parameter value, and takes the initial value for skipInitialChecks. It seems that the parameters passed to Operation.One are stored as ChainParameters, and when I call to other operations from inside Operation.One, ChainParemeter values override any passed parameter with the same name.\r\n\r\nIf I modify my code to this:\r\n```\r\n\r\njavascript\r\nvoid\r\nvoid\r\n\r\n\r\n\r\n\r\njavascript\r\nvoid\r\nvoid\r\n\r\n\r\n\r\n```\r\nThen it works as expected. The problem is that this code is simplified, and sometimes I cannot / do not want to change parameter names.\r\n\r\nBesides, it seems strange that the param values I've set directly when I call the second operation are ignored and replaced with the ones set to call the first operation.\r\n\r\nI think that the parameter values are overriden in class AutomationScriptingParamsInjector.\r\n\r\nIs this the expected behavior? Am I missing some configuration or is there any way to tell the operation to prioritize the passed params instead of the values stored in ChainParameters? Am I using scripted operations for something that they aren't prepared for and should I use plain Java operations instead?\r\nIs this a bug?\r\n\r\nPlease let me know if you need more information.\r\n\r\nThanks a lot in advance,\r\n\r\nIbai.\r\n\r\n", "htmlContent" : "

Hi,

\n

I have two scripted operations (Automation Scripting) like these:

\n
<scriptedOperation id=\"Operation.One\">\n    <category>javascript</category>\n    <inputType>void</inputType>\n    <outputType>void</outputType>\n    <param name=\"skipInitialChecks\" type=\"boolean\" />\n    <script>\n        <![CDATA[\n        function run(input, params) {\n\n            try {\n\n                Log(null, { 'level': 'error', 'message': 'SKIP 1: ' + params.skipInitialChecks });\n\n                if(!params.skipInitialChecks) {\n                    // Do initial checks\n                }\n\n                Operation.Two(input, {\n                    'skipInitialChecks': true\n                });\n\n                // Do other things\n\n                    ]]>\n    </script>\n</scriptedOperation>\n\n<scriptedOperation id=\"Operation.Two\">\n    <category>javascript</category>\n    <inputType>void</inputType>\n    <outputType>void</outputType>\n    <param name=\"skipInitialChecks\" type=\"boolean\" />\n    <script>\n        <![CDATA[\n        function run(input, params) {\n\n            try {\n\n                Log(null, { 'level': 'error', 'message': 'SKIP 2: ' + params.skipInitialChecks });\n\n                if(!params.skipInitialChecks) {\n                    // Do initial checks\n                }\n\n                // Do other things\n\n                    ]]>\n    </script>\n</scriptedOperation>\n
\n

Inside each operation, I have some initial checks that should be performed if I call the operation directly, but if I call it from another operation, then the checks shouldn't be executed. I have created a parameter named “skipInitialChecks” for that.

\n

In the example code, I call to Operation.One with parameter skipInitialChecks set to false (initial checks will be performed in Operation.One). But then from this operation I call to Operation.Two with skipInitialChecks set to true (so initial checks won't be performed in Operation.Two).

\n

But the operation ignores my parameter value, and takes the initial value for skipInitialChecks. It seems that the parameters passed to Operation.One are stored as ChainParameters, and when I call to other operations from inside Operation.One, ChainParemeter values override any passed parameter with the same name.

\n

If I modify my code to this:

\n
<scriptedOperation id=\"Operation.One\">\n<category>javascript</category>\n<inputType>void</inputType>\n<outputType>void</outputType>\n<param name=\"skipInitialChecks\" type=\"boolean\" />\n<script>\n<![CDATA[\nfunction run(input, params) {\ntry {\nLog(null, { 'level': 'error', 'message': 'SKIP 1: ' + params.skipInitialChecks });\nif(!params.skipInitialChecks) {\n// Do initial checks\n}\nOperation.Two(input, {\n'skipInitialChecks2': true\n});\n// Do other things\n]]>\n</script>\n</scriptedOperation>\n<scriptedOperation id=\"Operation.Two\">\n<category>javascript</category>\n<inputType>void</inputType>\n<outputType>void</outputType>\n<param name=\"skipInitialChecks2\" type=\"boolean\" />\n<script>\n<![CDATA[\nfunction run(input, params) {\ntry {\nLog(null, { 'level': 'error', 'message': 'SKIP 2: ' + params.skipInitialChecks2 });\nif(!params.skipInitialChecks2) {\n// Do initial checks\n}\n// Do other things\n]]>\n</script>\n</scriptedOperation>\n
\n

Then it works as expected. The problem is that this code is simplified, and sometimes I cannot / do not want to change parameter names.

\n

Besides, it seems strange that the param values I've set directly when I call the second operation are ignored and replaced with the ones set to call the first operation.

\n

I think that the parameter values are overriden in class AutomationScriptingParamsInjector.

\n

Is this the expected behavior? Am I missing some configuration or is there any way to tell the operation to prioritize the passed params instead of the values stored in ChainParameters? Am I using scripted operations for something that they aren't prepared for and should I use plain Java operations instead? Is this a bug?

\n

Please let me know if you need more information.

\n

Thanks a lot in advance,

\n

Ibai.

" } ] }; Versioning.getActiveVersion = function() { var versions = this.versions; for (var i=0,len=versions.length;i

Select a revision to compare with:
Side by side diff