public Conditional createNewConditional(String systemName,String userName){
  Conditional c=getBySystemName(systemName);
  if (c != null) {
    return null;
  }
  if (userName != null && userName.length() > 0) {
    c=getByUserName(userName);
    if (c != null) {
      if (systemName.equals(c.getSystemName())) {
        return null;
      }
    }
  }
  if (userName == null) {
    log.error("User name is null!");
  }
  if (systemName != null && systemName.length() > 0) {
    c=getBySystemName(systemName);
    if (c != null) {
      return null;
    }
  }
  if (systemName == null) {
    return null;
  }
  if (systemName.startsWith(SensorGroupFrame.ConditionalSystemPrefix)) {
    c=new SensorGroupConditional(systemName,userName);
  }
 else {
    c=new DefaultConditional(systemName,userName);
  }
  register(c);
  return c;
}

public Conditional createNewConditional ( String systemName , String userName ) { Conditional c = getBySystemName ( systemName ) ; if ( c != null ) { return null ; } if ( userName != null && userName . length ( ) > 0 ) { c = getByUserName ( userName ) ; if ( c != null ) { if ( systemName . equals ( c . getSystemName ( ) ) ) { return null ; } } } if ( userName == null ) { log . error ( "User name is null!" ) ; } if ( systemName != null && systemName . length ( ) > 0 ) { c = getBySystemName ( systemName ) ; if ( c != null ) { return null ; } } if ( systemName == null ) { return null ; } if ( systemName . startsWith ( SensorGroupFrame . ConditionalSystemPrefix ) ) { c = new SensorGroupConditional ( systemName , userName ) ; } else { c = new DefaultConditional ( systemName , userName ) ; } register ( c ) ; return c ; }
method to create a new conditional if the conditional does not exist if the parent logix cannot be found , the username cannot be checked , but the conditional is still created . the scenario can happen when a logix is loaded from a file after its conditionals .
