Add Agent feedback about Activity Item execution :) need test!

dev-linux
Ivan Maslov 4 years ago
parent f9b3c89fb4
commit 21f7f1f86d

@ -25,3 +25,9 @@ def _A2ODataSend(inGSettings, inDataDict):
def LogListSend(inGSettings, inLogList): def LogListSend(inGSettings, inLogList):
lDataDict = { "HostNameUpperStr": inGSettings["AgentDict"]["HostNameUpperStr"], "UserUpperStr": inGSettings["AgentDict"]["UserUpperStr"], "LogList": inLogList} lDataDict = { "HostNameUpperStr": inGSettings["AgentDict"]["HostNameUpperStr"], "UserUpperStr": inGSettings["AgentDict"]["UserUpperStr"], "LogList": inLogList}
_A2ODataSend(inGSettings=inGSettings, inDataDict=lDataDict) _A2ODataSend(inGSettings=inGSettings, inDataDict=lDataDict)
# Send some def result to the orchestrator by the Activity Item GUID str
def ActivityReturnDictSend(inGSettings, inActivityItemGUIDStr, inReturn):
lDataDict = {"HostNameUpperStr": inGSettings["AgentDict"]["HostNameUpperStr"],
"UserUpperStr": inGSettings["AgentDict"]["UserUpperStr"], "ActivityReturnDict": {inActivityItemGUIDStr:inReturn}}
_A2ODataSend(inGSettings=inGSettings, inDataDict=lDataDict)

@ -1,5 +1,6 @@
# 1.2.0 - general processor - contains old orchestrator processor + RDPActive processor # 1.2.0 - general processor - contains old orchestrator processor + RDPActive processor
import time, copy, threading import time, copy, threading
from . import A2O
# Run processor synchronious # Run processor synchronious
def ProcessorRunSync(inGSettings): def ProcessorRunSync(inGSettings):
""" """
@ -10,7 +11,8 @@ def ProcessorRunSync(inGSettings):
# "ArgList":[1,2,3], # Args list # "ArgList":[1,2,3], # Args list
# "ArgDict":{"ttt":1,"222":2,"dsd":3}, # Args dictionary # "ArgDict":{"ttt":1,"222":2,"dsd":3}, # Args dictionary
# "ArgGSettings": None # Name of GSettings attribute: str (ArgDict) or index (for ArgList) # "ArgGSettings": None # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
# "ArgLogger": None # Name of GSettings attribute: str (ArgDict) or index (for ArgList) # "ArgLogger": None, # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
# "GUIDStr": "sadasd-asdas-d-asdasd", # ActivityItem GUID which identify the Activity
# }, # },
], ],
"AliasDefDict": {}, # Storage for def with Str alias. To use it see pyOpenRPA.Orchestrator.ControlPanel "AliasDefDict": {}, # Storage for def with Str alias. To use it see pyOpenRPA.Orchestrator.ControlPanel
@ -24,7 +26,13 @@ def ProcessorRunSync(inGSettings):
if len(lActivityList)>0: if len(lActivityList)>0:
if lL: lL.debug(f'Processor ActivityList len: {len(lActivityList)}') if lL: lL.debug(f'Processor ActivityList len: {len(lActivityList)}')
lActivityItem = inGSettings["ProcessorDict"]["ActivityList"].pop(0) # Extract the first item from processor queue lActivityItem = inGSettings["ProcessorDict"]["ActivityList"].pop(0) # Extract the first item from processor queue
ActivityListExecute(inGSettings = inGSettings, inActivityList = [lActivityItem]) # execute the activity item lResultList = ActivityListExecute(inGSettings = inGSettings, inActivityList = [lActivityItem]) # execute the activity item
#Some help code
if len(lResultList) == 0: lResultList= [None]
# Send result to Orc if we have GUIDStr
if "GUIDStr" in lActivityItem:
# Def to send to Orc
A2O.ActivityReturnDictSend(inGSettings=inGSettings, inActivityItemGUIDStr=lActivityItem["GUIDStr"],inReturn=lResultList[0])
else: else:
time.sleep(inGSettings["ProcessorDict"]["CheckIntervalSecFloat"]) # Sleep when list is empty time.sleep(inGSettings["ProcessorDict"]["CheckIntervalSecFloat"]) # Sleep when list is empty

@ -400,6 +400,7 @@ def pyOpenRPA_Agent_O2A(inRequest, inGSettings):
lThisAgentDict["ConnectionCountInt"] -= 1 # Connection go to be closed - decrement the connection count lThisAgentDict["ConnectionCountInt"] -= 1 # Connection go to be closed - decrement the connection count
# See docs in Agent (pyOpenRPA.Agent.A2O) # See docs in Agent (pyOpenRPA.Agent.A2O)
def pyOpenRPA_Agent_A2O(inRequest, inGSettings): def pyOpenRPA_Agent_A2O(inRequest, inGSettings):
lL = inGSettings["Logger"]
# Recieve the data # Recieve the data
lValueStr = None lValueStr = None
if inRequest.headers.get('Content-Length') is not None: if inRequest.headers.get('Content-Length') is not None:
@ -410,6 +411,12 @@ def pyOpenRPA_Agent_A2O(inRequest, inGSettings):
if "LogList" in lInput: if "LogList" in lInput:
for lLogItemStr in lInput["LogList"]: for lLogItemStr in lInput["LogList"]:
inGSettings["Logger"].info(lLogItemStr) inGSettings["Logger"].info(lLogItemStr)
if "ActivityReturnDict" in lInput:
for lActivityReturnItemKeyStr in lInput["ActivityReturnDict"]:
lActivityReturnItemValue = lInput["ActivityReturnDict"][lActivityReturnItemKeyStr]
# Create item in gSettings
inGSettings["AgentActivityReturnDict"][lActivityReturnItemKeyStr]=SettingsTemplate.__AgentActivityReturnDictItemCreate__(inReturn=lActivityReturnItemValue)
if lL: lL.debug(f"SERVER: pyOpenRPA_Agent_A2O:: Has recieved result of the activity items from agent! ActivityItem GUID Str: {lActivityReturnItemKeyStr}; Return value: {lActivityReturnItemValue}")
def SettingsUpdate(inGlobalConfiguration): def SettingsUpdate(inGlobalConfiguration):
import os import os

