/* * GSABadPropertyCondition * * 06/04/2003 * * COPYRIGHT: * LICENSED MATERIALS - PROPERTY OF IBM * "RESTRICTED MATERIALS OF IBM" * 5724-AEF * (C) COPYRIGHT IBM CORP. 2003 * * %W% %E% */ package com.ibm.retail.AEF.util; import com.ibm.retail.AEF.automation.*; import com.ibm.retail.si.Copyright; import com.ibm.retail.AEF.data.*; /** * This class will hold the conditions which are considered errors in the * General Sales application. * */ public class GSABadConditionsImpl extends BadConditionsImpl { static String copyright() { return com.ibm.retail.si.Copyright.IBM_COPYRIGHT_SHORT; } /** * Constructor. * */ public GSABadConditionsImpl() { super(); } /** * Creates a set of conditions that are considered to be bad * conditions in the General Sales application. * * @return Condition[] an array of bad conditions. */ public Condition[] getBadConditions() { Condition clearConditions[] = { new PropertyEqualsCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.POS_STATE, State.getState("CLEAR")), new PropertyNotContainsAtIndexCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.ANPROMPT_LINE1, " ", 0) }; Condition badConditions[] = { new AndCondition(clearConditions), new PropertyEqualsCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.POS_STATE, State.getState("CREDIT_AUTHORIZATION")), new PropertyEqualsCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.POS_STATE, State.getState("ENT-CLR")), new PropertyEqualsCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.POS_STATE, State.getState("CPVERSIG")), new PropertyEqualsCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.POS_STATE, State.getState("ACCT_REQUIRED")), new PropertyEqualsCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.POS_STATE, State.getState("ENTER_QTY_AMOUNT")), new PropertyEqualsCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.POS_STATE, State.getState("QUANTITY_REQUIRED")), new PropertyEqualsCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.POS_STATE, State.getState("ORIGINAL_SALESPERSON")), new PropertyEqualsCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.POS_STATE, State.getState("PRICE_REQUIRED")) }; return badConditions; } /** * Creates a set of conditions that are considered to be bad * conditions in the General Sales application plus any conditions passed in. * * @param extraConditions An array of Conditions to be added to the standard set of conditions * returned by this method. * @return Condition[] an array of normal conditions. */ public Condition[] getBadConditions(Condition extraConditions[]) { Condition conditions[] = getBadConditions(); Condition compositeConditions[] = null; if (extraConditions != null) { int extraSize = extraConditions.length; int conditionsSize = conditions.length; compositeConditions = new Condition[extraSize + conditionsSize]; int i = 0; for (; i < extraSize; i++) { compositeConditions[i] = extraConditions[i]; } for (int j = 0; j < conditionsSize; j++, i++) { compositeConditions[i] = conditions[j]; } return compositeConditions; } else { return conditions; } } /** * Creates an extended set of conditions that are considered to be bad * conditions in the General Sales application. * * @return Condition[] an array of bad conditions. */ public Condition[] getExtendedBadConditions() { return(getBadConditions()); } }