protected List<ProcessChange> removeEquipmentControlTags(final T abstractEquipment,final ConfigurationElementReport equipmentReport){
  List<ProcessChange> changes=new ArrayList<>();
  LOGGER.debug("Removing (Sub-)Equipment control tags.");
  Long aliveTagId=abstractEquipment.getAliveTagId();
  if (aliveTagId != null) {
    ConfigurationElementReport tagReport=new ConfigurationElementReport(Action.REMOVE,Entity.CONTROLTAG,aliveTagId);
    ProcessChange change=controlTagConfigHandler.removeControlTag(aliveTagId,tagReport);
    if (change.processActionRequired()) {
      change.setNestedSubReport(tagReport);
      changes.add(change);
    }
 else {
      equipmentReport.addSubReport(tagReport);
    }
  }
  Long commTagId=abstractEquipment.getCommFaultTagId();
  if (commTagId != null) {
    ConfigurationElementReport tagReport=new ConfigurationElementReport(Action.REMOVE,Entity.CONTROLTAG,commTagId);
    ProcessChange change=controlTagConfigHandler.removeControlTag(commTagId,tagReport);
    if (change.processActionRequired()) {
      change.setNestedSubReport(tagReport);
      changes.add(change);
    }
 else {
      equipmentReport.addSubReport(tagReport);
    }
  }
  Long stateTagId=abstractEquipment.getStateTagId();
  ConfigurationElementReport tagReport=new ConfigurationElementReport(Action.REMOVE,Entity.CONTROLTAG,stateTagId);
  ProcessChange change=controlTagConfigHandler.removeControlTag(stateTagId,tagReport);
  if (change.processActionRequired()) {
    change.setNestedSubReport(tagReport);
    changes.add(change);
  }
 else {
    equipmentReport.addSubReport(tagReport);
  }
  return changes;
}

protected List < ProcessChange > removeEquipmentControlTags ( final T abstractEquipment , final ConfigurationElementReport equipmentReport ) { List < ProcessChange > changes = new ArrayList < > ( ) ; LOGGER . debug ( "Removing (Sub-)Equipment control tags." ) ; Long aliveTagId = abstractEquipment . getAliveTagId ( ) ; if ( aliveTagId != null ) { ConfigurationElementReport tagReport = new ConfigurationElementReport ( Action . REMOVE , Entity . CONTROLTAG , aliveTagId ) ; ProcessChange change = controlTagConfigHandler . removeControlTag ( aliveTagId , tagReport ) ; if ( change . processActionRequired ( ) ) { change . setNestedSubReport ( tagReport ) ; changes . add ( change ) ; } else { equipmentReport . addSubReport ( tagReport ) ; } } Long commTagId = abstractEquipment . getCommFaultTagId ( ) ; if ( commTagId != null ) { ConfigurationElementReport tagReport = new ConfigurationElementReport ( Action . REMOVE , Entity . CONTROLTAG , commTagId ) ; ProcessChange change = controlTagConfigHandler . removeControlTag ( commTagId , tagReport ) ; if ( change . processActionRequired ( ) ) { change . setNestedSubReport ( tagReport ) ; changes . add ( change ) ; } else { equipmentReport . addSubReport ( tagReport ) ; } } Long stateTagId = abstractEquipment . getStateTagId ( ) ; ConfigurationElementReport tagReport = new ConfigurationElementReport ( Action . REMOVE , Entity . CONTROLTAG , stateTagId ) ; ProcessChange change = controlTagConfigHandler . removeControlTag ( stateTagId , tagReport ) ; if ( change . processActionRequired ( ) ) { change . setNestedSubReport ( tagReport ) ; changes . add ( change ) ; } else { equipmentReport . addSubReport ( tagReport ) ; } return changes ; }
removes the control tags for this equipment . notice that if this fails , the equipment object will still be removed : this is to prevent the situation of not being able to remove the equipment because of the control tags ( say if another equipment is also using them by mistake ) and not being able to remove the control tags because of the equipment . < p > notice that in case of failure , only part of the control tags could remain ; they are removed in the following order : alive tag , commfaulttag , state tag .
