iflL:lL.warning(f"Processor.ProcessorMonitorRunSync: Processor wait more than {lWaitTimeSecFloat} sec. Activity def: {lItemDict['Def']}; GUID: {lItemDict['GUIDStr']}")
else:
lActiveGUIDStr=lItemDict["GUIDStr"]
lActiveTimeStart=time.time()
time.sleep(inGSettings["ProcessorDict"]["WarningExecutionMoreThanSecFloat"])# Sleep when list is empty
exceptExceptionase:
iflL:lL.exception(
f"Processor.ProcessorMonitorRunSync. Something goes very wrong in processor queue. See traceback")
lRDPConfigurationDict["SessionIsWindowExistBool"]=True# Flag that session is started
lRDPConfigurationDict["SessionIsWindowExistBool"]=True# Flag that session is started
iflL:lL.info(f"SessionHex: {str(lRDPConfigurationDict['SessionHex'])}:: Session has been initialized!")#Logging
iflL:lL.info(f"Host: {lRDPConfigurationDict['Host']}, Login: {lRDPConfigurationDict['Login']}, SessionHex: {str(lRDPConfigurationDict['SessionHex'])}:: Session has been initialized!")#Logging
lRDPConfigurationDict["SessionIsWindowExistBool"]=False# Set flag that session is disconnected
lRDPConfigurationDict["SessionIsWindowExistBool"]=False# Set flag that session is disconnected
iflL:lL.warning(f"SessionHex: {str(lRDPConfigurationDict['SessionHex'])}:: Session is not exist!")#Logging
iflL:lL.warning(f"Host: {lRDPConfigurationDict['Host']}, Login: {lRDPConfigurationDict['Login']}, SessionHex: {str(lRDPConfigurationDict['SessionHex'])}:: Session is not exist! Mark the retry")#Logging
iflL:lL.warning(f"!ATTENTION! Host: {lRDPConfigurationDict['Host']}, Login: {lRDPConfigurationDict['Login']}; RDP is not responsible for many times - run recovery mode")
Recovery.RetryHostClear(inHostStr=lRDPConfigurationDict['Host'],inGSettings=inGSettings)# Clear the stat about current host
iflL:lL.warning(f"An existing connection was forcibly closed by the remote host - OK for the network interactions (ConnectionResetError: [WinError 10054])")
iflL:lL.debug(f"SERVER: pyOpenRPA_Agent_A2O:: Has recieved result of the activity items from agent! ActivityItem GUID Str: {lActivityReturnItemKeyStr}; Return value: {lActivityReturnItemValue}")
Processor.__ActivityListVerify__(inActivityList=inActivityList)# DO VERIFICATION FOR THE inActivityList
Processor.__ActivityListVerify__(inActivityList=inActivityList)# DO VERIFICATION FOR THE inActivityList
inActivityList=copy.deepcopy(inActivityList)
# Check if no def function is here - if exist - replace to alias
# Check if no def function is here - if exist - replace to alias
forlActivityItemininActivityList:
forlActivityItemininActivityList:
if"GUIDStr"inlActivityItemandinGUIDRemoveBool==True:dellActivityItem["GUIDStr"]# Remove GUID from activity items if exists
lDef=lActivityItem["Def"]
lDef=lActivityItem["Def"]
ifcallable(lDef):raiseException(f"pyOpenRPA Exception: You can't send ActivityList with def to JS. Use Def Alias (see Orchestrator.ProcessorAliasDefUpdate)")
ifcallable(lDef):raiseException(f"pyOpenRPA Exception: You can't send ActivityList with def to JS. Use Def Alias (see Orchestrator.ProcessorAliasDefUpdate)")
Processor.__ActivityListVerify__(inActivityList=inActivityList)# DO VERIFICATION FOR THE inActivityList
Processor.__ActivityListVerify__(inActivityList=inActivityList)# DO VERIFICATION FOR THE inActivityList
inActivityList=copy.deepcopy(inActivityList)
# Check if no def function is here - if exist - replace to alias
forlActivityItemininActivityList:
if"GUIDStr"inlActivityItemandinGUIDRemoveBool==True:dellActivityItem["GUIDStr"]# Remove GUID from activity items if exists
lDef=lActivityItem["Def"]
ifcallable(lDef):raiseException(f"pyOpenRPA Exception: You can't send ActivityList with def to JS. Use Def Alias (see Orchestrator.ProcessorAliasDefUpdate)")
raiseException(f"__Orchestrator__.AgentActivityItemReturnGet !ATTENTION! Use this function only after Orchestrator initialization! Before orchestrator init exception will be raised.")
else:raiseException(f"pyOpenRPA Exception: You can't use Orchestrator.ProcessorAliasDefUpdate with arg 'inDef' string value. inDef is '{inDef}', inAliasStr is '{inAliasStr}'")
else:raiseException(f"pyOpenRPA Exception: You can't use Orchestrator.ProcessorAliasDefUpdate with arg 'inDef' string value. inDef is '{inDef}', inAliasStr is '{inAliasStr}'")
ifinGSettings["Logger"]:inGSettings["Logger"].warning(f"__Orchestrator__.ProcessDefIntervalCall def was called not from processor queue - activity will be append in the processor queue.")
lProcessorActivityDict={
"Def":ProcessDefIntervalCall,# def link or def alias (look gSettings["Processor"]["AliasDefDict"])
if(lNowDatetime-lItemValue["ReturnedByDatetime"]).total_seconds()<inGSettings["Autocleaner"]["AgentActivityReturnLifetimeSecFloat"]:# Add if lifetime is ok
lTechnicalAgentActivityReturnDictNew[lItemKeyStr]=lItemValue# Lifetime is ok - set
else:
iflL:lL.debug(f"AgentActivityReturnDict lItemKeyStr: Lifetime is expired. Remove from gSettings")# Info
inGSettings["AgentActivityReturnDict"]=lTechnicalAgentActivityReturnDictNew# Set updated Cache
iflL:lL.warning(f"Processor.ProcessorMonitorRunSync: Processor wait more than {lWaitTimeSecFloat} sec. Activity def: {lItemDict['Def']}; GUID: {lItemDict['GUIDStr']}")
else:
lActiveGUIDStr=lItemDict["GUIDStr"]
lActiveTimeStart=time.time()
time.sleep(inGSettings["ProcessorDict"]["WarningExecutionMoreThanSecFloat"])# Sleep when list is empty
exceptExceptionase:
iflL:lL.exception(
f"Processor.ProcessorMonitorRunSync. Something goes very wrong in processor queue. See traceback")
lRDPConfigurationDict["SessionIsWindowExistBool"]=True# Flag that session is started
lRDPConfigurationDict["SessionIsWindowExistBool"]=True# Flag that session is started
iflL:lL.info(f"SessionHex: {str(lRDPConfigurationDict['SessionHex'])}:: Session has been initialized!")#Logging
iflL:lL.info(f"Host: {lRDPConfigurationDict['Host']}, Login: {lRDPConfigurationDict['Login']}, SessionHex: {str(lRDPConfigurationDict['SessionHex'])}:: Session has been initialized!")#Logging
lRDPConfigurationDict["SessionIsWindowExistBool"]=False# Set flag that session is disconnected
lRDPConfigurationDict["SessionIsWindowExistBool"]=False# Set flag that session is disconnected
iflL:lL.warning(f"SessionHex: {str(lRDPConfigurationDict['SessionHex'])}:: Session is not exist!")#Logging
iflL:lL.warning(f"Host: {lRDPConfigurationDict['Host']}, Login: {lRDPConfigurationDict['Login']}, SessionHex: {str(lRDPConfigurationDict['SessionHex'])}:: Session is not exist! Mark the retry")#Logging
iflL:lL.warning(f"!ATTENTION! Host: {lRDPConfigurationDict['Host']}, Login: {lRDPConfigurationDict['Login']}; RDP is not responsible for many times - run recovery mode")
Recovery.RetryHostClear(inHostStr=lRDPConfigurationDict['Host'],inGSettings=inGSettings)# Clear the stat about current host
iflL:lL.warning(f"An existing connection was forcibly closed by the remote host - OK for the network interactions (ConnectionResetError: [WinError 10054])")
iflL:lL.debug(f"SERVER: pyOpenRPA_Agent_A2O:: Has recieved result of the activity items from agent! ActivityItem GUID Str: {lActivityReturnItemKeyStr}; Return value: {lActivityReturnItemValue}")
Processor.__ActivityListVerify__(inActivityList=inActivityList)# DO VERIFICATION FOR THE inActivityList
Processor.__ActivityListVerify__(inActivityList=inActivityList)# DO VERIFICATION FOR THE inActivityList
inActivityList=copy.deepcopy(inActivityList)
# Check if no def function is here - if exist - replace to alias
# Check if no def function is here - if exist - replace to alias
forlActivityItemininActivityList:
forlActivityItemininActivityList:
if"GUIDStr"inlActivityItemandinGUIDRemoveBool==True:dellActivityItem["GUIDStr"]# Remove GUID from activity items if exists
lDef=lActivityItem["Def"]
lDef=lActivityItem["Def"]
ifcallable(lDef):raiseException(f"pyOpenRPA Exception: You can't send ActivityList with def to JS. Use Def Alias (see Orchestrator.ProcessorAliasDefUpdate)")
ifcallable(lDef):raiseException(f"pyOpenRPA Exception: You can't send ActivityList with def to JS. Use Def Alias (see Orchestrator.ProcessorAliasDefUpdate)")
Processor.__ActivityListVerify__(inActivityList=inActivityList)# DO VERIFICATION FOR THE inActivityList
Processor.__ActivityListVerify__(inActivityList=inActivityList)# DO VERIFICATION FOR THE inActivityList
inActivityList=copy.deepcopy(inActivityList)
# Check if no def function is here - if exist - replace to alias
forlActivityItemininActivityList:
if"GUIDStr"inlActivityItemandinGUIDRemoveBool==True:dellActivityItem["GUIDStr"]# Remove GUID from activity items if exists
lDef=lActivityItem["Def"]
ifcallable(lDef):raiseException(f"pyOpenRPA Exception: You can't send ActivityList with def to JS. Use Def Alias (see Orchestrator.ProcessorAliasDefUpdate)")
raiseException(f"__Orchestrator__.AgentActivityItemReturnGet !ATTENTION! Use this function only after Orchestrator initialization! Before orchestrator init exception will be raised.")
else:raiseException(f"pyOpenRPA Exception: You can't use Orchestrator.ProcessorAliasDefUpdate with arg 'inDef' string value. inDef is '{inDef}', inAliasStr is '{inAliasStr}'")
else:raiseException(f"pyOpenRPA Exception: You can't use Orchestrator.ProcessorAliasDefUpdate with arg 'inDef' string value. inDef is '{inDef}', inAliasStr is '{inAliasStr}'")
ifinGSettings["Logger"]:inGSettings["Logger"].warning(f"__Orchestrator__.ProcessDefIntervalCall def was called not from processor queue - activity will be append in the processor queue.")
lProcessorActivityDict={
"Def":ProcessDefIntervalCall,# def link or def alias (look gSettings["Processor"]["AliasDefDict"])
if(lNowDatetime-lItemValue["ReturnedByDatetime"]).total_seconds()<inGSettings["Autocleaner"]["AgentActivityReturnLifetimeSecFloat"]:# Add if lifetime is ok
lTechnicalAgentActivityReturnDictNew[lItemKeyStr]=lItemValue# Lifetime is ok - set
else:
iflL:lL.debug(f"AgentActivityReturnDict lItemKeyStr: Lifetime is expired. Remove from gSettings")# Info
inGSettings["AgentActivityReturnDict"]=lTechnicalAgentActivityReturnDictNew# Set updated Cache
<td><p>Send signal via power shell to restart remote PC ATTENTION: Orchestrator user need to have restart right on the Remote machine to restart PC.</p></td>
<td><p>Check _SessionLast_RDPList.json and _SessionLast_StorageDict.pickle in working directory. if exist - load into gsettings # _SessionLast_StorageDict.pickle (binary) _SessionLast_RDPList.json (encoding = “utf-8”) _SessionLast_StorageDict.pickle (binary).</p></td>
<td><p>Check _SessionLast_RDPList.json and _SessionLast_StorageDict.pickle in working directory. if exist - load into gsettings # _SessionLast_StorageDict.pickle (binary) _SessionLast_RDPList.json (encoding = “utf-8”) _SessionLast_StorageDict.pickle (binary).</p></td>
<td><p>Create alias for def (can be used in ActivityItem in field Def) !WHEN DEF ALIAS IS REQUIRED! - Def alias is required when you try to call Python def from the Orchestrator WEB side (because you can’t transmit Python def object out of the Python environment)</p></td>
<td><p>Create alias for def (can be used in ActivityItem in field Def) !WHEN DEF ALIAS IS REQUIRED! - Def alias is required when you try to call Python def from the Orchestrator WEB side (because you can’t transmit Python def object out of the Python environment)</p></td>
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">OSRemotePCRestart</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">inLogger</span></em>, <emclass="sig-param"><spanclass="n">inHostStr</span></em>, <emclass="sig-param"><spanclass="n">inForceBool</span><spanclass="o">=</span><spanclass="default_value">True</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#OSRemotePCRestart"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.OSRemotePCRestart"title="Permalink to this definition">¶</a></dt>
<dd><p>Send signal via power shell to restart remote PC
ATTENTION: Orchestrator user need to have restart right on the Remote machine to restart PC.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>inLogger</strong>– logger to log powershell result in logs</p></li>
<li><p><strong>inHostStr</strong>– PC hostname which you need to restart.</p></li>
<li><p><strong>inForceBool</strong>– True - send signal to force retart PC; False - else case</p></li>
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">OrchestratorIsAdmin</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#OrchestratorIsAdmin"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.OrchestratorIsAdmin"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><codeclass="sig-name descname">OrchestratorIsAdmin</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#OrchestratorIsAdmin"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#pyOpenRPA.Orchestrator.__Orchestrator__.OrchestratorIsAdmin"title="Permalink to this definition">¶</a></dt>
<spanclass="s2">"CatchPeriodSecFloat"</span><spanclass="p">:</span><spanclass="mi">1200</span><spanclass="p">,</span><spanclass="c1"># Catch last 10 minutes</span>
<spanclass="s2">"TriggerCountInt"</span><spanclass="p">:</span><spanclass="mi">10</span><spanclass="p">,</span><spanclass="c1"># Activate trigger if for the period orch will catch the reconnect RDP n times</span>
<spanclass="s2">"OSRemotePCRestart"</span><spanclass="p">:</span><spanclass="kc">True</span><spanclass="c1"># Do powershell remote restart</span>
<li><ahref="Agent/02_Defs.html#pyOpenRPA.Agent.__Agent__.OSFileTextDataStrCreate">OSFileTextDataStrCreate() (in module pyOpenRPA.Agent.__Agent__)</a>
<li><ahref="Agent/02_Defs.html#pyOpenRPA.Agent.__Agent__.OSFileTextDataStrCreate">OSFileTextDataStrCreate() (in module pyOpenRPA.Agent.__Agent__)</a>
</li>
</li>
<li><ahref="Agent/02_Defs.html#pyOpenRPA.Agent.__Agent__.OSFileTextDataStrReceive">OSFileTextDataStrReceive() (in module pyOpenRPA.Agent.__Agent__)</a>
<li><ahref="Agent/02_Defs.html#pyOpenRPA.Agent.__Agent__.OSFileTextDataStrReceive">OSFileTextDataStrReceive() (in module pyOpenRPA.Agent.__Agent__)</a>
</li>
<li><ahref="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.OSRemotePCRestart">OSRemotePCRestart() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>