When the given task instance has changed. Look at task and context and change
    the corresponding item relation.
340264
def change_parent(sender, instance, **kwargs):
    
    if instance.id is None:
        return
    if len({'task', 'task_id'} & set(instance.changed_fields)) != 0:
        diff = instance.diff
        parent = diff['task'][0] if 'task' in diff else diff['task_id'][0]
        parent_id = parent.item_id if isinstance(parent, Task) else Task.objects.get(pk=parent).item_id
        child_id = instance.item_id
        ItemRelation.objects.filter(parent_id=parent_id, child_id=child_id).delete()
        ItemRelation.objects.create(parent_id=instance.task.item_id, child_id=child_id, visible=True)
    if len({'context', 'context_id'} & set(instance.changed_fields)) != 0:
        diff = instance.diff
        parent = diff['context'][0] if 'context' in diff else diff['context_id'][0]
        parent_id = parent.item_id if isinstance(parent, Context) else Context.objects.get(pk=parent).item_id
        child_id = instance.item_id
        ItemRelation.objects.filter(parent_id=parent_id, child_id=child_id).delete()
        ItemRelation.objects.create(parent_id=instance.context.item_id, child_id=child_id, visible=False)
476998
def persistent_object_context_changed(self):
        
        super().persistent_object_context_changed()

        def register():
            if self.__source is not None and self.__target is not None:
                assert not self.__binding
                self.__binding = Binding.PropertyBinding(self.__source, self.source_property)
                self.__binding.target_setter = self.__set_target_from_source
                # while reading, the data item in the display data channel will not be connected;
                # we still set its value here. when the data item becomes valid, it will update.
                self.__binding.update_target_direct(self.__binding.get_target_value())

        def source_registered(source):
            self.__source = source
            register()

        def target_registered(target):
            self.__target = target

            def property_changed(target, property_name):
                if property_name == self.target_property:
                    self.__set_source_from_target(getattr(target, property_name))

            assert self.__target_property_changed_listener is None
            self.__target_property_changed_listener = target.property_changed_event.listen(functools.partial(property_changed, target))
            register()

        def unregistered(item=None):
            if not item or item == self.__source:
                self.__source = None
            if not item or item == self.__target:
                self.__target = None
            if self.__binding:
                self.__binding.close()
                self.__binding = None
            if self.__target_property_changed_listener:
                self.__target_property_changed_listener.close()
                self.__target_property_changed_listener = None

        def change_registration(registered_object, unregistered_object):
            if registered_object and registered_object.uuid == self.source_uuid:
                source_registered(registered_object)
            if registered_object and registered_object.uuid == self.target_uuid:
                target_registered(registered_object)
            if unregistered_object and unregistered_object in (self._source, self._target):
                unregistered(unregistered_object)

        if self.persistent_object_context:
            self.__registration_listener = self.persistent_object_context.registration_event.listen(change_registration)
            source = self.persistent_object_context.get_registered_object(self.source_uuid)
            target = self.persistent_object_context.get_registered_object(self.target_uuid)
            if source:
                source_registered(source)
            if target:
                target_registered(target)
        else:
            unregistered()
93469
def changed(self, message=None, *args):
        
        if message is not None:
            self.logger.debug('%s: %s', self._repr(), message % args)
        self.logger.debug('%s: changed', self._repr())
        if self.parent is not None:
            self.parent.changed()
        elif isinstance(self, Mutable):
            super(TrackedObject, self).changed()
241430
@Override
  public void recordTaskNameChange(String taskId, String taskName) {
    if (isHistoryLevelAtLeast(HistoryLevel.AUDIT)) {
      HistoricTaskInstanceEntity historicTaskInstance = getHistoricTaskInstanceEntityManager().findById(taskId);
      if (historicTaskInstance != null) {
        historicTaskInstance.setName(taskName);
      }
    }
  }
