Adempiere 3.5.2a

org.compiere.model
Class MGoal

java.lang.Object
  extended by org.compiere.model.PO
      extended by org.compiere.model.X_PA_Goal
          extended by org.compiere.model.MGoal
All Implemented Interfaces:
Serializable, Comparator, I_PA_Goal, I_Persistent, Evaluatee

public class MGoal
extends X_PA_Goal

Performance Goal

Version:
$Id: MGoal.java,v 1.2 2006/07/30 00:51:03 jjanke Exp $
Author:
Jorg Janke, Teo Sarca, SC ARHIPAC SERVICE SRL
  • BF [ 1887674 ] Deadlock when try to modify PA Goal's Measure Target
  • BF [ 1760482 ] New Dashboard broke old functionality
  • See Also:
    Serialized Form

    Field Summary
     
    Fields inherited from class org.compiere.model.X_PA_Goal
    MEASUREDISPLAY_AD_Reference_ID, MEASUREDISPLAY_Day, MEASUREDISPLAY_Month, MEASUREDISPLAY_Quarter, MEASUREDISPLAY_Total, MEASUREDISPLAY_Week, MEASUREDISPLAY_Year, MEASURESCOPE_AD_Reference_ID, MEASURESCOPE_Day, MEASURESCOPE_Month, MEASURESCOPE_Quarter, MEASURESCOPE_Total, MEASURESCOPE_Week, MEASURESCOPE_Year, PA_GOALPARENT_ID_AD_Reference_ID
     
    Fields inherited from class org.compiere.model.PO
    ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, log, p_ctx, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
     
    Fields inherited from interface org.compiere.model.I_PA_Goal
    accessLevel, COLUMNNAME_AD_Role_ID, COLUMNNAME_AD_User_ID, COLUMNNAME_DateFrom, COLUMNNAME_DateLastRun, COLUMNNAME_DateTo, COLUMNNAME_Description, COLUMNNAME_GoalPerformance, COLUMNNAME_IsSummary, COLUMNNAME_MeasureActual, COLUMNNAME_MeasureDisplay, COLUMNNAME_MeasureScope, COLUMNNAME_MeasureTarget, COLUMNNAME_Name, COLUMNNAME_Note, COLUMNNAME_PA_ColorSchema_ID, COLUMNNAME_PA_Goal_ID, COLUMNNAME_PA_GoalParent_ID, COLUMNNAME_PA_Measure_ID, COLUMNNAME_RelativeWeight, COLUMNNAME_SeqNo, Model, Table_ID, Table_Name
     
    Constructor Summary
    MGoal(Properties ctx, int PA_Goal_ID, String trxName)
              Standard Constructor
    MGoal(Properties ctx, ResultSet rs, String trxName)
              Load Constructor
    MGoal(Properties ctx, String Name, String Description, BigDecimal MeasureTarget, String trxName)
              Base Constructor
     
    Method Summary
    protected  boolean afterSave(boolean newRecord, boolean success)
              After Save
    protected  boolean beforeSave(boolean newRecord)
              Before Save
     Color getColor()
              Get Color
     MColorSchema getColorSchema()
              Get the color schema for this goal.
     double getGoalPerformanceDouble()
              Get Goal Performance as Double
    static MGoal[] getGoals(Properties ctx)
              Get Accessible Goals
     MMeasure getMeasure()
              Get Measure
     String getMeasureDisplay()
              Get Measure Display
    static MGoal[] getMeasureGoals(Properties ctx, int PA_Measure_ID)
              Get Goals with Measure
    static BigDecimal getMultiplier(MGoal goal)
              Get Multiplier from Scope to Display
     int getPercent()
              Get Goal Performance in Percent
     MGoalRestriction[] getRestrictions(boolean reload)
              Get Restriction Lines
    static MGoal[] getTestGoals(Properties ctx)
              Create Test Goals
    static MGoal[] getUserGoals(Properties ctx, int AD_User_ID)
              Get User Goals
     String getXAxisText()
              Get Measure Display Text
     boolean isTarget()
              Goal has Target
     void setGoalPerformance()
              Calculate Performance Goal as multiplier
     void setMeasureActual(BigDecimal MeasureActual)
              Set Measure Actual
     String toString()
              String Representation
     boolean updateGoal(boolean force)
              Update/save Goals for the same measure
     
    Methods inherited from class org.compiere.model.X_PA_Goal
    get_AccessLevel, getAD_Role_ID, getAD_Role, getAD_User_ID, getAD_User, getDateFrom, getDateLastRun, getDateTo, getDescription, getGoalPerformance, getKeyNamePair, getMeasureActual, getMeasureScope, getMeasureTarget, getName, getNote, getPA_ColorSchema_ID, getPA_ColorSchema, getPA_Goal_ID, getPA_GoalParent_ID, getPA_Measure_ID, getPA_Measure, getRelativeWeight, getSeqNo, initPO, isSummary, setAD_Role_ID, setAD_User_ID, setDateFrom, setDateLastRun, setDateTo, setDescription, setGoalPerformance, setIsSummary, setMeasureDisplay, setMeasureScope, setMeasureTarget, setName, setNote, setPA_ColorSchema_ID, setPA_Goal_ID, setPA_GoalParent_ID, setPA_Measure_ID, setRelativeWeight, setSeqNo
     
    Methods inherited from class org.compiere.model.PO
    afterDelete, beforeDelete, compare, copyValues, copyValues, createAttachment, delete_Accounting, delete_Tree, delete, delete, deleteEx, deleteEx, dump, dump, equals, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_HashMap, get_ID, get_IDOld, get_KeyColumns, get_Logger, get_Table_ID, get_TableName, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_new, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, loadComplete, loadDefaults, loadSpecial, lock, save, save, saveEx, saveEx, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_ColumnUpdateable, set_CustomColumn, set_TrxName, set_TrxName, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setDoc, setDocWorkflowMgr, setIsActive, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, unlock
     
    Methods inherited from class java.lang.Object
    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     
    Methods inherited from interface org.compiere.model.I_Persistent
    save
     

    Constructor Detail

    MGoal

    public MGoal(Properties ctx,
                 int PA_Goal_ID,
                 String trxName)
    Standard Constructor

    Parameters:
    ctx - context
    PA_Goal_ID - id
    trxName - trx

    MGoal

    public MGoal(Properties ctx,
                 ResultSet rs,
                 String trxName)
    Load Constructor

    Parameters:
    ctx - context
    rs - result set
    trxName - trx

    MGoal

    public MGoal(Properties ctx,
                 String Name,
                 String Description,
                 BigDecimal MeasureTarget,
                 String trxName)
    Base Constructor

    Parameters:
    ctx - context
    Name - Name
    Description - Decsription
    MeasureTarget - target
    trxName - trx
    Method Detail

    getUserGoals

    public static MGoal[] getUserGoals(Properties ctx,
                                       int AD_User_ID)
    Get User Goals

    Parameters:
    ctx - context
    AD_User_ID - user
    Returns:
    array of goals

    getGoals

    public static MGoal[] getGoals(Properties ctx)
    Get Accessible Goals

    Parameters:
    ctx - context
    Returns:
    array of goals

    getTestGoals

    public static MGoal[] getTestGoals(Properties ctx)
    Create Test Goals

    Parameters:
    ctx - context
    Returns:
    array of goals

    getMeasureGoals

    public static MGoal[] getMeasureGoals(Properties ctx,
                                          int PA_Measure_ID)
    Get Goals with Measure

    Parameters:
    ctx - context
    PA_Measure_ID - measure
    Returns:
    goals

    getMultiplier

    public static BigDecimal getMultiplier(MGoal goal)
    Get Multiplier from Scope to Display

    Parameters:
    goal - goal
    Returns:
    null if error or multiplier

    getRestrictions

    public MGoalRestriction[] getRestrictions(boolean reload)
    Get Restriction Lines

    Parameters:
    reload - reload data
    Returns:
    array of lines

    getMeasure

    public MMeasure getMeasure()
    Get Measure

    Returns:
    measure or null

    updateGoal

    public boolean updateGoal(boolean force)
    Update/save Goals for the same measure

    Parameters:
    force - force to update goal (default once per day)
    Returns:
    true if updated

    setMeasureActual

    public void setMeasureActual(BigDecimal MeasureActual)
    Set Measure Actual

    Specified by:
    setMeasureActual in interface I_PA_Goal
    Overrides:
    setMeasureActual in class X_PA_Goal
    Parameters:
    MeasureActual - actual

    setGoalPerformance

    public void setGoalPerformance()
    Calculate Performance Goal as multiplier


    getGoalPerformanceDouble

    public double getGoalPerformanceDouble()
    Get Goal Performance as Double

    Returns:
    performance as multipier

    getPercent

    public int getPercent()
    Get Goal Performance in Percent

    Returns:
    performance in percent

    getColor

    public Color getColor()
    Get Color

    Returns:
    color - white if no target

    getColorSchema

    public MColorSchema getColorSchema()
    Get the color schema for this goal.

    Returns:
    the color schema, or null if the measure targer is 0

    getMeasureDisplay

    public String getMeasureDisplay()
    Get Measure Display

    Specified by:
    getMeasureDisplay in interface I_PA_Goal
    Overrides:
    getMeasureDisplay in class X_PA_Goal
    Returns:
    Measure Display

    getXAxisText

    public String getXAxisText()
    Get Measure Display Text

    Returns:
    Measure Display Text

    isTarget

    public boolean isTarget()
    Goal has Target

    Returns:
    true if target

    toString

    public String toString()
    String Representation

    Overrides:
    toString in class X_PA_Goal
    Returns:
    info

    beforeSave

    protected boolean beforeSave(boolean newRecord)
    Before Save

    Overrides:
    beforeSave in class PO
    Parameters:
    newRecord - new
    Returns:
    true

    afterSave

    protected boolean afterSave(boolean newRecord,
                                boolean success)
    After Save

    Overrides:
    afterSave in class PO
    Parameters:
    newRecord - new
    success - success
    Returns:
    true

    Adempiere 3.5.2a

    Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.