ModificationObserver#

class ansys.sam.sysml2.observer.observer.ModificationObserver(project, connector: ansys.sam.sysml2.api.sysml2_api_connector.SysML2APIConnector)#

Modification observer for SysML elements.

Overview#

set_transactional_mode

Set the new value for transactional mode.

notify

Catch a modification notification.

list_notify

Catch modification on a list.

delete_element

Delete function for observer.

reload_project

Reload of the project.

stop

Disconnect the observer.

start

Connect the observer.

Import detail#

from ansys.sam.sysml2.observer.observer import ModificationObserver

Method detail#

ModificationObserver.set_transactional_mode(state: bool) None#

Set the new value for transactional mode.

Parameters:
statebool

The new value.

ModificationObserver.notify(element_id: str, name: str, value: object) None#

Catch a modification notification.

Parameters:
element_idstr

Modified element ID.

namestr

Key of the modified field.

valueobject

Value of the modified field.

ModificationObserver.list_notify(element_id: str, name: str, list_content: list) None#

Catch modification on a list.

Parameters:
element_idstr

Modified element ID.

namestr

Key of the modified field.

list_contentlist

Updated content of the modified list field.

ModificationObserver.delete_element(element_id: str) None#

Delete function for observer.

Parameters:
element_idstr

The ID of the element to delete.

ModificationObserver.reload_project() None#

Reload of the project.

ModificationObserver.stop() None#

Disconnect the observer.

ModificationObserver.start() None#

Connect the observer.