private List<ProcessChange> updateControlTagInformation(final ConfigurationElement element,final Equipment equipment){
  List<ProcessChange> changes=new ArrayList<ProcessChange>(3);
  Long processId=equipment.getProcessId();
  Long equipmentId=equipment.getId();
  if (equipment.getAliveTagId() != null) {
    ControlTag aliveTagCopy=controlCache.getCopy(equipment.getAliveTagId());
    if (aliveTagCopy != null) {
      setEquipmentId((ControlTagCacheObject)aliveTagCopy,equipmentId,processId);
      if (aliveTagCopy.getAddress() != null) {
        IChange toAdd=new DataTagAdd(element.getSequenceId(),equipmentId,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("No Alive tag (%s) found for equipment #%d (%s).",equipment.getAliveTagId(),equipment.getId(),equipment.getName()));
    }
  }
  ControlTag commFaultTagCopy=controlCache.getCopy(equipment.getCommFaultTagId());
  if (commFaultTagCopy != null) {
    setEquipmentId((ControlTagCacheObject)commFaultTagCopy,equipmentId,processId);
  }
 else {
    throw new ConfigurationException(ConfigurationException.INVALID_PARAMETER_VALUE,String.format("No CommFault tag (%s) found for equipment #%d (%s).",equipment.getCommFaultTagId(),equipment.getId(),equipment.getName()));
  }
  ControlTag statusTagCopy=controlCache.getCopy(equipment.getStateTagId());
  if (statusTagCopy != null) {
    setEquipmentId((ControlTagCacheObject)statusTagCopy,equipmentId,processId);
  }
 else {
    throw new ConfigurationException(ConfigurationException.INVALID_PARAMETER_VALUE,String.format("No Status tag (%s) found for equipment #%d (%s).",equipment.getStateTagId(),equipment.getId(),equipment.getName()));
  }
  return changes;
}

private List < ProcessChange > updateControlTagInformation ( final ConfigurationElement element , final Equipment equipment ) { List < ProcessChange > changes = new ArrayList < ProcessChange > ( 3 ) ; Long processId = equipment . getProcessId ( ) ; Long equipmentId = equipment . getId ( ) ; if ( equipment . getAliveTagId ( ) != null ) { ControlTag aliveTagCopy = controlCache . getCopy ( equipment . getAliveTagId ( ) ) ; if ( aliveTagCopy != null ) { setEquipmentId ( ( ControlTagCacheObject ) aliveTagCopy , equipmentId , processId ) ; if ( aliveTagCopy . getAddress ( ) != null ) { IChange toAdd = new DataTagAdd ( element . getSequenceId ( ) , equipmentId , 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 ( "No Alive tag (%s) found for equipment #%d (%s)." , equipment . getAliveTagId ( ) , equipment . getId ( ) , equipment . getName ( ) ) ) ; } } ControlTag commFaultTagCopy = controlCache . getCopy ( equipment . getCommFaultTagId ( ) ) ; if ( commFaultTagCopy != null ) { setEquipmentId ( ( ControlTagCacheObject ) commFaultTagCopy , equipmentId , processId ) ; } else { throw new ConfigurationException ( ConfigurationException . INVALID_PARAMETER_VALUE , String . format ( "No CommFault tag (%s) found for equipment #%d (%s)." , equipment . getCommFaultTagId ( ) , equipment . getId ( ) , equipment . getName ( ) ) ) ; } ControlTag statusTagCopy = controlCache . getCopy ( equipment . getStateTagId ( ) ) ; if ( statusTagCopy != null ) { setEquipmentId ( ( ControlTagCacheObject ) statusTagCopy , equipmentId , processId ) ; } else { throw new ConfigurationException ( ConfigurationException . INVALID_PARAMETER_VALUE , String . format ( "No Status tag (%s) found for equipment #%d (%s)." , equipment . getStateTagId ( ) , equipment . getId ( ) , equipment . getName ( ) ) ) ; } return changes ; }
ensures that the alive - , status - and commfault tags have appropriately the equipment id set .
