If condition in XPath

0
I’m trying to assign empty string to Applications based on the condition that Category is hardware. But I’m getting an error. Both Category and Applications are Enumerations and that is why I’m using getCaption().     Thanks Sherlin
asked
1 answers
2

Hi Sherlin,

In a microflow, you can use a change object activity. On the $Ticket/Applications attribute, use something like this if/else statement. 

It's even better to model it out the Mendix way, using a split. Just use $Ticket/Category as input and follow the ‘Hardware’ flow from it.

If getCaption($Ticket/Category) = 'Hardware'
then
module.enum_category.emptystring
else $Ticket/Applications

A couple of tips:

  •  It's often better to use getKey, instead of getCaption. The caption can be changed, the key not.
  • you can compare $ticket/category directly to the enum. (something like this $ticket/category = modulename.enum_category.HARDWARE)
answered