def db_add_object(self, object, parent_obj_type=None,
                      parent_obj_id=None, parent_obj=None):
        if parent_obj is None:
            if parent_obj_type is None or parent_obj_id is None:
                parent_obj = self
            else:
                if parent_obj_type == 'abstractionRef' or \
                        parent_obj_type == 'group':
                    parent_obj_type = 'module'
                try:
                    parent_obj = self.objects[(parent_obj_type, parent_obj_id)]
                except __HOLE__:
                    msg = "Cannot find object of type '%s' with id '%s'" % \
                        (parent_obj_type, parent_obj_id)
                    raise Exception(msg)
        if object.vtType == 'abstractionRef' or object.vtType == 'group':
            obj_type = 'module'
        else:
            obj_type = object.vtType
        funname = 'db_add_' + obj_type
        obj_copy = copy.copy(object)
        getattr(parent_obj, funname)(obj_copy)
        self.add_to_index(obj_copy)
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/db/versions/v0_9_3/domain/workflow.py/DBWorkflow.db_add_object