I made a small generic java action for this for any enum because javaparameters does not support anyEnum.
📁 download here: https://app.box.com/s/15rexi1r0kjzefc0f29qefvzxkdulm1x
You need to provide a dummy entity with the enum as attribute to parse. It returns false if it cannot find the enum value.
//zoek attribuut in object op basis van enum name:
if ( EnumObject.getMember(this.getContext(), this.EnumName ) != null ) {
//gevraagde enum bestaat in het aangeleverde object nu opzoeken in metamodel
for( IMetaPrimitive metaPrimitive : EnumObject.getMetaObject().getMetaPrimitives() )
{
//zoeken op basis van naam en type
if( metaPrimitive.getType() == PrimitiveType.Enum && metaPrimitive.getName().equals(this.EnumName) )
{
//haal alle waarden van de enum op
for( IMetaEnumValue metaEnumValue : metaPrimitive.getEnumValues() )
{
//als de waarde overeenkomt met je string die je wilt parsen vul dan het aangeleverde object met juiste waarde
if ( metaEnumValue.getIdentifier().equals(StringToParse) )
{
EnumObject.setValue(this.context(), EnumName, metaEnumValue.getIdentifier() );
return true;
}
}
}
}
}
return false;
You can call a sub microflow where you check your string against the caption:
getCaption(ModuleName.EnumerationName.Value) = $YourString
Use a series of exclusive splits checking against each value until you find it, once you find it return the enumeration value and set it in your object.