6. Defs Managers¶
Process (General)¶
# EXAMPLE
from pyOpenRPA.Orchestrator import Orchestrator
lProcess = Orchestrator.Managers.Process(inAgentHostNameStr="PC-DESKTOP",inAgentUserNameStr="ND", inProcessNameWOExeStr="notepad",inStartCMDStr="notepad")
Classes:
|
Manager process, which is need to be started / stopped / restarted |
Functions:
|
Check if the Process instance is exists in GSettings by the (inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str) |
|
Return the process instance by the inProcessNameWOExeStr |
|
Exception safe function. |
|
Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self): |
Clear the last start tries list. |
|
Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self): |
|
Run status check every interval in second you specify. |
|
|
Manual/Auto start. |
|
Check if process is alive. |
|
Execute the StatusCheck, after that restore status to the saved state (see StatusSave). |
|
Save current status of the process. |
|
Get the status of the Process instance. |
|
Manual/Auto stop force. |
|
Manual/Auto stop safe. |
-
class
pyOpenRPA.Orchestrator.Managers.Process.
Process
(inAgentHostNameStr, inAgentUserNameStr, inProcessNameWOExeStr, inStartPathStr=None, inStartCMDStr=None, inStopSafeTimeoutSecFloat=300, inStartArgDict=None, inStatusCheckIntervalSecFloat=30)[source]¶ Manager process, which is need to be started / stopped / restarted
With Process instance you can automate your process activity. Use schedule package to set interval when process should be active and when not.
All defs in class are pickle safe! After orchestrator restart (if not the force stop of the orchestrator process) your instance with properties will be restored. But it not coverage the scheduler which is in __Orchestrator__ . After orc restart you need to reinit all schedule rules: Orchestrator.OrchestratorScheduleGet
- Process instance has the following statuses:
0_STOPPED
1_STOPPED_MANUAL
2_STOP_SAFE
3_STOP_SAFE_MANUAL
4_STARTED
5_STARTED_MANUAL
How to use StopSafe on the robot side
Methods:
Get the key turple of the current process
Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self):
Clear the last start tries list.
Log new start event.
ManualStopTriggerSet
(inMSTdTSecFloat, inMSTdNInt)Set ManualStopTrigger (MST) to switch to STOPPED MANUAL if specified count of start fails will be catched in specified time period
MuteWait
()Internal def.
RestartForce
([inIsManualBool])Manual/Auto restart force.
RestartSafe
([inIsManualBool])Manual/Auto restart safe.
Start
([inIsManualBool, inStartArgDict])Manual/Auto start.
Start program if auto stopped (0_STOPPED).
Lof information about status change
Check if process is alive.
Call from orchestrator when init
Check process status and run it if auto stopped self.mStatusStr is “0_STOPPED”
Check process status and auto stop force it if self.mStatusStr is 4_STARTED
Check process status and auto stop safe it if self.mStatusStr is 4_STARTED
Execute the StatusCheck, after that restore status to the saved state (see StatusSave).
Save current status of the process.
StopForce
([inIsManualBool, inMuteIgnoreBool])Manual/Auto stop force.
Stop force program if auto started (4_STARTED).
StopSafe
([inIsManualBool, …])Manual/Auto stop safe.
StopSafeCheck
([inStopSafeTimeoutSecFloat])Stop safe program if auto started (4_STARTED).
-
Manual2Auto
() → str[source]¶ Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self):
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
ManualStopTriggerNewStart
()[source]¶ Log new start event. Check if it is applicable. Change status if ManualStop trigger criteria is applied
- Returns
# 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
ManualStopTriggerSet
(inMSTdTSecFloat: float, inMSTdNInt: int) → None[source]¶ Set ManualStopTrigger (MST) to switch to STOPPED MANUAL if specified count of start fails will be catched in specified time period
- Parameters
inMSTdTSecFloat – Time perios in seconds
inMSTdNInt – Counts of the start tries
- Returns
None
-
MuteWait
()[source]¶ Internal def. Wait when class is apply to send new activities to the agent
- Returns
-
RestartForce
(inIsManualBool=True)[source]¶ Manual/Auto restart force. Force restart dont wait process termination - it just terminate process now ant then start it. Manual restart will block scheduling execution. To return schedule execution use def Manual2Auto
- Parameters
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
RestartSafe
(inIsManualBool=True)[source]¶ Manual/Auto restart safe. Restart safe is the operation which send signal to process to terminate own work (send term signal to process). Then it run process. Managers.Process wait for the mStopSafeTimeoutSecFloat seconds. After that, if process is not terminated - self will StopForce it. Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto
- Parameters
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
Start
(inIsManualBool=True, inStartArgDict=None) → str[source]¶ Manual/Auto start. Manual start will block scheduling execution. To return schedule execution use def Manual2Auto. Will not start if STOP SAFE is now and don’t start auto is stopped manual now
- Parameters
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StartCheck
() → str[source]¶ Start program if auto stopped (0_STOPPED).
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StatusCheck
()[source]¶ Check if process is alive. The def will save the manual flag is exists. Don’t wait mute but set mute if it is not set.
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StatusCheckStart
()[source]¶ Check process status and run it if auto stopped self.mStatusStr is “0_STOPPED”
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StatusCheckStopForce
()[source]¶ Check process status and auto stop force it if self.mStatusStr is 4_STARTED
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StatusCheckStopSafe
()[source]¶ Check process status and auto stop safe it if self.mStatusStr is 4_STARTED
- Returns
-
StatusRestore
()[source]¶ Execute the StatusCheck, after that restore status to the saved state (see StatusSave). Work when orchestrator is restarted.
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StatusSave
()[source]¶ Save current status of the process. After that you can restore process activity. Work when orchestrator is restarted. Don’t save “STOP_SAFE” status > “STOPPED”
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StopForce
(inIsManualBool=True, inMuteIgnoreBool=False) → str[source]¶ Manual/Auto stop force. Force stop don’t wait process termination - it just terminate process now. Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto
- Parameters
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StopForceCheck
() → str[source]¶ Stop force program if auto started (4_STARTED).
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StopSafe
(inIsManualBool=True, inStopSafeTimeoutSecFloat=None) → str[source]¶ Manual/Auto stop safe. Stop safe is the operation which send signal to process to terminate own work (send term signal to process). Managers.Process wait for the mStopSafeTimeoutSecFloat seconds. After that, if process is not terminated - self will StopForce it. Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto
- Parameters
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
inStopSafeTimeoutSecFloat – Default value goes from the instance. You can specify time is second to wait while safe stop. After that program will stop force
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StopSafeCheck
(inStopSafeTimeoutSecFloat=None) → str[source]¶ Stop safe program if auto started (4_STARTED).
- Parameters
inStopSafeTimeoutSecFloat – Default value goes from the instance. You can specify time is second to wait while safe stop. After that program will stop force
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessExists
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str) → bool[source]¶ Check if the Process instance is exists in GSettings by the (inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str)
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
- Returns
True - process exists in gsettings; False - else
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessGet
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str) → pyOpenRPA.Orchestrator.Managers.Process.Process[source]¶ Return the process instance by the inProcessNameWOExeStr
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
- Returns
Process instance (if exists) Else None
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessInitSafe
(inAgentHostNameStr, inAgentUserNameStr, inProcessNameWOExeStr, inStartPathStr=None, inStartCMDStr=None, inStopSafeTimeoutSecFloat=300) → pyOpenRPA.Orchestrator.Managers.Process.Process[source]¶ Exception safe function. Check if process instance is not exists in GSettings (it can be after restart because Orchestrator restore objects from dump of the previous Orchestrator session) Return existing instance (if exists) or create new instance and return it.
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
inStartPathStr – Path to start process (.cmd/ .exe or something else). Path can be relative (from orc working directory) or absolute
inStartCMDStr – CMD script to start program (if no start file is exists)
inStopSafeTimeoutSecFloat – Time to wait for stop safe. After that do the stop force (if process is not stopped)
- Returns
Process instance
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessManual2Auto
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str) → str[source]¶ Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self):
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
- Returns
Process status. See self.mStatusStr. Process instance has the following statuses: - 0_STOPPED - 1_STOPPED_MANUAL - 2_STOP_SAFE - 3_STOP_SAFE_MANUAL - 4_STARTED - 5_STARTED_MANUAL - None (if Process instance not exists)
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessManualStopListClear
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str) → None[source]¶ Clear the last start tries list.
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
- Returns
None
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessManualStopTriggerSet
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str, inMSTdTSecFloat: float, inMSTdNInt: int) → None[source]¶ Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self):
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
inMSTdTSecFloat – Time periods in seconds
inMSTdNInt – Counts of the start tries
- Returns
None
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessScheduleStatusCheckEverySeconds
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str, inIntervalSecondsInt: int = 120)[source]¶ Run status check every interval in second you specify.
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
inIntervalSecondsInt – Interval in seconds. Default is 120
- Returns
None
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessStart
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str, inIsManualBool: bool = True) → str[source]¶ Manual/Auto start. Manual start will block scheduling execution. To return schedule execution use def Manual2Auto
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
- Returns
Process status. See self.mStatusStr. Process instance has the following statuses: - 0_STOPPED - 1_STOPPED_MANUAL - 2_STOP_SAFE - 3_STOP_SAFE_MANUAL - 4_STARTED - 5_STARTED_MANUAL - None (if Process instance not exists)
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessStatusCheck
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str) → str[source]¶ Check if process is alive. The def will save the manual flag is exists.
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
- Returns
Process status. See self.mStatusStr. Process instance has the following statuses: - 0_STOPPED - 1_STOPPED_MANUAL - 2_STOP_SAFE - 3_STOP_SAFE_MANUAL - 4_STARTED - 5_STARTED_MANUAL - None (if Process instance not exists)
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessStatusRestore
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str)[source]¶ Execute the StatusCheck, after that restore status to the saved state (see StatusSave). Work when orchestrator is restarted.
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessStatusSave
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str)[source]¶ Save current status of the process. After that you can restore process activity. Work when orchestrator is restarted. Don’t save “STOP_SAFE” status > “STOPPED”
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessStatusStrGet
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str) → str[source]¶ Get the status of the Process instance.
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
- Returns
Process status. See self.mStatusStr. Process instance has the following statuses: - 0_STOPPED - 1_STOPPED_MANUAL - 2_STOP_SAFE - 3_STOP_SAFE_MANUAL - 4_STARTED - 5_STARTED_MANUAL - None (if Process instance not exists)
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessStopForce
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str, inIsManualBool: bool = True) → str[source]¶ Manual/Auto stop force. Force stop dont wait process termination - it just terminate process now. Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
- Returns
Process status. See self.mStatusStr. Process instance has the following statuses: - 0_STOPPED - 1_STOPPED_MANUAL - 2_STOP_SAFE - 3_STOP_SAFE_MANUAL - 4_STARTED - 5_STARTED_MANUAL - None (if Process instance not exists)
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessStopSafe
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str, inIsManualBool: bool = True, inStopSafeTimeoutSecFloat=None) → str[source]¶ Manual/Auto stop safe. Stop safe is the operation which send signal to process to terminate own work (send term signal to process). Managers.Process wait for the mStopSafeTimeoutSecFloat seconds. After that, if process is not terminated - self will StopForce it. Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
inStopSafeTimeoutSecFloat – Default value goes from the instance. You can specify time is second to wait while safe stop. After that program will stop force
- Returns
Process status. See self.mStatusStr. Process instance has the following statuses: - 0_STOPPED - 1_STOPPED_MANUAL - 2_STOP_SAFE - 3_STOP_SAFE_MANUAL - 4_STARTED - 5_STARTED_MANUAL - None (if Process instance not exists)
Process (Details)¶
Classes:
|
Manager process, which is need to be started / stopped / restarted |
Functions:
|
Check if the Process instance is exists in GSettings by the (inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str) |
|
Return the process instance by the inProcessNameWOExeStr |
|
Exception safe function. |
|
Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self): |
Clear the last start tries list. |
|
Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self): |
|
Run status check every interval in second you specify. |
|
|
Manual/Auto start. |
|
Check if process is alive. |
|
Execute the StatusCheck, after that restore status to the saved state (see StatusSave). |
|
Save current status of the process. |
|
Get the status of the Process instance. |
|
Manual/Auto stop force. |
|
Manual/Auto stop safe. |
-
class
pyOpenRPA.Orchestrator.Managers.Process.
Process
(inAgentHostNameStr, inAgentUserNameStr, inProcessNameWOExeStr, inStartPathStr=None, inStartCMDStr=None, inStopSafeTimeoutSecFloat=300, inStartArgDict=None, inStatusCheckIntervalSecFloat=30)[source]¶ Manager process, which is need to be started / stopped / restarted
With Process instance you can automate your process activity. Use schedule package to set interval when process should be active and when not.
All defs in class are pickle safe! After orchestrator restart (if not the force stop of the orchestrator process) your instance with properties will be restored. But it not coverage the scheduler which is in __Orchestrator__ . After orc restart you need to reinit all schedule rules: Orchestrator.OrchestratorScheduleGet
- Process instance has the following statuses:
0_STOPPED
1_STOPPED_MANUAL
2_STOP_SAFE
3_STOP_SAFE_MANUAL
4_STARTED
5_STARTED_MANUAL
How to use StopSafe on the robot side
Methods:
Get the key turple of the current process
Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self):
Clear the last start tries list.
Log new start event.
ManualStopTriggerSet
(inMSTdTSecFloat, inMSTdNInt)Set ManualStopTrigger (MST) to switch to STOPPED MANUAL if specified count of start fails will be catched in specified time period
MuteWait
()Internal def.
RestartForce
([inIsManualBool])Manual/Auto restart force.
RestartSafe
([inIsManualBool])Manual/Auto restart safe.
Start
([inIsManualBool, inStartArgDict])Manual/Auto start.
Start program if auto stopped (0_STOPPED).
Lof information about status change
Check if process is alive.
Call from orchestrator when init
Check process status and run it if auto stopped self.mStatusStr is “0_STOPPED”
Check process status and auto stop force it if self.mStatusStr is 4_STARTED
Check process status and auto stop safe it if self.mStatusStr is 4_STARTED
Execute the StatusCheck, after that restore status to the saved state (see StatusSave).
Save current status of the process.
StopForce
([inIsManualBool, inMuteIgnoreBool])Manual/Auto stop force.
Stop force program if auto started (4_STARTED).
StopSafe
([inIsManualBool, …])Manual/Auto stop safe.
StopSafeCheck
([inStopSafeTimeoutSecFloat])Stop safe program if auto started (4_STARTED).
-
Manual2Auto
() → str[source]¶ Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self):
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
ManualStopTriggerNewStart
()[source]¶ Log new start event. Check if it is applicable. Change status if ManualStop trigger criteria is applied
- Returns
# 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
ManualStopTriggerSet
(inMSTdTSecFloat: float, inMSTdNInt: int) → None[source]¶ Set ManualStopTrigger (MST) to switch to STOPPED MANUAL if specified count of start fails will be catched in specified time period
- Parameters
inMSTdTSecFloat – Time perios in seconds
inMSTdNInt – Counts of the start tries
- Returns
None
-
MuteWait
()[source]¶ Internal def. Wait when class is apply to send new activities to the agent
- Returns
-
RestartForce
(inIsManualBool=True)[source]¶ Manual/Auto restart force. Force restart dont wait process termination - it just terminate process now ant then start it. Manual restart will block scheduling execution. To return schedule execution use def Manual2Auto
- Parameters
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
RestartSafe
(inIsManualBool=True)[source]¶ Manual/Auto restart safe. Restart safe is the operation which send signal to process to terminate own work (send term signal to process). Then it run process. Managers.Process wait for the mStopSafeTimeoutSecFloat seconds. After that, if process is not terminated - self will StopForce it. Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto
- Parameters
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
Start
(inIsManualBool=True, inStartArgDict=None) → str[source]¶ Manual/Auto start. Manual start will block scheduling execution. To return schedule execution use def Manual2Auto. Will not start if STOP SAFE is now and don’t start auto is stopped manual now
- Parameters
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StartCheck
() → str[source]¶ Start program if auto stopped (0_STOPPED).
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StatusCheck
()[source]¶ Check if process is alive. The def will save the manual flag is exists. Don’t wait mute but set mute if it is not set.
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StatusCheckStart
()[source]¶ Check process status and run it if auto stopped self.mStatusStr is “0_STOPPED”
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StatusCheckStopForce
()[source]¶ Check process status and auto stop force it if self.mStatusStr is 4_STARTED
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StatusCheckStopSafe
()[source]¶ Check process status and auto stop safe it if self.mStatusStr is 4_STARTED
- Returns
-
StatusRestore
()[source]¶ Execute the StatusCheck, after that restore status to the saved state (see StatusSave). Work when orchestrator is restarted.
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StatusSave
()[source]¶ Save current status of the process. After that you can restore process activity. Work when orchestrator is restarted. Don’t save “STOP_SAFE” status > “STOPPED”
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StopForce
(inIsManualBool=True, inMuteIgnoreBool=False) → str[source]¶ Manual/Auto stop force. Force stop don’t wait process termination - it just terminate process now. Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto
- Parameters
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StopForceCheck
() → str[source]¶ Stop force program if auto started (4_STARTED).
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StopSafe
(inIsManualBool=True, inStopSafeTimeoutSecFloat=None) → str[source]¶ Manual/Auto stop safe. Stop safe is the operation which send signal to process to terminate own work (send term signal to process). Managers.Process wait for the mStopSafeTimeoutSecFloat seconds. After that, if process is not terminated - self will StopForce it. Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto
- Parameters
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
inStopSafeTimeoutSecFloat – Default value goes from the instance. You can specify time is second to wait while safe stop. After that program will stop force
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
StopSafeCheck
(inStopSafeTimeoutSecFloat=None) → str[source]¶ Stop safe program if auto started (4_STARTED).
- Parameters
inStopSafeTimeoutSecFloat – Default value goes from the instance. You can specify time is second to wait while safe stop. After that program will stop force
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessExists
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str) → bool[source]¶ Check if the Process instance is exists in GSettings by the (inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str)
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
- Returns
True - process exists in gsettings; False - else
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessGet
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str) → pyOpenRPA.Orchestrator.Managers.Process.Process[source]¶ Return the process instance by the inProcessNameWOExeStr
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
- Returns
Process instance (if exists) Else None
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessInitSafe
(inAgentHostNameStr, inAgentUserNameStr, inProcessNameWOExeStr, inStartPathStr=None, inStartCMDStr=None, inStopSafeTimeoutSecFloat=300) → pyOpenRPA.Orchestrator.Managers.Process.Process[source]¶ Exception safe function. Check if process instance is not exists in GSettings (it can be after restart because Orchestrator restore objects from dump of the previous Orchestrator session) Return existing instance (if exists) or create new instance and return it.
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
inStartPathStr – Path to start process (.cmd/ .exe or something else). Path can be relative (from orc working directory) or absolute
inStartCMDStr – CMD script to start program (if no start file is exists)
inStopSafeTimeoutSecFloat – Time to wait for stop safe. After that do the stop force (if process is not stopped)
- Returns
Process instance
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessManual2Auto
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str) → str[source]¶ Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self):
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
- Returns
Process status. See self.mStatusStr. Process instance has the following statuses: - 0_STOPPED - 1_STOPPED_MANUAL - 2_STOP_SAFE - 3_STOP_SAFE_MANUAL - 4_STARTED - 5_STARTED_MANUAL - None (if Process instance not exists)
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessManualStopListClear
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str) → None[source]¶ Clear the last start tries list.
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
- Returns
None
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessManualStopTriggerSet
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str, inMSTdTSecFloat: float, inMSTdNInt: int) → None[source]¶ Remove Manual flag from process (if exists) - it will allow the schedule operations via def StatusCheckStart(self): def StatusCheckStorForce(self): def StatusCheckStopSafe(self):
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
inMSTdTSecFloat – Time periods in seconds
inMSTdNInt – Counts of the start tries
- Returns
None
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessScheduleStatusCheckEverySeconds
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str, inIntervalSecondsInt: int = 120)[source]¶ Run status check every interval in second you specify.
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
inIntervalSecondsInt – Interval in seconds. Default is 120
- Returns
None
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessStart
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str, inIsManualBool: bool = True) → str[source]¶ Manual/Auto start. Manual start will block scheduling execution. To return schedule execution use def Manual2Auto
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
- Returns
Process status. See self.mStatusStr. Process instance has the following statuses: - 0_STOPPED - 1_STOPPED_MANUAL - 2_STOP_SAFE - 3_STOP_SAFE_MANUAL - 4_STARTED - 5_STARTED_MANUAL - None (if Process instance not exists)
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessStatusCheck
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str) → str[source]¶ Check if process is alive. The def will save the manual flag is exists.
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
- Returns
Process status. See self.mStatusStr. Process instance has the following statuses: - 0_STOPPED - 1_STOPPED_MANUAL - 2_STOP_SAFE - 3_STOP_SAFE_MANUAL - 4_STARTED - 5_STARTED_MANUAL - None (if Process instance not exists)
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessStatusRestore
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str)[source]¶ Execute the StatusCheck, after that restore status to the saved state (see StatusSave). Work when orchestrator is restarted.
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessStatusSave
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str)[source]¶ Save current status of the process. After that you can restore process activity. Work when orchestrator is restarted. Don’t save “STOP_SAFE” status > “STOPPED”
- Returns
Process status. See self.mStatusStr. 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessStatusStrGet
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str) → str[source]¶ Get the status of the Process instance.
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
- Returns
Process status. See self.mStatusStr. Process instance has the following statuses: - 0_STOPPED - 1_STOPPED_MANUAL - 2_STOP_SAFE - 3_STOP_SAFE_MANUAL - 4_STARTED - 5_STARTED_MANUAL - None (if Process instance not exists)
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessStopForce
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str, inIsManualBool: bool = True) → str[source]¶ Manual/Auto stop force. Force stop dont wait process termination - it just terminate process now. Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
- Returns
Process status. See self.mStatusStr. Process instance has the following statuses: - 0_STOPPED - 1_STOPPED_MANUAL - 2_STOP_SAFE - 3_STOP_SAFE_MANUAL - 4_STARTED - 5_STARTED_MANUAL - None (if Process instance not exists)
-
pyOpenRPA.Orchestrator.Managers.Process.
ProcessStopSafe
(inAgentHostNameStr: str, inAgentUserNameStr: str, inProcessNameWOExeStr: str, inIsManualBool: bool = True, inStopSafeTimeoutSecFloat=None) → str[source]¶ Manual/Auto stop safe. Stop safe is the operation which send signal to process to terminate own work (send term signal to process). Managers.Process wait for the mStopSafeTimeoutSecFloat seconds. After that, if process is not terminated - self will StopForce it. Manual stop safe will block scheduling execution. To return schedule execution use def Manual2Auto
- Parameters
inAgentHostNameStr – Agent hostname in any case. Required to identify Process
inAgentUserNameStr – Agent user name in any case. Required to identify Process
inProcessNameWOExeStr – The process name without extension .exe (the key of the Process instance). Any case - will be processed to the upper case
inIsManualBool – Default is True - Mark this operation as manual - StatusCheckStart/Stop will be blocked - only StatusCheck will be working. False - Auto operation
inStopSafeTimeoutSecFloat – Default value goes from the instance. You can specify time is second to wait while safe stop. After that program will stop force
- Returns
Process status. See self.mStatusStr. Process instance has the following statuses: - 0_STOPPED - 1_STOPPED_MANUAL - 2_STOP_SAFE - 3_STOP_SAFE_MANUAL - 4_STARTED - 5_STARTED_MANUAL - None (if Process instance not exists)
ControlPanel (General)¶
# EXAMPLE
from pyOpenRPA.Orchestrator import Orchestrator
lCP = Orchestrator.Managers.ControlPanel(inControlPanelNameStr="TestTTT",inRefreshHTMLJinja2TemplatePathStr="ControlPanel\\test.html", inJinja2TemplateRefreshBool = True)
Classes:
|
Manage your control panel on the orchestrator |
-
class
pyOpenRPA.Orchestrator.Managers.ControlPanel.
ControlPanel
(inControlPanelNameStr, inRefreshHTMLJinja2TemplatePathStr=None, inJinja2TemplateRefreshBool=False, inRobotNameStr=None)[source]¶ Manage your control panel on the orchestrator
Control panel has 3 events types: - onRefreshHTML - run every n (see settings) second to detect changes in HTML control panel. - onRefreshJSON - run every n (see settings) second to detect changes in JSON data container to client side. - onInitJS - run when client reload the Orchestrator web page
# Usage example: lCPManager = Orchestrator.Managers.ControlPanel(inControlPanelNameStr="TestControlPanel", inRefreshHTMLJinja2TemplatePathStr="ControlPanel\test.html", inJinja2TemplateRefreshBool = True)
If you use Jinja2 you can use next data context: StorageRobotDict: Orchestrator.StorageRobotGet(inRobotNameStr=self.mRobotNameStr), ControlPanelInstance: self, OrchestratorModule:Orchestrator, RequestInstance: inRequest, UserInfoDict: Orchestrator.WebUserInfoGet(inRequest=inRequest), UserUACDict: Orchestrator.UACUserDictGet(inRequest=inRequest), UserUACCheckDef: inRequest.UACClientCheck, EnumerateDef: enumerate, OperatorModule: operator, MathModule: math
You can modify jinja context by use the function: Jinja2DataUpdateDictSet
Methods:
DataDictGenerate
(inRequest)- param inRequest
request handler (from http.server import BaseHTTPRequestHandler)
InitJSJinja2StrGenerate
(inDataDict)Generate the HTML str from the Jinja2.
Create Jinja2 env and load the template html
Jinja2DataUpdateDictSet
(inJinja2DataUpdateDict)Set the data dict from the Jinja2 context (you can add some new params)
OnInitJSDataDict
(inRequest)Event to prepare data context for the futher Jinja2 JS init generation.
OnInitJSStr
(inRequest)Event when orchestrator web page is init on the client side - you can transmit some java script code is str type to execute it once.
OnRefreshHTMLDataDict
(inRequest)Event to prepare data context for the futher Jinja2 HTML generation.
OnRefreshHTMLHashStr
(inRequest)Generate the hash the result output HTML.
OnRefreshHTMLStr
(inRequest)Event to generate HTML code of the control panel when refresh time is over.
OnRefreshJSONDict
(inRequest)Event to transmit some data from server side to the client side in JSON format.
RefreshHTMLJinja2StrGenerate
(inDataDict)Generate the HTML str from the Jinja2.
Create Jinja2 env and load the template html
-
DataDictGenerate
(inRequest)[source]¶ - Parameters
inRequest – request handler (from http.server import BaseHTTPRequestHandler)
- Returns
-
InitJSJinja2StrGenerate
(inDataDict)[source]¶ Generate the HTML str from the Jinja2. Pass the context inDataDict :param inDataDict: :return:
-
InitJSJinja2TemplatePathSet
(inJinja2TemplatePathStr)[source]¶ Create Jinja2 env and load the template html
- Parameters
inJinja2TemplatePathStr –
- Returns
-
Jinja2DataUpdateDictSet
(inJinja2DataUpdateDict)[source]¶ Set the data dict from the Jinja2 context (you can add some new params)
- Parameters
inJinja2DataUpdateDict – dict, which will be appended to main data context
- Returns
None
-
OnInitJSDataDict
(inRequest)[source]¶ Event to prepare data context for the futher Jinja2 JS init generation. You can override this def if you want some thing more data
- Parameters
inRequest – request handler (from http.server import BaseHTTPRequestHandler)
- Returns
dict
-
OnInitJSStr
(inRequest)[source]¶ Event when orchestrator web page is init on the client side - you can transmit some java script code is str type to execute it once.
- Parameters
inRequest – request handler (from http.server import BaseHTTPRequestHandler)
- Returns
””
-
OnRefreshHTMLDataDict
(inRequest)[source]¶ Event to prepare data context for the futher Jinja2 HTML generation. You can override this def if you want some thing more data
- Parameters
inRequest – request handler (from http.server import BaseHTTPRequestHandler)
- Returns
dict
-
OnRefreshHTMLHashStr
(inRequest)[source]¶ Generate the hash the result output HTML. You can override this function if you know how to optimize HTML rendering. TODO NEED TO MODIFY ServerSettings to work with Hash because of all defs are need do use Hash
- Parameters
inRequest – request handler (from http.server import BaseHTTPRequestHandler)
- Returns
None - default, hash function is not determined. Str - hash function is working on!
-
OnRefreshHTMLStr
(inRequest)[source]¶ Event to generate HTML code of the control panel when refresh time is over. Support backward compatibility for previous versions.
- Parameters
inRequest – request handler (from http.server import BaseHTTPRequestHandler)
- Returns
-
OnRefreshJSONDict
(inRequest)[source]¶ Event to transmit some data from server side to the client side in JSON format. Call when page refresh is initialized
- Parameters
inRequest – request handler (from http.server import BaseHTTPRequestHandler)
- Returns
Dict type
ControlPanel (Details)¶
Classes:
|
Manage your control panel on the orchestrator |
-
class
pyOpenRPA.Orchestrator.Managers.ControlPanel.
ControlPanel
(inControlPanelNameStr, inRefreshHTMLJinja2TemplatePathStr=None, inJinja2TemplateRefreshBool=False, inRobotNameStr=None)[source]¶ Manage your control panel on the orchestrator
Control panel has 3 events types: - onRefreshHTML - run every n (see settings) second to detect changes in HTML control panel. - onRefreshJSON - run every n (see settings) second to detect changes in JSON data container to client side. - onInitJS - run when client reload the Orchestrator web page
# Usage example: lCPManager = Orchestrator.Managers.ControlPanel(inControlPanelNameStr="TestControlPanel", inRefreshHTMLJinja2TemplatePathStr="ControlPanel\test.html", inJinja2TemplateRefreshBool = True)
If you use Jinja2 you can use next data context: StorageRobotDict: Orchestrator.StorageRobotGet(inRobotNameStr=self.mRobotNameStr), ControlPanelInstance: self, OrchestratorModule:Orchestrator, RequestInstance: inRequest, UserInfoDict: Orchestrator.WebUserInfoGet(inRequest=inRequest), UserUACDict: Orchestrator.UACUserDictGet(inRequest=inRequest), UserUACCheckDef: inRequest.UACClientCheck, EnumerateDef: enumerate, OperatorModule: operator, MathModule: math
You can modify jinja context by use the function: Jinja2DataUpdateDictSet
Methods:
DataDictGenerate
(inRequest)- param inRequest
request handler (from http.server import BaseHTTPRequestHandler)
InitJSJinja2StrGenerate
(inDataDict)Generate the HTML str from the Jinja2.
Create Jinja2 env and load the template html
Jinja2DataUpdateDictSet
(inJinja2DataUpdateDict)Set the data dict from the Jinja2 context (you can add some new params)
OnInitJSDataDict
(inRequest)Event to prepare data context for the futher Jinja2 JS init generation.
OnInitJSStr
(inRequest)Event when orchestrator web page is init on the client side - you can transmit some java script code is str type to execute it once.
OnRefreshHTMLDataDict
(inRequest)Event to prepare data context for the futher Jinja2 HTML generation.
OnRefreshHTMLHashStr
(inRequest)Generate the hash the result output HTML.
OnRefreshHTMLStr
(inRequest)Event to generate HTML code of the control panel when refresh time is over.
OnRefreshJSONDict
(inRequest)Event to transmit some data from server side to the client side in JSON format.
RefreshHTMLJinja2StrGenerate
(inDataDict)Generate the HTML str from the Jinja2.
Create Jinja2 env and load the template html
-
DataDictGenerate
(inRequest)[source]¶ - Parameters
inRequest – request handler (from http.server import BaseHTTPRequestHandler)
- Returns
-
InitJSJinja2StrGenerate
(inDataDict)[source]¶ Generate the HTML str from the Jinja2. Pass the context inDataDict :param inDataDict: :return:
-
InitJSJinja2TemplatePathSet
(inJinja2TemplatePathStr)[source]¶ Create Jinja2 env and load the template html
- Parameters
inJinja2TemplatePathStr –
- Returns
-
Jinja2DataUpdateDictSet
(inJinja2DataUpdateDict)[source]¶ Set the data dict from the Jinja2 context (you can add some new params)
- Parameters
inJinja2DataUpdateDict – dict, which will be appended to main data context
- Returns
None
-
OnInitJSDataDict
(inRequest)[source]¶ Event to prepare data context for the futher Jinja2 JS init generation. You can override this def if you want some thing more data
- Parameters
inRequest – request handler (from http.server import BaseHTTPRequestHandler)
- Returns
dict
-
OnInitJSStr
(inRequest)[source]¶ Event when orchestrator web page is init on the client side - you can transmit some java script code is str type to execute it once.
- Parameters
inRequest – request handler (from http.server import BaseHTTPRequestHandler)
- Returns
””
-
OnRefreshHTMLDataDict
(inRequest)[source]¶ Event to prepare data context for the futher Jinja2 HTML generation. You can override this def if you want some thing more data
- Parameters
inRequest – request handler (from http.server import BaseHTTPRequestHandler)
- Returns
dict
-
OnRefreshHTMLHashStr
(inRequest)[source]¶ Generate the hash the result output HTML. You can override this function if you know how to optimize HTML rendering. TODO NEED TO MODIFY ServerSettings to work with Hash because of all defs are need do use Hash
- Parameters
inRequest – request handler (from http.server import BaseHTTPRequestHandler)
- Returns
None - default, hash function is not determined. Str - hash function is working on!
-
OnRefreshHTMLStr
(inRequest)[source]¶ Event to generate HTML code of the control panel when refresh time is over. Support backward compatibility for previous versions.
- Parameters
inRequest – request handler (from http.server import BaseHTTPRequestHandler)
- Returns
-
OnRefreshJSONDict
(inRequest)[source]¶ Event to transmit some data from server side to the client side in JSON format. Call when page refresh is initialized
- Parameters
inRequest – request handler (from http.server import BaseHTTPRequestHandler)
- Returns
Dict type