Home > Forum > General > Subworkflows settings > Advanced settings bug?

Subworkflows settings > Advanced settings bug?
0

MVP

Hi everyone! After upgrading to version 2025 we noticed that the Advanced settings are not working in the same way as they were in the previous versions. The query that was working just fine before is not doing its work. Does anyone else have the same experience?

If this helps, this is the query that we're using:

IF
(
/* Number of all child workflows */
SELECT
COUNT(*)
FROM WFElements
WHERE WFD_WFDID = {WFD_ID}
AND WFD_DTYPEID = {DT:494}
) = (
/* Number of positively finished subworkflows */
SELECT
COUNT(*)
FROM WFElements
WHERE WFD_WFDID = {WFD_ID}
AND WFD_DTYPEID = {DT:494}
AND WFD_StatusId = {WSTSPOSFINISHED}
)
BEGIN
SELECT {PH:2449}
END

Interesting. We're currently reviewing the 2025 version, but we haven’t encountered this bug before. Could you possibly break down the issue into smaller steps?

At the end, you mentioned using the path with ID 2249, so I assume that’s a SQL command for the workflow control step. Maybe you could try comparing two rules to determine the correct path in the control step based on business rules?

Rule: Number of all child workflows
Rule: Positively finished subworkflows
Result: Choose either path one or path two.

I realize this may involve more work, but I believe it will simplify identifying the source of the problem in the incorrect workflow activity.

MVP
In reply to: Cezary Rzucidło

Interesting. We're currently reviewing the 2025 version, but we haven’t encountered this bug before. Could you possibly break down the issue into smaller steps?

At the end, you mentioned using the path with ID 2249, so I assume that’s a SQL command for the workflow control step. Maybe you could try comparing two rules to determine the correct path in the control step based on business rules?

Rule: Number of all child workflows
Rule: Positively finished subworkflows
Result: Choose either path one or path two.

I realize this may involve more work, but I believe it will simplify identifying the source of the problem in the incorrect workflow activity.

Using the SQL tracer, we identified the root of the issue. The queries within the IF statement are returning incorrect results. Specifically, the following query:

SELECT
COUNT(*)
FROM WFElements
WHERE WFD_WFDID = {WFD_ID}
AND WFD_DTYPEID = {DT:494}

returns 0 (zero), even when it shouldn’t. The same behavior is observed with the other query. This issue persists regardless of whether the queries are executed directly in the advanced settings window or invoked via a business rule. Interestingly, the same business rule works as expected when we log its value during a path transition.

MVP

We identified the issue.

In the sample process we added a business rule to log the return value as well as the executed statement. The business rule is a part of the SQL statement.

Screenshot:
1) Is the advanced condition
2) Is the business rule

If you take a really close look, you will notice, that the variabel {WFD_ID} of the advanced condition is resolved to the one of the child instance (32381), which was completed. While the business rule uses the actual instance id 32380.

This means, that we can't work around this as the advanced setting is executed in the context of the subworkflow which is completing

MVP
In reply to: Michal Rykiert

Hello gentlemen, thanks for pointing out the issue. We're already working on a fix and it should be introduced to the product fairly soon :)

Thanks for the feedback. We are eagerly waiting for it. :)

In the mean time we are running a thorough test in two of our applications. Besides this we are only fixing some of our custom UI changes. :)