def addJobCache(self):
        p_module = self.useJobCache()
        if not p_module:
            return False
        jm = self.job_monitor()
        specs = p_module.sourcePorts()
        params = {}
        if not jm.getCache(self.signature):
            from vistrails.core.modules.basic_modules import Constant
            for spec in specs:
                if spec.name == 'self':
                    continue
                # get type for output param
                module = spec.descriptors()[0].module
                if not issubclass(module, Constant):
                    raise ModuleError(self, "Trying to cache a non-constant type: %s" % spec.name)
                params[spec.name] = module.translate_to_string(self.get_output(spec.name))
                jm.setCache(self.signature, params, p_module.name)
Add outputs from job cache
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/core/modules/vistrails_module.py/Module.addJobCache