Method Directive Condition Query

Have any of you had any success when creating a Method Directive Condition based on the results of a query?

It’s the Condition that the number of rows in the Query is more than or equal to 1

Very Simple BPM so Far. A single Condition of a query where I join the dataset on the ERP table JobOper, looking to see if the Job has a special operation ID and if that Operation is completed.

However, when I check the value of OpComplete = 0, I get the following error

Update.Pre.NoShipINC.cs(86,28): error CS0019: Operator ‘==’ cannot be applied to operands of type ‘bool’ and ‘int’

No worries, I then put in False, ‘False’, ‘No’, and it still does not validate upon save; however, when I validate the BPM, it validates fine, but I can not enable it.

I also can not seem to put it in a list, because there is a known bug where if you update one list record in the query in there are two it updates them all.

did you try false instead of 0 ?

Yes, I tried each of these, and they all provide a different error.

“True”

‘True’

1

‘1’,

“1”

“False”

‘False’

0

‘0’

“1”

Just false, small letters no quotes

Instead of using the constant from the drop down, have you tried an expression and then use the false/true flags built in (or just write false/true). I am sure I have done this before and end up using the expression instead of constant in this case.

Thanks, lowercase false is what was needed.

My favorite part of no code is syntax errors!

Happy Feel Good GIF by Rosanna Pansino

The reason for this is that although it looks quite similar to a BAQ which is SQL-based, a BPM query is translated to C# code. So it requires expressions to be compatible with C#. Hence, true/false, and string constants have to be in double quotes.

I understand the WHY but this is annoying, especially since I am fairly certain when you do the validation test it passes but then fails without a terribly helpful error when you try to save it as enabled.

That is exactly what I was seeing: it passed validation but provided no explanation for the actual reason for failure.