You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Wiki/ENG_Guide/markdown/Orchestrator/02_Defs.md

48 KiB

2. Defs

pyOpenRPA.Orchestrator.Orchestrator

# EXAMPLE 1
from pyOpenRPA import Orchestrator
Orchestrator.OSCMD(inCMDStr = "git status", inRunAsyncBool=True)

# EXAMPLE 2
from pyOpenRPA.Orchestrator import __Orchestrator__
__Orchestrator__.OSCMD(inCMDStr = "git status", inRunAsyncBool=True)

Group Agent…

Interaction between Orchestrator and pyOpenRPA.Agent daemon process, which can be deployed in another user session.

Group GSettings…

Basic defs to work with singleton gSettings.

Group OS…

Interaction with shell on the Orchestrator user session.

Group Process…

Interaction with some process on the Orchestrator user session.

Group Processor…

Work with Processor queue (see …).

Group Python…

Work with extra python modules.

Group RDPSession…

Interaction with RDP session, where you can manage some robots.

Group Web…

Manipulate the Orchestrator WEB side.

Group UAC…

Manipulate the User Access Controls (actual for the Orchestrator WEB access for the business users)

Group Scheduler…

Work with activity scheduling.

Functions:

| AgentActivityItemAdd(inGSettings, …)

| Add activity in AgentDict.

| | AgentOSCMD(inGSettings, inHostNameStr, …)

| Send CMD to OS thought the pyOpenRPA.Agent daemon.

| | AgentOSFileBinaryDataBase64StrCreate(…)

| Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmission)

| | AgentOSFileBinaryDataBytesCreate(…)

   | Create binary file by the base64 string by the pyOpenRPA.Agent daemon process (safe for JSON transmition)

| | AgentOSFileTextDataStrCreate(inGSettings, …)

| Create text file by the string by the pyOpenRPA.Agent daemon process

                                   |

| GSettingsAutocleaner(inGSettings)

        | HIDDEN Interval gSettings auto cleaner def to clear some garbage.

                                      |

| GSettingsKeyListValueAppend(inGSettings, inValue)

| Append value in GSettings by the key list

                                                              |

| GSettingsKeyListValueGet(inGSettings[, …])

    | Get the value from the GSettings by the key list

                                                       |

| GSettingsKeyListValueOperatorPlus(…[, …])

     | Execute plus operation between 2 lists (1:inValue and 2:gSettings by the inKeyList)

                    |

| GSettingsKeyListValueSet(inGSettings, inValue)

| Set value in GSettings by the key list

                                                                 |

| OSCMD(inCMDStr[, inRunAsyncBool, inLogger])

   | OS send command in shell locally

                                                                       |

| OSCredentialsVerify(inUserStr, inPasswordStr)

 | Verify user credentials in windows.

                                                                    |

| OrchestratorRestart([inGSettings])

            | Orchestrator restart

                                                                                   |

| OrchestratorSessionSave([inGSettings])

        | Orchestrator session save in file _SessionLast_RDPList.json (encoding = “utf-8”)

                       |

| ProcessIsStarted(inProcessNameWOExeStr)

       | Check if there is any running process that contains the given name processName.

                        |

| ProcessListGet([inProcessNameWOExeList])

      | Return process list on the orchestrator machine sorted by Memory Usage.

                                |

| ProcessStart(inPathStr, inArgList[, …])

       | Start process locally.

                                                                                 |

| ProcessStop(inProcessNameWOExeStr, …[, …])

    | Stop process on the orchestrator machine.

                                                              |

| ProcessorActivityItemAppend(inGSettings[, …])

 | Create and add activity item in processor queue.

                                                       |

| ProcessorActivityItemCreate(inDef[, …])

       | Create activity item.

                                                                                  |

| ProcessorAliasDefCreate(inGSettings, inDef)

   | Create alias for def (can be used in ActivityItem in field Def) !WHEN DEF ALIAS IS REQUIRED! - Def alias is required when you try to call Python def from the Orchestrator WEB side (because you cant transmit Python def object out of the Python environment)

| | ProcessorAliasDefUpdate(inGSettings, inDef, …)

| Update alias for def (can be used in ActivityItem in field Def).

                                                                                                                                                                                             |

| PythonStart(inModulePathStr, inDefNameStr[, …])

| Import module and run def in the Orchestrator process.

                                                                                                                                                                                                       |

| RDPSessionCMDRun(inGSettings, …[, inModeStr])

 | Send CMD command to the RDP session “RUN” window

                                                                                                                                                                                                             |

| RDPSessionConnect(inGSettings, …[, …])

        | Create new RDPSession in RobotRDPActive. Attention - activity will be ignored if RDP key is already exists

                                                                                                                                                   |

| RDPSessionDisconnect(inGSettings, …[, …])

     | Disconnect the RDP session and stop monitoring it.

                                                                                                                                                                                                           |

| RDPSessionDublicatesResolve(inGSettings)

      | DEVELOPING Search duplicates in GSettings RDPlist !def is developing!

                                                                                                                                                                                        |

| RDPSessionFileStoredRecieve(inGSettings, …)

   | Recieve file from RDP session to the Orchestrator session using shared drive in RDP (see RDP Configuration Dict, Shared drive)

                                                                                                                               |

| RDPSessionFileStoredSend(inGSettings, …)

      | Send file from Orchestrator session to the RDP session using shared drive in RDP (see RDP Configuration Dict, Shared drive)

                                                                                                                                  |

