|
|
@ -0,0 +1,925 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
|
|
|
<html class="writer-html5" lang="ru" >
|
|
|
|
|
|
|
|
<head>
|
|
|
|
|
|
|
|
<meta charset="utf-8" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<title>pyOpenRPA.Orchestrator.Managers.Process — документация pyOpenRPA v1.2.12 v1.2.12</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" />
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="shortcut icon" href="../../../../_static/favicon.ico"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--[if lt IE 9]>
|
|
|
|
|
|
|
|
<script src="../../../../_static/js/html5shiv.min.js"></script>
|
|
|
|
|
|
|
|
<![endif]-->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" id="documentation_options" data-url_root="../../../../" src="../../../../_static/documentation_options.js"></script>
|
|
|
|
|
|
|
|
<script src="../../../../_static/jquery.js"></script>
|
|
|
|
|
|
|
|
<script src="../../../../_static/underscore.js"></script>
|
|
|
|
|
|
|
|
<script src="../../../../_static/doctools.js"></script>
|
|
|
|
|
|
|
|
<script src="../../../../_static/translations.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" src="../../../../_static/js/theme.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="index" title="Алфавитный указатель" href="../../../../genindex.html" />
|
|
|
|
|
|
|
|
<link rel="search" title="Поиск" href="../../../../search.html" />
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<body class="wy-body-for-nav">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="wy-grid-for-nav">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
|
|
|
|
|
|
<div class="wy-side-scroll">
|
|
|
|
|
|
|
|
<div class="wy-side-nav-search" >
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a href="../../../../index.html" class="icon icon-home"> pyOpenRPA v1.2.12
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div role="search">
|
|
|
|
|
|
|
|
<form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
|
|
|
|
|
|
|
|
<input type="text" name="q" placeholder="Поиск в документации" />
|
|
|
|
|
|
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
|
|
|
|
|
|
<input type="hidden" name="area" value="default" />
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="caption"><span class="caption-text">ОБЩЕЕ</span></p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference external" href="https://pyopenrpa.ru/wiki/guide/index">Выбрать версию</a></li>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../01_HowToInstall.html">1. Первый запуск</a></li>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../03_Copyrights_Contacts.html">2. Права & Контакты</a></li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<p class="caption"><span class="caption-text">МОДУЛЬ РОБОТ</span></p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../Robot/01_Robot.html">1. Описание</a></li>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../Robot/02_Defs.html">2. Функции</a></li>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../Robot/03_HowToUse.html">3. Как использовать?</a></li>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../Robot/04_Dependencies.html">4. Зависимости</a></li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<p class="caption"><span class="caption-text">МОДУЛЬ СТУДИЯ</span></p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../Studio/01_Studio.html">1. Описание</a></li>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../Studio/02_HowToUse.html">2. Как использовать?</a></li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<p class="caption"><span class="caption-text">МОДУЛЬ ОРКЕСТРАТОР</span></p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/01_Orchestrator.html">1. Description</a></li>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/02_Defs.html">2. Defs</a></li>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/03_gSettingsTemplate.html">3. gSettings Template</a></li>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/04_HowToUse.html">4. How to use</a></li>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/05_UAC.html">5. UAC - User Access Control</a></li>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../Orchestrator/06_Defs%20Managers.html">6. Defs Managers</a></li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<p class="caption"><span class="caption-text">МОДУЛЬ АГЕНТ</span></p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../Agent/02_Defs.html">2. Defs</a></li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<p class="caption"><span class="caption-text">ИНСТРУМЕНТЫ</span></p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li class="toctree-l1"><a class="reference internal" href="../../../../Tools/02_Defs.html">2. Defs StopSafe</a></li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<nav class="wy-nav-top" aria-label="top navigation">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
|
|
|
|
|
|
<a href="../../../../index.html">pyOpenRPA v1.2.12</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="wy-nav-content">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="rst-content">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ul class="wy-breadcrumbs">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../../../../index.html" class="icon icon-home"></a> »</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li><a href="../../../index.html">Код модуля</a> »</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li>pyOpenRPA.Orchestrator.Managers.Process</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="wy-breadcrumbs-aside">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<hr/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
|
|
|
|
|
|
<div itemprop="articleBody">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h1>Исходный код pyOpenRPA.Orchestrator.Managers.Process</h1><div class="highlight"><pre>
|
|
|
|
|
|
|
|
<span></span><span class="c1">#from pyOpenRPA.Orchestrator import Managers</span>
|
|
|
|
|
|
|
|
<span class="kn">from</span> <span class="nn">..</span> <span class="kn">import</span> <span class="n">__Orchestrator__</span>
|
|
|
|
|
|
|
|
<span class="kn">import</span> <span class="nn">os</span>
|
|
|
|
|
|
|
|
<span class="kn">import</span> <span class="nn">time</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="kn">from</span> <span class="nn">pyOpenRPA</span> <span class="kn">import</span> <span class="n">Orchestrator</span>
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process">[документация]</a><span class="k">class</span> <span class="nc">Process</span><span class="p">():</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Manager process, which is need to be started / stopped / restarted</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> With Process instance you can automate your process activity. Use schedule package to set interval when process should be active and when not.</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> All defs in class are pickle safe! After orchestrator restart (if not the force stop of the orchestrator process) your instance with properties will be restored. But it not coverage the scheduler which is in __Orchestrator__ .</span>
|
|
|
|
|
|
|
|
<span class="sd"> After orc restart you need to reinit all schedule rules: Orchestrator.OrchestratorScheduleGet</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> Process instance has the following statuses:</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 0_STOPPED</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 1_STOPPED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 2_STOP_SAFE</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 3_STOP_SAFE_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 4_STARTED</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> .. code-block:: python</span>
|
|
|
|
|
|
|
|
<span class="sd"> # For the safe init class use ProcessInitSafe</span>
|
|
|
|
|
|
|
|
<span class="sd"> lProcess = Orchestrator.Managers.ProcessInitSafe(inAgentHostNameStr="PCNAME",inAgentUserNameStr="USER",</span>
|
|
|
|
|
|
|
|
<span class="sd"> inProcessNameWOExeStr="notepad",inStartCMDStr="notepad",inStopSafeTimeoutSecFloat=3)</span>
|
|
|
|
|
|
|
|
<span class="sd"> # Async way to run job</span>
|
|
|
|
|
|
|
|
<span class="sd"> lProcess.ScheduleStatusCheckEverySeconds(inIntervalSecondsInt=5)</span>
|
|
|
|
|
|
|
|
<span class="sd"> Orchestrator.OrchestratorScheduleGet().every(5).seconds.do(Orchestrator.OrchestratorThreadStart,</span>
|
|
|
|
|
|
|
|
<span class="sd"> lProcess.StartCheck)</span>
|
|
|
|
|
|
|
|
<span class="sd"> # OR (sync mode)</span>
|
|
|
|
|
|
|
|
<span class="sd"> Orchestrator.OrchestratorScheduleGet().every(5).seconds.do(lProcess.StartCheck)</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> How to use StopSafe on the robot side</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> .. code-block:: python</span>
|
|
|
|
|
|
|
|
<span class="sd"> from pyOpenRPA.Tools import StopSafe</span>
|
|
|
|
|
|
|
|
<span class="sd"> StopSafe.Init(inLogger=None)</span>
|
|
|
|
|
|
|
|
<span class="sd"> StopSafe.IsSafeStop() # True - WM_CLOSE SIGNAL has come. taskkill /im someprocess.exe</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="n">mAgentHostNameStr</span> <span class="o">=</span> <span class="kc">None</span>
|
|
|
|
|
|
|
|
<span class="n">mAgentUserNameStr</span> <span class="o">=</span> <span class="kc">None</span>
|
|
|
|
|
|
|
|
<span class="n">mStartPathStr</span> <span class="o">=</span> <span class="kc">None</span>
|
|
|
|
|
|
|
|
<span class="n">mStartCMDStr</span> <span class="o">=</span> <span class="kc">None</span>
|
|
|
|
|
|
|
|
<span class="n">mStartArgDict</span> <span class="o">=</span> <span class="kc">None</span>
|
|
|
|
|
|
|
|
<span class="n">mStatusCheckIntervalSecFloat</span> <span class="o">=</span> <span class="kc">None</span>
|
|
|
|
|
|
|
|
<span class="n">mProcessNameWOExeStr</span> <span class="o">=</span> <span class="kc">None</span>
|
|
|
|
|
|
|
|
<span class="n">mStopSafeTimeoutSecFloat</span> <span class="o">=</span> <span class="kc">None</span>
|
|
|
|
|
|
|
|
<span class="n">mStatusStr</span> <span class="o">=</span> <span class="kc">None</span> <span class="c1"># 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="c1"># MST - Manual Stop Trigger</span>
|
|
|
|
|
|
|
|
<span class="n">mMSTdTSecFloat</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="kc">None</span>
|
|
|
|
|
|
|
|
<span class="n">mMSTdNInt</span> <span class="o">=</span> <span class="kc">None</span>
|
|
|
|
|
|
|
|
<span class="n">mMSTStartTimeList</span> <span class="o">=</span> <span class="p">[]</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="n">mAgentMuteBool</span> <span class="o">=</span> <span class="kc">False</span> <span class="c1"># Mute any sends to agent while some action is perfomed</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="n">mStatusSavedStr</span> <span class="o">=</span> <span class="kc">None</span> <span class="c1"># Saved status to the further restore</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.MuteWait"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.MuteWait">[документация]</a> <span class="k">def</span> <span class="nf">MuteWait</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Internal def. Wait when class is apply to send new activities to the agent</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :return:</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lIntervalSecFloat</span> <span class="o">=</span> <span class="mf">0.3</span>
|
|
|
|
|
|
|
|
<span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">mAgentMuteBool</span> <span class="o">==</span> <span class="kc">True</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="n">lIntervalSecFloat</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="kc">None</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.KeyTurpleGet"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.KeyTurpleGet">[документация]</a> <span class="k">def</span> <span class="nf">KeyTurpleGet</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Get the key turple of the current process</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span> <span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span> <span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">,</span> <span class="n">inStartPathStr</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inStartCMDStr</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="n">inStopSafeTimeoutSecFloat</span><span class="o">=</span><span class="mi">300</span><span class="p">,</span> <span class="n">inStartArgDict</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inStatusCheckIntervalSecFloat</span><span class="o">=</span><span class="mi">30</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Init the class instance.</span>
|
|
|
|
|
|
|
|
<span class="sd"> !ATTENTION! Function can raise exception if process with the same (inAgentHostNameStr, inAgentUserNameStr, inProcessNameWOExeStr) is already exists in GSettings (can be restored from previous Orchestrator session). See ProcessInitSafe to sefaty init the instance or restore previous</span>
|
|
|
|
|
|
|
|
<span class="sd"> !ATTENTION! Schedule options you must</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inStartPathStr: Path to start process (.cmd/ .exe or something else). Path can be relative (from orc working directory) or absolute</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inStartCMDStr: CMD script to start program (if no start file is exists)</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inStopSafeTimeoutSecFloat: Time to wait for stop safe. After that do the stop force (if process is not stopped)</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lGS</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">GSettingsGet</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="c1"># Check if Process is not exists in GSettings</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span> <span class="n">inAgentUserNameStr</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span> <span class="n">inProcessNameWOExeStr</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">lGS</span><span class="p">[</span><span class="s2">"ManagersProcessDict"</span><span class="p">]:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mStartArgDict</span> <span class="o">=</span> <span class="n">inStartArgDict</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span> <span class="o">=</span> <span class="n">inAgentHostNameStr</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span> <span class="o">=</span> <span class="n">inAgentUserNameStr</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mStartPathStr</span> <span class="o">=</span> <span class="n">inStartPathStr</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mStartCMDStr</span> <span class="o">=</span> <span class="n">inStartCMDStr</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span> <span class="o">=</span> <span class="n">inProcessNameWOExeStr</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mStopSafeTimeoutSecFloat</span> <span class="o">=</span> <span class="n">inStopSafeTimeoutSecFloat</span>
|
|
|
|
|
|
|
|
<span class="n">lGS</span><span class="p">[</span><span class="s2">"ManagersProcessDict"</span><span class="p">][(</span><span class="n">inAgentHostNameStr</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span> <span class="n">inAgentUserNameStr</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span> <span class="n">inProcessNameWOExeStr</span><span class="o">.</span><span class="n">upper</span><span class="p">())]</span><span class="o">=</span><span class="bp">self</span>
|
|
|
|
|
|
|
|
<span class="n">lActivityDict</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">ProcessorActivityItemCreate</span><span class="p">(</span><span class="n">inDef</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">StatusCheck</span><span class="p">,</span><span class="n">inArgList</span><span class="o">=</span><span class="p">[],</span> <span class="n">inThreadBool</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">ProcessorActivityItemAppend</span><span class="p">(</span><span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityDict</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">inStatusCheckIntervalSecFloat</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">OrchestratorScheduleGet</span><span class="p">()</span><span class="o">.</span><span class="n">every</span><span class="p">(</span><span class="n">inStatusCheckIntervalSecFloat</span><span class="p">)</span><span class="o">.</span><span class="n">seconds</span><span class="o">.</span><span class="n">do</span><span class="p">(</span><span class="n">Orchestrator</span><span class="o">.</span><span class="n">OrchestratorThreadStart</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">StatusCheck</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mStatusCheckIntervalSecFloat</span> <span class="o">=</span> <span class="n">inStatusCheckIntervalSecFloat</span>
|
|
|
|
|
|
|
|
<span class="k">else</span><span class="p">:</span> <span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Managers.Process (</span><span class="si">{</span><span class="n">inAgentHostNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="n">inAgentUserNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="n">inProcessNameWOExeStr</span><span class="si">}</span><span class="s2">): Can't init the Process instance because it already inited in early (see ProcessInitSafe)"</span><span class="p">)</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.ManualStopTriggerSet"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.ManualStopTriggerSet">[документация]</a> <span class="k">def</span> <span class="nf">ManualStopTriggerSet</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inMSTdTSecFloat</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">inMSTdNInt</span><span class="p">:</span> <span class="nb">int</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Set ManualStopTrigger (MST) to switch to STOPPED MANUAL if specified count of start fails will be catched in specified time period</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inMSTdTSecFloat: Time perios in seconds</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inMSTdNInt: Counts of the start tries</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: None</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="c1"># MST - Manual Stop Trigger</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mMSTdTSecFloat</span> <span class="o">=</span> <span class="n">inMSTdTSecFloat</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mMSTdNInt</span> <span class="o">=</span> <span class="n">inMSTdNInt</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.ManualStopTriggerNewStart"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.ManualStopTriggerNewStart">[документация]</a> <span class="k">def</span> <span class="nf">ManualStopTriggerNewStart</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Log new start event. Check if it is applicable. Change status if ManualStop trigger criteria is applied</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :return: # 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mMSTdTSecFloat</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">mMSTdNInt</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="n">lTimeNowSecFloat</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mMSTStartTimeList</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">lTimeNowSecFloat</span><span class="p">)</span> <span class="c1"># Append current time to MST list</span>
|
|
|
|
|
|
|
|
<span class="c1"># Remove old items from list</span>
|
|
|
|
|
|
|
|
<span class="n">lMSTStartTimeList</span> <span class="o">=</span> <span class="p">[]</span>
|
|
|
|
|
|
|
|
<span class="k">for</span> <span class="n">lTimeItemSecFloat</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">mMSTStartTimeList</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="n">ldTSecFloat</span> <span class="o">=</span> <span class="n">lTimeNowSecFloat</span> <span class="o">-</span> <span class="n">lTimeItemSecFloat</span>
|
|
|
|
|
|
|
|
<span class="c1"># Move to the new list if dT less</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">ldTSecFloat</span> <span class="o"><</span> <span class="bp">self</span><span class="o">.</span><span class="n">mMSTdTSecFloat</span><span class="p">:</span> <span class="n">lMSTStartTimeList</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">lTimeItemSecFloat</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mMSTStartTimeList</span> <span class="o">=</span> <span class="n">lMSTStartTimeList</span> <span class="c1"># Set new list</span>
|
|
|
|
|
|
|
|
<span class="c1"># Check count in list</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">lMSTStartTimeList</span><span class="p">)</span> <span class="o">></span> <span class="bp">self</span><span class="o">.</span><span class="n">mMSTdNInt</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"1_STOPPED_MANUAL"</span>
|
|
|
|
|
|
|
|
<span class="c1"># Log info about process</span>
|
|
|
|
|
|
|
|
<span class="n">lL</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">OrchestratorLoggerGet</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="n">lL</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Managers.Process (</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span><span class="si">}</span><span class="s2">): ManualStopTrigger is activated. </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mMSTdNInt</span><span class="si">}</span><span class="s2"> start tries in </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mMSTdTSecFloat</span><span class="si">}</span><span class="s2"> sec."</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.ManualStopListClear"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.ManualStopListClear">[документация]</a> <span class="k">def</span> <span class="nf">ManualStopListClear</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Clear the last start tries list.</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :return: None</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mMSTStartTimeList</span><span class="o">=</span><span class="p">[]</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.Manual2Auto"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.Manual2Auto">[документация]</a> <span class="k">def</span> <span class="nf">Manual2Auto</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self):</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lLogBool</span> <span class="o">=</span> <span class="kc">False</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span><span class="o">==</span><span class="s2">"1_STOPPED_MANUAL"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"0_STOPPED"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span><span class="o">==</span><span class="s2">"3_STOP_SAFE_MANUAL"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"2_STOP_SAFE"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span><span class="o">==</span><span class="s2">"5_STARTED_MANUAL"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"4_STARTED"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="c1"># Log info about process</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lLogBool</span> <span class="o">==</span> <span class="kc">True</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">StatusChangeLog</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.Start"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.Start">[документация]</a> <span class="k">def</span> <span class="nf">Start</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inIsManualBool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">inStartArgDict</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Manual/Auto start. Manual start will block scheduling execution. To return schedule execution use def Manual2Auto.</span>
|
|
|
|
|
|
|
|
<span class="sd"> Will not start if STOP SAFE is now and don't start auto is stopped manual now</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">inIsManualBool</span> <span class="o">==</span> <span class="kc">False</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">ManualStopTriggerNewStart</span><span class="p">()</span> <span class="c1"># Set the time</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"1_STOPPED_MANUAL"</span> <span class="ow">or</span> <span class="s2">"STOP_SAFE"</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span><span class="p">)</span> <span class="ow">and</span> <span class="n">inIsManualBool</span> <span class="o">==</span> <span class="kc">False</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="n">lStr</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"Managers.Process (</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span><span class="si">}</span><span class="s2">): Process will not start because of stopped manual or stop safe is now."</span>
|
|
|
|
|
|
|
|
<span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">OrchestratorLoggerGet</span><span class="p">()</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="n">lStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span>
|
|
|
|
|
|
|
|
<span class="c1"># Send activity item to agent - wait result</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStartPathStr</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="n">lCMDStr</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mStartPathStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStartCMDStr</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="n">lCMDStr</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStartCMDStr</span>
|
|
|
|
|
|
|
|
<span class="c1"># Append args</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">inStartArgDict</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStartArgDict</span> <span class="o">=</span> <span class="n">inStartArgDict</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStartArgDict</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="k">for</span> <span class="n">lItemKeyStr</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStartArgDict</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="n">lItemValueStr</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStartArgDict</span><span class="p">[</span><span class="n">lItemKeyStr</span><span class="p">]</span>
|
|
|
|
|
|
|
|
<span class="n">lCMDStr</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">lCMDStr</span><span class="si">}</span><span class="s2"> </span><span class="si">{</span><span class="n">lItemKeyStr</span><span class="si">}</span><span class="s2"> </span><span class="si">{</span><span class="n">lItemValueStr</span><span class="si">}</span><span class="s2">"</span>
|
|
|
|
|
|
|
|
<span class="c1">#import pdb</span>
|
|
|
|
|
|
|
|
<span class="c1">#pdb.set_trace()</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">MuteWait</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mAgentMuteBool</span><span class="o">=</span><span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="n">lActivityItemStart</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">ProcessorActivityItemCreate</span><span class="p">(</span><span class="n">inDef</span><span class="o">=</span><span class="s2">"OSCMD"</span><span class="p">,</span>
|
|
|
|
|
|
|
|
<span class="n">inArgDict</span><span class="o">=</span><span class="p">{</span><span class="s2">"inCMDStr"</span><span class="p">:</span><span class="n">lCMDStr</span><span class="p">,</span><span class="s2">"inSendOutputToOrchestratorLogsBool"</span><span class="p">:</span><span class="kc">False</span><span class="p">,</span> <span class="s2">"inCaptureBool"</span><span class="p">:</span><span class="kc">False</span><span class="p">},</span>
|
|
|
|
|
|
|
|
<span class="n">inArgGSettingsStr</span><span class="o">=</span><span class="s2">"inGSettings"</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="n">lGUIDStr</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">AgentActivityItemAdd</span><span class="p">(</span><span class="n">inHostNameStr</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="p">,</span>
|
|
|
|
|
|
|
|
<span class="n">inUserStr</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="p">,</span>
|
|
|
|
|
|
|
|
<span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityItemStart</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="n">lStartResult</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">AgentActivityItemReturnGet</span><span class="p">(</span><span class="n">inGUIDStr</span><span class="o">=</span><span class="n">lGUIDStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">inIsManualBool</span><span class="o">==</span><span class="kc">True</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"5_STARTED_MANUAL"</span>
|
|
|
|
|
|
|
|
<span class="k">else</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"4_STARTED"</span>
|
|
|
|
|
|
|
|
<span class="c1"># Log info about process</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">StatusChangeLog</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mAgentMuteBool</span> <span class="o">=</span> <span class="kc">False</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.StartCheck"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StartCheck">[документация]</a> <span class="k">def</span> <span class="nf">StartCheck</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Start program if auto stopped (0_STOPPED).</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">MuteWait</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"0_STOPPED"</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">Start</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.StopSafe"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StopSafe">[документация]</a> <span class="k">def</span> <span class="nf">StopSafe</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inIsManualBool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">inStopSafeTimeoutSecFloat</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Manual/Auto stop safe. Stop safe is the operation which send signal to process to terminate own work (send term signal to process). Managers.Process wait for the mStopSafeTimeoutSecFloat seconds. After that, if process is not terminated - self will StopForce it.</span>
|
|
|
|
|
|
|
|
<span class="sd"> Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inStopSafeTimeoutSecFloat: Default value goes from the instance. You can specify time is second to wait while safe stop. After that program will stop force</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">inStopSafeTimeoutSecFloat</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> <span class="n">inStopSafeTimeoutSecFloat</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStopSafeTimeoutSecFloat</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">MuteWait</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mAgentMuteBool</span><span class="o">=</span><span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="c1"># Send activity item to agent - wait result</span>
|
|
|
|
|
|
|
|
<span class="n">lCMDStr</span> <span class="o">=</span> <span class="sa">f</span><span class="s1">'taskkill /im "</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span><span class="si">}</span><span class="s1">.exe" /fi "username eq %USERNAME%"'</span>
|
|
|
|
|
|
|
|
<span class="n">lActivityItemStart</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">ProcessorActivityItemCreate</span><span class="p">(</span>
|
|
|
|
|
|
|
|
<span class="n">inDef</span><span class="o">=</span><span class="s2">"OSCMD"</span><span class="p">,</span><span class="n">inArgDict</span><span class="o">=</span><span class="p">{</span><span class="s2">"inCMDStr"</span><span class="p">:</span> <span class="n">lCMDStr</span><span class="p">,</span><span class="s2">"inSendOutputToOrchestratorLogsBool"</span><span class="p">:</span><span class="kc">False</span><span class="p">,</span> <span class="s2">"inCaptureBool"</span><span class="p">:</span> <span class="kc">False</span><span class="p">},</span><span class="n">inArgGSettingsStr</span><span class="o">=</span><span class="s2">"inGSettings"</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="n">lGUIDStr</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">AgentActivityItemAdd</span><span class="p">(</span><span class="n">inHostNameStr</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="p">,</span>
|
|
|
|
|
|
|
|
<span class="n">inUserStr</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="p">,</span>
|
|
|
|
|
|
|
|
<span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityItemStart</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="n">lStartResult</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">AgentActivityItemReturnGet</span><span class="p">(</span><span class="n">inGUIDStr</span><span class="o">=</span><span class="n">lGUIDStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">inIsManualBool</span><span class="o">==</span><span class="kc">True</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"3_STOP_SAFE_MANUAL"</span>
|
|
|
|
|
|
|
|
<span class="k">else</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"2_STOP_SAFE"</span>
|
|
|
|
|
|
|
|
<span class="c1"># Log info about process</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">StatusChangeLog</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="c1"># Interval check is stopped</span>
|
|
|
|
|
|
|
|
<span class="n">lTimeStartFloat</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="n">lIntervalCheckSafeStatusFLoat</span> <span class="o">=</span> <span class="mf">15.0</span>
|
|
|
|
|
|
|
|
<span class="k">while</span> <span class="s2">"SAFE"</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="ow">and</span> <span class="p">(</span><span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">-</span> <span class="n">lTimeStartFloat</span><span class="p">)</span> <span class="o"><</span> <span class="n">inStopSafeTimeoutSecFloat</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">StatusCheck</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="s2">"SAFE"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span><span class="p">:</span> <span class="k">break</span>
|
|
|
|
|
|
|
|
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="n">lIntervalCheckSafeStatusFLoat</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="s2">"SAFE"</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="c1"># Log info about process</span>
|
|
|
|
|
|
|
|
<span class="n">lL</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">OrchestratorLoggerGet</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="n">lL</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Managers.Process (</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span><span class="si">}</span><span class="s2">): Safe stop has been wait for </span><span class="si">{</span><span class="n">inStopSafeTimeoutSecFloat</span><span class="si">}</span><span class="s2"> sec. Now do the force stop."</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">StopForce</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="n">inIsManualBool</span><span class="p">,</span><span class="n">inMuteIgnoreBool</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="c1"># Log info about process</span>
|
|
|
|
|
|
|
|
<span class="c1"># self.StatusChangeLog() status check has already log status (see above)</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mAgentMuteBool</span> <span class="o">=</span> <span class="kc">False</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.StopSafeCheck"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StopSafeCheck">[документация]</a> <span class="k">def</span> <span class="nf">StopSafeCheck</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inStopSafeTimeoutSecFloat</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Stop safe program if auto started (4_STARTED).</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inStopSafeTimeoutSecFloat: Default value goes from the instance. You can specify time is second to wait while safe stop. After that program will stop force</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">MuteWait</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"4_STARTED"</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">StopSafe</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">inStopSafeTimeoutSecFloat</span> <span class="o">=</span> <span class="n">inStopSafeTimeoutSecFloat</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.StopForce"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StopForce">[документация]</a> <span class="k">def</span> <span class="nf">StopForce</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inIsManualBool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">inMuteIgnoreBool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Manual/Auto stop force. Force stop don't wait process termination - it just terminate process now.</span>
|
|
|
|
|
|
|
|
<span class="sd"> Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">inMuteIgnoreBool</span> <span class="o">==</span> <span class="kc">False</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">MuteWait</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="n">lMuteWorkBool</span> <span class="o">=</span> <span class="kc">False</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mAgentMuteBool</span><span class="o">==</span><span class="kc">False</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mAgentMuteBool</span><span class="o">=</span><span class="kc">True</span><span class="p">;</span> <span class="n">lMuteWorkBool</span><span class="o">=</span><span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="c1"># Send activity item to agent - wait result</span>
|
|
|
|
|
|
|
|
<span class="n">lCMDStr</span> <span class="o">=</span> <span class="sa">f</span><span class="s1">'taskkill /F /im "</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span><span class="si">}</span><span class="s1">.exe" /fi "username eq %USERNAME%"'</span>
|
|
|
|
|
|
|
|
<span class="n">lActivityItemStart</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">ProcessorActivityItemCreate</span><span class="p">(</span>
|
|
|
|
|
|
|
|
<span class="n">inDef</span><span class="o">=</span><span class="s2">"OSCMD"</span><span class="p">,</span><span class="n">inArgDict</span><span class="o">=</span><span class="p">{</span><span class="s2">"inCMDStr"</span><span class="p">:</span> <span class="n">lCMDStr</span><span class="p">,</span><span class="s2">"inSendOutputToOrchestratorLogsBool"</span><span class="p">:</span><span class="kc">False</span><span class="p">,</span> <span class="s2">"inCaptureBool"</span><span class="p">:</span> <span class="kc">False</span><span class="p">},</span><span class="n">inArgGSettingsStr</span><span class="o">=</span><span class="s2">"inGSettings"</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="n">lGUIDStr</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">AgentActivityItemAdd</span><span class="p">(</span><span class="n">inHostNameStr</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="p">,</span>
|
|
|
|
|
|
|
|
<span class="n">inUserStr</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="p">,</span>
|
|
|
|
|
|
|
|
<span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityItemStart</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="n">lStartResult</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">AgentActivityItemReturnGet</span><span class="p">(</span><span class="n">inGUIDStr</span><span class="o">=</span><span class="n">lGUIDStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">inIsManualBool</span><span class="o">==</span><span class="kc">True</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"1_STOPPED_MANUAL"</span>
|
|
|
|
|
|
|
|
<span class="k">else</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"0_STOPPED"</span>
|
|
|
|
|
|
|
|
<span class="c1"># Log info about process</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">StatusChangeLog</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lMuteWorkBool</span> <span class="o">==</span> <span class="kc">True</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mAgentMuteBool</span><span class="o">=</span><span class="kc">False</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.StopForceCheck"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StopForceCheck">[документация]</a> <span class="k">def</span> <span class="nf">StopForceCheck</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Stop force program if auto started (4_STARTED).</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">MuteWait</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"4_STARTED"</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">StopForce</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.RestartSafe"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.RestartSafe">[документация]</a> <span class="k">def</span> <span class="nf">RestartSafe</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inIsManualBool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Manual/Auto restart safe. Restart safe is the operation which send signal to process to terminate own work (send term signal to process). Then it run process. Managers.Process wait for the mStopSafeTimeoutSecFloat seconds. After that, if process is not terminated - self will StopForce it.</span>
|
|
|
|
|
|
|
|
<span class="sd"> Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">StopSafe</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="n">inIsManualBool</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">Start</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="n">inIsManualBool</span><span class="p">)</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.RestartForce"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.RestartForce">[документация]</a> <span class="k">def</span> <span class="nf">RestartForce</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">inIsManualBool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Manual/Auto restart force. Force restart dont wait process termination - it just terminate process now ant then start it.</span>
|
|
|
|
|
|
|
|
<span class="sd"> Manual restart will block scheduling execution. To return schedule execution use def Manual2Auto</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">StopForce</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="n">inIsManualBool</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">Start</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="n">inIsManualBool</span><span class="p">)</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.StatusSave"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StatusSave">[документация]</a> <span class="k">def</span> <span class="nf">StatusSave</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Save current status of the process. After that you can restore process activity. Work when orchestrator is restarted. Don't save "STOP_SAFE" status > "STOPPED"</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lWarnSafeBool</span> <span class="o">=</span> <span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"2_STOP_SAFE"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusSavedStr</span> <span class="o">=</span> <span class="s2">"0_STOPPED"</span>
|
|
|
|
|
|
|
|
<span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"3_STOP_SAFE_MANUAL"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusSavedStr</span> <span class="o">=</span> <span class="s2">"1_STOPPED_MANUAL"</span>
|
|
|
|
|
|
|
|
<span class="k">else</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusSavedStr</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span><span class="p">;</span> <span class="n">lWarnSafeBool</span> <span class="o">=</span> <span class="kc">False</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lWarnSafeBool</span><span class="o">==</span><span class="kc">True</span><span class="p">:</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">OrchestratorLoggerGet</span><span class="p">()</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Managers.Process (</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span><span class="si">}</span><span class="s2">): Safe status has been catched when safe > change saved status to stopped."</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.StatusCheckIntervalRestore"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StatusCheckIntervalRestore">[документация]</a> <span class="k">def</span> <span class="nf">StatusCheckIntervalRestore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""Call from orchestrator when init</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusCheckIntervalSecFloat</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">OrchestratorLoggerGet</span><span class="p">()</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Managers.Process (</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span><span class="si">}</span><span class="s2">): Restore schedule to StatusCheck in interval of </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mStatusCheckIntervalSecFloat</span><span class="si">}</span><span class="s2"> sec."</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">OrchestratorScheduleGet</span><span class="p">()</span><span class="o">.</span><span class="n">every</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mStatusCheckIntervalSecFloat</span><span class="p">)</span><span class="o">.</span><span class="n">seconds</span><span class="o">.</span><span class="n">do</span><span class="p">(</span><span class="n">Orchestrator</span><span class="o">.</span><span class="n">OrchestratorThreadStart</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">StatusCheck</span><span class="p">)</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.StatusRestore"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StatusRestore">[документация]</a> <span class="k">def</span> <span class="nf">StatusRestore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Execute the StatusCheck, after that restore status to the saved state (see StatusSave). Work when orchestrator is restarted.</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">StatusCheck</span><span class="p">()</span> <span class="c1"># check current status</span>
|
|
|
|
|
|
|
|
<span class="c1"># Do some action</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusSavedStr</span> <span class="o">!=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusSavedStr</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="c1">#lManualBool = False</span>
|
|
|
|
|
|
|
|
<span class="c1">#if "MANUAL" in self.mStatusSavedStr:</span>
|
|
|
|
|
|
|
|
<span class="c1"># lManualBool = True</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="s2">"STOPPED"</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusSavedStr</span> <span class="ow">and</span> <span class="s2">"STOPPED"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">StopSafe</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="s2">"STARTED"</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusSavedStr</span> <span class="ow">and</span> <span class="s2">"STARTED"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">Start</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="n">Orchestrator</span><span class="o">.</span><span class="n">OrchestratorLoggerGet</span><span class="p">()</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Managers.Process (</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span><span class="si">}</span><span class="s2">): Status has been restored to </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mStatusSavedStr</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusSavedStr</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mStatusSavedStr</span> <span class="o">=</span> <span class="kc">None</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.StatusChangeLog"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StatusChangeLog">[документация]</a> <span class="k">def</span> <span class="nf">StatusChangeLog</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Lof information about status change</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :return:</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="c1"># Log info about process</span>
|
|
|
|
|
|
|
|
<span class="n">lL</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">OrchestratorLoggerGet</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="n">lL</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Managers.Process (</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span><span class="si">}</span><span class="s2">): Status has been changed to </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span><span class="si">}</span><span class="s2">)"</span><span class="p">)</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.StatusCheck"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StatusCheck">[документация]</a> <span class="k">def</span> <span class="nf">StatusCheck</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Check if process is alive. The def will save the manual flag is exists. Don't wait mute but set mute if it is not set.</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="c1"># Send activity item to agent - wait result</span>
|
|
|
|
|
|
|
|
<span class="n">lLogBool</span> <span class="o">=</span> <span class="kc">False</span>
|
|
|
|
|
|
|
|
<span class="n">lActivityItemUserProcessList</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">ProcessorActivityItemCreate</span><span class="p">(</span><span class="n">inDef</span><span class="o">=</span><span class="s2">"ProcessWOExeUpperUserListGet"</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="c1">#self.MuteWait()</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mAgentMuteBool</span><span class="o">=</span><span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="n">lGUIDStr</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">AgentActivityItemAdd</span><span class="p">(</span><span class="n">inHostNameStr</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentHostNameStr</span><span class="p">,</span><span class="n">inUserStr</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">mAgentUserNameStr</span><span class="p">,</span><span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityItemUserProcessList</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="n">lUserProcessList</span> <span class="o">=</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">AgentActivityItemReturnGet</span><span class="p">(</span><span class="n">inGUIDStr</span><span class="o">=</span><span class="n">lGUIDStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mProcessNameWOExeStr</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="ow">in</span> <span class="n">lUserProcessList</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"1_STOPPED_MANUAL"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"5_STARTED_MANUAL"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"0_STOPPED"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"4_STARTED"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"4_STARTED"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="k">else</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"2_STOP_SAFE"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"0_STOPPED"</span><span class="p">;</span> <span class="n">lLogBool</span> <span class="o">=</span> <span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"3_STOP_SAFE_MANUAL"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"1_STOPPED_MANUAL"</span><span class="p">;</span> <span class="n">lLogBool</span> <span class="o">=</span> <span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"5_STARTED_MANUAL"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"1_STOPPED_MANUAL"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">==</span> <span class="s2">"4_STARTED"</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"0_STOPPED"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span> <span class="o">=</span> <span class="s2">"0_STOPPED"</span><span class="p">;</span> <span class="n">lLogBool</span><span class="o">=</span><span class="kc">True</span>
|
|
|
|
|
|
|
|
<span class="c1"># Log info about process</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lLogBool</span> <span class="o">==</span> <span class="kc">True</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">StatusChangeLog</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">mAgentMuteBool</span> <span class="o">=</span> <span class="kc">False</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.StatusCheckStart"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StatusCheckStart">[документация]</a> <span class="k">def</span> <span class="nf">StatusCheckStart</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Check process status and run it if auto stopped self.mStatusStr is "0_STOPPED"</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lStatusStr</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">StatusCheck</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lStatusStr</span> <span class="o">==</span> <span class="s2">"0_STOPPED"</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">Start</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.StatusCheckStopForce"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StatusCheckStopForce">[документация]</a> <span class="k">def</span> <span class="nf">StatusCheckStopForce</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Check process status and auto stop force it if self.mStatusStr is 4_STARTED</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lStatusStr</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">StatusCheck</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lStatusStr</span> <span class="o">==</span> <span class="s2">"4_STARTED"</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">StopForce</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Process.StatusCheckStopSafe"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.Process.StatusCheckStopSafe">[документация]</a> <span class="k">def</span> <span class="nf">StatusCheckStopSafe</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Check process status and auto stop safe it if self.mStatusStr is 4_STARTED</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :return:</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lStatusStr</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">StatusCheck</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lStatusStr</span> <span class="o">==</span> <span class="s2">"4_STARTED"</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="bp">self</span><span class="o">.</span><span class="n">StopSafe</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mStatusStr</span></div></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="ProcessInitSafe"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessInitSafe">[документация]</a><span class="k">def</span> <span class="nf">ProcessInitSafe</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">,</span> <span class="n">inStartPathStr</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">inStartCMDStr</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="n">inStopSafeTimeoutSecFloat</span><span class="o">=</span><span class="mi">300</span><span class="p">)</span> <span class="o">-></span> <span class="n">Process</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Exception safe function. Check if process instance is not exists in GSettings (it can be after restart because Orchestrator restore objects from dump of the previous Orchestrator session)</span>
|
|
|
|
|
|
|
|
<span class="sd"> Return existing instance (if exists) or create new instance and return it.</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inStartPathStr: Path to start process (.cmd/ .exe or something else). Path can be relative (from orc working directory) or absolute</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inStartCMDStr: CMD script to start program (if no start file is exists)</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inStopSafeTimeoutSecFloat: Time to wait for stop safe. After that do the stop force (if process is not stopped)</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process instance</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span> <span class="o">=</span> <span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span> <span class="o">=</span> <span class="n">inAgentUserNameStr</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="k">return</span> <span class="n">lProcess</span>
|
|
|
|
|
|
|
|
<span class="k">else</span><span class="p">:</span> <span class="k">return</span> <span class="n">Process</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="o">=</span><span class="n">inAgentHostNameStr</span><span class="p">,</span><span class="n">inAgentUserNameStr</span><span class="o">=</span><span class="n">inAgentUserNameStr</span><span class="p">,</span><span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">,</span>
|
|
|
|
|
|
|
|
<span class="n">inStartPathStr</span><span class="o">=</span><span class="n">inStartPathStr</span><span class="p">,</span><span class="n">inStartCMDStr</span><span class="o">=</span><span class="n">inStartCMDStr</span><span class="p">,</span><span class="n">inStopSafeTimeoutSecFloat</span><span class="o">=</span><span class="n">inStopSafeTimeoutSecFloat</span><span class="p">)</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="ProcessExists"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessExists">[документация]</a><span class="k">def</span> <span class="nf">ProcessExists</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Check if the Process instance is exists in GSettings by the (inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str)</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: True - process exists in gsettings; False - else</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span> <span class="n">inAgentUserNameStr</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span> <span class="n">inProcessNameWOExeStr</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span> <span class="ow">in</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">GSettingsGet</span><span class="p">()[</span><span class="s2">"ManagersProcessDict"</span><span class="p">]</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="ProcessGet"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessGet">[документация]</a><span class="k">def</span> <span class="nf">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="n">Process</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Return the process instance by the inProcessNameWOExeStr</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process instance (if exists) Else None</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">GSettingsGet</span><span class="p">()[</span><span class="s2">"ManagersProcessDict"</span><span class="p">]</span><span class="o">.</span><span class="n">get</span><span class="p">((</span><span class="n">inAgentHostNameStr</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span> <span class="n">inAgentUserNameStr</span><span class="o">.</span><span class="n">upper</span><span class="p">(),</span> <span class="n">inProcessNameWOExeStr</span><span class="o">.</span><span class="n">upper</span><span class="p">()),</span><span class="kc">None</span><span class="p">)</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="ProcessStatusStrGet"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessStatusStrGet">[документация]</a><span class="k">def</span> <span class="nf">ProcessStatusStrGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Get the status of the Process instance.</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr.</span>
|
|
|
|
|
|
|
|
<span class="sd"> Process instance has the following statuses:</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 0_STOPPED</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 1_STOPPED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 2_STOP_SAFE</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 3_STOP_SAFE_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 4_STARTED</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - None (if Process instance not exists)</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span> <span class="o">=</span> <span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span> <span class="o">=</span> <span class="n">inAgentUserNameStr</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="k">return</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="ProcessStart"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessStart">[документация]</a><span class="k">def</span> <span class="nf">ProcessStart</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inIsManualBool</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Manual/Auto start. Manual start will block scheduling execution. To return schedule execution use def Manual2Auto</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr.</span>
|
|
|
|
|
|
|
|
<span class="sd"> Process instance has the following statuses:</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 0_STOPPED</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 1_STOPPED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 2_STOP_SAFE</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 3_STOP_SAFE_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 4_STARTED</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - None (if Process instance not exists)</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span> <span class="o">=</span> <span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span> <span class="o">=</span> <span class="n">inAgentUserNameStr</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="k">return</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">Start</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="n">inIsManualBool</span><span class="p">)</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="ProcessStopSafe"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessStopSafe">[документация]</a><span class="k">def</span> <span class="nf">ProcessStopSafe</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inIsManualBool</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">inStopSafeTimeoutSecFloat</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Manual/Auto stop safe. Stop safe is the operation which send signal to process to terminate own work (send term signal to process). Managers.Process wait for the mStopSafeTimeoutSecFloat seconds. After that, if process is not terminated - self will StopForce it.</span>
|
|
|
|
|
|
|
|
<span class="sd"> Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inStopSafeTimeoutSecFloat: Default value goes from the instance. You can specify time is second to wait while safe stop. After that program will stop force</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr.</span>
|
|
|
|
|
|
|
|
<span class="sd"> Process instance has the following statuses:</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 0_STOPPED</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 1_STOPPED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 2_STOP_SAFE</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 3_STOP_SAFE_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 4_STARTED</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - None (if Process instance not exists)</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span> <span class="o">=</span> <span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span> <span class="o">=</span> <span class="n">inAgentUserNameStr</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="k">return</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">StopSafe</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="n">inIsManualBool</span><span class="p">)</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="ProcessStopForce"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessStopForce">[документация]</a><span class="k">def</span> <span class="nf">ProcessStopForce</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inIsManualBool</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Manual/Auto stop force. Force stop dont wait process termination - it just terminate process now.</span>
|
|
|
|
|
|
|
|
<span class="sd"> Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inIsManualBool: Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr.</span>
|
|
|
|
|
|
|
|
<span class="sd"> Process instance has the following statuses:</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 0_STOPPED</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 1_STOPPED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 2_STOP_SAFE</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 3_STOP_SAFE_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 4_STARTED</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - None (if Process instance not exists)</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span> <span class="o">=</span> <span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span> <span class="o">=</span> <span class="n">inAgentUserNameStr</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="k">return</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">StopForce</span><span class="p">(</span><span class="n">inIsManualBool</span><span class="o">=</span><span class="n">inIsManualBool</span><span class="p">)</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="ProcessStatusSave"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessStatusSave">[документация]</a><span class="k">def</span> <span class="nf">ProcessStatusSave</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Save current status of the process. After that you can restore process activity. Work when orchestrator is restarted. Don't save "STOP_SAFE" status > "STOPPED"</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="o">=</span><span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="o">=</span><span class="n">inAgentUserNameStr</span><span class="p">,</span>
|
|
|
|
|
|
|
|
<span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="n">lProcess</span><span class="o">.</span><span class="n">StatusSave</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="ProcessStatusRestore"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessStatusRestore">[документация]</a><span class="k">def</span> <span class="nf">ProcessStatusRestore</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Execute the StatusCheck, after that restore status to the saved state (see StatusSave). Work when orchestrator is restarted.</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="o">=</span><span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="o">=</span><span class="n">inAgentUserNameStr</span><span class="p">,</span>
|
|
|
|
|
|
|
|
<span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="n">lProcess</span><span class="o">.</span><span class="n">StatusRestore</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="ProcessStatusCheck"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessStatusCheck">[документация]</a><span class="k">def</span> <span class="nf">ProcessStatusCheck</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Check if process is alive. The def will save the manual flag is exists.</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr.</span>
|
|
|
|
|
|
|
|
<span class="sd"> Process instance has the following statuses:</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 0_STOPPED</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 1_STOPPED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 2_STOP_SAFE</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 3_STOP_SAFE_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 4_STARTED</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - None (if Process instance not exists)</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="o">=</span><span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="o">=</span><span class="n">inAgentUserNameStr</span><span class="p">,</span>
|
|
|
|
|
|
|
|
<span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="n">lProcess</span><span class="o">.</span><span class="n">StatusCheck</span><span class="p">()</span>
|
|
|
|
|
|
|
|
<span class="k">return</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">mStatusStr</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="ProcessManual2Auto"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessManual2Auto">[документация]</a><span class="k">def</span> <span class="nf">ProcessManual2Auto</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self):</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: Process status. See self.mStatusStr.</span>
|
|
|
|
|
|
|
|
<span class="sd"> Process instance has the following statuses:</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 0_STOPPED</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 1_STOPPED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 2_STOP_SAFE</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 3_STOP_SAFE_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 4_STARTED</span>
|
|
|
|
|
|
|
|
<span class="sd"> - 5_STARTED_MANUAL</span>
|
|
|
|
|
|
|
|
<span class="sd"> - None (if Process instance not exists)</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="o">=</span><span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="o">=</span><span class="n">inAgentUserNameStr</span><span class="p">,</span>
|
|
|
|
|
|
|
|
<span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="k">return</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">Manual2Auto</span><span class="p">()</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="ProcessManualStopTriggerSet"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessManualStopTriggerSet">[документация]</a><span class="k">def</span> <span class="nf">ProcessManualStopTriggerSet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inMSTdTSecFloat</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">inMSTdNInt</span><span class="p">:</span> <span class="nb">int</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self):</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inMSTdTSecFloat: Time periods in seconds</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inMSTdNInt: Counts of the start tries</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: None</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="o">=</span><span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="o">=</span><span class="n">inAgentUserNameStr</span><span class="p">,</span>
|
|
|
|
|
|
|
|
<span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">ManualStopTriggerSet</span><span class="p">(</span><span class="n">inMSTdTSecFloat</span> <span class="o">=</span> <span class="n">inMSTdTSecFloat</span><span class="p">,</span> <span class="n">inMSTdNInt</span> <span class="o">=</span> <span class="n">inMSTdNInt</span><span class="p">)</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="ProcessManualStopListClear"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessManualStopListClear">[документация]</a><span class="k">def</span> <span class="nf">ProcessManualStopListClear</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Clear the last start tries list.</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: None</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="o">=</span><span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="o">=</span><span class="n">inAgentUserNameStr</span><span class="p">,</span>
|
|
|
|
|
|
|
|
<span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="k">if</span> <span class="n">lProcess</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="n">lProcess</span><span class="o">.</span><span class="n">ManualStopListClear</span><span class="p">()</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="ProcessScheduleStatusCheckEverySeconds"><a class="viewcode-back" href="../../../../Orchestrator/06_Defs%20Managers.html#pyOpenRPA.Orchestrator.Managers.Process.ProcessScheduleStatusCheckEverySeconds">[документация]</a><span class="k">def</span> <span class="nf">ProcessScheduleStatusCheckEverySeconds</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">inProcessNameWOExeStr</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span><span class="n">inIntervalSecondsInt</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">120</span><span class="p">):</span>
|
|
|
|
|
|
|
|
<span class="sd">"""</span>
|
|
|
|
|
|
|
|
<span class="sd"> Run status check every interval in second you specify.</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentHostNameStr: Agent hostname in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inAgentUserNameStr: Agent user name in any case. Required to identify Process</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inProcessNameWOExeStr: The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case</span>
|
|
|
|
|
|
|
|
<span class="sd"> :param inIntervalSecondsInt: Interval in seconds. Default is 120</span>
|
|
|
|
|
|
|
|
<span class="sd"> :return: None</span>
|
|
|
|
|
|
|
|
<span class="sd"> """</span>
|
|
|
|
|
|
|
|
<span class="n">lProcess</span> <span class="o">=</span> <span class="n">ProcessGet</span><span class="p">(</span><span class="n">inAgentHostNameStr</span><span class="o">=</span><span class="n">inAgentHostNameStr</span><span class="p">,</span> <span class="n">inAgentUserNameStr</span><span class="o">=</span><span class="n">inAgentUserNameStr</span><span class="p">,</span>
|
|
|
|
|
|
|
|
<span class="n">inProcessNameWOExeStr</span><span class="o">=</span><span class="n">inProcessNameWOExeStr</span><span class="p">)</span>
|
|
|
|
|
|
|
|
<span class="c1"># Check job in threaded way</span>
|
|
|
|
|
|
|
|
<span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">OrchestratorScheduleGet</span><span class="p">()</span><span class="o">.</span><span class="n">every</span><span class="p">(</span><span class="n">inIntervalSecondsInt</span><span class="p">)</span><span class="o">.</span><span class="n">seconds</span><span class="o">.</span><span class="n">do</span><span class="p">(</span><span class="n">__Orchestrator__</span><span class="o">.</span><span class="n">OrchestratorThreadStart</span><span class="p">,</span><span class="n">lProcess</span><span class="o">.</span><span class="n">StatusCheck</span><span class="p">)</span></div>
|
|
|
|
|
|
|
|
</pre></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<footer>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<hr/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div role="contentinfo">
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
|
|
|
© Copyright 2022, ООО "ОПЕН РПА".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Собрано при помощи <a href="https://www.sphinx-doc.org/">Sphinx</a> с использованием
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a href="https://github.com/readthedocs/sphinx_rtd_theme">темы,</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
предоставленной <a href="https://readthedocs.org">Read the Docs</a>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</footer>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
jQuery(function () {
|
|
|
|
|
|
|
|
SphinxRtdTheme.Navigation.enable(true);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|