# Now Activity Item Support "" value for ArgGSettings and ArgLogger

# Basic.JSProcessorActivityListAdd - raise exception if Def is not string
# Orchestrator.ProcessorAliasDefUpdate fix if inDef is not a function - raise Exception
# Scheduler major bugfix! It works now!
dev-linux
Ivan Maslov 4 years ago
parent 32278ccde5
commit ecce39c234

@ -1,7 +1,7 @@
cd %~dp0
@ECHO OFF
set PATH=%PATH%;%~dp0..\..\Resources\WPy64-3720\python-3.7.2.amd64\Scripts
set PYTHONPATH=%PATH%;%~dp0..\..\Resources\WPy64-3720\python-3.7.2.amd64\Scripts
set PYTHONPATH=%PYTHONPATH%;%~dp0..\..\Resources\WPy64-3720\python-3.7.2.amd64\Scripts
pushd %~dp0
REM Command file for Sphinx documentation

@ -47,15 +47,15 @@ def ActivityListExecute(inGSettings, inActivityList):
#gSettings
lGSettingsDictKey = lActivityItem.pop("ArgGSettings",None)
# # Prepare arg dict - gSettings
if type(lGSettingsDictKey) is str: # check if gSetting key is in ArgDict
if type(lGSettingsDictKey) is str and lGSettingsDictKey is not "": # check if gSetting key is in ArgDict 13.02.2021 - Fix when ArgGSettings is ""
lActivityItem["ArgDict"][lGSettingsDictKey] = inGSettings # Set the gSettings in dict
# # Prepare arg list
elif type(lGSettingsDictKey) is int: # check if gSetting key is in ArgDict
lActivityItem["ArgList"].insert(lGSettingsDictKey,inGSettings)# Set the gSettings in list by the index
#Logger
lLoggerDictKey = lActivityItem.pop("ArgLogger",None)
# # Prepare arg dict - gSettings
if type(lLoggerDictKey) is str: # check if gSetting key is in ArgDict
# # Prepare arg dict - Logger
if type(lLoggerDictKey) is str and lLoggerDictKey is not "": # check if gSetting key is in ArgDict 13.02.2021 - Fix when ArgLogger is ""
lActivityItem["ArgDict"][lLoggerDictKey] = lL # Set the lLogger in dict
# # Prepare arg list
elif type(lLoggerDictKey) is int: # check if gSetting key is in ArgDict