| RDPSessionLogoff(inGSettings, inRDPSessionKeyStr)

| Logoff the RDP session from the Orchestrator process (close all apps in session when logoff)

                                                                                                                                                                 |

| RDPSessionMonitorStop(inGSettings, …)

         | Stop monitoring the RDP session by the Orchestrator process.

                                                                                                                                                                                                 |

| RDPSessionProcessStartIfNotRunning(…[, …])

    | Start process in RDP if it is not running (check by the arg inProcessNameWEXEStr)

                                                                                                                                                                            |

| RDPSessionProcessStop(inGSettings, …)

         | Send CMD command to the RDP session “RUN” window.

                                                                                                                                                                                                            |

| RDPSessionReconnect(inGSettings, …[, …])

      | Reconnect the RDP session

                                                                                                                                                                                                                                    |

| RDPSessionResponsibilityCheck(inGSettings, …)

 | DEVELOPING, MAYBE NOT USEFUL Check RDP Session responsibility TODO NEED DEV + TEST

                                                                                                                                                                           |

| RDPTemplateCreate(inLoginStr, inPasswordStr)

  | Create RDP connect dict item/ Use it connect/reconnect (Orchestrator.RDPSessionConnect)

                                                                                                                                                                      |

| SchedulerActivityTimeAddWeekly(inGSettings)

   | Add activity item list in scheduler.

                                                                                                                                                                                                                         |

| UACKeyListCheck(inRequest, inRoleKeyList)

     | Check is client is has access for the key list

                                                                                                                                                                                                               |

| UACSuperTokenUpdate(inGSettings, inSuperTokenStr)

| Add supertoken for the all access (it is need for the robot communication without human)

                                                                                                                                                                     |

| UACUpdate(inGSettings, inADLoginStr[, …])

     | Update user access (UAC)

                                                                                                                                                                                                                                     |

| WebCPUpdate(inGSettings, inCPKeyStr[, …])

     | Add control panel HTML, JSON generator or JS when page init

                                                                                                                                                                                                  |

| WebURLConnectDef(inGSettings, inMethodStr, …)

 | Connect URL to DEF

                                                                                                                                                                                                                                           |

| WebURLConnectFile(inGSettings, inMethodStr, …)

| Connect URL to File

                                                                                                                                                                                                                                          |

| WebURLConnectFolder(inGSettings, …)

           | Connect URL to Folder

                                                                                                                                                                                                                                        |

| WebUserInfoGet(inRequest)

                     | Return User info about request

                                                                                                                                                                                                                               |

| WebUserIsSuperToken(inRequest, inGSettings)

   | Return bool if request is authentificated with supetoken (token which is never expires)

                                                                                                                                                                      |

| WebUserUACHierarchyGet(inRequest)

             | Return User UAC Hierarchy DICT Return {…}

                                                                                                                                                                                                                    |

pyOpenRPA.Orchestrator.Orchestrator.AgentActivityItemAdd(inGSettings, inHostNameStr, inUserStr, inActivityItemDict)

Add activity in AgentDict. Check if item is created

  • Parameters

    • inGSettings Global settings dict (singleton)

    • inHostNameStr Agent host name

    • inUserStr User login, where agent is based

    • inActivityItemDict ActivityItem

  • Returns

    None

pyOpenRPA.Orchestrator.Orchestrator.AgentOSCMD(inGSettings, inHostNameStr, inUserStr, inCMDStr, inRunAsyncBool=True)

Send CMD to OS thought the pyOpenRPA.Agent daemon. Result return to log + Orchestrator by the A2O connection

  • Parameters

    • inGSettings Global settings dict (singleton)

    • inHostNameStr

    • inUserStr

    • inCMDStr

    • inRunAsyncBool

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)

  • Parameters

    • inGSettings Global settings dict (singleton)

    • inHostNameStr

    • inUserStr

    • inFilePathStr

    • inFileDataBase64Str

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)

  • Parameters

    • inGSettings Global settings dict (singleton)

    • inHostNameStr

    • inUserStr

    • inFilePathStr

    • inFileDataBytes

pyOpenRPA.Orchestrator.Orchestrator.AgentOSFileTextDataStrCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataStr, inEncodingStr='utf-8')

Create text file by the string by the pyOpenRPA.Agent daemon process

  • Parameters

    • inGSettings Global settings dict (singleton)

    • inHostNameStr

    • inUserStr

    • inFilePathStr

    • inFileDataStr

    • inEncodingStr

pyOpenRPA.Orchestrator.Orchestrator.GSettingsAutocleaner(inGSettings)

HIDDEN Interval gSettings auto cleaner def to clear some garbage.

  • Parameters

    inGSettings Global settings dict (singleton)

  • Returns

    None

pyOpenRPA.Orchestrator.Orchestrator.GSettingsKeyListValueAppend(inGSettings, inValue, inKeyList=None)

Append value in GSettings by the key list

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.GSettingsKeyListValueAppend(
    inGSettings = gSettings,
    inValue = "NewValue",
    inKeyList=["NewKeyDict","NewKeyList"]):
# result inGSettings: {
#    ... another keys in gSettings ...,
#    "NewKeyDict":{
#        "NewKeyList":[
#            "NewValue"
#        ]
#    }
#}
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inValue Any value to be appended in gSettings Dict by the key list

    • inKeyList List of the nested keys (see example)

  • Returns

    True every time