@ -7,6 +7,7 @@ def __Create__():
"Autocleaner": { "Autocleaner": {
# Some gurbage is collecting in g settings. So you can configure autocleaner to periodically clear gSettings # Some gurbage is collecting in g settings. So you can configure autocleaner to periodically clear gSettings
"IntervalSecFloat": 3600.0, # Sec float to periodically clear gsettings "IntervalSecFloat": 3600.0, # Sec float to periodically clear gsettings
"AgentActivityReturnLifetimeSecFloat": 300.0 # Time in seconds to life for activity result recieved from the agent
}, },
"Client": { # Settings about client web orchestrator "Client": { # Settings about client web orchestrator
"Session": { "Session": {
@ -266,12 +267,21 @@ def __Create__():
}, },
"AgentDict": { # Will be filled when program runs "AgentDict": { # Will be filled when program runs
#("HostNameUpperStr", "UserUpperStr"): { "IsListenBool": True, "QueueList": [] } #("HostNameUpperStr", "UserUpperStr"): { "IsListenBool": True, "QueueList": [] }
},
"AgentActivityReturnDict": { # Will be filled when programs run - fill result of the Activity execution on the agent
# Key - Activity Item GUID str, Value {"Return": ..., "ReturnedByDatetime": datetime.datetime}
# If key exists - def has been completed
} }
} }
# Create full configuration for # Create full configuration for
def __AgentDictItemCreate__(): def __AgentDictItemCreate__():
return {"IsListenBool":False, "ConnectionCountInt":0, "ConnectionFirstQueueItemCountInt":0, "ActivityList":[]} return {"IsListenBool":False, "ConnectionCountInt":0, "ConnectionFirstQueueItemCountInt":0, "ActivityList":[]}
# Create full configuration for AgentActivityReturnDict
def __AgentActivityReturnDictItemCreate__(inReturn):
return {"Return": inReturn, "ReturnedByDatetime": datetime.datetime.now()}
# Create full configuration for # Create full configuration for
def __UACClientAdminCreate__(): def __UACClientAdminCreate__():
lResultDict = { lResultDict = {

@ -35,13 +35,15 @@ def AgentActivityItemAdd(inGSettings, inHostNameStr, inUserStr, inActivityItemDi
:param inHostNameStr: Agent host name :param inHostNameStr: Agent host name
:param inUserStr: User login, where agent is based :param inUserStr: User login, where agent is based
:param inActivityItemDict: ActivityItem :param inActivityItemDict: ActivityItem
:return: None :return: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
""" """
lActivityItemDict = copy.deepcopy(inActivityItemDict) lActivityItemDict = copy.deepcopy(inActivityItemDict)
# Add GUIDStr if not exist # Add GUIDStr if not exist
lGUIDStr = None
if "GUIDStr" not in lActivityItemDict: if "GUIDStr" not in lActivityItemDict:
lGUIDStr = str(uuid.uuid4()) # generate new GUID lGUIDStr = str(uuid.uuid4()) # generate new GUID
lActivityItemDict["GUIDStr"] = lGUIDStr lActivityItemDict["GUIDStr"] = lGUIDStr
else: lGUIDStr = lActivityItemDict["GUIDStr"]
# Add CreatedByDatetime # Add CreatedByDatetime
lActivityItemDict["CreatedByDatetime"] = datetime.datetime.now() lActivityItemDict["CreatedByDatetime"] = datetime.datetime.now()
# Main alg # Main alg
@ -50,7 +52,35 @@ def AgentActivityItemAdd(inGSettings, inHostNameStr, inUserStr, inActivityItemDi
inGSettings["AgentDict"][lAgentDictItemKeyTurple] = SettingsTemplate.__AgentDictItemCreate__() inGSettings["AgentDict"][lAgentDictItemKeyTurple] = SettingsTemplate.__AgentDictItemCreate__()
lThisAgentDict = inGSettings["AgentDict"][lAgentDictItemKeyTurple] lThisAgentDict = inGSettings["AgentDict"][lAgentDictItemKeyTurple]
lThisAgentDict["ActivityList"].append(lActivityItemDict) lThisAgentDict["ActivityList"].append(lActivityItemDict)
# Return the result
return lGUIDStr
def AgentActivityItemReturnExists(inGSettings, inGUIDStr):
"""
Check by GUID if ActivityItem has been executed and result has come to the Orchestrator
:param inGSettings: Global settings dict (singleton)
:param inGUIDStr: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
:return: True - result has been received from the Agent to orc; False - else case
"""
# Check if GUID is exists in dict - has been recieved
return inGUIDStr in inGSettings["AgentActivityReturnDict"]
def AgentActivityItemReturnGet(inGSettings, inGUIDStr, inCheckIntervalSecFloat = 0.5):
"""
Work synchroniously! Wait while result will be recieved. Get the result of the ActivityItem execution on the Agent side. Before this please check by the def AgentActivityItemReturnExists that result has come to the Orchestrator
:param inGSettings: Global settings dict (singleton)
:param inGUIDStr: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
:param inCheckIntervalSecFloat: Interval in sec of the check Activity Item result
:return: Result of the ActivityItem executed on the Agent side anr transmitted to the Orchestrator. IMPORTANT! ONLY JSON ENABLED Types CAN BE TRANSMITTED TO ORCHESTRATOR!
"""
# Wait while result will not come here
while not AgentActivityItemReturnExists(inGSettings=inGSettings, inGUIDStr=inGUIDStr):
time.sleep(inCheckIntervalSecFloat)
# Return the result
return inGSettings["AgentActivityReturnDict"][inGUIDStr]
def AgentOSCMD(inGSettings, inHostNameStr, inUserStr, inCMDStr, inRunAsyncBool=True, inSendOutputToOrchestratorLogsBool=True, inCMDEncodingStr="cp1251"): def AgentOSCMD(inGSettings, inHostNameStr, inUserStr, inCMDStr, inRunAsyncBool=True, inSendOutputToOrchestratorLogsBool=True, inCMDEncodingStr="cp1251"):
""" """
@ -63,7 +93,7 @@ def AgentOSCMD(inGSettings, inHostNameStr, inUserStr, inCMDStr, inRunAsyncBool=T
:param inRunAsyncBool: True - Agent processor don't wait execution; False - Agent processor wait cmd execution :param inRunAsyncBool: True - Agent processor don't wait execution; False - Agent processor wait cmd execution
:param inSendOutputToOrchestratorLogsBool: True - catch cmd execution output and send it to the Orchestrator logs; Flase - else case; Default True :param inSendOutputToOrchestratorLogsBool: True - catch cmd execution output and send it to the Orchestrator logs; Flase - else case; Default True
:param inCMDEncodingStr: Set the encoding of the DOS window on the Agent server session. Windows is beautiful :) . Default is "cp1251" early was "cp866" - need test :param inCMDEncodingStr: Set the encoding of the DOS window on the Agent server session. Windows is beautiful :) . Default is "cp1251" early was "cp866" - need test
:return: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
""" """
lActivityItemDict = { lActivityItemDict = {
@ -74,7 +104,7 @@ def AgentOSCMD(inGSettings, inHostNameStr, inUserStr, inCMDStr, inRunAsyncBool=T
"ArgLogger": None # Name of GSettings attribute: str (ArgDict) or index (for ArgList) "ArgLogger": None # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
} }
#Send item in AgentDict for the futher data transmition #Send item in AgentDict for the futher data transmition
AgentActivityItemAdd(inGSettings=inGSettings, inHostNameStr=inHostNameStr, inUserStr=inUserStr, inActivityItemDict=lActivityItemDict) return AgentActivityItemAdd(inGSettings=inGSettings, inHostNameStr=inHostNameStr, inUserStr=inUserStr, inActivityItemDict=lActivityItemDict)
def AgentOSFileBinaryDataBytesCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataBytes): def AgentOSFileBinaryDataBytesCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataBytes):
""" """
@ -85,6 +115,7 @@ def AgentOSFileBinaryDataBytesCreate(inGSettings, inHostNameStr, inUserStr, inFi
:param inUserStr: :param inUserStr:
:param inFilePathStr: :param inFilePathStr:
:param inFileDataBytes: :param inFileDataBytes:
:return: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
""" """
lFileDataBase64Str = base64.b64encode(inFileDataBytes).decode("utf-8") lFileDataBase64Str = base64.b64encode(inFileDataBytes).decode("utf-8")
@ -96,7 +127,7 @@ def AgentOSFileBinaryDataBytesCreate(inGSettings, inHostNameStr, inUserStr, inFi
"ArgLogger": None # Name of GSettings attribute: str (ArgDict) or index (for ArgList) "ArgLogger": None # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
} }
#Send item in AgentDict for the futher data transmition #Send item in AgentDict for the futher data transmition
AgentActivityItemAdd(inGSettings=inGSettings, inHostNameStr=inHostNameStr, inUserStr=inUserStr, inActivityItemDict=lActivityItemDict) return AgentActivityItemAdd(inGSettings=inGSettings, inHostNameStr=inHostNameStr, inUserStr=inUserStr, inActivityItemDict=lActivityItemDict)
def AgentOSFileBinaryDataBase64StrCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataBase64Str): def AgentOSFileBinaryDataBase64StrCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataBase64Str):
@ -108,6 +139,7 @@ def AgentOSFileBinaryDataBase64StrCreate(inGSettings, inHostNameStr, inUserStr,
:param inUserStr: :param inUserStr:
:param inFilePathStr: :param inFilePathStr:
:param inFileDataBase64Str: :param inFileDataBase64Str:
:return: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
""" """
lActivityItemDict = { lActivityItemDict = {
@ -118,7 +150,7 @@ def AgentOSFileBinaryDataBase64StrCreate(inGSettings, inHostNameStr, inUserStr,
"ArgLogger": None # Name of GSettings attribute: str (ArgDict) or index (for ArgList) "ArgLogger": None # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
} }
#Send item in AgentDict for the futher data transmition #Send item in AgentDict for the futher data transmition
AgentActivityItemAdd(inGSettings=inGSettings, inHostNameStr=inHostNameStr, inUserStr=inUserStr, inActivityItemDict=lActivityItemDict) return AgentActivityItemAdd(inGSettings=inGSettings, inHostNameStr=inHostNameStr, inUserStr=inUserStr, inActivityItemDict=lActivityItemDict)
# Send text file to Agent (string) # Send text file to Agent (string)
def AgentOSFileTextDataStrCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataStr, inEncodingStr = "utf-8"): def AgentOSFileTextDataStrCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataStr, inEncodingStr = "utf-8"):
@ -131,6 +163,7 @@ def AgentOSFileTextDataStrCreate(inGSettings, inHostNameStr, inUserStr, inFilePa
:param inFilePathStr: :param inFilePathStr:
:param inFileDataStr: :param inFileDataStr:
:param inEncodingStr: :param inEncodingStr:
:return: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
""" """
lActivityItemDict = { lActivityItemDict = {
@ -141,7 +174,7 @@ def AgentOSFileTextDataStrCreate(inGSettings, inHostNameStr, inUserStr, inFilePa
"ArgLogger": None # Name of GSettings attribute: str (ArgDict) or index (for ArgList) "ArgLogger": None # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
} }
#Send item in AgentDict for the futher data transmition #Send item in AgentDict for the futher data transmition
AgentActivityItemAdd(inGSettings=inGSettings, inHostNameStr=inHostNameStr, inUserStr=inUserStr, inActivityItemDict=lActivityItemDict) return AgentActivityItemAdd(inGSettings=inGSettings, inHostNameStr=inHostNameStr, inUserStr=inUserStr, inActivityItemDict=lActivityItemDict)
# OS DEFS # OS DEFS
def OSCredentialsVerify(inUserStr, inPasswordStr, inDomainStr=""): ## def OSCredentialsVerify(inUserStr, inPasswordStr, inDomainStr=""): ##
@ -1614,6 +1647,15 @@ def GSettingsAutocleaner(inGSettings):
else: else:
if lL: lL.debug(f"Client > Session > TechnicalSessionGUIDCache > lItemKeyStr: Lifetime is expired. Remove from gSettings") # Info if lL: lL.debug(f"Client > Session > TechnicalSessionGUIDCache > lItemKeyStr: Lifetime is expired. Remove from gSettings") # Info
inGSettings["Client"]["Session"]["TechnicalSessionGUIDCache"] = lTechnicalSessionGUIDCacheNew # Set updated Cache inGSettings["Client"]["Session"]["TechnicalSessionGUIDCache"] = lTechnicalSessionGUIDCacheNew # Set updated Cache
# Clean old items in AgentActivityReturnDict > GUIDStr > ReturnedByDatetime
lTechnicalAgentActivityReturnDictNew = {}
for lItemKeyStr in inGSettings["AgentActivityReturnDict"]:
lItemValue = inGSettings["AgentActivityReturnDict"][lItemKeyStr]
if (lNowDatetime - lItemValue["ReturnedByDatetime"]).total_seconds() < inGSettings["Autocleaner"]["AgentActivityReturnLifetimeSecFloat"]: # Add if lifetime is ok
lTechnicalAgentActivityReturnDictNew[lItemKeyStr]=lItemValue # Lifetime is ok - set
else:
if lL: lL.debug(f"AgentActivityReturnDict lItemKeyStr: Lifetime is expired. Remove from gSettings") # Info
inGSettings["AgentActivityReturnDict"] = lTechnicalAgentActivityReturnDictNew # Set updated Cache
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
from .. import __version__ # Get version from the package from .. import __version__ # Get version from the package

@ -256,6 +256,12 @@
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemAdd" title="pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemAdd"><code class="xref py py-obj docutils literal notranslate"><span class="pre">AgentActivityItemAdd</span></code></a>(inGSettings, …)</p></td> <tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemAdd" title="pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemAdd"><code class="xref py py-obj docutils literal notranslate"><span class="pre">AgentActivityItemAdd</span></code></a>(inGSettings, …)</p></td>
<td><p>Add activity in AgentDict.</p></td> <td><p>Add activity in AgentDict.</p></td>
</tr> </tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnExists" title="pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnExists"><code class="xref py py-obj docutils literal notranslate"><span class="pre">AgentActivityItemReturnExists</span></code></a>(inGSettings, …)</p></td>
<td><p>Check by GUID if ActivityItem has been executed and result has come to the Orchestrator</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnGet" title="pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnGet"><code class="xref py py-obj docutils literal notranslate"><span class="pre">AgentActivityItemReturnGet</span></code></a>(inGSettings, …)</p></td>
<td><p>Work synchroniously! Wait while result will be recieved.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD" title="pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD"><code class="xref py py-obj docutils literal notranslate"><span class="pre">AgentOSCMD</span></code></a>(inGSettings, inHostNameStr, …)</p></td> <tr class="row-even"><td><p><a class="reference internal" href="#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD" title="pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD"><code class="xref py py-obj docutils literal notranslate"><span class="pre">AgentOSCMD</span></code></a>(inGSettings, inHostNameStr, …)</p></td>
<td><p>Send CMD to OS thought the pyOpenRPA.Agent daemon.</p></td> <td><p>Send CMD to OS thought the pyOpenRPA.Agent daemon.</p></td>
</tr> </tr>
@ -410,7 +416,42 @@
</ul> </ul>
</dd> </dd>
<dt class="field-even">Returns</dt> <dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p> <dd class="field-even"><p>GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnExists">
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">AgentActivityItemReturnExists</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">inGSettings</span></em>, <em class="sig-param"><span class="n">inGUIDStr</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#AgentActivityItemReturnExists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnExists" title="Permalink to this definition"></a></dt>
<dd><p>Check by GUID if ActivityItem has been executed and result has come to the Orchestrator</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>inGSettings</strong> Global settings dict (singleton)</p></li>
<li><p><strong>inGUIDStr</strong> GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True - result has been received from the Agent to orc; False - else case</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnGet">
<code class="sig-prename descclassname">pyOpenRPA.Orchestrator.__Orchestrator__.</code><code class="sig-name descname">AgentActivityItemReturnGet</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">inGSettings</span></em>, <em class="sig-param"><span class="n">inGUIDStr</span></em>, <em class="sig-param"><span class="n">inCheckIntervalSecFloat</span><span class="o">=</span><span class="default_value">0.5</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/pyOpenRPA/Orchestrator/__Orchestrator__.html#AgentActivityItemReturnGet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnGet" title="Permalink to this definition"></a></dt>
<dd><p>Work synchroniously! Wait while result will be recieved. Get the result of the ActivityItem execution on the Agent side. Before this please check by the def AgentActivityItemReturnExists that result has come to the Orchestrator</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>inGSettings</strong> Global settings dict (singleton)</p></li>
<li><p><strong>inGUIDStr</strong> GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</p></li>
<li><p><strong>inCheckIntervalSecFloat</strong> Interval in sec of the check Activity Item result</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Result of the ActivityItem executed on the Agent side anr transmitted to the Orchestrator. IMPORTANT! ONLY JSON ENABLED Types CAN BE TRANSMITTED TO ORCHESTRATOR!</p>
</dd> </dd>
</dl> </dl>
</dd></dl> </dd></dl>
@ -431,6 +472,9 @@
<li><p><strong>inCMDEncodingStr</strong> Set the encoding of the DOS window on the Agent server session. Windows is beautiful :) . Default is “cp1251” early was “cp866” - need test</p></li> <li><p><strong>inCMDEncodingStr</strong> Set the encoding of the DOS window on the Agent server session. Windows is beautiful :) . Default is “cp1251” early was “cp866” - need test</p></li>
</ul> </ul>
</dd> </dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</p>
</dd>
</dl> </dl>
</dd></dl> </dd></dl>
@ -448,6 +492,9 @@
<li><p><strong>inFileDataBase64Str</strong> </p></li> <li><p><strong>inFileDataBase64Str</strong> </p></li>
</ul> </ul>
</dd> </dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</p>
</dd>
</dl> </dl>
</dd></dl> </dd></dl>
@ -465,6 +512,9 @@
<li><p><strong>inFileDataBytes</strong> </p></li> <li><p><strong>inFileDataBytes</strong> </p></li>
</ul> </ul>
</dd> </dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</p>
</dd>
</dl> </dl>
</dd></dl> </dd></dl>
@ -483,6 +533,9 @@
<li><p><strong>inEncodingStr</strong> </p></li> <li><p><strong>inEncodingStr</strong> </p></li>
</ul> </ul>
</dd> </dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</p>
</dd>
</dl> </dl>
</dd></dl> </dd></dl>

