You are viewing limited content. For full access, please sign in.

Question

Question

Understanding Starting Rule : Does Not Contain Clause

asked on September 24, 2020

Hi Everyone,

I'm having hard times to understand how "does not contain" clause works on a starting rule. I have a multiple value field and what I'm trying to do is if one of the values on the field contains "POA" word, I don't want the workflow to start on it. However, the workflow still starts. I tracked down the file on Subscriber Tracer on WF Admin Console and I can see that the rule condition satisfied despite the value contains POA . (See attached picture) 

Would you help me understand what am I missing here?
Thank you very much!

Does not contain - True.png
1 0

Answer

SELECTED ANSWER
replied on September 29, 2020

Contains/Does not contain conditions do not work well with multi-value fields because they translate to "if any of the values contains/does not contain X", so they always evaluate to true because the values are considered individually.

For ex, say you have a field with values A and B. A "Field contains B" translates to "either A or B is equal to B" and evaluates to true because B=B. "Field does not contain B" translates to "either A or B is not equal to B" and evaluates to true because A<>B.

Matches/Does not match <regular expression> will have the same behavior.

Workflow does not have conditions on (arbitrarily large) sets of values. You could work around it by flattening the multi-value field into a single value before checking if it contains the string you're looking for (so the condition turns into "if none of the values contains".

The activities above boil down to "wait for the field to change, get the current values, build a single string from the values by glue-ing them together with @ and use it to check if we're done. If not, go wait some more and do it again."

Things to note, you want to make sure Repeat is set to check the condition AFTER it executes the loop so you get the field values for a proper condition evaluation.

3 0
replied on September 29, 2020

Thank you for the explanation Miruna it make sense.

0 0

Replies

replied on September 24, 2020 Show version history

I believe the contains and does not contain rules are in regards to multi-value fields. What you would want to do to achieve this rule would resemble something like

 

 

Entry Field [File Waits for]: Does not match regular expression .*POE.*

 

EDIT: Looking at it now, I am realizing that it is a multivalue field. However, I believe it is looking for a direct relation to one of the values. Since the value is not POE, it does not complete the rule. 

0 0
replied on September 25, 2020

Thank you for your answer Brett. With does not contain clause, the value does not need to be the same with the field value. We can use “equal” for that instead of “contain”. If you check the previous condition which I had to obfuscated, but the condition goes like;


[TRUE] Entry Field [NAR Program Setup Completed]: ‘A-Completed’, ‘B-Completed’ <Contains> ‘B’

 

Since the second value of the field satisfies the condition as it contains B, it came back as [TRUE]

 

For some reason, this logic did not work on POA one. Nevertheless, I tried to put the entire value in the clause like you said and that still did not work too.

 

Therefore, I'm not sure how's the logic works of this clause.

0 0
replied on September 29, 2020

Here is a stupid trick that makes no sense to me - but works sometimes. Try inverting the logic:

If all of these conditions are FALSE:

Entry Field [File Waits for]:  <contains> POE

^swap out the entry and token with yours

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.