1. @override
void onCreated()

Callback used to notify a node that it was created. This is called after a node is deserialized as well.

Source

@override
void onCreated() {
  new Future(() async {
    config = configs[r"$$db_config"];
    while (removed != true) {
      try {
        database = await _historian.getDatabase(config);
        while (onDatabaseReady.isNotEmpty) {
          onDatabaseReady.removeAt(0)();
        }
        break;
      } catch (e, stack) {
        logger.severe(
          "Failed to connect to database for ${path}",
          e,
          stack
        );
        await new Future.delayed(const Duration(seconds: 5));
      }
    }

    if (removed == true) {
      try {
        await database.close();
      } catch (e) {}
      return;
    }

    _link.addNode("${path}/createWatchGroup", {
      r"$name": "Add Watch Group",
      r"$is": "createWatchGroup",
      r"$invokable": "write",
      r"$params": [
        {
          "name": "Name",
          "type": "string"
        }
      ]
    });

    _link.addNode("${path}/delete", {
      r"$name": "Delete",
      r"$invokable": "write",
      r"$is": "delete"
    });
  });
}