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
1 |
Eq([//Target/BooleanAttr],true) |
Umm, didn’t work. Should have matched and executed the WF. Tried various other ways
1 2 3 4 5 |
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
1 |
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.Â
1 |
ConvertToBoolean([//Target/BooleanAttr]) |
See.. I told you I did something wrong 🙂Â