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

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

@ -391,9 +391,10 @@ def pyOpenRPA_Debugging_HelperDefList(inRequest, inGSettings):
lPathSplitList = __Orchestrator__.WebRequestParsePath(inRequest=inRequest).split('/') lPathSplitList = __Orchestrator__.WebRequestParsePath(inRequest=inRequest).split('/')
lQueryStr = None lQueryStr = None
if "HelperDefList" != lPathSplitList[-1] and "" != lPathSplitList[-1]: lQueryStr = lPathSplitList[-1] if "HelperDefList" != lPathSplitList[-1] and "" != lPathSplitList[-1]: lQueryStr = lPathSplitList[-1]
lDefList = __Orchestrator__.ActivityItemHelperDefList(inDefQueryStr=lQueryStr) if lQueryStr != "" and lQueryStr is not None:
for lDefStr in lDefList: lDefList = __Orchestrator__.ActivityItemHelperDefList(inDefQueryStr=lQueryStr)
lResultDict["results"].append({"name": lDefStr, "value": lDefStr, "text": lDefStr}) for lDefStr in lDefList:
lResultDict["results"].append({"name": lDefStr, "value": lDefStr, "text": lDefStr})
__Orchestrator__.WebRequestResponseSend(inRequest=inRequest, inResponeStr=json.dumps(lResultDict)) __Orchestrator__.WebRequestResponseSend(inRequest=inRequest, inResponeStr=json.dumps(lResultDict))
def pyOpenRPA_Debugging_HelperDefAutofill(inRequest, inGSettings): 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/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/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/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/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"}, {"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 lResultDict["Def"] = inDef
lGS = GSettingsGet() lGS = GSettingsGet()
lDefSignature = inspect.signature(lGS["ProcessorDict"]["AliasDefDict"][inDef]) if inDef in lGS["ProcessorDict"]["AliasDefDict"]:
for lItemKeyStr in lDefSignature.parameters: lDefSignature = inspect.signature(lGS["ProcessorDict"]["AliasDefDict"][inDef])
lItemValue = lDefSignature.parameters[lItemKeyStr] for lItemKeyStr in lDefSignature.parameters:
# Check if arg name contains "GSetting" or "Logger" lItemValue = lDefSignature.parameters[lItemKeyStr]
if "GSETTING" in lItemKeyStr.upper(): # Check if arg name contains "GSetting" or "Logger"
lResultDict["ArgGSettingsStr"] = lItemKeyStr if "GSETTING" in lItemKeyStr.upper():
elif "LOGGER" in lItemKeyStr.upper(): lResultDict["ArgGSettingsStr"] = lItemKeyStr
lResultDict["ArgLoggerStr"] = lItemKeyStr elif "LOGGER" in lItemKeyStr.upper():
else: lResultDict["ArgLoggerStr"] = lItemKeyStr
if lItemValue.default is inspect._empty:
lResultDict["ArgDict"][lItemKeyStr] = None
else: else:
lResultDict["ArgDict"][lItemKeyStr] = lItemValue.default if lItemValue.default is inspect._empty:
lResultDict["ArgDict"][lItemKeyStr] = None
else:
lResultDict["ArgDict"][lItemKeyStr] = lItemValue.default
return lResultDict return lResultDict
def ActivityItemCreate(inDef, inArgList=None, inArgDict=None, inArgGSettingsStr=None, inArgLoggerStr=None, inGUIDStr = None, inThreadBool = False): def ActivityItemCreate(inDef, inArgList=None, inArgDict=None, inArgGSettingsStr=None, inArgLoggerStr=None, inGUIDStr = None, inThreadBool = False):

Loading…
Cancel
Save