pyOpenRPA.Orchestrator.Orchestrator.GSettingsKeyListValueGet(inGSettings, inKeyList=None)

Get the value from the GSettings by the key list

  • Parameters

    • inGSettings Global settings dict (singleton)

    • inKeyList

  • Returns

    value any type

pyOpenRPA.Orchestrator.Orchestrator.GSettingsKeyListValueOperatorPlus(inGSettings, inValue, inKeyList=None)

Execute plus operation between 2 lists (1:inValue and 2:gSettings by the inKeyList)

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.GSettingsKeyListValueOperatorPlus(
    inGSettings = gSettings,
    inValue = [1,2,3],
    inKeyList=["NewKeyDict","NewKeyList"]):
# result inGSettings: {
#    ... another keys in gSettings ...,
#    "NewKeyDict":{
#        "NewKeyList":[
#            "NewValue",
#            1,
#            2,
#            3
#        ]
#    }
#}
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inValue List with values to be merged with list in gSettings

    • inKeyList List of the nested keys (see example)

  • Returns

    True every time

pyOpenRPA.Orchestrator.Orchestrator.GSettingsKeyListValueSet(inGSettings, inValue, inKeyList=None)

Set value in GSettings by the key list

  • Parameters

    • inGSettings Global settings dict (singleton)

    • inValue

    • inKeyList

  • Returns

    bool

pyOpenRPA.Orchestrator.Orchestrator.OSCMD(inCMDStr, inRunAsyncBool=True, inLogger=None)

OS send command in shell locally

  • Parameters

    • inCMDStr

    • inRunAsyncBool

    • inLogger

  • Returns

    CMD result string

pyOpenRPA.Orchestrator.Orchestrator.OSCredentialsVerify(inUserStr, inPasswordStr, inDomainStr='')

Verify user credentials in windows. Return bool

  • Parameters

    • inUserStr

    • inPasswordStr

    • inDomainStr

  • Returns

    True - Credentials are actual; False - Credentials are not actual

pyOpenRPA.Orchestrator.Orchestrator.OrchestratorRestart(inGSettings=None)

Orchestrator restart

  • Parameters

    inGSettings Global settings dict (singleton)

pyOpenRPA.Orchestrator.Orchestrator.OrchestratorSessionSave(inGSettings=None)

Orchestrator session save in file _SessionLast_RDPList.json (encoding = “utf-8”)

  • Parameters

    inGSettings Global settings dict (singleton)

  • Returns

    True every time

pyOpenRPA.Orchestrator.Orchestrator.ProcessIsStarted(inProcessNameWOExeStr)

Check if there is any running process that contains the given name processName.

# USAGE
from pyOpenRPA import Orchestrator

lProcessIsStartedBool = Orchestrator.ProcessIsStarted(inProcessNameWOExeStr = "notepad")
# lProcessIsStartedBool is True - notepad.exe is running on the Orchestrator machine
  • Parameters

    inProcessNameWOExeStr Process name WithOut (WO) .exe postfix. Example: “notepad” (not “notepad.exe”)

  • Returns

    True - process is running on the orchestrator machine; False - process is not running on the orchestrator machine

pyOpenRPA.Orchestrator.Orchestrator.ProcessListGet(inProcessNameWOExeList=None)

Return process list on the orchestrator machine sorted by Memory Usage. You can determine the list of the processes you are interested - def will return the list about it.

# USAGE
from pyOpenRPA import Orchestrator

