Activity Execution Condition - Target attribute is not value "A" or "B" RRS feed

  • Question

  • Hi

    I have a situation where I need to use OR function on AEC. I have a custon attribute country and I want to execute activity when the country attribute is not country A or country B. I have strugled with this too long so I need to ask help. Below are some scratches which are not workin.

    Not(Eq([//Target/Country], "A" OR "B"))
    Not(Eq([//Target/Country], "A")) OR Not(Eq([//Target/Country], "B"))

    These works but of course dont't give results what I want:

    Eq([//Target/Country], "A")
    Not(Eq([//Target/Country], "A"))

    So I don't want to create x times the same activity with condition Eq([//Target/Country], "x") where x is number of countries. I only need 3 different conditions and those are:

    country = A

    country = B

    county != A or B

    Tuesday, July 18, 2017 10:36 AM

All replies

  • I got it working.

    Not(Or(ConvertToBoolean(Eq([//Target/Country], "A")),ConvertToBoolean(Eq([//Target/Country], "B"))))

    But I am wondering could I add third condition to Or-function like this:

    Not(Or(ConvertToBoolean(Eq([//Target/Country], "A")),ConvertToBoolean(Eq([//Target/Country], "B"),ConvertToBoolean(Eq([//Target/Country], "C")))))

    Tuesday, July 18, 2017 11:00 AM
  • Eq() already returns Boolean result so no need to do ConvertToBoolean() again. Or() accepts only two input parameters, but nothing prevents you from nesting Or conditions.
    Tuesday, July 18, 2017 1:41 PM