Home > Forum > Tips&Tricks > Check status/step of subworkflows

Check status/step of subworkflows
0

Hello everyone, I am new to Webcon so it might be a dumb question.
Anyway, I am trying to create an App where one Department starts one Workflow that creates subworkflows for several other departments. The main Workflow should be able to see the current status/step of every subworkflow.
But with what I did, I am getting 2 Errors
[Form] "Failed with an unknown exception Fehler-ID: d1a18cc6-c67d-43bb-b883-66e3584445e9"
[] "during saga execution: Failed with an unknown exception".
See the attachment for a picture of that.

How I tried to realise this scenario:
On the only path from the Start button i have an automation that starts a subworkflow and then saves the subworkflow ID to a technical field. (Or at least I think that it should do that, see attachments).
Then in the mainform Workflow I have a step that is waiting for the Subworkflow and there a Tab that should get the status.
For that I created a Data table and put the technical field as the filter.
And when I test this I get a huge error message from the Query test.

With that I think that I am either doing something increadibly wrong, or it will be a simple thing like a checkbox I am missing. Which of the 2 is it and how do I fix this?

Thanks in advance.

MVP

Hi Artur
I'll start with the Error - it's caused due to wrong filter on the HR View.

Those filters are translated by WEBCON to SQL queries, you can look how the query looks like for example with using diagnostics*, but for now it's not required.
With that in mind we can compare it to what happens under the hood, the query looks something like this (it's very rough, there is much more, but that is the part which we have to focus on):
SELECT * FROM V_WFElements WHERE {QM_Parent_ID}
It's missing an equality operator, it should be more like this:
SELECT * FROM V_WFElements WHERE {QM_Parent_ID} = {WFD_ID}

So you should make some kind of a comparsion when filtering, and you most certainly want to compare value from form attribute QM Parent ID with Data Source Columns (attachment) - ID should be what you are looking for.

At this moment you are copying subworkflow ID into a field on parent workflow - this works fine, when you are sure that there will be only one subworfklow - creating new subworkflows will override this value.
If there is a possibility that more subworkflows of same type will be created, then I'd suggest creating a field on subworkflow, which will contain ID of parent - this way, you can also handle one to many relations.

This is also something that webcon does when you set start mode as 'subworkflow of current instance', it saves the ID of parent into WFD_WFDID column of child element - available as 'Instance ID from parent workflow' in Values tab of business rules/filters etc. From what i know this is required to make step Wait for subworkflows work - you can't achieve it with custom relations.
Sometimes you might want to have your own relation though, for ease of use.

*https://community.webcon.com/posts/post/diagnostics-and-form-behavior-registration-mechanism/215/40