lProcessList = Orchestrator.ProcessListGet()
# Return the list of the process on the machine.
# !ATTENTION! RUn orchestrator as administrator to get all process list on the machine.
  • Parameters

    inProcessNameWOExeList

  • Returns

    {

“ProcessWOExeList”: [“notepad”,”…”], “ProcessWOExeUpperList”: [“NOTEPAD”,”…”], “ProcessDetailList”: [

{

pid: 412,
username: “DESKTOPUSER”,
name: notepad.exe,
vms: 13.77767775,
NameWOExeUpperStr: NOTEPAD,
NameWOExeStr: “notepad”},

{…}]

pyOpenRPA.Orchestrator.Orchestrator.ProcessStart(inPathStr, inArgList, inStopProcessNameWOExeStr=None)

Start process locally. Extra feature: Use inStopProcessNameWOExeStr to stop the execution if current process is running.

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.ProcessStart(
    inPathStr = "notepad"
    inArgList = []
    inStopProcessNameWOExeStr = "notepad")
# notepad.exe will be started if no notepad.exe is active on the machine
  • Parameters

    • inPathStr Command to send in CMD

    • inArgList List of the arguments for the CMD command. Example: [“test.txt”]

    • inStopProcessNameWOExeStr Trigger: stop execution if process is running. Process name WithOut (WO) .exe postfix. Example: “notepad” (not “notepad.exe”)

  • Returns

    None - nothing is returned. If process will not start -exception will be raised

pyOpenRPA.Orchestrator.Orchestrator.ProcessStop(inProcessNameWOExeStr, inCloseForceBool, inUserNameStr='%username%')

Stop process on the orchestrator machine. You can set user session on the machine and set flag about to force close process.

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.ProcessStop(
    inProcessNameWOExeStr = "notepad"
    inCloseForceBool = True
    inUserNameStr = "USER_99")
# Will close process "notepad.exe" on the user session "USER_99" (!ATTENTION! if process not exists no exceptions will be raised)
  • Parameters

    • inProcessNameWOExeStr Process name WithOut (WO) .exe postfix. Example: “notepad” (not “notepad.exe”)

    • inCloseForceBool True - do force close. False - send signal to safe close (!ATTENTION! - Safe close works only in orchestrator session. Win OS doenst allow to send safe close signal between GUI sessions)

    • inUserNameStr User name which is has current process to close. Default value is close process on the Orchestrator session

  • Returns

    None

pyOpenRPA.Orchestrator.Orchestrator.ProcessorActivityItemAppend(inGSettings, inDef=None, inArgList=None, inArgDict=None, inArgGSettingsStr=None, inArgLoggerStr=None, inActivityItemDict=None)

Create and add activity item in processor queue.

# USAGE
from pyOpenRPA import Orchestrator

# EXAMPLE 1
def TestDef(inArg1Str, inGSettings, inLogger):
    pass
lActivityItem = Orchestrator.ProcessorActivityItemAppend(
    inGSettings = gSettingsDict,
    inDef = TestDef,
    inArgList=[],
    inArgDict={"inArg1Str": "ArgValueStr"},
    inArgGSettingsStr = "inGSettings",
    inArgLoggerStr = "inLogger")
# Activity have been already append in the processor queue

# EXAMPLE 2
def TestDef(inArg1Str):
    pass
Orchestrator.ProcessorAliasDefUpdate(
    inGSettings = gSettings,
    inDef = TestDef,
    inAliasStr="TestDefAlias")
lActivityItem = Orchestrator.ProcessorActivityItemCreate(
    inDef = "TestDefAlias",
    inArgList=[],
    inArgDict={"inArg1Str": "ArgValueStr"},
    inArgGSettingsStr = None,
    inArgLoggerStr = None)
Orchestrator.ProcessorActivityItemAppend(
    inGSettings = gSettingsDict,
    inActivityItemDict = lActivityItem)
# Activity have been already append in the processor queue
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inDef def link or def alias (look gSettings[“Processor”][“AliasDefDict”])

    • inArgList Args list for the Def

    • inArgDict Args dict for the Def

    • inArgGSettingsStr Name of def argument of the GSettings dict

    • inArgLoggerStr Name of def argument of the logging object

    • inActivityItemDict Fill if you already have ActivityItemDict (dont fill inDef, inArgList, inArgDict, inArgGSettingsStr, inArgLoggerStr)

pyOpenRPA.Orchestrator.Orchestrator.ProcessorActivityItemCreate(inDef, inArgList=None, inArgDict=None, inArgGSettingsStr=None, inArgLoggerStr=None)

Create activity item. Activity item can be used as list item in ProcessorActivityItemAppend or in Processor.ActivityListExecute.

# USAGE
from pyOpenRPA import Orchestrator

# EXAMPLE 1
def TestDef(inArg1Str, inGSettings, inLogger):
    pass
lActivityItem = Orchestrator.ProcessorActivityItemCreate(
    inDef = TestDef,
    inArgList=[],
    inArgDict={"inArg1Str": "ArgValueStr"},
    inArgGSettingsStr = "inGSettings",
    inArgLoggerStr = "inLogger")
# lActivityItem:
#   {
#       "Def":TestDef,
#       "ArgList":inArgList,
#       "ArgDict":inArgDict,
#       "ArgGSettings": "inArgGSettings",
#       "ArgLogger": "inLogger"
#   }

# EXAMPLE 2
def TestDef(inArg1Str):
    pass
Orchestrator.ProcessorAliasDefUpdate(
    inGSettings = gSettings,
    inDef = TestDef,
    inAliasStr="TestDefAlias")
lActivityItem = Orchestrator.ProcessorActivityItemCreate(
    inDef = "TestDefAlias",
    inArgList=[],
    inArgDict={"inArg1Str": "ArgValueStr"},
    inArgGSettingsStr = None,
    inArgLoggerStr = None)
# lActivityItem:
#   {
#       "Def":"TestDefAlias",
#       "ArgList":inArgList,
#       "ArgDict":inArgDict,
#       "ArgGSettings": None,
#       "ArgLogger": None
#   }
  • Parameters

    • inDef def link or def alias (look gSettings[“Processor”][“AliasDefDict”])

    • inArgList Args list for the Def

    • inArgDict Args dict for the def

    • inArgGSettingsStr Name of def argument of the GSettings dict

    • inArgLoggerStr Name of def argument of the logging object

  • Returns

    {}

pyOpenRPA.Orchestrator.Orchestrator.ProcessorAliasDefCreate(inGSettings, inDef, inAliasStr=None)

Create alias for def (can be used in ActivityItem in field Def) !WHEN DEF ALIAS IS REQUIRED! - Def alias is required when you try to call Python def from the Orchestrator WEB side (because you cant transmit Python def object out of the Python environment)

# USAGE
from pyOpenRPA import Orchestrator

def TestDef():
    pass
lAliasStr = Orchestrator.ProcessorAliasDefCreate(
    inGSettings = gSettings,
    inDef = TestDef,
    inAliasStr="TestDefAlias")
# Now you can call TestDef by the alias from var lAliasStr with help of ActivityItem (key Def = lAliasStr)
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inDef Def

    • inAliasStr String alias for associated def

  • Returns

    str Alias string (Alias can be regenerated if previous alias was occupied)

pyOpenRPA.Orchestrator.Orchestrator.ProcessorAliasDefUpdate(inGSettings, inDef, inAliasStr)

Update alias for def (can be used in ActivityItem in field Def). !WHEN DEF ALIAS IS REQUIRED! - Def alias is required when you try to call Python def from the Orchestrator WEB side (because you cant transmit Python def object out of the Python environment)

# USAGE
from pyOpenRPA import Orchestrator

def TestDef():
    pass
Orchestrator.ProcessorAliasDefUpdate(
    inGSettings = gSettings,
    inDef = TestDef,
    inAliasStr="TestDefAlias")
# Now you can call TestDef by the alias "TestDefAlias" with help of ActivityItem (key Def = "TestDefAlias")
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inDef Def

    • inAliasStr String alias for associated def

  • Returns

    str Alias string

pyOpenRPA.Orchestrator.Orchestrator.PythonStart(inModulePathStr, inDefNameStr, inArgList=None, inArgDict=None, inLogger=None)

Import module and run def in the Orchestrator process.

NOTE: Import module will be each time when PythonStart def will be called.

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.PythonStart(
    inModulePathStr="ModuleToCall.py", # inModulePathStr: Working Directory\ModuleToCall.py
    inDefNameStr="TestDef")
# Import module in Orchestrator process and call def "TestDef" from module "ModuleToCall.py"
  • Parameters

    • inModulePathStr Absolute or relative (working directory of the orchestrator process) path to the importing module .py

    • inDefNameStr Def name in module

    • inArgList List of the arguments for callable def

    • inArgDict Dict of the named arguments for callable def

    • inLogger Logger instance to log some information when PythonStart def is running

  • Returns

    None

pyOpenRPA.Orchestrator.Orchestrator.RDPSessionCMDRun(inGSettings, inRDPSessionKeyStr, inCMDStr, inModeStr='CROSSCHECK')

Send CMD command to the RDP session “RUN” window

# USAGE
from pyOpenRPA import Orchestrator

lResultDict = Orchestrator.RDPSessionCMDRun(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inModeStr = 'LISTEN')
# Orchestrator will send CMD to RDP and return the result (see return section)
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inRDPSessionKeyStr RDP Session string key - need for the further identification

    • inCMDStr Any CMD string

    • inModeStr Variants: “LISTEN” - Get result of the cmd command in result; “CROSSCHECK” - Check if the command was successfully sent “RUN” - Run without crosscheck and get clipboard

  • Returns

    OLD > True - CMD was executed successfully

      {
    
          “OutStr”: <> # Result string
          “IsResponsibleBool”: True|False # Flag is RDP is responsible - works only when inModeStr = CROSSCHECK
    

    }

pyOpenRPA.Orchestrator.Orchestrator.RDPSessionConnect(inGSettings, inRDPSessionKeyStr, inRDPTemplateDict=None, inHostStr=None, inPortStr=None, inLoginStr=None, inPasswordStr=None)

Create new RDPSession in RobotRDPActive. Attention - activity will be ignored if RDP key is already exists

2 way of the use

Var 1 (Main stream): inGSettings, inRDPSessionKeyStr, inRDPTemplateDict Var 2 (Backward compatibility): inGSettings, inRDPSessionKeyStr, inHostStr, inPortStr, inLoginStr, inPasswordStr

# USAGE
from pyOpenRPA import Orchestrator

lRDPItemDict = Orchestrator.RDPTemplateCreate(
    inLoginStr = "USER_99",
    inPasswordStr = "USER_PASS_HERE", inHostStr="127.0.0.1", inPortInt = 3389, inWidthPXInt = 1680,
    inHeightPXInt = 1050, inUseBothMonitorBool = False, inDepthBitInt = 32, inSharedDriveList=None)
Orchestrator.RDPSessionConnect(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inRDPTemplateDict = lRDPItemDict)
# Orchestrator will create RDP session by the lRDPItemDict configuration
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inRDPSessionKeyStr RDP Session string key - need for the further identification

    • inRDPTemplateDict RDP configuration dict with settings (see def Orchestrator.RDPTemplateCreate)

    • inHostStr Backward compatibility from Orchestrator v 1.1.20. Use inRDPTemplateDict

    • inPortStr Backward compatibility from Orchestrator v 1.1.20. Use inRDPTemplateDict

    • inLoginStr Backward compatibility from Orchestrator v 1.1.20. Use inRDPTemplateDict

    • inPasswordStr Backward compatibility from Orchestrator v 1.1.20. Use inRDPTemplateDict

  • Returns

    True every time :)

