Microflow setting an enumeration value to an attribute
In a microflow I want to set an integer value to an attribute based on a value that is chosen in an enumeration. For example in the enumeration the user have to choose between 3 answers. Answer A, B and C. If the user choose answer A another attribute should be set to the value 5, if the user choose answer B the attribute should be set to the value 3, and if they choose answer C the attribute should be set to the value 0. I try to make an activity which change an object, but whatever expression I try, I always get an error. For example: if $Survey/QuestionA = MyFirstModule.QuestionA.1Atleast3Times then $Survey/Question1converted = 0 else $Survey/Question1converted = 5 In this expression I try to say that if the user choose in the attribute QuestionA the enumeration value 1Atleast3Times then the attribute Question1converted should be set to the value 0 if they do not choose this value in the enumeration then the value of the attribute Question1converted should be setted to 5. This expression gives the error: The microflow expression is of type Boolean but should be of type integer/long. I hope that someone can help me with an expression which does not give an error.
When you change a certain member you don't have to add the $Survey/Question1converted part again, it would look something like:
if $Survey/QuestionA = MyFirstModule.QuestionA.1Atleast3Times then 0 else 5
Sebastiaan van den Broek
Create a decision for every enumeration value that you have. Say for example,
If your parameter equals to a MyFirstModule.QuestionA for example set your integer value to a number you want else another decision to a different enum value and so on. So far that's the only way i know how to do it.