Testing pyOpenRPA.Orchestrator.Managers.Process defs

dev-linux
Ivan Maslov 3 years ago
parent 6026c771ae
commit e14bed7fca

@ -33,6 +33,7 @@ class Process():
self.mProcessNameWOExeStr = inProcessNameWOExeStr
self.mStopSafeTimeoutSecFloat = inStopSafeTimeoutSecFloat
__Orchestrator__.GSettingsGet()["ManagersProcessDict"][inProcessNameWOExeStr.upper()]=self
self.StatusCheck()
def Manual2Auto(self):
"""
@ -54,6 +55,8 @@ class Process():
# Send activity item to agent - wait result
if self.mStartPathStr is not None: lCMDStr = f"start {os.path.abspath(self.mStartPathStr)}"
elif self.mStartCMDStr is not None: lCMDStr = f"start {self.mStartCMDStr}"
#import pdb
#pdb.set_trace()
lActivityItemStart = __Orchestrator__.ProcessorActivityItemCreate(inDef="OSCMD",
inArgDict={"inCMDStr":lCMDStr,"inSendOutputToOrchestratorLogsBool":False},
inArgGSettingsStr="inGSettings")
@ -88,7 +91,7 @@ class Process():
:return:
"""
# Send activity item to agent - wait result
lCMDStr = f'taskkill /im "{self.mProcessNameWOExeStr}" /fi "username eq %USERNAME%"'
lCMDStr = f'taskkill /im "{self.mProcessNameWOExeStr}.exe" /fi "username eq %USERNAME%"'
lActivityItemStart = __Orchestrator__.ProcessorActivityItemCreate(
inDef="OSCMD",inArgDict={"inCMDStr": lCMDStr,"inSendOutputToOrchestratorLogsBool":False},inArgGSettingsStr="inGSettings")
lGUIDStr = __Orchestrator__.AgentActivityItemAdd(inHostNameStr=self.mAgentHostNameStr,

@ -1,2 +1,2 @@
from .ControlPanel import ControlPanel
from .Process import Process
from .ControlPanel import *
from .Process import *

@ -391,9 +391,10 @@ def pyOpenRPA_Debugging_HelperDefList(inRequest, inGSettings):
lPathSplitList = __Orchestrator__.WebRequestParsePath(inRequest=inRequest).split('/')
lQueryStr = None
if "HelperDefList" != lPathSplitList[-1] and "" != lPathSplitList[-1]: lQueryStr = lPathSplitList[-1]
lDefList = __Orchestrator__.ActivityItemHelperDefList(inDefQueryStr=lQueryStr)
for lDefStr in lDefList:
lResultDict["results"].append({"name": lDefStr, "value": lDefStr, "text": lDefStr})
if lQueryStr != "" and lQueryStr is not None:
lDefList = __Orchestrator__.ActivityItemHelperDefList(inDefQueryStr=lQueryStr)
for lDefStr in lDefList:
lResultDict["results"].append({"name": lDefStr, "value": lDefStr, "text": lDefStr})
__Orchestrator__.WebRequestResponseSend(inRequest=inRequest, inResponeStr=json.dumps(lResultDict))
def pyOpenRPA_Debugging_HelperDefAutofill(inRequest, inGSettings):
@ -473,6 +474,7 @@ def SettingsUpdate(inGlobalConfiguration):
{"Method": "POST", "URL": "/pyOpenRPA/ProcessorQueueAdd", "MatchType": "Equal","ResponseDefRequestGlobal": pyOpenRPA_Processor, "ResponseContentType": "application/json"},
{"Method": "POST", "URL": "/pyOpenRPA/ActivityListExecute", "MatchType": "Equal","ResponseDefRequestGlobal": pyOpenRPA_ActivityListExecute, "ResponseContentType": "application/json"},
{"Method": "POST", "URL": "/pyOpenRPA/Agent/O2A", "MatchType": "Equal","ResponseDefRequestGlobal": pyOpenRPA_Agent_O2A, "ResponseContentType": "application/json"},
{"Method": "POST", "URL": "/pyOpenRPA/Agent/A2O", "MatchType": "Equal","ResponseDefRequestGlobal": pyOpenRPA_Agent_A2O, "ResponseContentType": "application/json"},
{"Method": "GET", "URL": "/pyOpenRPA/Debugging/HelperDefList/", "MatchType": "BeginWith","ResponseDefRequestGlobal": pyOpenRPA_Debugging_HelperDefList, "ResponseContentType": "application/json"},
{"Method": "GET", "URL": "/pyOpenRPA/Debugging/HelperDefAutofill/", "MatchType": "BeginWith","ResponseDefRequestGlobal": pyOpenRPA_Debugging_HelperDefAutofill, "ResponseContentType": "application/json"},
]

@ -1208,19 +1208,20 @@ def ActivityItemHelperDefAutofill(inDef):
}
lResultDict["Def"] = inDef
lGS = GSettingsGet()
lDefSignature = inspect.signature(lGS["ProcessorDict"]["AliasDefDict"][inDef])
for lItemKeyStr in lDefSignature.parameters:
lItemValue = lDefSignature.parameters[lItemKeyStr]
# Check if arg name contains "GSetting" or "Logger"
if "GSETTING" in lItemKeyStr.upper():
lResultDict["ArgGSettingsStr"] = lItemKeyStr
elif "LOGGER" in lItemKeyStr.upper():
lResultDict["ArgLoggerStr"] = lItemKeyStr
else:
if lItemValue.default is inspect._empty:
lResultDict["ArgDict"][lItemKeyStr] = None
if inDef in lGS["ProcessorDict"]["AliasDefDict"]:
lDefSignature = inspect.signature(lGS["ProcessorDict"]["AliasDefDict"][inDef])
for lItemKeyStr in lDefSignature.parameters:
lItemValue = lDefSignature.parameters[lItemKeyStr]
# Check if arg name contains "GSetting" or "Logger"
if "GSETTING" in lItemKeyStr.upper():
lResultDict["ArgGSettingsStr"] = lItemKeyStr
elif "LOGGER" in lItemKeyStr.upper():
lResultDict["ArgLoggerStr"] = lItemKeyStr
else:
lResultDict["ArgDict"][lItemKeyStr] = lItemValue.default
if lItemValue.default is inspect._empty:
lResultDict["ArgDict"][lItemKeyStr] = None
else:
lResultDict["ArgDict"][lItemKeyStr] = lItemValue.default
return lResultDict
def ActivityItemCreate(inDef, inArgList=None, inArgDict=None, inArgGSettingsStr=None, inArgLoggerStr=None, inGUIDStr = None, inThreadBool = False):

Loading…
Cancel
Save