<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: global variable when running a multidevice workflow in Scripting</title>
    <link>https://community.extremenetworks.com/t5/scripting/global-variable-when-running-a-multidevice-workflow/m-p/98991#M542</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks. You said in your second reply. There would be conflict and last one will win. My activity runs for each device the user has selected (say they multiselected 10 devices and ran the workflow). Then the activity will run for each device. Let's say the outcome of each activity run is that some devices were changed, and thus needs a save config, and some didn't change and thus don't need a save config. So I was trying to add the devices that need to have config saved into one list so at the end I can save config for them, or&amp;nbsp; report those devices in an event. But because I don't really have a global variable that I can use between device activities, then I am stuck to save config for all of them.&lt;/P&gt;&lt;P&gt;Not sure how your first reply on having a variable scoped per activity will help me solve the global variable question.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jan 2024 15:02:18 GMT</pubDate>
    <dc:creator>Chad5</dc:creator>
    <dc:date>2024-01-22T15:02:18Z</dc:date>
    <item>
      <title>global variable when running a multidevice workflow</title>
      <link>https://community.extremenetworks.com/t5/scripting/global-variable-when-running-a-multidevice-workflow/m-p/98953#M535</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am wondering if I can create a global variable in a workflow that can be shared/updated between the different device instances during a script activity. I created a variable, and I made it's scope "WORKFLOW":&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Chad5_0-1705697590813.png" style="width: 400px;"&gt;&lt;img src="https://community.extremenetworks.com/t5/image/serverpage/image-id/6960i4F6BB58931F619C9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Chad5_0-1705697590813.png" alt="Chad5_0-1705697590813.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but it seems that if I manipulate this variable within a "script activity" in different device instances, it's not really global in that sense if I have multi devices running; I find that for the "script activity" every device has it's own until the activity is done then it it just takes the last device.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure if I am making myself clear, but I want to be able to manipulate a variable (add entries to it) from the same script activity for different devices.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 20:56:48 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/global-variable-when-running-a-multidevice-workflow/m-p/98953#M535</guid>
      <dc:creator>Chad5</dc:creator>
      <dc:date>2024-01-19T20:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: global variable when running a multidevice workflow</title>
      <link>https://community.extremenetworks.com/t5/scripting/global-variable-when-running-a-multidevice-workflow/m-p/98975#M536</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Markus_Nikulski_0-1705915943489.png" style="width: 400px;"&gt;&lt;img src="https://community.extremenetworks.com/t5/image/serverpage/image-id/6963iB8C875A3CA9016CB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Markus_Nikulski_0-1705915943489.png" alt="Markus_Nikulski_0-1705915943489.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 09:33:08 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/global-variable-when-running-a-multidevice-workflow/m-p/98975#M536</guid>
      <dc:creator>Markus_Nikulski</dc:creator>
      <dc:date>2024-01-22T09:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: global variable when running a multidevice workflow</title>
      <link>https://community.extremenetworks.com/t5/scripting/global-variable-when-running-a-multidevice-workflow/m-p/98977#M537</link>
      <description>&lt;P&gt;Alternatively you can use the activity variables.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Markus_Nikulski_1-1705916066416.png" style="width: 400px;"&gt;&lt;img src="https://community.extremenetworks.com/t5/image/serverpage/image-id/6964iF08DFFA5C60E56F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Markus_Nikulski_1-1705916066416.png" alt="Markus_Nikulski_1-1705916066416.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 09:34:40 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/global-variable-when-running-a-multidevice-workflow/m-p/98977#M537</guid>
      <dc:creator>Markus_Nikulski</dc:creator>
      <dc:date>2024-01-22T09:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: global variable when running a multidevice workflow</title>
      <link>https://community.extremenetworks.com/t5/scripting/global-variable-when-running-a-multidevice-workflow/m-p/98991#M542</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks. You said in your second reply. There would be conflict and last one will win. My activity runs for each device the user has selected (say they multiselected 10 devices and ran the workflow). Then the activity will run for each device. Let's say the outcome of each activity run is that some devices were changed, and thus needs a save config, and some didn't change and thus don't need a save config. So I was trying to add the devices that need to have config saved into one list so at the end I can save config for them, or&amp;nbsp; report those devices in an event. But because I don't really have a global variable that I can use between device activities, then I am stuck to save config for all of them.&lt;/P&gt;&lt;P&gt;Not sure how your first reply on having a variable scoped per activity will help me solve the global variable question.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 15:02:18 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/global-variable-when-running-a-multidevice-workflow/m-p/98991#M542</guid>
      <dc:creator>Chad5</dc:creator>
      <dc:date>2024-01-22T15:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: global variable when running a multidevice workflow</title>
      <link>https://community.extremenetworks.com/t5/scripting/global-variable-when-running-a-multidevice-workflow/m-p/99012#M544</link>
      <description>&lt;P&gt;If 10 devices get executed each activity has per device the own thread to run in parallels. If all writing to the same global variable the last wan will win.&amp;nbsp;&lt;BR /&gt;The alternative I explained is more complicated to set and relay on the activity ID, but it makes sure that each thread (device) gets its data shared.&lt;BR /&gt;&lt;BR /&gt;Also, you can consider using the device annotation to store data per device. Or using site variables depends on what you like to achieve.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;write device&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;annotation&lt;/STRONG&gt;&lt;BR /&gt;mutation {&lt;BR /&gt;&amp;nbsp; network {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; configureDevice(input: {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; deviceConfig: {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ipAddress: "192.168.0.11"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; deviceAnnotationConfig: {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; userData1: "my stuff"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; status&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;read device&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;annotation&lt;BR /&gt;&lt;/STRONG&gt;{&lt;BR /&gt;&amp;nbsp; network {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; device(ip: "192.168.0.11") {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; deviceData {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; userData1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 15:19:08 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/global-variable-when-running-a-multidevice-workflow/m-p/99012#M544</guid>
      <dc:creator>Markus_Nikulski</dc:creator>
      <dc:date>2024-01-23T15:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: global variable when running a multidevice workflow</title>
      <link>https://community.extremenetworks.com/t5/scripting/global-variable-when-running-a-multidevice-workflow/m-p/99149#M547</link>
      <description>&lt;P&gt;this is a different question than you initially ask for. please open a new thread next time.&lt;/P&gt;&lt;P&gt;you can update messages in three contexts&lt;/P&gt;&lt;P&gt;emc_results.put(&lt;STRONG&gt;"&lt;/STRONG&gt;&lt;STRONG&gt;workflowMessage&lt;/STRONG&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;, &lt;STRONG&gt;"Some custom workflow message" &lt;/STRONG&gt;)&lt;BR /&gt;emc_results.put(&lt;STRONG&gt;"&lt;/STRONG&gt;&lt;STRONG&gt;activityMessage&lt;/STRONG&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;, &lt;STRONG&gt;"Some custom activity message" &lt;/STRONG&gt;)&lt;BR /&gt;emc_results.put(&lt;STRONG&gt;"&lt;/STRONG&gt;&lt;STRONG&gt;deviceMessage&lt;/STRONG&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;"Some custom device message" &lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As well you can change the end result of a workflow&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;emc_results.setStatus&lt;/STRONG&gt;&lt;STRONG&gt;( &lt;/STRONG&gt;&lt;STRONG&gt;emc_results.Status.ERROR&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;)&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;emc_results.setStatus&lt;/STRONG&gt;&lt;STRONG&gt;( &lt;/STRONG&gt;&lt;STRONG&gt;emc_results.Status.CANCELED&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;)&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;emc_results.setStatus&lt;/STRONG&gt;&lt;STRONG&gt;( &lt;/STRONG&gt;&lt;STRONG&gt;emc_results.Status.SUCCESS&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;)&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;emc_results.setStatus&lt;/STRONG&gt;&lt;STRONG&gt;( &lt;/STRONG&gt;&lt;STRONG&gt;emc_results.Status.COMPLETED&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;)&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;emc_results.setStatus&lt;/STRONG&gt;&lt;STRONG&gt;( &lt;/STRONG&gt;&lt;STRONG&gt;emc_results.Status.PENDING&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;)&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;emc_results.setStatus&lt;/STRONG&gt;&lt;STRONG&gt;( &lt;/STRONG&gt;&lt;STRONG&gt;emc_results.Status.STARTED&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;emc_results.setStatus&lt;/STRONG&gt;&lt;STRONG&gt;( &lt;/STRONG&gt;&lt;STRONG&gt;emc_results.Status.NOT_SUBMITTED&lt;/STRONG&gt;&lt;STRONG&gt; )&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 07:45:11 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/scripting/global-variable-when-running-a-multidevice-workflow/m-p/99149#M547</guid>
      <dc:creator>Markus_Nikulski</dc:creator>
      <dc:date>2024-01-31T07:45:11Z</dc:date>
    </item>
  </channel>
</rss>

