In reply to: Andreia Correia
Hi Daniel,
Thank you for your suggestion, I will try to do it.
Yesterday I've made a test using the query
Select WFD_ID, PATH_ID from WFElements
join WFAvaiblePaths on WFD_STPID = PATH_STPID
join WFSteps on WFD_STPID = STP_ID
where PATH_Name in ( 'Complete', 'Submit Estimation') --Replace your's path name here
and WFD_DTYPEID in ({DT:120}) --Replace your's form types variables
and I got the error: Document is in incorrect step. Attempt of passing through forbidden path with id 1933 to step with id 1008.
But path and step are correct.
I'm going to change the query for the previous version with your suggestion and try again.
Do you think it might be because some of sub workflows might be closed already?
Thank you for your kind help!
Hi Andreia,
the query looks fine to me, although I don't see a reason for join WFSteps on WFD_STPID = STP_ID as it's not used. What's missing though is your where condition with the WFD_WFDID = INSTANCEID
Currently you would move all workflow instances with this form type regardless of their parent workflow.
Select WFD_ID, PATH_ID from WFElements
join WFAvaiblePaths on WFD_STPID = PATH_STPID
--join WFSteps on WFD_STPID = STP_ID
where PATH_Name in ( 'Complete', 'Submit Estimation') --Replace your's path name here
and WFD_DTYPEID in ({DT:120}) --Replace your's form types variables
I now remember, that I used something similar in the past and it did work out. There also shouldn't be a problem with any closed subworkflows. After all their ids won't come up, if they don't have such a path.
Can you check for which workflow instance, the path should have been executed?
One other thing you can check is, whether there is any availability restriction on the path. If this would hide the path with this from the user, you won't be able to use the path in a move action either.
Best regards,
Daniel