Skip to main content
Version: 8.0

UniversalExtension Class (1.3.0)

Classes​

class UniversalExtension​

Base class for Stonebranch Universal Extension module implementations

Instance variables​

uip​

can be used to access the following properties of an Extension task instance:

  • task_variables : dict
  • is_triggered : bool
  • trigger_id : str
  • instance_id : str
  • monitor_id : str
Examples​
>>> ops_task_id = self.uip.task_variables['ops_task_id']
>>> is_triggered = self.uip.is_triggered
>>> trigger_id = self.uip.trigger_id
>>> instance_id = self.uip.instance_id
>>> monitor_id = self.uip.monitor_id

Methods​

extension_start(self, fields)​

Serves as the starting point for work that will be performed for a task instance. It must be implemented in the derived class.

Parameters​

fields : dict

populated with field values from the associated task instance launched in the Controller

Returns​

ExtensionResult

once the work is done, an instance of ExtensionResult must be returned. See the ExtensionResult documentation for a full list of parameters that can be passed to the class constructor

extension_cancel(self)​

Optional method that allows the Extension to do any cleanup work before terminating. To use it, implement in the derived class.

Parameters​

None

Returns​

None

update_extension_status(self, fields)​

Propagate state changes back to the associated extension instance in the Controller.

  • Can be called at any time by an Extension instance.
  • Any/all output fields defined in the associated Extension Template can be updated using this method.
Parameters​

fields : dict

The fields parameter expects a dictionary of output fields to be sent back to the controller for the associated Extension instance. Field names are implementation dependent and correlate with the Universal Template field names in the Controller's Template definition for the associated task.

Returns​

None

Examples​
>>> fields = {"foo": "bar"}
>>> self.update_extension_status(fields)