iflL:lL.debug(f"SERVER: pyOpenRPA_Agent_A2O:: Has recieved result of the activity items from agent! ActivityItem GUID Str: {lActivityReturnItemKeyStr}; Return value: {lActivityReturnItemValue}")
if(lNowDatetime-lItemValue["ReturnedByDatetime"]).total_seconds()<inGSettings["Autocleaner"]["AgentActivityReturnLifetimeSecFloat"]:# Add if lifetime is ok
lTechnicalAgentActivityReturnDictNew[lItemKeyStr]=lItemValue# Lifetime is ok - set
else:
iflL:lL.debug(f"AgentActivityReturnDict lItemKeyStr: Lifetime is expired. Remove from gSettings")# Info
inGSettings["AgentActivityReturnDict"]=lTechnicalAgentActivityReturnDictNew# Set updated Cache
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">AgentActivityItemReturnExists</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">inGSettings</span></em>, <emclass="sig-param"><spanclass="n">inGUIDStr</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#AgentActivityItemReturnExists"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnExists"title="Permalink to this definition">¶</a></dt>
<dd><p>Check by GUID if ActivityItem has been executed and result has come to the Orchestrator</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>inGSettings</strong>– Global settings dict (singleton)</p></li>
<li><p><strong>inGUIDStr</strong>– GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>True - result has been received from the Agent to orc; False - else case</p>
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">AgentActivityItemReturnGet</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">inGSettings</span></em>, <emclass="sig-param"><spanclass="n">inGUIDStr</span></em>, <emclass="sig-param"><spanclass="n">inCheckIntervalSecFloat</span><spanclass="o">=</span><spanclass="default_value">0.5</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#AgentActivityItemReturnGet"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnGet"title="Permalink to this definition">¶</a></dt>
<dd><p>Work synchroniously! Wait while result will be recieved. Get the result of the ActivityItem execution on the Agent side. Before this please check by the def AgentActivityItemReturnExists that result has come to the Orchestrator</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>inGSettings</strong>– Global settings dict (singleton)</p></li>
<li><p><strong>inGUIDStr</strong>– GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</p></li>
<li><p><strong>inCheckIntervalSecFloat</strong>– Interval in sec of the check Activity Item result</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>Result of the ActivityItem executed on the Agent side anr transmitted to the Orchestrator. IMPORTANT! ONLY JSON ENABLED Types CAN BE TRANSMITTED TO ORCHESTRATOR!</p>
</dd>
</dd>
</dl>
</dl>
</dd></dl>
</dd></dl>
@ -431,6 +472,9 @@
<li><p><strong>inCMDEncodingStr</strong>– Set the encoding of the DOS window on the Agent server session. Windows is beautiful :) . Default is “cp1251” early was “cp866” - need test</p></li>
<li><p><strong>inCMDEncodingStr</strong>– Set the encoding of the DOS window on the Agent server session. Windows is beautiful :) . Default is “cp1251” early was “cp866” - need test</p></li>
</ul>
</ul>
</dd>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</p>
<spanclass="c1"># Some gurbage is collecting in g settings. So you can configure autocleaner to periodically clear gSettings</span>
<spanclass="c1"># Some gurbage is collecting in g settings. So you can configure autocleaner to periodically clear gSettings</span>
<spanclass="s2">"IntervalSecFloat"</span><spanclass="p">:</span><spanclass="mf">3600.0</span><spanclass="p">,</span><spanclass="c1"># Sec float to periodically clear gsettings</span>
<spanclass="s2">"IntervalSecFloat"</span><spanclass="p">:</span><spanclass="mf">3600.0</span><spanclass="p">,</span><spanclass="c1"># Sec float to periodically clear gsettings</span>
<spanclass="s2">"AgentActivityReturnLifetimeSecFloat"</span><spanclass="p">:</span><spanclass="mf">300.0</span><spanclass="c1"># Time in seconds to life for activity result recieved from the agent</span>
<spanclass="p">},</span>
<spanclass="p">},</span>
<spanclass="s2">"Client"</span><spanclass="p">:</span><spanclass="p">{</span><spanclass="c1"># Settings about client web orchestrator</span>
<spanclass="s2">"Client"</span><spanclass="p">:</span><spanclass="p">{</span><spanclass="c1"># Settings about client web orchestrator</span>
<spanclass="s2">"AgentActivityReturnDict"</span><spanclass="p">:</span><spanclass="p">{</span><spanclass="c1"># Will be filled when programs run - fill result of the Activity execution on the agent</span>
<spanclass="n">lGUIDStr</span><spanclass="o">=</span><spanclass="nb">str</span><spanclass="p">(</span><spanclass="n">uuid</span><spanclass="o">.</span><spanclass="n">uuid4</span><spanclass="p">())</span><spanclass="c1"># generate new GUID</span>
<spanclass="n">lGUIDStr</span><spanclass="o">=</span><spanclass="nb">str</span><spanclass="p">(</span><spanclass="n">uuid</span><spanclass="o">.</span><spanclass="n">uuid4</span><spanclass="p">())</span><spanclass="c1"># generate new GUID</span>
<spanclass="sd"> Work synchroniously! Wait while result will be recieved. Get the result of the ActivityItem execution on the Agent side. Before this please check by the def AgentActivityItemReturnExists that result has come to the Orchestrator</span>
<spanclass="sd"> :param inGSettings: Global settings dict (singleton)</span>
<spanclass="sd"> :param inGUIDStr: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</span>
<spanclass="sd"> :param inCheckIntervalSecFloat: Interval in sec of the check Activity Item result</span>
<spanclass="sd"> :return: Result of the ActivityItem executed on the Agent side anr transmitted to the Orchestrator. IMPORTANT! ONLY JSON ENABLED Types CAN BE TRANSMITTED TO ORCHESTRATOR!</span>
<spanclass="sd">"""</span>
<spanclass="c1"># Wait while result will not come here</span>
<spanclass="sd"> :param inSendOutputToOrchestratorLogsBool: True - catch cmd execution output and send it to the Orchestrator logs; Flase - else case; Default True</span>
<spanclass="sd"> :param inSendOutputToOrchestratorLogsBool: True - catch cmd execution output and send it to the Orchestrator logs; Flase - else case; Default True</span>
<spanclass="sd"> :param inCMDEncodingStr: Set the encoding of the DOS window on the Agent server session. Windows is beautiful :) . Default is "cp1251" early was "cp866" - need test</span>
<spanclass="sd"> :param inCMDEncodingStr: Set the encoding of the DOS window on the Agent server session. Windows is beautiful :) . Default is "cp1251" early was "cp866" - need test</span>
<spanclass="sd"> :return: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</span>
<spanclass="s2">"ArgLogger"</span><spanclass="p">:</span><spanclass="kc">None</span><spanclass="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<spanclass="s2">"ArgLogger"</span><spanclass="p">:</span><spanclass="kc">None</span><spanclass="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<spanclass="p">}</span>
<spanclass="p">}</span>
<spanclass="c1">#Send item in AgentDict for the futher data transmition</span>
<spanclass="c1">#Send item in AgentDict for the futher data transmition</span>
<spanclass="s2">"ArgLogger"</span><spanclass="p">:</span><spanclass="kc">None</span><spanclass="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<spanclass="s2">"ArgLogger"</span><spanclass="p">:</span><spanclass="kc">None</span><spanclass="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<spanclass="p">}</span>
<spanclass="p">}</span>
<spanclass="c1">#Send item in AgentDict for the futher data transmition</span>
<spanclass="c1">#Send item in AgentDict for the futher data transmition</span>
<spanclass="s2">"ArgLogger"</span><spanclass="p">:</span><spanclass="kc">None</span><spanclass="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<spanclass="s2">"ArgLogger"</span><spanclass="p">:</span><spanclass="kc">None</span><spanclass="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<spanclass="p">}</span>
<spanclass="p">}</span>
<spanclass="c1">#Send item in AgentDict for the futher data transmition</span>
<spanclass="c1">#Send item in AgentDict for the futher data transmition</span>
<spanclass="s2">"ArgLogger"</span><spanclass="p">:</span><spanclass="kc">None</span><spanclass="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<spanclass="s2">"ArgLogger"</span><spanclass="p">:</span><spanclass="kc">None</span><spanclass="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<spanclass="p">}</span>
<spanclass="p">}</span>
<spanclass="c1">#Send item in AgentDict for the futher data transmition</span>
<spanclass="c1">#Send item in AgentDict for the futher data transmition</span>
<spanclass="n">lTechnicalSessionGUIDCacheNew</span><spanclass="p">[</span><spanclass="n">lItemKeyStr</span><spanclass="p">]</span><spanclass="o">=</span><spanclass="n">lItemValue</span><spanclass="c1"># Lifetime is ok - set</span>
<spanclass="n">lTechnicalSessionGUIDCacheNew</span><spanclass="p">[</span><spanclass="n">lItemKeyStr</span><spanclass="p">]</span><spanclass="o">=</span><spanclass="n">lItemValue</span><spanclass="c1"># Lifetime is ok - set</span>
<spanclass="k">else</span><spanclass="p">:</span>
<spanclass="k">else</span><spanclass="p">:</span>
<spanclass="k">if</span><spanclass="n">lL</span><spanclass="p">:</span><spanclass="n">lL</span><spanclass="o">.</span><spanclass="n">debug</span><spanclass="p">(</span><spanclass="sa">f</span><spanclass="s2">"Client > Session > TechnicalSessionGUIDCache > lItemKeyStr: Lifetime is expired. Remove from gSettings"</span><spanclass="p">)</span><spanclass="c1"># Info</span>
<spanclass="k">if</span><spanclass="n">lL</span><spanclass="p">:</span><spanclass="n">lL</span><spanclass="o">.</span><spanclass="n">debug</span><spanclass="p">(</span><spanclass="sa">f</span><spanclass="s2">"Client > Session > TechnicalSessionGUIDCache > lItemKeyStr: Lifetime is expired. Remove from gSettings"</span><spanclass="p">)</span><spanclass="c1"># Info</span>
<spanclass="n">inGSettings</span><spanclass="p">[</span><spanclass="s2">"Client"</span><spanclass="p">][</span><spanclass="s2">"Session"</span><spanclass="p">][</span><spanclass="s2">"TechnicalSessionGUIDCache"</span><spanclass="p">]</span><spanclass="o">=</span><spanclass="n">lTechnicalSessionGUIDCacheNew</span><spanclass="c1"># Set updated Cache</span></div>
<spanclass="n">inGSettings</span><spanclass="p">[</span><spanclass="s2">"Client"</span><spanclass="p">][</span><spanclass="s2">"Session"</span><spanclass="p">][</span><spanclass="s2">"TechnicalSessionGUIDCache"</span><spanclass="p">]</span><spanclass="o">=</span><spanclass="n">lTechnicalSessionGUIDCacheNew</span><spanclass="c1"># Set updated Cache</span>
<spanclass="c1"># Clean old items in AgentActivityReturnDict > GUIDStr > ReturnedByDatetime</span>
<spanclass="k">if</span><spanclass="p">(</span><spanclass="n">lNowDatetime</span><spanclass="o">-</span><spanclass="n">lItemValue</span><spanclass="p">[</span><spanclass="s2">"ReturnedByDatetime"</span><spanclass="p">])</span><spanclass="o">.</span><spanclass="n">total_seconds</span><spanclass="p">()</span><spanclass="o"><</span><spanclass="n">inGSettings</span><spanclass="p">[</span><spanclass="s2">"Autocleaner"</span><spanclass="p">][</span><spanclass="s2">"AgentActivityReturnLifetimeSecFloat"</span><spanclass="p">]:</span><spanclass="c1"># Add if lifetime is ok</span>
<spanclass="n">lTechnicalAgentActivityReturnDictNew</span><spanclass="p">[</span><spanclass="n">lItemKeyStr</span><spanclass="p">]</span><spanclass="o">=</span><spanclass="n">lItemValue</span><spanclass="c1"># Lifetime is ok - set</span>
<spanclass="k">else</span><spanclass="p">:</span>
<spanclass="k">if</span><spanclass="n">lL</span><spanclass="p">:</span><spanclass="n">lL</span><spanclass="o">.</span><spanclass="n">debug</span><spanclass="p">(</span><spanclass="sa">f</span><spanclass="s2">"AgentActivityReturnDict lItemKeyStr: Lifetime is expired. Remove from gSettings"</span><spanclass="p">)</span><spanclass="c1"># Info</span>
<spanclass="n">inGSettings</span><spanclass="p">[</span><spanclass="s2">"AgentActivityReturnDict"</span><spanclass="p">]</span><spanclass="o">=</span><spanclass="n">lTechnicalAgentActivityReturnDictNew</span><spanclass="c1"># Set updated Cache</span></div>
<spanclass="kn">from</span><spanclass="nn">..</span><spanclass="kn">import</span><spanclass="n">__version__</span><spanclass="c1"># Get version from the package</span>
<spanclass="kn">from</span><spanclass="nn">..</span><spanclass="kn">import</span><spanclass="n">__version__</span><spanclass="c1"># Get version from the package</span>
<li><ahref="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemAdd">AgentActivityItemAdd() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
<li><ahref="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemAdd">AgentActivityItemAdd() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
</li>
<li><ahref="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD">AgentOSCMD() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
<li><ahref="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnExists">AgentActivityItemReturnExists() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><ahref="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnGet">AgentActivityItemReturnGet() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
</li>
</ul></td>
</ul></td>
<tdstyle="width: 33%; vertical-align: top;"><ul>
<tdstyle="width: 33%; vertical-align: top;"><ul>
<li><ahref="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD">AgentOSCMD() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><ahref="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBase64StrCreate">AgentOSFileBinaryDataBase64StrCreate() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
<li><ahref="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBase64StrCreate">AgentOSFileBinaryDataBase64StrCreate() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
</li>
<li><ahref="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBytesCreate">AgentOSFileBinaryDataBytesCreate() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
<li><ahref="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBytesCreate">AgentOSFileBinaryDataBytesCreate() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
Work synchroniously! Wait while result will be recieved. Get the result of the ActivityItem execution on the Agent side. Before this please check by the def AgentActivityItemReturnExists that result has come to the Orchestrator
* **Parameters**
* **inGSettings** – Global settings dict (singleton)
* **inGUIDStr** – GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
* **inCheckIntervalSecFloat** – Interval in sec of the check Activity Item result
* **Returns**
Result of the ActivityItem executed on the Agent side anr transmitted to the Orchestrator. IMPORTANT! ONLY JSON ENABLED Types CAN BE TRANSMITTED TO ORCHESTRATOR!
@ -345,6 +398,12 @@ Send CMD to OS thought the pyOpenRPA.Agent daemon. Result return to log + Orches
* **Returns**
GUID String of the ActivityItem - you can wait (sync or async) result by this guid!