Home > Forum > Actions > Using dictionary process data in action “start a subworkflow (SQL)”

Using dictionary process data in action “start a subworkflow (SQL)”
0

Hello community,

I am building application with one Dictionary process, and one standard process with 2 workflows.

I would like to start second workflow many times as subworkflow of fist workflow and assign it to the several users/users groups (one per subworkflow) selected from Dictionary process. I am trying to use action “start a subworkflow (SQL)”. My understanding is that “start a subworkflow (SQL)” action (configuration of Data settings – Query returning data) works as follows: SELECT ‘value’ AS object of subworkflow (Database field Name) etc.

• How to write SQL query / where to get ‘value’ from Dictionary process?
• How to set up Step edit/Task creation/Tasks assignment to use this ‘value’ to assignment subworkflows (each subworkflow to other user/users group)?

Any ideas?

MVP

Hi,

You should create a query that will generate as many items as you want to get subworkflows.
In addition, you can return users or groups in one of the columns of the query and transfer this data to the attribute in the registered flow, then set the action of assigning the task to this attribute there.

if the dictionary values come specifically from 1 element, you can use the dictionary's guid to fetch the values

select * from wfelements where WFD_Guid = 'b94a269e-b683-4ce8-be3b-fcf2f0ad2792' (guid of your dictionary. provided dictionaries are migrated between environments, you are sure that guid refers to the same element)

if the data comes from multiple dictionary cards use the id of the form type to get the values from the dictionary
e.g. select * from wfelements where WFD_dtypeid = 1597

use a CROSS JOIN query to create multiple items

Regards

In reply to: Raluca-Mirabela Lupu

Hi,
Could you provide more details about the processes and dictionary?
Is there any connection between the first flow and the dictionary?
In order to retrieve only the necessary information for each instance from the dictionary, you will need to add some conditions to extract what is required.

Thank,
Raluca

Karel, Raluca

Thank you for you hints. While trying to provide more details / describe more clearly the problem, I did some progress and SQL query is returning column with users. Unfortunately I still missing something, as I have error behavior. I hope picture is explanatory enough. Regards, Ondrej

MVP
In reply to: Ondrej

Karel, Raluca

Thank you for you hints. While trying to provide more details / describe more clearly the problem, I did some progress and SQL query is returning column with users. Unfortunately I still missing something, as I have error behavior. I hope picture is explanatory enough. Regards, Ondrej

Hi Ondrej,



Thanks for the details. I will also need you to do some tests.
Firstly, you should change the SQL condition/filter and replace the "Write User or Group Nr. to be selected from DIC" from OBJECT to the VALUE tab (the equality only needs the current value).
Copy-paste the new SQL and test it. Best to do it in a business rule or an action like "Change value of single field". If you have a saved instance then you can also test it in the expression editor.
After confirming that it works and returns the desired values, use it in the "Start subworkflow" action and test it again.
Will come with other suggestions after.


Regards,
Raluca