@ -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 )