pyOpenRPA.Orchestrator.Orchestrator.RDPSessionDisconnect(inGSettings, inRDPSessionKeyStr, inBreakTriggerProcessWOExeList=None)

Disconnect the RDP session and stop monitoring it.

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.RDPSessionDisconnect(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey")
# Orchestrator will disconnect RDP session and will stop to monitoring current RDP
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inRDPSessionKeyStr RDP Session string key - need for the further identification

    • inBreakTriggerProcessWOExeList List of the processes, which will stop the execution. Example [“notepad”]

    Orchestrator look processes on the current machine

  • Returns

    True every time

pyOpenRPA.Orchestrator.Orchestrator.RDPSessionDublicatesResolve(inGSettings)

DEVELOPING Search duplicates in GSettings RDPlist !def is developing!

  • Parameters

    inGSettings Global settings dict (singleton)

  • Returns

pyOpenRPA.Orchestrator.Orchestrator.RDPSessionFileStoredRecieve(inGSettings, inRDPSessionKeyStr, inRDPFilePathStr, inHostFilePathStr)

Recieve file from RDP session to the Orchestrator session using shared drive in RDP (see RDP Configuration Dict, Shared drive)

# USAGE
from pyOpenRPA import Orchestrator

lResultDict = Orchestrator.RDPSessionFileStoredRecieve(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inHostFilePathStr = "TESTDIR\Test.py",
    inRDPFilePathStr = "C:\RPA\TESTDIR\Test.py")
# Orchestrator will send CMD to RDP and return the result (see return section)
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inRDPSessionKeyStr RDP Session string key - need for the further identification

    • inRDPFilePathStr !Absolute! path to the destination file location on the RDP side. Example: “C:RPATESTDIRTest.py”

    • inHostFilePathStr Relative or absolute path to the file location on the Orchestrator side. Example: “TESTDIRTest.py”

  • Returns

    True every time

pyOpenRPA.Orchestrator.Orchestrator.RDPSessionFileStoredSend(inGSettings, inRDPSessionKeyStr, inHostFilePathStr, inRDPFilePathStr)

Send file from Orchestrator session to the RDP session using shared drive in RDP (see RDP Configuration Dict, Shared drive)

# USAGE
from pyOpenRPA import Orchestrator

lResultDict = Orchestrator.RDPSessionFileStoredSend(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inHostFilePathStr = "TESTDIR\Test.py",
    inRDPFilePathStr = "C:\RPA\TESTDIR\Test.py")
# Orchestrator will send CMD to RDP and return the result (see return section)
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inRDPSessionKeyStr RDP Session string key - need for the further identification

    • inHostFilePathStr Relative or absolute path to the file location on the Orchestrator side. Example: “TESTDIRTest.py”

    • inRDPFilePathStr !Absolute! path to the destination file location on the RDP side. Example: “C:RPATESTDIRTest.py”

  • Returns

    True every time

pyOpenRPA.Orchestrator.Orchestrator.RDPSessionLogoff(inGSettings, inRDPSessionKeyStr, inBreakTriggerProcessWOExeList=None)

Logoff the RDP session from the Orchestrator process (close all apps in session when logoff)

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.RDPSessionLogoff(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inBreakTriggerProcessWOExeList = ['Notepad'])
# Orchestrator will logoff the RDP session
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inRDPSessionKeyStr RDP Session string key - need for the further identification

    • inBreakTriggerProcessWOExeList List of the processes, which will stop the execution. Example [“notepad”]

  • Returns

    True - logoff is successful

pyOpenRPA.Orchestrator.Orchestrator.RDPSessionMonitorStop(inGSettings, inRDPSessionKeyStr)

Stop monitoring the RDP session by the Orchestrator process. Current def dont kill RDP session - only stop to track it (it can give )

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.RDPSessionMonitorStop(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey")
# Orchestrator will stop the RDP monitoring
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inRDPSessionKeyStr RDP Session string key - need for the further identification

  • Returns

    True every time :>

pyOpenRPA.Orchestrator.Orchestrator.RDPSessionProcessStartIfNotRunning(inGSettings, inRDPSessionKeyStr, inProcessNameWEXEStr, inFilePathStr, inFlagGetAbsPathBool=True)

Start process in RDP if it is not running (check by the arg inProcessNameWEXEStr)

# USAGE
from pyOpenRPA import Orchestrator

Orchestrator.RDPSessionProcessStartIfNotRunning(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inProcessNameWEXEStr = 'Notepad.exe',
    inFilePathStr = "path\to    he\executable\file.exe"
    inFlagGetAbsPathBool = True)
# Orchestrator will start the process in RDP session
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inRDPSessionKeyStr RDP Session string key - need for the further identification

    • inProcessNameWEXEStr Process name with extension (.exe). This arg allow to check the process is running. Example: “Notepad.exe”

    • inFilePathStr Path to run process if it is not running.

    • inFlagGetAbsPathBool True - get abs path from the relative path in inFilePathStr. False - else case

  • Returns

    True every time :)

pyOpenRPA.Orchestrator.Orchestrator.RDPSessionProcessStop(inGSettings, inRDPSessionKeyStr, inProcessNameWEXEStr, inFlagForceCloseBool)

Send CMD command to the RDP session “RUN” window.

# USAGE
from pyOpenRPA import Orchestrator

lResultDict = Orchestrator.RDPSessionProcessStop(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inProcessNameWEXEStr = 'notepad.exe',
    inFlagForceCloseBool = True)
# Orchestrator will send CMD to RDP and return the result (see return section)
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inRDPSessionKeyStr RDP Session string key - need for the further identification

    • inProcessNameWEXEStr Process name to kill. Example: notepad.exe

    • inFlagForceCloseBool True - force close the process. False - safe close the process

  • Returns

    True every time

pyOpenRPA.Orchestrator.Orchestrator.RDPSessionReconnect(inGSettings, inRDPSessionKeyStr, inRDPTemplateDict=None)

Reconnect the RDP session

# USAGE
from pyOpenRPA import Orchestrator

lRDPItemDict = Orchestrator.RDPTemplateCreate(
    inLoginStr = "USER_99",
    inPasswordStr = "USER_PASS_HERE", inHostStr="127.0.0.1", inPortInt = 3389, inWidthPXInt = 1680,
    inHeightPXInt = 1050, inUseBothMonitorBool = False, inDepthBitInt = 32, inSharedDriveList=None)
Orchestrator.RDPSessionReconnect(
    inGSettings = gSettings,
    inRDPSessionKeyStr = "RDPKey",
    inRDPTemplateDict = inRDPTemplateDict)
# Orchestrator will reconnect RDP session and will continue to monitoring current RDP
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inRDPSessionKeyStr RDP Session string key - need for the further identification

    • inRDPTemplateDict RDP configuration dict with settings (see def Orchestrator.RDPTemplateCreate)

  • Returns

pyOpenRPA.Orchestrator.Orchestrator.RDPSessionResponsibilityCheck(inGSettings, inRDPSessionKeyStr)

DEVELOPING, MAYBE NOT USEFUL Check RDP Session responsibility TODO NEED DEV + TEST

  • Parameters

    • inGSettings Global settings dict (singleton)

    • inRDPSessionKeyStr RDP Session string key - need for the further identification

  • Returns

    True every time

pyOpenRPA.Orchestrator.Orchestrator.RDPTemplateCreate(inLoginStr, inPasswordStr, inHostStr='127.0.0.1', inPortInt=3389, inWidthPXInt=1680, inHeightPXInt=1050, inUseBothMonitorBool=False, inDepthBitInt=32, inSharedDriveList=None)

Create RDP connect dict item/ Use it connect/reconnect (Orchestrator.RDPSessionConnect)

# USAGE
from pyOpenRPA import Orchestrator

lRDPItemDict = Orchestrator.RDPTemplateCreate(
    inLoginStr = "USER_99",
    inPasswordStr = "USER_PASS_HERE",
    inHostStr="127.0.0.1",
    inPortInt = 3389,
    inWidthPXInt = 1680,
    inHeightPXInt = 1050,
    inUseBothMonitorBool = False,
    inDepthBitInt = 32,
    inSharedDriveList=None)
#     lRDPTemplateDict= {  # Init the configuration item
#         "Host": "127.0.0.1", "Port": "3389", "Login": "USER_99", "Password": "USER_PASS_HERE",
#         "Screen": { "Width": 1680, "Height": 1050, "FlagUseAllMonitors": False, "DepthBit": "32" },
#         "SharedDriveList": ["c"],
#         ###### Will updated in program ############
#         "SessionHex": "77777sdfsdf77777dsfdfsf77777777",  # Hex is created when robot runs, example ""
#         "SessionIsWindowExistBool": False, "SessionIsWindowResponsibleBool": False, "SessionIsIgnoredBool": False
#     }
  • Parameters

    • inLoginStr User/Robot Login, example “USER_99”

    • inPasswordStr Password, example “USER_PASS_HERE”

    • inHostStr Host address, example “77.77.22.22”

    • inPortInt RDP Port, example “3389” (default)

    • inWidthPXInt Width of the remote desktop in pixels, example 1680

    • inHeightPXInt Height of the remote desktop in pixels, example 1050

    • inUseBothMonitorBool True - connect to the RDP with both monitors. False - else case

    • inDepthBitInt Remote desktop bitness. Available: 32 or 24 or 16 or 15, example 32

    • inSharedDriveList Host local disc to connect to the RDP session. Example: [“c”, “d”]

  • Returns

    {

      “Host”: inHostStr,  # Host address, example “77.77.22.22”
      “Port”: str(inPortInt),  # RDP Port, example “3389”
      “Login”: inLoginStr,  # Login, example “test”
      “Password”: inPasswordStr,  # Password, example “test”
      “Screen”: {
    
      > ”Width”: inWidthPXInt,  # Width of the remote desktop in pixels, example 1680
      > “Height”: inHeightPXInt,  # Height of the remote desktop in pixels, example 1050
      > # “640x480” or “1680x1050” or “FullScreen”. If Resolution not exists set full screen, example
      > “FlagUseAllMonitors”: inUseBothMonitorBool,  # True or False, example False
      > “DepthBit”: str(inDepthBitInt)  # “32” or “24” or “16” or “15”, example “32”
    
      },
      “SharedDriveList”: inSharedDriveList,  # List of the Root sesion hard drives, example [“c”]
      ###### Will updated in program ############
      “SessionHex”: “77777sdfsdf77777dsfdfsf77777777”,  # Hex is created when robot runs, example “”
      “SessionIsWindowExistBool”: False,
      # Flag if the RDP window is exist, old name “FlagSessionIsActive”. Check every n seconds , example False
      “SessionIsWindowResponsibleBool”: False,
      # Flag if RDP window is responsible (recieve commands). Check every nn seconds. If window is Responsible - window is Exist too , example False
      “SessionIsIgnoredBool”: False  # Flag to ignore RDP window False - dont ignore, True - ignore, example False
    

    }

pyOpenRPA.Orchestrator.Orchestrator.SchedulerActivityTimeAddWeekly(inGSettings, inTimeHHMMStr='23:55:', inWeekdayList=None, inActivityList=None)

Add activity item list in scheduler. You can set weekday list and set time when launch. Activity list will be executed at planned time/day.

# USAGE
from pyOpenRPA import Orchestrator

# EXAMPLE 1
def TestDef(inArg1Str):
    pass
lActivityItem = Orchestrator.ProcessorActivityItemCreate(
    inDef = TestDef,
    inArgList=[],
    inArgDict={"inArg1Str": "ArgValueStr"},
    inArgGSettingsStr = None,
    inArgLoggerStr = None)
Orchestrator.SchedulerActivityTimeAddWeekly(
    inGSettings = gSettingsDict,
    inTimeHHMMStr = "04:34",
    inWeekdayList=[2,3,4],
    inActivityList = [lActivityItem])
# Activity will be executed at 04:34 Wednesday (2), thursday (3), friday (4)
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inTimeHHMMStr Activation time from “00:00” to “23:59”. Example: “05:29”

    • inWeekdayList Week day list to initiate activity list. Use int from 0 (monday) to 6 (sunday) as list items. Example: [0,1,2,3,4]. Default value is everyday ([0,1,2,3,4,5,6])

    • inActivityList Activity list structure

  • Returns

    None

pyOpenRPA.Orchestrator.Orchestrator.UACKeyListCheck(inRequest, inRoleKeyList)

Check is client is has access for the key list

  • Parameters

    • inRequest

    • inRoleKeyList

  • Returns

    bool

pyOpenRPA.Orchestrator.Orchestrator.UACSuperTokenUpdate(inGSettings, inSuperTokenStr)

Add supertoken for the all access (it is need for the robot communication without human)

  • Parameters

    • inGSettings Global settings dict (singleton)

    • inSuperTokenStr

pyOpenRPA.Orchestrator.Orchestrator.UACUpdate(inGSettings, inADLoginStr, inADStr='', inADIsDefaultBool=True, inURLList=None, inRoleHierarchyAllowedDict=None)

Update user access (UAC)

  • Parameters

    • inGSettings Global settings dict (singleton)

    • inADLoginStr

    • inADStr

    • inADIsDefaultBool

    • inURLList

    • inRoleHierarchyAllowedDict

pyOpenRPA.Orchestrator.Orchestrator.WebCPUpdate(inGSettings, inCPKeyStr, inHTMLRenderDef=None, inJSONGeneratorDef=None, inJSInitGeneratorDef=None)

Add control panel HTML, JSON generator or JS when page init

  • Parameters

    • inGSettings Global settings dict (singleton)

    • inCPKeyStr

    • inHTMLRenderDef

    • inJSONGeneratorDef

    • inJSInitGeneratorDef

pyOpenRPA.Orchestrator.Orchestrator.WebURLConnectDef(inGSettings, inMethodStr, inURLStr, inMatchTypeStr, inDef, inContentTypeStr='application/octet-stream')

Connect URL to DEF

“inMethodStr”:”GET|POST”,
“inURLStr”: “/index”, #URL of the request
“inMatchTypeStr”: “”, #”BeginWith|Contains|Equal|EqualCase”,
“inContentTypeStr”: “”, #HTTP Content-type
“inDef”: None #Function with str result
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inMethodStr

    • inURLStr

    • inMatchTypeStr

    • inDef

    • inContentTypeStr

pyOpenRPA.Orchestrator.Orchestrator.WebURLConnectFile(inGSettings, inMethodStr, inURLStr, inMatchTypeStr, inFilePathStr, inContentTypeStr='application/octet-stream')

Connect URL to File

“inMethodStr”:”GET|POST”,
“inURLStr”: “/index”, #URL of the request
“inMatchTypeStr”: “”, #”BeginWith|Contains|Equal|EqualCase”,
“inFolderPathStr”: “”, #Absolute or relative path
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inMethodStr

    • inURLStr

    • inMatchTypeStr

    • inFilePathStr

    • inContentTypeStr

pyOpenRPA.Orchestrator.Orchestrator.WebURLConnectFolder(inGSettings, inMethodStr, inURLStr, inMatchTypeStr, inFolderPathStr)

Connect URL to Folder

“inMethodStr”:”GET|POST”,
“inURLStr”: “/Folder/”, #URL of the request
“inMatchTypeStr”: “”, #”BeginWith|Contains|Equal|EqualCase”,
“inFolderPathStr”: “”, #Absolute or relative path
  • Parameters

    • inGSettings Global settings dict (singleton)

    • inMethodStr

    • inURLStr

    • inMatchTypeStr

    • inFolderPathStr

pyOpenRPA.Orchestrator.Orchestrator.WebUserInfoGet(inRequest)

Return User info about request

  • Parameters

    inRequest

  • Returns

    {“DomainUpperStr”: “”, “UserNameUpperStr”: “”}

pyOpenRPA.Orchestrator.Orchestrator.WebUserIsSuperToken(inRequest, inGSettings)

Return bool if request is authentificated with supetoken (token which is never expires)

  • Parameters

    • inRequest

    • inGSettings Global settings dict (singleton)

  • Returns

    bool True - is supertoken; False - is not supertoken

pyOpenRPA.Orchestrator.Orchestrator.WebUserUACHierarchyGet(inRequest)

Return User UAC Hierarchy DICT Return {…}

  • Parameters

    inRequest

  • Returns

    UAC Dict {}

References

reStructuredText