gt: 		int errorCount = listOfErrors.size();
context: //#############################################################################
  //#                                                                           #
  //#  Copyright (C) <2014>  <IMS MAXIMS>                                       #
  //#                                                                           #
  //#  This program is free software: you can redistribute it and/or modify     #
  //#  it under the terms of the GNU Affero General Public License as           #
  //#  published by the Free Software Foundation, either version 3 of the       #
  //#  License, or (at your option) any later version.                          # 
  //#                                                                           #
  //#  This program is distributed in the hope that it will be useful,          #
  //#  but WITHOUT ANY WARRANTY; without even the implied warranty of           #
  //#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
  //#  GNU Affero General Public License for more details.                      #
  //#                                                                           #
  //#  You should have received a copy of the GNU Affero General Public License #
  //#  along with this program.  If not, see <http://www.gnu.org/licenses/>.    #
  //#                                                                           #
  //#############################################################################
  //#EOH
  // This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5007.25751)
  // Copyright (C) 1995-2014 IMS MAXIMS. All rights reserved.
  // WARNING: DO NOT MODIFY the content of this file
  
  package ims.scheduling.vo;
  
  /**
   * Linked to Scheduling.ActivityStatusToPathwayEvent business object (ID: 1055100022).
   */
  public class ProfileActivityEventVo extends ims.scheduling.vo.ActivityStatusToPathwayEventRefVo implements ims.vo.ImsCloneable, Comparable
  {
  	private static final long serialVersionUID = 1L;
  
  	public ProfileActivityEventVo()
  	{
  	}
  	public ProfileActivityEventVo(Integer id, int version)
  	{
  		super(id, version);
  	}
  	public ProfileActivityEventVo(ims.scheduling.vo.beans.ProfileActivityEventVoBean bean)
  	{
  		this.id = bean.getId();
  		this.version = bean.getVersion();
  		this.activity = bean.getActivity() == null ? null : bean.getActivity().buildVo();
  		this.appointmentstatus = bean.getAppointmentStatus() == null ? null : ims.scheduling.vo.lookups.Status_Reason.buildLookup(bean.getAppointmentStatus());
  		this.event = bean.getEvent() == null ? null : bean.getEvent().buildVo();
  	}
  	public void populate(ims.vo.ValueObjectBeanMap map, ims.scheduling.vo.beans.ProfileActivityEventVoBean bean)
  	{
  		this.id = bean.getId();
  		this.version = bean.getVersion();
  		this.activity = bean.getActivity() == null ? null : bean.getActivity().buildVo(map);
  		this.appointmentstatus = bean.getAppointmentStatus() == null ? null : ims.scheduling.vo.lookups.Status_Reason.buildLookup(bean.getAppointmentStatus());
  		this.event = bean.getEvent() == null ? null : bean.getEvent().buildVo(map);
  	}
  	public ims.vo.ValueObjectBean getBean()
  	{
  		return this.getBean(new ims.vo.ValueObjectBeanMap());
  	}
  	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
  	{
  		ims.scheduling.vo.beans.ProfileActivityEventVoBean bean = null;
  		if(map != null)
  			bean = (ims.scheduling.vo.beans.ProfileActivityEventVoBean)map.getValueObjectBean(this);
  		if (bean == null)
  		{
  			bean = new ims.scheduling.vo.beans.ProfileActivityEventVoBean();
  			map.addValueObjectBean(this, bean);
  			bean.populate(map, this);
  		}
  		return bean;
  	}
  	public Object getFieldValueByFieldName(String fieldName)
  	{
  		if(fieldName == null)
  			throw new ims.framework.exceptions.CodingRuntimeException("Invalid field name");
  		fieldName = fieldName.toUpperCase();
  		if(fieldName.equals("ACTIVITY"))
  			return getActivity();
  		if(fieldName.equals("APPOINTMENTSTATUS"))
  			return getAppointmentStatus();
  		if(fieldName.equals("EVENT"))
  			return getEvent();
  		return super.getFieldValueByFieldName(fieldName);
  	}
  	public boolean getActivityIsNotNull()
  	{
  		return this.activity != null;
  	}
  	public ims.core.vo.ActivityLiteVo getActivity()
  	{
  		return this.activity;
  	}
  	public void setActivity(ims.core.vo.ActivityLiteVo value)
  	{
  		this.isValidated = false;
  		this.activity = value;
  	}
  	public boolean getAppointmentStatusIsNotNull()
  	{
  		return this.appointmentstatus != null;
  	}
  	public ims.scheduling.vo.lookups.Status_Reason getAppointmentStatus()
  	{
  		return this.appointmentstatus;
  	}
  	public void setAppointmentStatus(ims.scheduling.vo.lookups.Status_Reason value)
  	{
  		this.isValidated = false;
  		this.appointmentstatus = value;
  	}
  	public boolean getEventIsNotNull()
  	{
  		return this.event != null;
  	}
  	public ims.pathways.vo.EventLiteVo getEvent()
  	{
  		return this.event;
  	}
  	public void setEvent(ims.pathways.vo.EventLiteVo value)
  	{
  		this.isValidated = false;
  		this.event = value;
  	}
  	public boolean isValidated()
  	{
  		if(this.isBusy)
  			return true;
  		this.isBusy = true;
  	
  		if(!this.isValidated)
  		{
  			this.isBusy = false;
  			return false;
  		}
  		if(this.activity != null)
  		{
  			if(!this.activity.isValidated())
  			{
  				this.isBusy = false;
  				return false;
  			}
  		}
  		if(this.event != null)
  		{
  			if(!this.event.isValidated())
  			{
  				this.isBusy = false;
  				return false;
  			}
  		}
  		this.isBusy = false;
  		return true;
  	}
  	public String[] validate()
  	{
  		return validate(null);
  	}
  	public String[] validate(String[] existingErrors)
  	{
  		if(this.isBusy)
  			return null;
  		this.isBusy = true;
  	
  		java.util.ArrayList<String> listOfErrors = new java.util.ArrayList<String>();
  		if(existingErrors != null)
  		{
  			for(int x = 0; x < existingErrors.length; x++)
  			{
  				listOfErrors.add(existingErrors[x]);
  			}
  		}
  		if(this.activity == null)
  			listOfErrors.add("Events tab,  Activity field is mandatory");
  		if(this.activity != null)
  		{
  			String[] listOfOtherErrors = this.activity.validate();
  			if(listOfOtherErrors != null)
  			{
  				for(int x = 0; x < listOfOtherErrors.length; x++)
  				{
  					listOfErrors.add(listOfOtherErrors[x]);
  				}
  			}
  		}
  		if(this.appointmentstatus == null)
  			listOfErrors.add("Events tab,  Status field is mandatory");
  		if(this.event == null)
  			listOfErrors.add("Events tab,  Pathway Event field is mandatory");
  		if(this.event != null)
  		{
  			String[] listOfOtherErrors = this.event.validate();
  			if(listOfOtherErrors != null)
  			{
  				for(int x = 0; x < listOfOtherErrors.length; x++)
  				{
  					listOfErrors.add(listOfOtherErrors[x]);
  				}
  			}
  		}
  