def db_add_object(self, object, parentObjType=None, parentObjId=None):
        if parentObjType is None or parentObjId is None:
            parentObj = self
        else:
            try:
                parentObj = self.objects[(parentObjType, parentObjId)]
            except __HOLE__:
                msg = "Cannot find object of type '%s' with id '%s'" % \
                    (parentObjType, parentObjId)
                raise Exception(msg)
        funname = 'db_add_%s' % object.vtType
        objCopy = copy.copy(object)
        getattr(parentObj, funname)(objCopy)
        self.addToIndex(objCopy)
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/db/versions/v0_7_0/domain/workflow.py/DBWorkflow.db_add_object