/******************************************************************************
 * Product: iDempiere ERP & CRM Smart Business Solution                       *
 * Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved.                *
 * This program is free software, you can redistribute it and/or modify it    *
 * under the terms version 2 of the GNU General Public License as published   *
 * by the Free Software Foundation. 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 General Public License for more details.                       *
 * You should have received a copy of the GNU General Public License along    *
 * with this program, if not, write to the Free Software Foundation, Inc.,    *
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.                     *
 * For the text or an alternative of this public license, you may reach us    *
 * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA        *
 * or via info@compiere.org or http://www.compiere.org/license.html           *
 *****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package org.compiere.model;

import java.math.BigDecimal;
import java.sql.ResultSet;
import java.util.Properties;
import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;

/** Generated Model for AD_WF_EventAudit
 *  @author iDempiere (generated)
 *  @version Release 12 - $Id$ */
@org.adempiere.base.Model(table="AD_WF_EventAudit")
public class X_AD_WF_EventAudit extends PO implements I_AD_WF_EventAudit, I_Persistent
{

	/**
	 *
	 */
	private static final long serialVersionUID = 20241222L;

    /** Standard Constructor */
    public X_AD_WF_EventAudit (Properties ctx, int AD_WF_EventAudit_ID, String trxName)
    {
      super (ctx, AD_WF_EventAudit_ID, trxName);
      /** if (AD_WF_EventAudit_ID == 0)
        {
			setAD_Table_ID (0);
			setAD_WF_EventAudit_ID (0);
			setAD_WF_Node_ID (0);
			setAD_WF_Process_ID (0);
			setAD_WF_Responsible_ID (0);
			setElapsedTimeMS (Env.ZERO);
			setEventType (null);
			setRecord_ID (0);
			setWFState (null);
        } */
    }

    /** Standard Constructor */
    public X_AD_WF_EventAudit (Properties ctx, int AD_WF_EventAudit_ID, String trxName, String ... virtualColumns)
    {
      super (ctx, AD_WF_EventAudit_ID, trxName, virtualColumns);
      /** if (AD_WF_EventAudit_ID == 0)
        {
			setAD_Table_ID (0);
			setAD_WF_EventAudit_ID (0);
			setAD_WF_Node_ID (0);
			setAD_WF_Process_ID (0);
			setAD_WF_Responsible_ID (0);
			setElapsedTimeMS (Env.ZERO);
			setEventType (null);
			setRecord_ID (0);
			setWFState (null);
        } */
    }

    /** Standard Constructor */
    public X_AD_WF_EventAudit (Properties ctx, String AD_WF_EventAudit_UU, String trxName)
    {
      super (ctx, AD_WF_EventAudit_UU, trxName);
      /** if (AD_WF_EventAudit_UU == null)
        {
			setAD_Table_ID (0);
			setAD_WF_EventAudit_ID (0);
			setAD_WF_Node_ID (0);
			setAD_WF_Process_ID (0);
			setAD_WF_Responsible_ID (0);
			setElapsedTimeMS (Env.ZERO);
			setEventType (null);
			setRecord_ID (0);
			setWFState (null);
        } */
    }

    /** Standard Constructor */
    public X_AD_WF_EventAudit (Properties ctx, String AD_WF_EventAudit_UU, String trxName, String ... virtualColumns)
    {
      super (ctx, AD_WF_EventAudit_UU, trxName, virtualColumns);
      /** if (AD_WF_EventAudit_UU == null)
        {
			setAD_Table_ID (0);
			setAD_WF_EventAudit_ID (0);
			setAD_WF_Node_ID (0);
			setAD_WF_Process_ID (0);
			setAD_WF_Responsible_ID (0);
			setElapsedTimeMS (Env.ZERO);
			setEventType (null);
			setRecord_ID (0);
			setWFState (null);
        } */
    }

    /** Load Constructor */
    public X_AD_WF_EventAudit (Properties ctx, ResultSet rs, String trxName)
    {
      super (ctx, rs, trxName);
    }

    /** AccessLevel
      * @return 7 - System - Client - Org
      */
    protected int get_AccessLevel()
    {
      return accessLevel.intValue();
    }

    /** Load Meta Data */
    protected POInfo initPO (Properties ctx)
    {
      POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
      return poi;
    }

    public String toString()
    {
      StringBuilder sb = new StringBuilder ("X_AD_WF_EventAudit[")
        .append(get_ID()).append("]");
      return sb.toString();
    }

	public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException
	{
		return (org.compiere.model.I_AD_Table)MTable.get(getCtx(), org.compiere.model.I_AD_Table.Table_ID)
			.getPO(getAD_Table_ID(), get_TrxName());
	}

	/** Set Table.
		@param AD_Table_ID Database Table information
	*/
	public void setAD_Table_ID (int AD_Table_ID)
	{
		if (AD_Table_ID < 1)
			set_Value (COLUMNNAME_AD_Table_ID, null);
		else
			set_Value (COLUMNNAME_AD_Table_ID, Integer.valueOf(AD_Table_ID));
	}

