Try below expression.
if (primaryBusinessObject != null)
{
try
{
com.ptc.core.lwc.server.PersistableAdapter obj = new com.ptc.core.lwc.server.PersistableAdapter(primaryBusinessObject,null, java.util.Locale.US, new com.ptc.core.meta.common.DisplayOperationIdentifier());
obj.load("CustomerGroup");
java.lang.String string_value = (java.lang.String) obj.get("CustomerGroup");
System.out.println("Soft attibute value : " + string_value);
if ( string_value.equals("HERO") )
{
result = "Route1";
}
else
if( string_value.equals("FORD") )
{
result="Route3";
}
else
result="Route2";
}
catch ( Exception e )
{
e.printStackTrace();
}
}