534401
def next_task(self, item, raise_exceptions=None, **kwargs):
        
        filename = os.path.basename(item)
        batch = self.get_batch(filename)
        tx_deserializer = self.tx_deserializer_cls(
            allow_self=self.allow_self, override_role=self.override_role
        )
        try:
            tx_deserializer.deserialize_transactions(
                transactions=batch.saved_transactions
            )
        except (DeserializationError, TransactionDeserializerError) as e:
            raise TransactionsFileQueueError(e) from e
        else:
            batch.close()
            self.archive(filename)
89527
def item_selection_changed(self):
        """"""
        is_selection = len(self.selectedItems()) > 0
        self.expand_selection_action.setEnabled(is_selection)
        self.collapse_selection_action.setEnabled(is_selection)
1039452
def UpdateTaskAsPendingMerge(self, task):
    
    with self._lock:
      is_abandoned = task.identifier in self._tasks_abandoned
      is_processing = task.identifier in self._tasks_processing
      is_queued = task.identifier in self._tasks_queued

      if not is_queued and not is_processing and not is_abandoned:
        raise KeyError('Status of task {0:s} is unknown.'.format(
            task.identifier))

      if is_abandoned and task.has_retry:
        raise KeyError('Will not merge a task {0:s} with retry task.'.format(
            task.identifier))

      if is_queued:
        logger.debug('Task {0:s} was queued, now merging.'.format(
            task.identifier))
        del self._tasks_queued[task.identifier]

      if is_processing:
        logger.debug('Task {0:s} was processing, now merging.'.format(
            task.identifier))
        del self._tasks_processing[task.identifier]

      if is_abandoned:
        logger.debug('Task {0:s} was abandoned, now merging.'.format(
            task.identifier))
        del self._tasks_abandoned[task.identifier]

      self._tasks_pending_merge.PushTask(task)

      self.SampleTaskStatus(task, 'pending_merge')

      task.UpdateProcessingTime()
      self._UpdateLatestProcessingTime(task)
259557
def persistent_object_context_changed(self):
        
        super().persistent_object_context_changed()

        def detach():
            for listener in self.__interval_mutated_listeners:
                listener.close()
            self.__interval_mutated_listeners = list()

        def reattach():
            detach()
            interval_descriptors = list()
            if self.__source:
                for region in self.__source.graphics:
                    if isinstance(region, Graphics.IntervalGraphic):
                        interval_descriptor = {"interval": region.interval, "color": "#F00"}
                        interval_descriptors.append(interval_descriptor)
                        self.__interval_mutated_listeners.append(region.property_changed_event.listen(lambda k: reattach()))
            if self.__target:
                self.__target.interval_descriptors = interval_descriptors

        def item_inserted(key, value, before_index):
            if key == "graphics" and self.__target:
                reattach()

        def item_removed(key, value, index):
            if key == "graphics" and self.__target:
                reattach()

        def source_registered(source):
            self.__source = source
            self.__item_inserted_event_listener = self.__source.item_inserted_event.listen(item_inserted)
            self.__item_removed_event_listener = self.__source.item_removed_event.listen(item_removed)
            reattach()

        def target_registered(target):
            self.__target = target
            reattach()

        def unregistered(source=None):
            if self.__item_inserted_event_listener:
                self.__item_inserted_event_listener.close()
                self.__item_inserted_event_listener = None
            if self.__item_removed_event_listener:
                self.__item_removed_event_listener.close()
                self.__item_removed_event_listener = None

        if self.persistent_object_context:
            self.persistent_object_context.subscribe(self.source_uuid, source_registered, unregistered)
            self.persistent_object_context.subscribe(self.target_uuid, target_registered, unregistered)
        else:
            unregistered()
1004881
def dataChanged(self, topleft, bottomright):
        """"""
        self._viewIsDirty = True
        super(StimulusView, self).dataChanged(topleft, bottomright)
30187
def updateItem(self, instance, subKey, value):
    """"""
    instanceId = statsId(instance)

    container = _Stats.getContainerForObject(instanceId)
    self._aggregate(instanceId, container, value, subKey)
