MIMWAL Boolean Comparison: Did I do it wrong?

So I had to do some complex workflows for a client. And you know MIMWAL is best for that.

Now I was going to use the Eq() built in function to do a comparison to see if the attribute is coming back is true. The attribute I was comparing to was a boolean. So in the workflow I used an update resource type and had an activity execution condition that if the attribute is true then run the update. 

Naturally I tried this to being with

Eq([//Target/BooleanAttr],true)

Umm, didn’t work. Should have matched and executed the WF. Tried various other ways

Eq([//Target/BooleanAttr],True)
Eq([//Target/BooleanAttr],"true")
Eq([//Target/BooleanAttr],"True")
Eq([//Target/BooleanAttr],$true)
Eq([//Target/BooleanAttr],1)

On doing some debugging I saw that WAL was doing a string comparison to a Int64 type and coming back as a False match even on a (‘True’,’True’) condition.

Then tried something different

Eq([//Target/BooleanAttr],ConvertToBoolean(1))

Voila!! That worked. Well I don’t know if I did something or if this is the only way to do a boolean comparison in the Eq() function but hey it worked for me.. 

Mental note!!!

Edit: So as per comment below did some more testing and the following execution condition code worked ๐Ÿ™‚ even with false value it looked for true.ย 

ConvertToBoolean([//Target/BooleanAttr])

See.. I told you I did something wrong ๐Ÿ™‚ย 

2 thoughts on “MIMWAL Boolean Comparison: Did I do it wrong?”

  1. I think it is not necessary to use EQ()
    Just use the boolean Attribute.

    Like so:
    Executioncondition = //Target/BooleanAttr

    Reply
    • Thanks Martin. Doesn’t work just like that. You will get the error message

      “The activity execution condition must be a boolean function. Consider wrapping your current condition inside a ConvertToBoolean() function.”

      But then the following works

      ConvertToBoolean([//Target/BooleanAttr])

      Even with a false or null value it looks for true so all good ๐Ÿ™‚

      Thanks

      Reply

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.