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_observer

Disconnect the observer.

start_observer

Connect the observer.

Import detail#

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

Method detail#

ModificationObserver.set_transactional_mode(state: bool)#

Set the new value for transactional mode.

Parameters:
statebool

The new value.

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

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

Catch modification on a list.

Parameters:
element_idstr

Modified element ID.

namestr

Key of the modified field.

list_contentAny

Updated content of the modified list field.

ModificationObserver.delete_element(element_id: str)#

Delete function for observer.

Parameters:
element_idstr

The ID of the element to delete.

ModificationObserver.reload_project()#

Reload of the project.

ModificationObserver.stop_observer()#

Disconnect the observer.

ModificationObserver.start_observer()#

Connect the observer.