private List<ProcessChange> updateControlTagInformation(final ConfigurationElement element,final SubEquipment subEquipment){
  List<ProcessChange> changes=new ArrayList<ProcessChange>(3);
  final Long processId=subEquipmentFacade.getProcessIdForAbstractEquipment(subEquipment.getId());
  ControlTag aliveTagCopy=controlCache.getCopy(subEquipment.getAliveTagId());
  if (aliveTagCopy != null) {
    setSubEquipmentId((ControlTagCacheObject)aliveTagCopy,subEquipment.getId(),processId);
    if (aliveTagCopy.getAddress() != null) {
      IChange toAdd=new DataTagAdd(element.getSequenceId(),subEquipment.getId(),controlTagFacade.generateSourceDataTag(aliveTagCopy));
      ConfigurationElementReport report=new ConfigurationElementReport(Action.CREATE,Entity.CONTROLTAG,aliveTagCopy.getId());
      ProcessChange change=new ProcessChange(processId,toAdd);
      change.setNestedSubReport(report);
      changes.add(change);
    }
 else {
      throw new ConfigurationException(ConfigurationException.INVALID_PARAMETER_VALUE,String.format("Alive tag #%d (%s) for sub-equipment #%d (%s) must by definition have a hardware address defined.",aliveTagCopy.getId(),aliveTagCopy.getName(),subEquipment.getId(),subEquipment.getName()));
    }
  }
 else {
    throw new ConfigurationException(ConfigurationException.INVALID_PARAMETER_VALUE,String.format("No Alive tag (%s) found for sub-equipment #%d (%s).",subEquipment.getAliveTagId(),subEquipment.getId(),subEquipment.getName()));
  }
  ControlTag commFaultTagCopy=controlCache.getCopy(subEquipment.getCommFaultTagId());
  if (commFaultTagCopy != null) {
    setSubEquipmentId((ControlTagCacheObject)commFaultTagCopy,subEquipment.getId(),processId);
  }
 else {
    throw new ConfigurationException(ConfigurationException.INVALID_PARAMETER_VALUE,String.format("No CommFault tag (%s) found for sub-equipment #%d (%s).",subEquipment.getCommFaultTagId(),subEquipment.getId(),subEquipment.getName()));
  }
  ControlTag statusTagCopy=controlCache.getCopy(subEquipment.getStateTagId());
  if (statusTagCopy != null) {
    setSubEquipmentId((ControlTagCacheObject)statusTagCopy,subEquipment.getId(),processId);
  }
 else {
    throw new ConfigurationException(ConfigurationException.INVALID_PARAMETER_VALUE,String.format("No Status tag (%s) found for sub-equipment #%d (%s).",subEquipment.getStateTagId(),subEquipment.getId(),subEquipment.getName()));
  }
  return changes;
}

private List < ProcessChange > updateControlTagInformation ( final ConfigurationElement element , final SubEquipment subEquipment ) { List < ProcessChange > changes = new ArrayList < ProcessChange > ( 3 ) ; final Long processId = subEquipmentFacade . getProcessIdForAbstractEquipment ( subEquipment . getId ( ) ) ; ControlTag aliveTagCopy = controlCache . getCopy ( subEquipment . getAliveTagId ( ) ) ; if ( aliveTagCopy != null ) { setSubEquipmentId ( ( ControlTagCacheObject ) aliveTagCopy , subEquipment . getId ( ) , processId ) ; if ( aliveTagCopy . getAddress ( ) != null ) { IChange toAdd = new DataTagAdd ( element . getSequenceId ( ) , subEquipment . getId ( ) , controlTagFacade . generateSourceDataTag ( aliveTagCopy ) ) ; ConfigurationElementReport report = new ConfigurationElementReport ( Action . CREATE , Entity . CONTROLTAG , aliveTagCopy . getId ( ) ) ; ProcessChange change = new ProcessChange ( processId , toAdd ) ; change . setNestedSubReport ( report ) ; changes . add ( change ) ; } else { throw new ConfigurationException ( ConfigurationException . INVALID_PARAMETER_VALUE , String . format ( "Alive tag #%d (%s) for sub-equipment #%d (%s) must by definition have a hardware address defined." , aliveTagCopy . getId ( ) , aliveTagCopy . getName ( ) , subEquipment . getId ( ) , subEquipment . getName ( ) ) ) ; } } else { throw new ConfigurationException ( ConfigurationException . INVALID_PARAMETER_VALUE , String . format ( "No Alive tag (%s) found for sub-equipment #%d (%s)." , subEquipment . getAliveTagId ( ) , subEquipment . getId ( ) , subEquipment . getName ( ) ) ) ; } ControlTag commFaultTagCopy = controlCache . getCopy ( subEquipment . getCommFaultTagId ( ) ) ; if ( commFaultTagCopy != null ) { setSubEquipmentId ( ( ControlTagCacheObject ) commFaultTagCopy , subEquipment . getId ( ) , processId ) ; } else { throw new ConfigurationException ( ConfigurationException . INVALID_PARAMETER_VALUE , String . format ( "No CommFault tag (%s) found for sub-equipment #%d (%s)." , subEquipment . getCommFaultTagId ( ) , subEquipment . getId ( ) , subEquipment . getName ( ) ) ) ; } ControlTag statusTagCopy = controlCache . getCopy ( subEquipment . getStateTagId ( ) ) ; if ( statusTagCopy != null ) { setSubEquipmentId ( ( ControlTagCacheObject ) statusTagCopy , subEquipment . getId ( ) , processId ) ; } else { throw new ConfigurationException ( ConfigurationException . INVALID_PARAMETER_VALUE , String . format ( "No Status tag (%s) found for sub-equipment #%d (%s)." , subEquipment . getStateTagId ( ) , subEquipment . getId ( ) , subEquipment . getName ( ) ) ) ; } return changes ; }
ensures that the alive - , status - and commfault tags have appropriately the sub - equipment id set .