@ -190,6 +190,7 @@
<span class="s2">&quot;Autocleaner&quot;</span><span class="p">:</span> <span class="p">{</span> <span class="s2">&quot;Autocleaner&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="c1"># Some gurbage is collecting in g settings. So you can configure autocleaner to periodically clear gSettings</span> <span class="c1"># Some gurbage is collecting in g settings. So you can configure autocleaner to periodically clear gSettings</span>
<span class="s2">&quot;IntervalSecFloat&quot;</span><span class="p">:</span> <span class="mf">3600.0</span><span class="p">,</span> <span class="c1"># Sec float to periodically clear gsettings</span> <span class="s2">&quot;IntervalSecFloat&quot;</span><span class="p">:</span> <span class="mf">3600.0</span><span class="p">,</span> <span class="c1"># Sec float to periodically clear gsettings</span>
<span class="s2">&quot;AgentActivityReturnLifetimeSecFloat&quot;</span><span class="p">:</span> <span class="mf">300.0</span> <span class="c1"># Time in seconds to life for activity result recieved from the agent</span>
<span class="p">},</span> <span class="p">},</span>
<span class="s2">&quot;Client&quot;</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Settings about client web orchestrator</span> <span class="s2">&quot;Client&quot;</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Settings about client web orchestrator</span>
<span class="s2">&quot;Session&quot;</span><span class="p">:</span> <span class="p">{</span> <span class="s2">&quot;Session&quot;</span><span class="p">:</span> <span class="p">{</span>
@ -449,12 +450,21 @@
<span class="p">},</span> <span class="p">},</span>
<span class="s2">&quot;AgentDict&quot;</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Will be filled when program runs</span> <span class="s2">&quot;AgentDict&quot;</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Will be filled when program runs</span>
<span class="c1">#(&quot;HostNameUpperStr&quot;, &quot;UserUpperStr&quot;): { &quot;IsListenBool&quot;: True, &quot;QueueList&quot;: [] }</span> <span class="c1">#(&quot;HostNameUpperStr&quot;, &quot;UserUpperStr&quot;): { &quot;IsListenBool&quot;: True, &quot;QueueList&quot;: [] }</span>
<span class="p">},</span>
<span class="s2">&quot;AgentActivityReturnDict&quot;</span><span class="p">:</span> <span class="p">{</span> <span class="c1"># Will be filled when programs run - fill result of the Activity execution on the agent</span>
<span class="c1"># Key - Activity Item GUID str, Value {&quot;Return&quot;: ..., &quot;ReturnedByDatetime&quot;: datetime.datetime}</span>
<span class="c1"># If key exists - def has been completed</span>
<span class="p">}</span> <span class="p">}</span>
<span class="p">}</span> <span class="p">}</span>
<span class="c1"># Create full configuration for</span> <span class="c1"># Create full configuration for</span>
<span class="k">def</span> <span class="nf">__AgentDictItemCreate__</span><span class="p">():</span> <span class="k">def</span> <span class="nf">__AgentDictItemCreate__</span><span class="p">():</span>
<span class="k">return</span> <span class="p">{</span><span class="s2">&quot;IsListenBool&quot;</span><span class="p">:</span><span class="kc">False</span><span class="p">,</span> <span class="s2">&quot;ConnectionCountInt&quot;</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span> <span class="s2">&quot;ConnectionFirstQueueItemCountInt&quot;</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span> <span class="s2">&quot;ActivityList&quot;</span><span class="p">:[]}</span> <span class="k">return</span> <span class="p">{</span><span class="s2">&quot;IsListenBool&quot;</span><span class="p">:</span><span class="kc">False</span><span class="p">,</span> <span class="s2">&quot;ConnectionCountInt&quot;</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span> <span class="s2">&quot;ConnectionFirstQueueItemCountInt&quot;</span><span class="p">:</span><span class="mi">0</span><span class="p">,</span> <span class="s2">&quot;ActivityList&quot;</span><span class="p">:[]}</span>
<span class="c1"># Create full configuration for AgentActivityReturnDict</span>
<span class="k">def</span> <span class="nf">__AgentActivityReturnDictItemCreate__</span><span class="p">(</span><span class="n">inReturn</span><span class="p">):</span>
<span class="k">return</span> <span class="p">{</span><span class="s2">&quot;Return&quot;</span><span class="p">:</span> <span class="n">inReturn</span><span class="p">,</span> <span class="s2">&quot;ReturnedByDatetime&quot;</span><span class="p">:</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()}</span>
<span class="c1"># Create full configuration for</span> <span class="c1"># Create full configuration for</span>
<span class="k">def</span> <span class="nf">__UACClientAdminCreate__</span><span class="p">():</span> <span class="k">def</span> <span class="nf">__UACClientAdminCreate__</span><span class="p">():</span>
<span class="n">lResultDict</span> <span class="o">=</span> <span class="p">{</span> <span class="n">lResultDict</span> <span class="o">=</span> <span class="p">{</span>

@ -212,13 +212,15 @@
<span class="sd"> :param inHostNameStr: Agent host name</span> <span class="sd"> :param inHostNameStr: Agent host name</span>
<span class="sd"> :param inUserStr: User login, where agent is based</span> <span class="sd"> :param inUserStr: User login, where agent is based</span>
<span class="sd"> :param inActivityItemDict: ActivityItem</span> <span class="sd"> :param inActivityItemDict: ActivityItem</span>
<span class="sd"> :return: None</span> <span class="sd"> :return: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="n">lActivityItemDict</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="n">inActivityItemDict</span><span class="p">)</span> <span class="n">lActivityItemDict</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="n">inActivityItemDict</span><span class="p">)</span>
<span class="c1"># Add GUIDStr if not exist</span> <span class="c1"># Add GUIDStr if not exist</span>
<span class="n">lGUIDStr</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">if</span> <span class="s2">&quot;GUIDStr&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">lActivityItemDict</span><span class="p">:</span> <span class="k">if</span> <span class="s2">&quot;GUIDStr&quot;</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">lActivityItemDict</span><span class="p">:</span>
<span class="n">lGUIDStr</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">uuid</span><span class="o">.</span><span class="n">uuid4</span><span class="p">())</span> <span class="c1"># generate new GUID</span> <span class="n">lGUIDStr</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">uuid</span><span class="o">.</span><span class="n">uuid4</span><span class="p">())</span> <span class="c1"># generate new GUID</span>
<span class="n">lActivityItemDict</span><span class="p">[</span><span class="s2">&quot;GUIDStr&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">lGUIDStr</span> <span class="n">lActivityItemDict</span><span class="p">[</span><span class="s2">&quot;GUIDStr&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">lGUIDStr</span>
<span class="k">else</span><span class="p">:</span> <span class="n">lGUIDStr</span> <span class="o">=</span> <span class="n">lActivityItemDict</span><span class="p">[</span><span class="s2">&quot;GUIDStr&quot;</span><span class="p">]</span>
<span class="c1"># Add CreatedByDatetime</span> <span class="c1"># Add CreatedByDatetime</span>
<span class="n">lActivityItemDict</span><span class="p">[</span><span class="s2">&quot;CreatedByDatetime&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span> <span class="n">lActivityItemDict</span><span class="p">[</span><span class="s2">&quot;CreatedByDatetime&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span>
<span class="c1"># Main alg</span> <span class="c1"># Main alg</span>
@ -226,8 +228,36 @@
<span class="k">if</span> <span class="n">lAgentDictItemKeyTurple</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentDict&quot;</span><span class="p">]:</span> <span class="k">if</span> <span class="n">lAgentDictItemKeyTurple</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentDict&quot;</span><span class="p">]:</span>
<span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentDict&quot;</span><span class="p">][</span><span class="n">lAgentDictItemKeyTurple</span><span class="p">]</span> <span class="o">=</span> <span class="n">SettingsTemplate</span><span class="o">.</span><span class="n">__AgentDictItemCreate__</span><span class="p">()</span> <span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentDict&quot;</span><span class="p">][</span><span class="n">lAgentDictItemKeyTurple</span><span class="p">]</span> <span class="o">=</span> <span class="n">SettingsTemplate</span><span class="o">.</span><span class="n">__AgentDictItemCreate__</span><span class="p">()</span>
<span class="n">lThisAgentDict</span> <span class="o">=</span> <span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentDict&quot;</span><span class="p">][</span><span class="n">lAgentDictItemKeyTurple</span><span class="p">]</span> <span class="n">lThisAgentDict</span> <span class="o">=</span> <span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentDict&quot;</span><span class="p">][</span><span class="n">lAgentDictItemKeyTurple</span><span class="p">]</span>
<span class="n">lThisAgentDict</span><span class="p">[</span><span class="s2">&quot;ActivityList&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">lActivityItemDict</span><span class="p">)</span></div> <span class="n">lThisAgentDict</span><span class="p">[</span><span class="s2">&quot;ActivityList&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">lActivityItemDict</span><span class="p">)</span>
<span class="c1"># Return the result</span>
<span class="k">return</span> <span class="n">lGUIDStr</span></div>
<div class="viewcode-block" id="AgentActivityItemReturnExists"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnExists">[docs]</a><span class="k">def</span> <span class="nf">AgentActivityItemReturnExists</span><span class="p">(</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inGUIDStr</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Check by GUID if ActivityItem has been executed and result has come to the Orchestrator</span>
<span class="sd"> :param inGSettings: Global settings dict (singleton)</span>
<span class="sd"> :param inGUIDStr: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</span>
<span class="sd"> :return: True - result has been received from the Agent to orc; False - else case</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># Check if GUID is exists in dict - has been recieved</span>
<span class="k">return</span> <span class="n">inGUIDStr</span> <span class="ow">in</span> <span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentActivityReturnDict&quot;</span><span class="p">]</span></div>
<div class="viewcode-block" id="AgentActivityItemReturnGet"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnGet">[docs]</a><span class="k">def</span> <span class="nf">AgentActivityItemReturnGet</span><span class="p">(</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inGUIDStr</span><span class="p">,</span> <span class="n">inCheckIntervalSecFloat</span> <span class="o">=</span> <span class="mf">0.5</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Work synchroniously! Wait while result will be recieved. Get the result of the ActivityItem execution on the Agent side. Before this please check by the def AgentActivityItemReturnExists that result has come to the Orchestrator</span>
<span class="sd"> :param inGSettings: Global settings dict (singleton)</span>
<span class="sd"> :param inGUIDStr: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</span>
<span class="sd"> :param inCheckIntervalSecFloat: Interval in sec of the check Activity Item result</span>
<span class="sd"> :return: Result of the ActivityItem executed on the Agent side anr transmitted to the Orchestrator. IMPORTANT! ONLY JSON ENABLED Types CAN BE TRANSMITTED TO ORCHESTRATOR!</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># Wait while result will not come here</span>
<span class="k">while</span> <span class="ow">not</span> <span class="n">AgentActivityItemReturnExists</span><span class="p">(</span><span class="n">inGSettings</span><span class="o">=</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inGUIDStr</span><span class="o">=</span><span class="n">inGUIDStr</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">inCheckIntervalSecFloat</span><span class="p">)</span>
<span class="c1"># Return the result</span>
<span class="k">return</span> <span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentActivityReturnDict&quot;</span><span class="p">][</span><span class="n">inGUIDStr</span><span class="p">]</span></div>
<div class="viewcode-block" id="AgentOSCMD"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD">[docs]</a><span class="k">def</span> <span class="nf">AgentOSCMD</span><span class="p">(</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="p">,</span> <span class="n">inCMDStr</span><span class="p">,</span> <span class="n">inRunAsyncBool</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">inSendOutputToOrchestratorLogsBool</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">inCMDEncodingStr</span><span class="o">=</span><span class="s2">&quot;cp1251&quot;</span><span class="p">):</span> <div class="viewcode-block" id="AgentOSCMD"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD">[docs]</a><span class="k">def</span> <span class="nf">AgentOSCMD</span><span class="p">(</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="p">,</span> <span class="n">inCMDStr</span><span class="p">,</span> <span class="n">inRunAsyncBool</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">inSendOutputToOrchestratorLogsBool</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">inCMDEncodingStr</span><span class="o">=</span><span class="s2">&quot;cp1251&quot;</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span> <span class="sd">&quot;&quot;&quot;</span>
@ -240,7 +270,7 @@
<span class="sd"> :param inRunAsyncBool: True - Agent processor don&#39;t wait execution; False - Agent processor wait cmd execution</span> <span class="sd"> :param inRunAsyncBool: True - Agent processor don&#39;t wait execution; False - Agent processor wait cmd execution</span>
<span class="sd"> :param inSendOutputToOrchestratorLogsBool: True - catch cmd execution output and send it to the Orchestrator logs; Flase - else case; Default True</span> <span class="sd"> :param inSendOutputToOrchestratorLogsBool: True - catch cmd execution output and send it to the Orchestrator logs; Flase - else case; Default True</span>
<span class="sd"> :param inCMDEncodingStr: Set the encoding of the DOS window on the Agent server session. Windows is beautiful :) . Default is &quot;cp1251&quot; early was &quot;cp866&quot; - need test</span> <span class="sd"> :param inCMDEncodingStr: Set the encoding of the DOS window on the Agent server session. Windows is beautiful :) . Default is &quot;cp1251&quot; early was &quot;cp866&quot; - need test</span>
<span class="sd"> :return: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="n">lActivityItemDict</span> <span class="o">=</span> <span class="p">{</span> <span class="n">lActivityItemDict</span> <span class="o">=</span> <span class="p">{</span>
@ -251,7 +281,7 @@
<span class="s2">&quot;ArgLogger&quot;</span><span class="p">:</span> <span class="kc">None</span> <span class="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span> <span class="s2">&quot;ArgLogger&quot;</span><span class="p">:</span> <span class="kc">None</span> <span class="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<span class="p">}</span> <span class="p">}</span>
<span class="c1">#Send item in AgentDict for the futher data transmition</span> <span class="c1">#Send item in AgentDict for the futher data transmition</span>
<span class="n">AgentActivityItemAdd</span><span class="p">(</span><span class="n">inGSettings</span><span class="o">=</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="o">=</span><span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="o">=</span><span class="n">inUserStr</span><span class="p">,</span> <span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityItemDict</span><span class="p">)</span></div> <span class="k">return</span> <span class="n">AgentActivityItemAdd</span><span class="p">(</span><span class="n">inGSettings</span><span class="o">=</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="o">=</span><span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="o">=</span><span class="n">inUserStr</span><span class="p">,</span> <span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityItemDict</span><span class="p">)</span></div>
<div class="viewcode-block" id="AgentOSFileBinaryDataBytesCreate"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBytesCreate">[docs]</a><span class="k">def</span> <span class="nf">AgentOSFileBinaryDataBytesCreate</span><span class="p">(</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="p">,</span> <span class="n">inFilePathStr</span><span class="p">,</span> <span class="n">inFileDataBytes</span><span class="p">):</span> <div class="viewcode-block" id="AgentOSFileBinaryDataBytesCreate"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBytesCreate">[docs]</a><span class="k">def</span> <span class="nf">AgentOSFileBinaryDataBytesCreate</span><span class="p">(</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="p">,</span> <span class="n">inFilePathStr</span><span class="p">,</span> <span class="n">inFileDataBytes</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span> <span class="sd">&quot;&quot;&quot;</span>
@ -262,6 +292,7 @@
<span class="sd"> :param inUserStr:</span> <span class="sd"> :param inUserStr:</span>
<span class="sd"> :param inFilePathStr:</span> <span class="sd"> :param inFilePathStr:</span>
<span class="sd"> :param inFileDataBytes:</span> <span class="sd"> :param inFileDataBytes:</span>
<span class="sd"> :return: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="n">lFileDataBase64Str</span> <span class="o">=</span> <span class="n">base64</span><span class="o">.</span><span class="n">b64encode</span><span class="p">(</span><span class="n">inFileDataBytes</span><span class="p">)</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s2">&quot;utf-8&quot;</span><span class="p">)</span> <span class="n">lFileDataBase64Str</span> <span class="o">=</span> <span class="n">base64</span><span class="o">.</span><span class="n">b64encode</span><span class="p">(</span><span class="n">inFileDataBytes</span><span class="p">)</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s2">&quot;utf-8&quot;</span><span class="p">)</span>
@ -273,7 +304,7 @@
<span class="s2">&quot;ArgLogger&quot;</span><span class="p">:</span> <span class="kc">None</span> <span class="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span> <span class="s2">&quot;ArgLogger&quot;</span><span class="p">:</span> <span class="kc">None</span> <span class="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<span class="p">}</span> <span class="p">}</span>
<span class="c1">#Send item in AgentDict for the futher data transmition</span> <span class="c1">#Send item in AgentDict for the futher data transmition</span>
<span class="n">AgentActivityItemAdd</span><span class="p">(</span><span class="n">inGSettings</span><span class="o">=</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="o">=</span><span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="o">=</span><span class="n">inUserStr</span><span class="p">,</span> <span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityItemDict</span><span class="p">)</span></div> <span class="k">return</span> <span class="n">AgentActivityItemAdd</span><span class="p">(</span><span class="n">inGSettings</span><span class="o">=</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="o">=</span><span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="o">=</span><span class="n">inUserStr</span><span class="p">,</span> <span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityItemDict</span><span class="p">)</span></div>
<div class="viewcode-block" id="AgentOSFileBinaryDataBase64StrCreate"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBase64StrCreate">[docs]</a><span class="k">def</span> <span class="nf">AgentOSFileBinaryDataBase64StrCreate</span><span class="p">(</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="p">,</span> <span class="n">inFilePathStr</span><span class="p">,</span> <span class="n">inFileDataBase64Str</span><span class="p">):</span> <div class="viewcode-block" id="AgentOSFileBinaryDataBase64StrCreate"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBase64StrCreate">[docs]</a><span class="k">def</span> <span class="nf">AgentOSFileBinaryDataBase64StrCreate</span><span class="p">(</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="p">,</span> <span class="n">inFilePathStr</span><span class="p">,</span> <span class="n">inFileDataBase64Str</span><span class="p">):</span>
@ -285,6 +316,7 @@
<span class="sd"> :param inUserStr:</span> <span class="sd"> :param inUserStr:</span>
<span class="sd"> :param inFilePathStr:</span> <span class="sd"> :param inFilePathStr:</span>
<span class="sd"> :param inFileDataBase64Str:</span> <span class="sd"> :param inFileDataBase64Str:</span>
<span class="sd"> :return: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="n">lActivityItemDict</span> <span class="o">=</span> <span class="p">{</span> <span class="n">lActivityItemDict</span> <span class="o">=</span> <span class="p">{</span>
@ -295,7 +327,7 @@
<span class="s2">&quot;ArgLogger&quot;</span><span class="p">:</span> <span class="kc">None</span> <span class="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span> <span class="s2">&quot;ArgLogger&quot;</span><span class="p">:</span> <span class="kc">None</span> <span class="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<span class="p">}</span> <span class="p">}</span>
<span class="c1">#Send item in AgentDict for the futher data transmition</span> <span class="c1">#Send item in AgentDict for the futher data transmition</span>
<span class="n">AgentActivityItemAdd</span><span class="p">(</span><span class="n">inGSettings</span><span class="o">=</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="o">=</span><span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="o">=</span><span class="n">inUserStr</span><span class="p">,</span> <span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityItemDict</span><span class="p">)</span></div> <span class="k">return</span> <span class="n">AgentActivityItemAdd</span><span class="p">(</span><span class="n">inGSettings</span><span class="o">=</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="o">=</span><span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="o">=</span><span class="n">inUserStr</span><span class="p">,</span> <span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityItemDict</span><span class="p">)</span></div>
<span class="c1"># Send text file to Agent (string)</span> <span class="c1"># Send text file to Agent (string)</span>
<div class="viewcode-block" id="AgentOSFileTextDataStrCreate"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileTextDataStrCreate">[docs]</a><span class="k">def</span> <span class="nf">AgentOSFileTextDataStrCreate</span><span class="p">(</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="p">,</span> <span class="n">inFilePathStr</span><span class="p">,</span> <span class="n">inFileDataStr</span><span class="p">,</span> <span class="n">inEncodingStr</span> <span class="o">=</span> <span class="s2">&quot;utf-8&quot;</span><span class="p">):</span> <div class="viewcode-block" id="AgentOSFileTextDataStrCreate"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileTextDataStrCreate">[docs]</a><span class="k">def</span> <span class="nf">AgentOSFileTextDataStrCreate</span><span class="p">(</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="p">,</span> <span class="n">inFilePathStr</span><span class="p">,</span> <span class="n">inFileDataStr</span><span class="p">,</span> <span class="n">inEncodingStr</span> <span class="o">=</span> <span class="s2">&quot;utf-8&quot;</span><span class="p">):</span>
@ -308,6 +340,7 @@
<span class="sd"> :param inFilePathStr:</span> <span class="sd"> :param inFilePathStr:</span>
<span class="sd"> :param inFileDataStr:</span> <span class="sd"> :param inFileDataStr:</span>
<span class="sd"> :param inEncodingStr:</span> <span class="sd"> :param inEncodingStr:</span>
<span class="sd"> :return: GUID String of the ActivityItem - you can wait (sync or async) result by this guid!</span>
<span class="sd"> &quot;&quot;&quot;</span> <span class="sd"> &quot;&quot;&quot;</span>
<span class="n">lActivityItemDict</span> <span class="o">=</span> <span class="p">{</span> <span class="n">lActivityItemDict</span> <span class="o">=</span> <span class="p">{</span>
@ -318,7 +351,7 @@
<span class="s2">&quot;ArgLogger&quot;</span><span class="p">:</span> <span class="kc">None</span> <span class="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span> <span class="s2">&quot;ArgLogger&quot;</span><span class="p">:</span> <span class="kc">None</span> <span class="c1"># Name of GSettings attribute: str (ArgDict) or index (for ArgList)</span>
<span class="p">}</span> <span class="p">}</span>
<span class="c1">#Send item in AgentDict for the futher data transmition</span> <span class="c1">#Send item in AgentDict for the futher data transmition</span>
<span class="n">AgentActivityItemAdd</span><span class="p">(</span><span class="n">inGSettings</span><span class="o">=</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="o">=</span><span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="o">=</span><span class="n">inUserStr</span><span class="p">,</span> <span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityItemDict</span><span class="p">)</span></div> <span class="k">return</span> <span class="n">AgentActivityItemAdd</span><span class="p">(</span><span class="n">inGSettings</span><span class="o">=</span><span class="n">inGSettings</span><span class="p">,</span> <span class="n">inHostNameStr</span><span class="o">=</span><span class="n">inHostNameStr</span><span class="p">,</span> <span class="n">inUserStr</span><span class="o">=</span><span class="n">inUserStr</span><span class="p">,</span> <span class="n">inActivityItemDict</span><span class="o">=</span><span class="n">lActivityItemDict</span><span class="p">)</span></div>
<span class="c1"># OS DEFS</span> <span class="c1"># OS DEFS</span>
<div class="viewcode-block" id="OSCredentialsVerify"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.OSCredentialsVerify">[docs]</a><span class="k">def</span> <span class="nf">OSCredentialsVerify</span><span class="p">(</span><span class="n">inUserStr</span><span class="p">,</span> <span class="n">inPasswordStr</span><span class="p">,</span> <span class="n">inDomainStr</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">):</span> <span class="c1">##</span> <div class="viewcode-block" id="OSCredentialsVerify"><a class="viewcode-back" href="../../../Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.OSCredentialsVerify">[docs]</a><span class="k">def</span> <span class="nf">OSCredentialsVerify</span><span class="p">(</span><span class="n">inUserStr</span><span class="p">,</span> <span class="n">inPasswordStr</span><span class="p">,</span> <span class="n">inDomainStr</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">):</span> <span class="c1">##</span>
@ -1790,7 +1823,16 @@
<span class="n">lTechnicalSessionGUIDCacheNew</span><span class="p">[</span><span class="n">lItemKeyStr</span><span class="p">]</span><span class="o">=</span><span class="n">lItemValue</span> <span class="c1"># Lifetime is ok - set</span> <span class="n">lTechnicalSessionGUIDCacheNew</span><span class="p">[</span><span class="n">lItemKeyStr</span><span class="p">]</span><span class="o">=</span><span class="n">lItemValue</span> <span class="c1"># Lifetime is ok - set</span>
<span class="k">else</span><span class="p">:</span> <span class="k">else</span><span class="p">:</span>
<span class="k">if</span> <span class="n">lL</span><span class="p">:</span> <span class="n">lL</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Client &gt; Session &gt; TechnicalSessionGUIDCache &gt; lItemKeyStr: Lifetime is expired. Remove from gSettings&quot;</span><span class="p">)</span> <span class="c1"># Info</span> <span class="k">if</span> <span class="n">lL</span><span class="p">:</span> <span class="n">lL</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Client &gt; Session &gt; TechnicalSessionGUIDCache &gt; lItemKeyStr: Lifetime is expired. Remove from gSettings&quot;</span><span class="p">)</span> <span class="c1"># Info</span>
<span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;Client&quot;</span><span class="p">][</span><span class="s2">&quot;Session&quot;</span><span class="p">][</span><span class="s2">&quot;TechnicalSessionGUIDCache&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">lTechnicalSessionGUIDCacheNew</span> <span class="c1"># Set updated Cache</span></div> <span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;Client&quot;</span><span class="p">][</span><span class="s2">&quot;Session&quot;</span><span class="p">][</span><span class="s2">&quot;TechnicalSessionGUIDCache&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">lTechnicalSessionGUIDCacheNew</span> <span class="c1"># Set updated Cache</span>
<span class="c1"># Clean old items in AgentActivityReturnDict &gt; GUIDStr &gt; ReturnedByDatetime</span>
<span class="n">lTechnicalAgentActivityReturnDictNew</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">for</span> <span class="n">lItemKeyStr</span> <span class="ow">in</span> <span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentActivityReturnDict&quot;</span><span class="p">]:</span>
<span class="n">lItemValue</span> <span class="o">=</span> <span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentActivityReturnDict&quot;</span><span class="p">][</span><span class="n">lItemKeyStr</span><span class="p">]</span>
<span class="k">if</span> <span class="p">(</span><span class="n">lNowDatetime</span> <span class="o">-</span> <span class="n">lItemValue</span><span class="p">[</span><span class="s2">&quot;ReturnedByDatetime&quot;</span><span class="p">])</span><span class="o">.</span><span class="n">total_seconds</span><span class="p">()</span> <span class="o">&lt;</span> <span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;Autocleaner&quot;</span><span class="p">][</span><span class="s2">&quot;AgentActivityReturnLifetimeSecFloat&quot;</span><span class="p">]:</span> <span class="c1"># Add if lifetime is ok</span>
<span class="n">lTechnicalAgentActivityReturnDictNew</span><span class="p">[</span><span class="n">lItemKeyStr</span><span class="p">]</span><span class="o">=</span><span class="n">lItemValue</span> <span class="c1"># Lifetime is ok - set</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">if</span> <span class="n">lL</span><span class="p">:</span> <span class="n">lL</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;AgentActivityReturnDict lItemKeyStr: Lifetime is expired. Remove from gSettings&quot;</span><span class="p">)</span> <span class="c1"># Info</span>
<span class="n">inGSettings</span><span class="p">[</span><span class="s2">&quot;AgentActivityReturnDict&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">lTechnicalAgentActivityReturnDictNew</span> <span class="c1"># Set updated Cache</span></div>
<span class="c1"># # # # # # # # # # # # # # # # # # # # # # # # # #</span> <span class="c1"># # # # # # # # # # # # # # # # # # # # # # # # # #</span>
<span class="kn">from</span> <span class="nn">..</span> <span class="kn">import</span> <span class="n">__version__</span> <span class="c1"># Get version from the package</span> <span class="kn">from</span> <span class="nn">..</span> <span class="kn">import</span> <span class="n">__version__</span> <span class="c1"># Get version from the package</span>

@ -194,10 +194,14 @@
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemAdd">AgentActivityItemAdd() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a> <li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemAdd">AgentActivityItemAdd() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li> </li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD">AgentOSCMD() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a> <li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnExists">AgentActivityItemReturnExists() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnGet">AgentActivityItemReturnGet() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li> </li>
</ul></td> </ul></td>
<td style="width: 33%; vertical-align: top;"><ul> <td style="width: 33%; vertical-align: top;"><ul>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSCMD">AgentOSCMD() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBase64StrCreate">AgentOSFileBinaryDataBase64StrCreate() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a> <li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBase64StrCreate">AgentOSFileBinaryDataBase64StrCreate() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>
</li> </li>
<li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBytesCreate">AgentOSFileBinaryDataBytesCreate() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a> <li><a href="Orchestrator/02_Defs.html#pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBytesCreate">AgentOSFileBinaryDataBytesCreate() (in module pyOpenRPA.Orchestrator.__Orchestrator__)</a>

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -59,29 +59,39 @@ Work with activity scheduling.
| Add activity in AgentDict. | Add activity in AgentDict.
| |
| `AgentOSCMD`(inGSettings, inHostNameStr, …) | `AgentActivityItemReturnExists`(inGSettings, …)
| Send CMD to OS thought the pyOpenRPA.Agent daemon. | Check by GUID if ActivityItem has been executed and result has come to the Orchestrator
| |
| `AgentActivityItemReturnGet`(inGSettings, …)
| Work synchroniously! Wait while result will be recieved.
|
| `AgentOSCMD`(inGSettings, inHostNameStr, …)
| Send CMD to OS thought the pyOpenRPA.Agent daemon.
|
| `AgentOSFileBinaryDataBase64StrCreate`(…) | `AgentOSFileBinaryDataBase64StrCreate`(…)
| Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmission) | Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmission)
| |
| `AgentOSFileBinaryDataBytesCreate`(…) | `AgentOSFileBinaryDataBytesCreate`(…)
| Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmition) | Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmition)
| |
| `AgentOSFileTextDataStrCreate`(inGSettings, …) | `AgentOSFileTextDataStrCreate`(inGSettings, …)
| Create text file by the string by the pyOpenRPA.Agent daemon process | Create text file by the string by the pyOpenRPA.Agent daemon process
| |
| `GSettingsAutocleaner`(inGSettings) | `GSettingsAutocleaner`(inGSettings)
| HIDDEN Interval gSettings auto cleaner def to clear some garbage. | HIDDEN Interval gSettings auto cleaner def to clear some garbage.
| |
| `GSettingsKeyListValueAppend`(inGSettings, inValue) | `GSettingsKeyListValueAppend`(inGSettings, inValue)
@ -312,7 +322,50 @@ Add activity in AgentDict. Check if item is created
* **Returns** * **Returns**
None GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
### pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnExists(inGSettings, inGUIDStr)
Check by GUID if ActivityItem has been executed and result has come to the Orchestrator
* **Parameters**
* **inGSettings** Global settings dict (singleton)
* **inGUIDStr** GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
* **Returns**
True - result has been received from the Agent to orc; False - else case
### pyOpenRPA.Orchestrator.__Orchestrator__.AgentActivityItemReturnGet(inGSettings, inGUIDStr, inCheckIntervalSecFloat=0.5)
Work synchroniously! Wait while result will be recieved. Get the result of the ActivityItem execution on the Agent side. Before this please check by the def AgentActivityItemReturnExists that result has come to the Orchestrator
* **Parameters**
* **inGSettings** Global settings dict (singleton)
* **inGUIDStr** GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
* **inCheckIntervalSecFloat** Interval in sec of the check Activity Item result
* **Returns**
Result of the ActivityItem executed on the Agent side anr transmitted to the Orchestrator. IMPORTANT! ONLY JSON ENABLED Types CAN BE TRANSMITTED TO ORCHESTRATOR!
@ -345,6 +398,12 @@ Send CMD to OS thought the pyOpenRPA.Agent daemon. Result return to log + Orches
* **Returns**
GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
### pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBase64StrCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataBase64Str) ### pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBase64StrCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataBase64Str)
Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmission) Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmission)
@ -368,6 +427,12 @@ Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (s
* **Returns**
GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
### pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBytesCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataBytes) ### pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileBinaryDataBytesCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataBytes)
Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmition) Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmition)
@ -391,6 +456,12 @@ Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (s
* **Returns**
GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
### pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileTextDataStrCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataStr, inEncodingStr='utf-8') ### pyOpenRPA.Orchestrator.__Orchestrator__.AgentOSFileTextDataStrCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataStr, inEncodingStr='utf-8')
Create text file by the string by the pyOpenRPA.Agent daemon process Create text file by the string by the pyOpenRPA.Agent daemon process
@ -417,6 +488,12 @@ Create text file by the string by the pyOpenRPA.Agent daemon process
* **Returns**
GUID String of the ActivityItem - you can wait (sync or async) result by this guid!
### pyOpenRPA.Orchestrator.__Orchestrator__.GSettingsAutocleaner(inGSettings) ### pyOpenRPA.Orchestrator.__Orchestrator__.GSettingsAutocleaner(inGSettings)
HIDDEN Interval gSettings auto cleaner def to clear some garbage. HIDDEN Interval gSettings auto cleaner def to clear some garbage.

@ -12,6 +12,7 @@ def __Create__():
"Autocleaner": { "Autocleaner": {
# Some gurbage is collecting in g settings. So you can configure autocleaner to periodically clear gSettings # Some gurbage is collecting in g settings. So you can configure autocleaner to periodically clear gSettings
"IntervalSecFloat": 3600.0, # Sec float to periodically clear gsettings "IntervalSecFloat": 3600.0, # Sec float to periodically clear gsettings
"AgentActivityReturnLifetimeSecFloat": 300.0 # Time in seconds to life for activity result recieved from the agent
}, },
"Client": { # Settings about client web orchestrator "Client": { # Settings about client web orchestrator
"Session": { "Session": {
@ -271,12 +272,21 @@ def __Create__():
}, },
"AgentDict": { # Will be filled when program runs "AgentDict": { # Will be filled when program runs
#("HostNameUpperStr", "UserUpperStr"): { "IsListenBool": True, "QueueList": [] } #("HostNameUpperStr", "UserUpperStr"): { "IsListenBool": True, "QueueList": [] }
},
"AgentActivityReturnDict": { # Will be filled when programs run - fill result of the Activity execution on the agent
# Key - Activity Item GUID str, Value {"Return": ..., "ReturnedByDatetime": datetime.datetime}
# If key exists - def has been completed
} }
} }
# Create full configuration for # Create full configuration for
def __AgentDictItemCreate__(): def __AgentDictItemCreate__():
return {"IsListenBool":False, "ConnectionCountInt":0, "ConnectionFirstQueueItemCountInt":0, "ActivityList":[]} return {"IsListenBool":False, "ConnectionCountInt":0, "ConnectionFirstQueueItemCountInt":0, "ActivityList":[]}
# Create full configuration for AgentActivityReturnDict
def __AgentActivityReturnDictItemCreate__(inReturn):
return {"Return": inReturn, "ReturnedByDatetime": datetime.datetime.now()}
# Create full configuration for # Create full configuration for
def __UACClientAdminCreate__(): def __UACClientAdminCreate__():
lResultDict = { lResultDict = {

Loading…
Cancel
Save