MAPI service MorpheeProcessControl
To get MorpheeProcessControl service use:
Bases: MAPIServiceWithSignalR
MorpheeProcessControl MAPI service allows to control MORPHEE process: Test if MORPHEE is launched. Start MORPHEE. Manage MORPHEE report dialog. Call init_signalr if you intend to use the signalr hub events and with keyword on the MorpheeProcessControlServiceProxy object to be sure that the communication is closed at the end.
Source code in restmapi\restmapi\services.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 | |
__init__(url)
DO NOT create MorpheeProcessControlServiceProxy by yourself. Always use MAPIServices.get_service("MorpheeProcessControl") method to create it.
Parameters:
-
url(string) –Base URL to create of the REST service.
Source code in restmapi\restmapi\services.py
close_report(instance=0, result=None)
Close a pending MORPHEE report. Note that the report default button is OK if every messages are warning. If one message is an error or FatalError, the default button is Cancel. If one message is a FatalError, the OK button is disabled.
Parameters:
-
instance(int, default:0) –MORPHEE instance number (0 master instance), by default 0 -
result(string, default:None) –A string convert from DialogResult enum ("OK" or "Cancel"). If the parameter is omitted, the report is closed using the default button.
Source code in restmapi\restmapi\services.py
get_current_session_id()
Get the current Windows session id (CAUTION that method fails for now).
Returns:
-
int–Current session id.
get_main_window_handles()
Get MainWindow handles of morphee processes.
Returns:
-
int array–Returns MainWindow handles of morphee processes. You can use them to show/hide/activate MORPHEE main window.
Source code in restmapi\restmapi\services.py
get_number_of_instances()
Get the number of MORPHEE instances including the master instance
Returns:
-
int–Number of MORPHEE instances
get_report_messages(instance=0)
Get the content of a pending MORPHEE report window.
Parameters:
-
instance(int, default:0) –MORPHEE instance number (0 master instance), by default 0
Returns:
-
ReportMessage array–Returns an array of ReportMessage. The class RestReportMessage contains 3 parameters: - string severity ("Warning", "Error" or "FatalError") - string message - string source
Source code in restmapi\restmapi\services.py
is_morphee_instance_process_started(instance)
Check if MORPHEE process is started. is_morphee_instance_process_started() becomes true immediately after the process creation, but is_morphee_instance_started() becomes true only when MORPHEE MAPI services are available.
Parameters:
-
instance(int) –Requested MORPHEE instance number
Returns:
-
bool–Returns True if MORPHEE instance is started.
Source code in restmapi\restmapi\services.py
is_morphee_instance_started(instance)
Check if morphee instance is started and MORPHEE MAPI REST services are available. Note that when MORPHEE starts, it can take some time before having MORPHEE MAPI REST services. You can is_morphee_instance_process_started() to know that MORPHEE process is started.
Parameters:
-
instance(int) –Requested MORPHEE instance number
Returns:
-
bool–Returns True if MORPHEE is started and MORPHEE MAPI services are available
Source code in restmapi\restmapi\services.py
is_morphee_process_started()
Check if MORPHEE process is started. is_morphee_process_started() becomes true immediately after the process creation, but is_morphee_started() becomes true only when MORPHEE MAPI services are available.
Returns:
-
bool–Returns True if MORPHEE is started.
Source code in restmapi\restmapi\services.py
is_morphee_started()
Check if morphee is started and MORPHEE MAPI REST services are available. Note that when MORPHEE starts, it can take some time before having MORPHEE MAPI REST services. You can is_morphee_process_started() to know that MORPHEE process is started.
Returns:
-
bool–Returns True if MORPHEE is started and available for REST requests.
Source code in restmapi\restmapi\services.py
is_report_pending(instance=0)
Check if a MORPHEE report is displayed. If yes, use get_report_messages to get the content.
Parameters:
-
instance(int, default:0) –MORPHEE instance number (0 master instance), by default 0.
Returns:
-
bool–Return if a MORPHEE report is displayed.
Source code in restmapi\restmapi\services.py
register_report_updated_callback(action)
Register a signalR callback to be called when a MORPHEE instance open or close a report dialog. init_signalr() method has to be called before to initialize signalR communication.
Parameters:
-
action(Function with an int parameter) –A callback function with a parameter (instance number who send the event (0 for master instance)).
Source code in restmapi\restmapi\services.py
register_started_callback(action)
Register a signalR callback to be called when a MORPHEE instance is started. init_signalr() method has to be called before to initialize signalR communication.
Parameters:
-
action(Function with an int parameter) –A callback function with a parameter (instance number who send the event (0 for master instance)).
Source code in restmapi\restmapi\services.py
register_stopped_callback(action)
Register a signalR callback to be called when a MORPHEE instance is stopped. init_signalr() method has to be called before to initialize signalR communication.
Parameters:
-
action(Function with an int parameter) –A callback function with a parameter (instance number who send the event (0 for master instance)).
Source code in restmapi\restmapi\services.py
start(cmdLine=None, startAs=None, sessionId=None)
Start MORPHEE.
Parameters:
-
cmdLine(string, default:None) –process command line arguments, by default None. For example, "-1" to start MORPHEE instance1. -
startAs(string, default:None) –account used for starting the process, by default None. Values: - "lsa" Start the process as local system administrator account - "morphee_interactive" Start the process as the current TM interactive user - "current" Start the process as the current windows login - "runas" Start the process using the administrator account (process will start by RunAs.exe application) -
sessionId(string, default:None) –Current windows sessionId, by default None. When started in a RDP session, the current user session has to be set if you want to see the MORPHEE window into your RDP session. The method get_current_session_id should returns the current id.
Returns:
-
Process–Returns the MORPHEE process object.