Hi, I have to decide my workflow path depending on an attribute type, which is having a list of values, Each value will take a separate workflow after choosing it.
I am tried to execute the below code but some how not succesful.
For Routing Two options succesfully executed, while i am using the values in place of String_value its not working.
Soft Attribute Name = CustomerGroup, Dropdown values are HERO/FORD.
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 == "HERO" )
{
result = "Route1";
}
else
if( string_value == "FORD" )
{
result="Route3";
}
else
result="Route2";
}
catch ( Exception e )
{
e.printStackTrace();
}
},
Below code executed succesfully,
Soft Attribute Name = CustomerGroup, Dropdown values are HERO/FORD.
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 !=null)
{
result = "Route1";
}
else
result="Route2";
}
catch ( Exception e )
{
e.printStackTrace();
}
}
Thanks in advance.