/*
* SABadPropertyCondition
*
* 02/03/2003
*
* COPYRIGHT:
* LICENSED MATERIALS - PROPERTY OF IBM
* "RESTRICTED MATERIALS OF IBM"
* 5724-AEF
* (C) COPYRIGHT IBM CORP. 2002
*
* %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
* supermarket application.
*
*/
public class SABadConditionsImpl extends BadConditionsImpl
{
static String copyright()
{ return com.ibm.retail.si.Copyright.IBM_COPYRIGHT_SHORT; }
/**
* Constructor.
*
*/
public SABadConditionsImpl()
{
super();
}
public Condition[] getBadConditions()
{
Condition andThenConditions[] =
{
new PropertyEqualsCondition(POSDeviceProperties.CATEGORY,
POSDeviceProperties.POS_STATE,
State.getState("CLEAR")),
new PropertyNotEqualsCondition(POSDeviceProperties.CATEGORY,
POSDeviceProperties.ANPROMPT_LINE1,
" "), // Blank line
};
Condition badConditions[] =
{
new AndThenCondition(andThenConditions),
new PropertyContainsAtIndexCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.ANPROMPT_LINE1, "B013", 0),
new PropertyContainsAtIndexCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.ANPROMPT_LINE1, "B049", 0),
new PropertyContainsAtIndexCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.ANPROMPT_LINE1, "B003", 0)
};
return badConditions;
}
public Condition[] getExtendedBadConditions()
{
String desc = null;
desc = DescriptorsImpl.getInstance().getDescriptor("BASE_DESC", 56); // "PROCESSING REQUEST PLEASE WAIT"
if (desc != null)
{
desc = desc.substring(0,20);
}
else
{
desc = "";
}
Condition andConditions[] =
{
new PropertyEqualsCondition(POSDeviceProperties.CATEGORY,
POSDeviceProperties.POS_STATE,
State.getState("CLEAR")),
new PropertyNotEqualsCondition(POSDeviceProperties.CATEGORY,
POSDeviceProperties.ANPROMPT_LINE1,
desc),
new PropertyNotContainsAtIndexCondition(POSDeviceProperties.CATEGORY,
POSDeviceProperties.ANPROMPT_LINE1,
"B531",
0), // B531 APPROVED
new PropertyNotEqualsCondition(POSDeviceProperties.CATEGORY,
POSDeviceProperties.ANPROMPT_LINE1,
" "), // Blank line
new PropertyNotEqualsCondition(POSDeviceProperties.CATEGORY,
POSDeviceProperties.POS_SUB_STATE,
Substate.getSubstate("CHANGE_OR_BAL_DUE")),
new PropertyNotEqualsCondition(POSDeviceProperties.CATEGORY,
POSDeviceProperties.POS_SUB_STATE,
Substate.getSubstate("WAITING_ON_HOST_RESPONSE")),
new PropertyNotEqualsCondition(POSDeviceProperties.CATEGORY,
POSDeviceProperties.POS_SUB_STATE,
Substate.getSubstate("VALID_ACCOUNT_ENTERED")),
new PropertyNotEqualsCondition(POSDeviceProperties.CATEGORY,
POSDeviceProperties.POS_SUB_STATE,
"30031"),
};
Condition andConditions2[] =
{
new PropertyEqualsCondition(POSDeviceProperties.CATEGORY,
POSDeviceProperties.POS_STATE,
State.getState("ENTER_CLEAR")),
new PropertyEqualsCondition(POSDeviceProperties.CATEGORY,
POSDeviceProperties.POS_SUB_STATE,
Substate.getSubstate("PROMPT_FOR_DUPLICATE_RECEIPT")),
};
Condition badConditions[] =
{
new AndCondition(andConditions),
new AndCondition(andConditions2),
new PropertyContainsAtIndexCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.ANPROMPT_LINE1, "B013", 0),
new PropertyContainsAtIndexCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.ANPROMPT_LINE1, "B049", 0),
new PropertyContainsAtIndexCondition(POSDeviceProperties.CATEGORY, POSDeviceProperties.ANPROMPT_LINE1, "B003", 0)
};
return badConditions;
}
}