Class MGoal

  • All Implemented Interfaces:
    Serializable, Cloneable, Comparator<Object>, 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
  • BF [ 1887691 ] I get NPE if the PA Goal's target is 0
  • See Also:
    Serialized Form
    • 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
      • 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
      • getXAxisText

        public String getXAxisText()
        Get Measure Display Text
        Returns:
        Measure Display Text
      • isTarget

        public boolean isTarget()
        Goal has Target
        Returns:
        true if target
      • 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