1191472
function(compute, newValue, oldValue, batchNum) {
            // Only trigger event when value has changed
            if (newValue !== oldValue) {
                can.batch.trigger(compute, batchNum ? {
                        type: "change",
                        batchNum: batchNum
                    } : 'change', [
                        newValue,
                        oldValue
                    ]);
            }
        }
1102548
@Override
  public void recordTaskProcessDefinitionChange(String taskId, String processDefinitionId) {
    if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
      HistoricTaskInstanceEntity historicTaskInstance = getHistoricTaskInstanceEntityManager().findById(taskId);
      if (historicTaskInstance != null) {
        historicTaskInstance.setProcessDefinitionId(processDefinitionId);
      }
    }
  }
327337
def shot_taskfile_sel_changed(self, tf):
        
        self.shot_open_pb.setEnabled(bool(tf))
        # only allow new, if the releasetype is work
        # only allow new, if there is a shot. if there is a shot, there should always be a task.
        enablenew = bool(self.browser.shotbrws.selected_indexes(1)) and self.browser.get_releasetype() == djadapter.RELEASETYPES['work']
        self.shot_save_pb.setEnabled(enablenew)
        self.shot_descriptor_le.setEnabled(enablenew)
        self.shot_comment_pte.setEnabled(enablenew)
        self.update_descriptor_le(self.shot_descriptor_le, tf)
945080
function changedActiveItems(dataSource) {
  reviseLegendHelper(dataSource);
  updateEntitiesAndExtent(dataSource); // Only does anything if there are lat & lon columns.
  dataSource._changed.raiseEvent(dataSource);
}
1020293
private function changed()
    {
        if ($this->isDirty) {
            return;
        }

        $this->isDirty = true;

        if ($this->association instanceof ManyToManyAssociationMetadata &&
            $this->owner &&
            $this->association->isOwningSide() &&
            $this->em->getClassMetadata(get_class($this->owner))->changeTrackingPolicy === ChangeTrackingPolicy::NOTIFY) {
            $this->em->getUnitOfWork()->scheduleForSynchronization($this->owner);
        }
    }
569558
public void updateTaskData() {
        // Only update the local task list of topologyContext here. Because
        // other
        // relative parts in context shall be updated while the updating of
        // WorkerData (Task2Component and Component2Task map)
        List<Integer> localTasks = JStormUtils.mk_list(workerData.getTaskIds());
        topologyContext.setThisWorkerTasks(localTasks);
        userContext.setThisWorkerTasks(localTasks);

        // Update the TaskSendTargets
        updateSendTargets();
    }
802559
private void updateTaskCosts(Task parentTask)
   {
      double baselineCost = 0;
      double actualCost = 0;
      double remainingCost = 0;
      double cost = 0;

      //process children first before adding their costs
      for (Task child : parentTask.getChildTasks())
      {
         updateTaskCosts(child);
         baselineCost += NumberHelper.getDouble(child.getBaselineCost());
         actualCost += NumberHelper.getDouble(child.getActualCost());
         remainingCost += NumberHelper.getDouble(child.getRemainingCost());
         cost += NumberHelper.getDouble(child.getCost());
      }

      List<ResourceAssignment> resourceAssignments = parentTask.getResourceAssignments();
      for (ResourceAssignment assignment : resourceAssignments)
      {
         baselineCost += NumberHelper.getDouble(assignment.getBaselineCost());
         actualCost += NumberHelper.getDouble(assignment.getActualCost());
         remainingCost += NumberHelper.getDouble(assignment.getRemainingCost());
         cost += NumberHelper.getDouble(assignment.getCost());
      }

      parentTask.setBaselineCost(NumberHelper.getDouble(baselineCost));
      parentTask.setActualCost(NumberHelper.getDouble(actualCost));
      parentTask.setRemainingCost(NumberHelper.getDouble(remainingCost));
      parentTask.setCost(NumberHelper.getDouble(cost));
   }