ifinGSettings["Logger"]:inGSettings["Logger"].warning(f"RDP def was called not from processor queue - activity will be append in the processor queue.")
lResult={
lActivityItem={
"Def":RDPSessionProcessStartIfNotRunning,# def link or def alias (look gSettings["Processor"]["AliasDefDict"])
<td><p>pyOpenRPA.Agent: Create text file by the string def OSFileTextDataStrCreate(inFilePathStr, inFileDataStr, inEncodingStr = “utf-8”,inGSettings = None): Create Activity Item for the agent</p></td>
<td><p>Create text file by the string by the pyOpenRPA.Agent daemon process</p></td>
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">AgentActivityItemAdd</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">inGSettings</span></em>, <emclass="sig-param"><spanclass="n">inHostNameStr</span></em>, <emclass="sig-param"><spanclass="n">inUserStr</span></em>, <emclass="sig-param"><spanclass="n">inActivityItemDict</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#AgentActivityItemAdd"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemAdd"title="Permalink to this definition">¶</a></dt>
<dd><p>Add activity in AgentDict. Check if item is created</p>
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">GSettingsAutocleaner</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">inGSettings</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#GSettingsAutocleaner"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.GSettingsAutocleaner"title="Permalink to this definition">¶</a></dt>
<dd><p>Interval gsettings auto cleaner</p>
<dd><p>HIDDEN Interval gSettings auto cleaner def to clear some garbage.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>inGSettings</strong>– Global settings dict (singleton)</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p></p>
<ddclass="field-even"><p>None</p>
</dd>
</dl>
</dd></dl>
@ -946,16 +985,26 @@ Create Activity Item for the agent</p>
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">RDPSessionCMDRun</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">inGSettings</span></em>, <emclass="sig-param"><spanclass="n">inRDPSessionKeyStr</span></em>, <emclass="sig-param"><spanclass="n">inCMDStr</span></em>, <emclass="sig-param"><spanclass="n">inModeStr</span><spanclass="o">=</span><spanclass="default_value">'CROSSCHECK'</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#RDPSessionCMDRun"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionCMDRun"title="Permalink to this definition">¶</a></dt>
<dd><p>Send command in RDP session</p>
<dd><p>Send CMD command to the RDP session “RUN” window</p>
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">RDPSessionDisconnect</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">inGSettings</span></em>, <emclass="sig-param"><spanclass="n">inRDPSessionKeyStr</span></em>, <emclass="sig-param"><spanclass="n">inBreakTriggerProcessWOExeList</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#RDPSessionDisconnect"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionDisconnect"title="Permalink to this definition">¶</a></dt>
<dd><p>Disconnect the RDP session</p>
<dd><p>Disconnect the RDP session and stop monitoring it.</p>
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">RDPSessionDublicatesResolve</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">inGSettings</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#RDPSessionDublicatesResolve"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionDublicatesResolve"title="Permalink to this definition">¶</a></dt>
<dd><p>DEVELOPING Search dublicates in GSettings RDPlist
<dd><p>DEVELOPING Search duplicates in GSettings RDPlist
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">RDPSessionFileStoredRecieve</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">inGSettings</span></em>, <emclass="sig-param"><spanclass="n">inRDPSessionKeyStr</span></em>, <emclass="sig-param"><spanclass="n">inRDPFilePathStr</span></em>, <emclass="sig-param"><spanclass="n">inHostFilePathStr</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#RDPSessionFileStoredRecieve"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionFileStoredRecieve"title="Permalink to this definition">¶</a></dt>
<dd><p>Receive file from Session RDP to Host using shared drive in RDP</p>
<dd><p>Recieve file from RDP session to the Orchestrator session using shared drive in RDP (see RDP Configuration Dict, Shared drive)</p>
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">RDPSessionFileStoredSend</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">inGSettings</span></em>, <emclass="sig-param"><spanclass="n">inRDPSessionKeyStr</span></em>, <emclass="sig-param"><spanclass="n">inHostFilePathStr</span></em>, <emclass="sig-param"><spanclass="n">inRDPFilePathStr</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#RDPSessionFileStoredSend"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionFileStoredSend"title="Permalink to this definition">¶</a></dt>
<dd><p>Send file from Host to Session RDP using shared drive in RDP</p>
<dd><p>Send file from Orchestrator session to the RDP session using shared drive in RDP (see RDP Configuration Dict, Shared drive)</p>
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">RDPSessionLogoff</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">inGSettings</span></em>, <emclass="sig-param"><spanclass="n">inRDPSessionKeyStr</span></em>, <emclass="sig-param"><spanclass="n">inBreakTriggerProcessWOExeList</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#RDPSessionLogoff"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionLogoff"title="Permalink to this definition">¶</a></dt>
<dd><p>Logoff the RDP session</p>
<dd><p>Logoff the RDP session from the Orchestrator process (close all apps in session when logoff)</p>
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">RDPSessionMonitorStop</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">inGSettings</span></em>, <emclass="sig-param"><spanclass="n">inRDPSessionKeyStr</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#RDPSessionMonitorStop"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionMonitorStop"title="Permalink to this definition">¶</a></dt>
<dd><p>Stop track the RDP session. Current def dont kill RDP session - only stop to track it (it can give )</p>
<dd><p>Stop monitoring the RDP session by the Orchestrator process. Current def don’t kill RDP session - only stop to track it (it can give )</p>
<li><p><strong>inRDPSessionKeyStr</strong>–RDP Session string key - need for the further identification</p></li>
<li><p><strong>inProcessNameWEXEStr</strong>–Process name with extension (.exe). This arg allow to check the process is running. Example: “Notepad.exe”</p></li>
<li><p><strong>inFilePathStr</strong>–Path to run process if it is not running.</p></li>
<li><p><strong>inFlagGetAbsPathBool</strong>–True - get abs path from the relative path in inFilePathStr. False - else case</p></li>
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">RDPSessionProcessStop</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">inGSettings</span></em>, <emclass="sig-param"><spanclass="n">inRDPSessionKeyStr</span></em>, <emclass="sig-param"><spanclass="n">inProcessNameWEXEStr</span></em>, <emclass="sig-param"><spanclass="n">inFlagForceCloseBool</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#RDPSessionProcessStop"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionProcessStop"title="Permalink to this definition">¶</a></dt>
<dd><p>Create CMD str to stop process</p>
<dd><p>Send CMD command to the RDP session “RUN” window.</p>
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">RDPSessionReconnect</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">inGSettings</span></em>, <emclass="sig-param"><spanclass="n">inRDPSessionKeyStr</span></em>, <emclass="sig-param"><spanclass="n">inRDPTemplateDict</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#RDPSessionReconnect"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionReconnect"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">RDPSessionResponsibilityCheck</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">inGSettings</span></em>, <emclass="sig-param"><spanclass="n">inRDPSessionKeyStr</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#RDPSessionResponsibilityCheck"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.RDPSessionResponsibilityCheck"title="Permalink to this definition">¶</a></dt>
<dd><p>Check RDP Session responsibility TODO NEED DEV + TEST</p>
<dd><p>DEVELOPING, MAYBE NOT USEFUL Check RDP Session responsibility TODO NEED DEV + TEST</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>
<ahref="04_HowToStart.html"class="btn btn-neutral float-right"title="4. How to start" accesskey="n"rel="next">Next <spanclass="fa fa-arrow-circle-right"aria-hidden="true"></span></a>
<ahref="04_HowToStart.html"class="btn btn-neutral float-right"title="4. How to start process" accesskey="n"rel="next">Next <spanclass="fa fa-arrow-circle-right"aria-hidden="true"></span></a>
<h1>4. How to start<aclass="headerlink"href="#how-to-start" title="Permalink to this headline">¶</a></h1>
<divclass="section"id="how-to-start-process">
<h1>4. How to start process<aclass="headerlink"href="#how-to-start-process" title="Permalink to this headline">¶</a></h1>
<p>Start configuration example</p>
<divclass="highlight-default notranslate"><divclass="highlight"><pre><span></span><spanclass="kn">import</span><spanclass="nn">psutil</span><spanclass="o">,</span><spanclass="nn">datetime</span><spanclass="o">,</span><spanclass="nn">logging</span><spanclass="o">,</span><spanclass="nn">os</span><spanclass="o">,</span><spanclass="nn">sys</span><spanclass="c1"># stdout from logging</span>
<spanclass="n">RDPSessionDisconnect</span><spanclass="p">(</span><spanclass="n">inRDPSessionKeyStr</span><spanclass="o">=</span><spanclass="n">inRDPSessionKeyStr</span><spanclass="p">)</span><spanclass="c1"># Disconnect the RDP</span>
<spanclass="n">RDPSessionDisconnect</span><spanclass="p">(</span><spanclass="n">inGSettings</span><spanclass="o">=</span><spanclass="n">inGSettings</span><spanclass="p">,</span><spanclass="n">inRDPSessionKeyStr</span><spanclass="o">=</span><spanclass="n">inRDPSessionKeyStr</span><spanclass="p">)</span><spanclass="c1"># Disconnect the RDP 2021 02 22 minor fix by Ivan Maslov</span>
<spanclass="c1"># Replace Configuration item if inRDPTemplateDict exists</span>
<spanclass="sd"> Stop track the RDP session. Current def dont kill RDP session - only stop to track it (it can give )</span>
<spanclass="sd"> Stop monitoring the RDP session by the Orchestrator process. Current def don't kill RDP session - only stop to track it (it can give )</span>
<spanclass="sd"> .. code-block:: python</span>
<spanclass="sd"> # USAGE</span>
<spanclass="sd"> from pyOpenRPA import Orchestrator</span>
<spanclass="n">inGSettings</span><spanclass="p">[</span><spanclass="s2">"RobotRDPActive"</span><spanclass="p">][</span><spanclass="s2">"RDPList"</span><spanclass="p">]</span><spanclass="o">.</span><spanclass="n">pop</span><spanclass="p">(</span><spanclass="n">inRDPSessionKeyStr</span><spanclass="p">,</span><spanclass="kc">None</span><spanclass="p">)</span><spanclass="c1"># Remove item from RDPList</span>
<spanclass="sd"> :param inRDPSessionKeyStr: RDP Session string key - need for the further identification</span>
<spanclass="sd"> :param inProcessNameWEXEStr: Process name with extension (.exe). This arg allow to check the process is running. Example: "Notepad.exe"</span>
<spanclass="sd"> :param inFilePathStr: Path to run process if it is not running.</span>
<spanclass="sd"> :param inFlagGetAbsPathBool: True - get abs path from the relative path in inFilePathStr. False - else case</span>
<spanclass="sd"> :return: True every time :)</span>
<spanclass="k">if</span><spanclass="n">inGSettings</span><spanclass="p">[</span><spanclass="s2">"Logger"</span><spanclass="p">]:</span><spanclass="n">inGSettings</span><spanclass="p">[</span><spanclass="s2">"Logger"</span><spanclass="p">]</span><spanclass="o">.</span><spanclass="n">warning</span><spanclass="p">(</span><spanclass="sa">f</span><spanclass="s2">"RDP def was called not from processor queue - activity will be append in the processor queue."</span><spanclass="p">)</span>
<spanclass="s2">"Def"</span><spanclass="p">:</span><spanclass="n">RDPSessionProcessStartIfNotRunning</span><spanclass="p">,</span><spanclass="c1"># def link or def alias (look gSettings["Processor"]["AliasDefDict"])</span>
<spanclass="s2">"ArgGSettings"</span><spanclass="p">:</span><spanclass="s2">"inGSettings"</span><spanclass="p">,</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="sd"> :param inRDPSessionKeyStr: RDP Session string key - need for the further identification</span>
<spanclass="sd"> :param inHostFilePathStr: Relative or absolute path to the file location on the Orchestrator side. Example: "TESTDIR\\Test.py"</span>
<spanclass="sd"> :param inRDPFilePathStr: !Absolute! path to the destination file location on the RDP side. Example: "C:\\RPA\\TESTDIR\\Test.py"</span>
<spanclass="sd"> :param inRDPSessionKeyStr: RDP Session string key - need for the further identification</span>
<spanclass="sd"> :param inRDPFilePathStr: !Absolute! path to the destination file location on the RDP side. Example: "C:\\RPA\\TESTDIR\\Test.py"</span>
<spanclass="sd"> :param inHostFilePathStr: Relative or absolute path to the file location on the Orchestrator side. Example: "TESTDIR\\Test.py"</span>
<spanclass="n">time</span><spanclass="o">.</span><spanclass="n">sleep</span><spanclass="p">(</span><spanclass="n">inGSettings</span><spanclass="p">[</span><spanclass="s2">"Autocleaner"</span><spanclass="p">][</span><spanclass="s2">"IntervalSecFloat"</span><spanclass="p">])</span><spanclass="c1"># Wait for the next iteration</span>
| Send CMD to OS throught the pyOpenRPA.Agent daemon.
| Send CMD to OS thought the pyOpenRPA.Agent daemon.
|
| `AgentOSFileBinaryDataBase64StrCreate`(…)
| pyOpenRPA.Agent: Create binary file by the base64 string (safe for JSON transmission) def OSFileBinaryDataBase64StrCreate(inFilePathStr, inFileDataBase64Str,inGSettings = None): Send binary file to Agent (base64 string)
| Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmission)
|
| `AgentOSFileBinaryDataBytesCreate`(…)
| pyOpenRPA.Agent: Create binary file by the base64 string (safe for JSON transmition) def OSFileBinaryDataBase64StrCreate(inFilePathStr, inFileDataBase64Str,inGSettings = None): Send binary file to Agent (Bytes)
| Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmition)
|
|
| `AgentOSFileTextDataStrCreate`(inGSettings, …)
| pyOpenRPA.Agent: Create text file by the string def OSFileTextDataStrCreate(inFilePathStr, inFileDataStr, inEncodingStr = “utf-8”,inGSettings = None): Create Activity Item for the agent
| Create text file by the string by the pyOpenRPA.Agent daemon process
|
|
| `GSettingsAutocleaner`(inGSettings)
| Interval gsettings auto cleaner
| HIDDEN Interval gSettings auto cleaner def to clear some garbage.
| Orchestrator session save in file _SessionLast_RDPList.json (encoding = “utf-8”)
|
|
| `ProcessIsStarted`(inProcessNameWOExeStr)
| Check if there is any running process that contains the given name processName.
|
|
| `ProcessListGet`([inProcessNameWOExeList])
| Return process list on the orchestrator machine sorted by Memory Usage.
|
|
| `ProcessStart`(inPathStr, inArgList[, …])
| Start process locally.
|
|
| `ProcessStop`(inProcessNameWOExeStr, …[, …])
| Stop process on the orchestrator machine.
|
|
| `ProcessorActivityItemAppend`(inGSettings[, …])
| Create and add activity item in processor queue.
|
|
| `ProcessorActivityItemCreate`(inDef[, …])
| Create activity item.
|
|
| `ProcessorAliasDefCreate`(inGSettings, inDef)
| Create alias for def (can be used in ActivityItem in field Def) !WHEN DEF ALIAS IS REQUIRED! - Def alias is required when you try to call Python def from the Orchestrator WEB side (because you can’t transmit Python def object out of the Python environment)