	/** Get Table.
		@return Database Table information
	  */
	public int getAD_Table_ID()
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_AD_Table_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	public org.compiere.model.I_AD_User getAD_User() throws RuntimeException
	{
		return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_ID)
			.getPO(getAD_User_ID(), get_TrxName());
	}

	/** Set User/Contact.
		@param AD_User_ID User within the system - Internal or Business Partner Contact
	*/
	public void setAD_User_ID (int AD_User_ID)
	{
		if (AD_User_ID < 1)
			set_Value (COLUMNNAME_AD_User_ID, null);
		else
			set_Value (COLUMNNAME_AD_User_ID, Integer.valueOf(AD_User_ID));
	}

	/** Get User/Contact.
		@return User within the system - Internal or Business Partner Contact
	  */
	public int getAD_User_ID()
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_AD_User_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/** Set Workflow Event Audit.
		@param AD_WF_EventAudit_ID Workflow Process Activity Event Audit Information
	*/
	public void setAD_WF_EventAudit_ID (int AD_WF_EventAudit_ID)
	{
		if (AD_WF_EventAudit_ID < 1)
			set_ValueNoCheck (COLUMNNAME_AD_WF_EventAudit_ID, null);
		else
			set_ValueNoCheck (COLUMNNAME_AD_WF_EventAudit_ID, Integer.valueOf(AD_WF_EventAudit_ID));
	}

	/** Get Workflow Event Audit.
		@return Workflow Process Activity Event Audit Information
	  */
	public int getAD_WF_EventAudit_ID()
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_AD_WF_EventAudit_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

    /** Get Record ID/ColumnName
        @return ID/ColumnName pair
      */
    public KeyNamePair getKeyNamePair()
    {
        return new KeyNamePair(get_ID(), String.valueOf(getAD_WF_EventAudit_ID()));
    }

	/** Set AD_WF_EventAudit_UU.
		@param AD_WF_EventAudit_UU AD_WF_EventAudit_UU
	*/
	public void setAD_WF_EventAudit_UU (String AD_WF_EventAudit_UU)
	{
		set_Value (COLUMNNAME_AD_WF_EventAudit_UU, AD_WF_EventAudit_UU);
	}

	/** Get AD_WF_EventAudit_UU.
		@return AD_WF_EventAudit_UU	  */
	public String getAD_WF_EventAudit_UU()
	{
		return (String)get_Value(COLUMNNAME_AD_WF_EventAudit_UU);
	}

	public org.compiere.model.I_AD_WF_Node getAD_WF_Node() throws RuntimeException
	{
		return (org.compiere.model.I_AD_WF_Node)MTable.get(getCtx(), org.compiere.model.I_AD_WF_Node.Table_ID)
			.getPO(getAD_WF_Node_ID(), get_TrxName());
	}

	/** Set Node.
		@param AD_WF_Node_ID Workflow Node (activity), step or process
	*/
	public void setAD_WF_Node_ID (int AD_WF_Node_ID)
	{
		if (AD_WF_Node_ID < 1)
			set_Value (COLUMNNAME_AD_WF_Node_ID, null);
		else
			set_Value (COLUMNNAME_AD_WF_Node_ID, Integer.valueOf(AD_WF_Node_ID));
	}

	/** Get Node.
		@return Workflow Node (activity), step or process
	  */
	public int getAD_WF_Node_ID()
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_AD_WF_Node_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	public org.compiere.model.I_AD_WF_Process getAD_WF_Process() throws RuntimeException
	{
		return (org.compiere.model.I_AD_WF_Process)MTable.get(getCtx(), org.compiere.model.I_AD_WF_Process.Table_ID)
			.getPO(getAD_WF_Process_ID(), get_TrxName());
	}

	/** Set Workflow Process.
		@param AD_WF_Process_ID Actual Workflow Process Instance
	*/
	public void setAD_WF_Process_ID (int AD_WF_Process_ID)
	{
		if (AD_WF_Process_ID < 1)
			set_Value (COLUMNNAME_AD_WF_Process_ID, null);
		else
			set_Value (COLUMNNAME_AD_WF_Process_ID, Integer.valueOf(AD_WF_Process_ID));
	}

	/** Get Workflow Process.
		@return Actual Workflow Process Instance
	  */
	public int getAD_WF_Process_ID()
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_AD_WF_Process_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	public org.compiere.model.I_AD_WF_Responsible getAD_WF_Responsible() throws RuntimeException
	{
		return (org.compiere.model.I_AD_WF_Responsible)MTable.get(getCtx(), org.compiere.model.I_AD_WF_Responsible.Table_ID)
			.getPO(getAD_WF_Responsible_ID(), get_TrxName());
	}

	/** Set Workflow Responsible.
		@param AD_WF_Responsible_ID Responsible for Workflow Execution
	*/
	public void setAD_WF_Responsible_ID (int AD_WF_Responsible_ID)
	{
		if (AD_WF_Responsible_ID < 1)
			set_Value (COLUMNNAME_AD_WF_Responsible_ID, null);
		else
			set_Value (COLUMNNAME_AD_WF_Responsible_ID, Integer.valueOf(AD_WF_Responsible_ID));
	}

	/** Get Workflow Responsible.
		@return Responsible for Workflow Execution
	  */
	public int getAD_WF_Responsible_ID()
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_AD_WF_Responsible_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/** Set Attribute Name.
		@param AttributeName Name of the Attribute
	*/
	public void setAttributeName (String AttributeName)
	{
		set_Value (COLUMNNAME_AttributeName, AttributeName);
	}

	/** Get Attribute Name.
		@return Name of the Attribute
	  */
	public String getAttributeName()
	{
		return (String)get_Value(COLUMNNAME_AttributeName);
	}

	/** Set Description.
		@param Description Optional short description of the record
	*/
	public void setDescription (String Description)
	{
		set_Value (COLUMNNAME_Description, Description);
	}

	/** Get Description.
		@return Optional short description of the record
	  */
	public String getDescription()
	{
		return (String)get_Value(COLUMNNAME_Description);
	}

	/** Set Elapsed Time ms.
		@param ElapsedTimeMS Elapsed Time in milli seconds
	*/
	public void setElapsedTimeMS (BigDecimal ElapsedTimeMS)
	{
		set_Value (COLUMNNAME_ElapsedTimeMS, ElapsedTimeMS);
	}

	/** Get Elapsed Time ms.
		@return Elapsed Time in milli seconds
	  */
	public BigDecimal getElapsedTimeMS()
	{
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ElapsedTimeMS);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	/** EventType AD_Reference_ID=306 */
	public static final int EVENTTYPE_AD_Reference_ID=306;
	/** Process Created = PC */
	public static final String EVENTTYPE_ProcessCreated = "PC";
	/** Process Completed = PX */
	public static final String EVENTTYPE_ProcessCompleted = "PX";
	/** State Changed = SC */
	public static final String EVENTTYPE_StateChanged = "SC";
	/** Set Event Type.
		@param EventType Type of Event
	*/
	public void setEventType (String EventType)
	{

		set_Value (COLUMNNAME_EventType, EventType);
	}

	/** Get Event Type.
		@return Type of Event
	  */
	public String getEventType()
	{
		return (String)get_Value(COLUMNNAME_EventType);
	}

	/** Set New Value.
		@param NewValue New field value
	*/
	public void setNewValue (String NewValue)
	{
		set_Value (COLUMNNAME_NewValue, NewValue);
	}

	/** Get New Value.
		@return New field value
	  */
	public String getNewValue()
	{
		return (String)get_Value(COLUMNNAME_NewValue);
	}

	/** Set Old Value.
		@param OldValue The old file data
	*/
	public void setOldValue (String OldValue)
	{
		set_Value (COLUMNNAME_OldValue, OldValue);
	}

	/** Get Old Value.
		@return The old file data
	  */
	public String getOldValue()
	{
		return (String)get_Value(COLUMNNAME_OldValue);
	}

	/** Set Record ID.
		@param Record_ID Direct internal record ID
	*/
	public void setRecord_ID (int Record_ID)
	{
		if (Record_ID < 0)
			set_Value (COLUMNNAME_Record_ID, null);
		else
			set_Value (COLUMNNAME_Record_ID, Integer.valueOf(Record_ID));
	}

	/** Get Record ID.
		@return Direct internal record ID
	  */
	public int getRecord_ID()
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_Record_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/** Set Text Message.
		@param TextMsg Text Message
	*/
	public void setTextMsg (String TextMsg)
	{
		set_Value (COLUMNNAME_TextMsg, TextMsg);
	}

	/** Get Text Message.
		@return Text Message
	  */
	public String getTextMsg()
	{
		return (String)get_Value(COLUMNNAME_TextMsg);
	}

	/** WFState AD_Reference_ID=305 */
	public static final int WFSTATE_AD_Reference_ID=305;
	/** Aborted = CA */
	public static final String WFSTATE_Aborted = "CA";
	/** Completed = CC */
	public static final String WFSTATE_Completed = "CC";
	/** Terminated = CT */
	public static final String WFSTATE_Terminated = "CT";
	/** Not Started = ON */
	public static final String WFSTATE_NotStarted = "ON";
	/** Running = OR */
	public static final String WFSTATE_Running = "OR";
	/** Suspended = OS */
	public static final String WFSTATE_Suspended = "OS";
	/** Set Workflow State.
		@param WFState State of the execution of the workflow
	*/
	public void setWFState (String WFState)
	{

		set_Value (COLUMNNAME_WFState, WFState);
	}

	/** Get Workflow State.
		@return State of the execution of the workflow
	  */
	public String getWFState()
	{
		return (String)get_Value(COLUMNNAME_WFState);
	}
}