How does variable scope work in pa_scripts and scripted breakdown mappings?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2024 11:27 AM
I'm hoping someone can explain to me why the following is possible: when running a scheduled data collection, the pa script (for a breakdown mapping) is able to access variable values assigned in previous runs.
For instance, if you have the following code in your pa script...
var i;
if (!i) i = 1;
i++;
gs.info('record number '+i);
...i will increment with each record that is processed.
Questions:
- Is this intended functionality?
- Can someone explain to me what is happening in the background with pa_scripts and scripted bd mappings that enables this?
- Is it safe to use this functionality to pass data (such as manual_breakdown sys_ids) between pa_script executions?
I would have expected each run to have its own variable scope.
0 REPLIES 0