{
VendorInfoState startState = VendorInfoState.START.getState( vendorInfo );
VendorInfoTransitionRule rule = transitionRules.get( startState );
if ( rule == null )
{
throw new IllegalStateException(
"NPANDAY-102-002: Could not find rule for state: State = " + startState.name() );
}
for ( VendorInfoState state = VendorInfoState.START; !state.equals( VendorInfoState.EXIT ); )
{
logger.debug( "NPANDAY-102-003: Apply rule:" + rule );
state = rule.process( vendorInfo );
logger.debug( "NPANDAY-102-004: Vendor info after rule:" + vendorInfo );
rule = transitionRules.get( state );
if ( rule == null && !state.equals( VendorInfoState.EXIT ) )
{
throw new IllegalStateException(
"NPANDAY-102-005: Could not find rule for state: State = " + state.name() );
}
}
}