Alisha Posted September 20, 2018 Posted September 20, 2018 Hello, Sometimes when creating captures I accidentally add custom expressions in the wrong order and have to delete them to put them in the right order. Would it be possible to add arrow buttons so that we can easily change the order please? Similar to how we can change the order of form fields (see second image attached). Many thanks, Alisha
Alisha Posted February 12, 2019 Author Posted February 12, 2019 Hello @James Ainsworth @Steven Boardman @Victor, Would it be possible for someone to look at this please? Many thanks, Alisha
James Ainsworth Posted February 13, 2019 Posted February 13, 2019 Hi @Alisha I believe that the development work for this has been completed and it should be available in an upcoming platform update over the next few weeks. Regards, James 1
Alisha Posted April 9, 2019 Author Posted April 9, 2019 Hi @James Ainsworth, Thank you, this has been really helpful. Is there any chance that the arrow buttons could also be made available in the override flag area as well please? Many thanks, Alisha
Victor Posted April 10, 2019 Posted April 10, 2019 @Alisha - one thing you (and anyone building complex expressions) needs to be aware of is boolean operator precedence. In Hornbill (and I think in most IT systems) the AND operator has precedence over the OR operator. I will try and explain what this means with an example where you have 3 criterions in an expression: a = 1 a = 2 b = 3 Let's say your expression looks like this: a = 1 OR a = 2 AND b = 3 Without knowing the operator precedence rule, one might look at this and think that this will match if: a has either of the values of 1 and 2 and in addition of all this, b has a value of 3. However, this is not how the expression is actually evaluated because of the operator precedence, this will be matched: first, a has a value of 2 and also, at the same time b has a value of 3. If not, then secondly the whole expression will also match if a has the value of 1. This can be also explained a bit better by using brackets which help override the default operator precedence. So back to our example: a = 1 OR a = 2 AND b = 3 With no brackets this will execute like this: a = 1 OR (a = 2 AND b = 3) Assuming you want the OR evaluated first then using brackets you can "force" different precedence: (a = 1 OR a = 2) AND b = 3 Expanding on the above, using some information from the screenshot and showing the implications of changing criterion position within expressions. Let's say the expression is: Global Variable -> Service == Service 1 OR Global Variable -> Service == Service 2 AND Global Variable -> Source == Email One might think this expression will produce a positive match in one scenario that Service is either 1 or 2 and in addition to service values, the source is email. Based on the above explanation this will not work like this, instead, this will produce a positive match in the following two scenarios, either of them will produce a positive match: Global Variable -> Service == Service 1 Global Variable -> Service == Service 2 AND Global Variable -> Source == Email To achieve the result you would need from the above, which is to produce a positive match only if the source is email and Service is 1 or 2, you would need to build your expression like this: Global Variable -> Service == Service 1 AND Global Variable -> Source == Email OR Global Variable -> Service == Service 2 AND Global Variable -> Source == Email Going back to the initial expression, let's say you move the "Email" criterion on top: Global Variable -> Source == Email AND Global Variable -> Service == Service 1 OR Global Variable -> Service == Service 2 Again, one might think this expression will produce a positive match in one scenario that the source is email and in addition, service is either 1 or 2. Again, based on the above explanation this will not work like this, instead, this will produce a positive match in the following two scenarios, either of them will produce a positive match: Global Variable -> Source == Email AND Global Variable -> Service == Service 1 Global Variable -> Service == Service 2 You can see now that by moving the "email" criterion on top produced this result: Global Variable -> Source == Email AND Global Variable -> Service == Service 1 Global Variable -> Service == Service 2 as opposed to what result produced when the email criterion was last: Global Variable -> Service == Service 1 Global Variable -> Service == Service 2 AND Global Variable -> Source == Email Therefore one needs to be quite mindful of repositioning the criterions to ensure the expressions produce the result the one needs. I know all this might sound complicated but happy to detail any parts that need clarifying.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now