def instantiate(self, predecessor=None, instance_kwargs=None, **kwargs):
    if (predecessor is None):
        raise ValueError("Can't wait for something without a predecessor.")
    try:
        self.instance = self._find_existing_instance(predecessor)
    except self.flow.activity_model.DoesNotExist:
        self.instance = self.flow.activity_model(process=self.process, activity_name=self.name, **(instance_kwargs or {}))
        self.instance.save()
    self.instance.predecessors.add(predecessor.instance)
    self.start()
def instantiate(self, predecessor=None, instance_kwargs=None, **kwargs):
    if (predecessor is None):
        raise ValueError("Can't wait for something without a predecessor.")
    try:
        self.instance = self._find_existing_instance(predecessor)
    except self.flow.activity_model.DoesNotExist:
        self.instance = self.flow.activity_model(process=self.process, activity_name=self.name, **(instance_kwargs or {}))
        self.instance.save()
    self.instance.predecessors.add(predecessor.instance)
    self.start()