@ -9,6 +9,10 @@ def JSEscapeForHTMLInline(inJSStr):
# Create JS for send activity list/ activity to the processor
# USAGE: Orchestrator.Web.Basic.JSProcessorActivityListAdd(inActivityList)
def JSProcessorActivityListAdd(inActivityList):
# Check if no def function is here - if exist - replace to alias
for lActivityItem in inActivityList:
lDef = lActivityItem["Def"]
if callable(lDef): raise Exception(f"pyOpenRPA Exception: You can't send ActivityList with def to JS. Use Def Alias (see Orchestrator.ProcessorAliasDefUpdate)")
if type(inActivityList) is not list: inActivityList = [inActivityList]
lJSStr = f"""mGlobal.pyOpenRPA.ProcessorQueueAdd({json.dumps(inActivityList)});"""
return lJSStr
@ -43,9 +47,10 @@ def HTMLLinkJSOnClick(inJSOnClickStr, inTitleStr, inColorStr=None):
# Create HTMLLink by the def, argdict, arglist, gsettingsStr, logger Str titleStr, color, (add in processor queue)
def HTMLLinkDefProcessor(inGSettings, inDef, inArgDict=None, inArgList=None, inArgGSettingsStr=None, inArgLoggerStr=None, inLinkTitleStr=None, inLinkColorStr=""):
lDefAliasStr = inDef
if callable(inDef): lDefAliasStr = str(inDef)
if callable(inDef):
lDefAliasStr = str(inDef)
lDefAliasStr = __Orchestrator__.ProcessorAliasDefUpdate(inGSettings=inGSettings, inDef=inDef, inAliasStr=lDefAliasStr)
if inLinkTitleStr is None: inLinkTitleStr = lDefAliasStr
lDefAliasStr=__Orchestrator__.ProcessorAliasDefUpdate(inGSettings=inGSettings, inDef=inDef, inAliasStr=lDefAliasStr)
lActivityList = [__Orchestrator__.ProcessorActivityItemCreate(inDef=lDefAliasStr,inArgList=inArgList,inArgDict=inArgDict,inArgGSettingsStr=inArgGSettingsStr,inArgLoggerStr=inArgLoggerStr)]
lJSStr = JSProcessorActivityListAdd(lActivityList)
lHTMLStr = HTMLLinkJSOnClick(inJSOnClickStr=lJSStr,inTitleStr=inLinkTitleStr, inColorStr=inLinkColorStr)
@ -54,9 +59,10 @@ def HTMLLinkDefProcessor(inGSettings, inDef, inArgDict=None, inArgList=None, inA
# Create HTMLLink by the def, argdict, arglist, gsettingsStr, logger Str titleStr, color, (execute permanently)
def HTMLLinkDefExecute(inGSettings, inDef, inArgDict=None, inArgList=None, inArgGSettingsStr=None, inArgLoggerStr=None, inLinkTitleStr=None, inLinkColorStr=""):
lDefAliasStr = inDef
if callable(inDef): lDefAliasStr = str(inDef)
if callable(inDef):
lDefAliasStr = str(inDef)
lDefAliasStr = __Orchestrator__.ProcessorAliasDefUpdate(inGSettings=inGSettings, inDef=inDef, inAliasStr=lDefAliasStr)
if inLinkTitleStr is None: inLinkTitleStr = lDefAliasStr
lDefAliasStr=__Orchestrator__.ProcessorAliasDefUpdate(inGSettings=inGSettings, inDef=inDef, inAliasStr=lDefAliasStr)
lActivityList = [__Orchestrator__.ProcessorActivityItemCreate(inDef=lDefAliasStr,inArgList=inArgList,inArgDict=inArgDict,inArgGSettingsStr=inArgGSettingsStr,inArgLoggerStr=inArgLoggerStr)]
lJSStr = JSActivityListExecute(lActivityList)
lHTMLStr = HTMLLinkJSOnClick(inJSOnClickStr=lJSStr,inTitleStr=inLinkTitleStr, inColorStr=inLinkColorStr)

@ -545,7 +545,8 @@ def ProcessorAliasDefUpdate(inGSettings, inDef, inAliasStr):
:param inAliasStr:
:return: str Alias
"""
inGSettings["ProcessorDict"]["AliasDefDict"][inAliasStr] = inDef
if callable(inDef): inGSettings["ProcessorDict"]["AliasDefDict"][inAliasStr] = inDef
else: raise Exception(f"pyOpenRPA Exception: You can't use Orchestrator.ProcessorAliasDefUpdate with arg 'inDef' string value. inDef is '{inDef}', inAliasStr is '{inAliasStr}'")
return inAliasStr
def ProcessorActivityItemCreate(inDef, inArgList=None, inArgDict=None, inArgGSettingsStr=None, inArgLoggerStr=None):
@ -1334,11 +1335,11 @@ def Orchestrator(inGSettings):
#######################################################################
#Branch 1 - if has TimeHH:MM
#######################################################################
if "TimeHH:MM" in lItem:
if "TimeHH:MMStr" in lItem:
#Вид активности - запуск процесса
#Сформировать временной штамп, относительно которого надо будет проверять время
#часовой пояс пока не учитываем
lActivityDateTime=datetime.datetime.strptime(lItem["TimeHH:MM"],"%H:%M")
lActivityDateTime=datetime.datetime.strptime(lItem["TimeHH:MMStr"],"%H:%M")
lActivityDateTime=lActivityDateTime.replace(year=lCurrentDateTime.year,month=lCurrentDateTime.month,day=lCurrentDateTime.day)
#Убедиться в том, что время наступило
if (

Loading…
Cancel
Save