WELCOME TO THE COMMUNITY
find what you are looking for or ask a new question
Home > Forum > Latest posts > Tips&Tricks

Tips&Tricks

MVP

Hi Andreia,
could you specify a little bit more on how does the process look like?

Do we have multiple forms/workflows, what is currently in the report?
Maybe you could prepare some table/spreadsheet/screenshot of what you want to achieve?

Right now i'm seeing 3 columns there:
Signature, Status, KPI

Should the KPI be calculated like this?
(amount of instances(in process/workflow/doctype?) where DATEDIFF(day,WFD_AttDateTime3,getdate()) = 0) / (amount of all instances (in process/workflow/doctype?))
(amount of instances(in process/workflow/doctype?) where DATEDIFF(day,WFD_AttDateTime3,getdate()) < 0) / (amount of all instances (in process/workflow/doctype?))

Hello,

I need to set up two columns to calculate some KPIs for a report.
The first one will show the status based on Case statement and date difference:


(select
case when DATEDIFF(day,WFD_AttDateTime3,getdate()) >0 then 0
when DATEDIFF(day,WFD_AttDateTime3,getdate()) = 0 then 1
else 2
end)


The second column should pick the number of instances that have the conditions
DATEDIFF(day,WFD_AttDateTime3,getdate()) = 0
DATEDIFF(day,WFD_AttDateTime3,getdate()) < 0

and then divide by the number of total instances by month.
Since this is kind of dynamic, I think that putting this calculation on the report side would be best, but I don't know how to configure the second condition.

Any thoughts?
Thank you! :)

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

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.