Home > Forum > Processes > How to relate Subworkflow which is Parallel and not Child

How to relate Subworkflow which is Parallel and not Child
0

Hello all,


First of all I would like to thank you for taking time reading my post!

I'm working on a current process where I need to trigger many subworkflows to request information for the main one. Because the main one will keep being edited after the subworkflows are launched, I've decided to set them as parallel. They will be started through a item list and after one person for the task is selected in that item list.

This is bringing me many issues and challenges.

First of all, I need to use 2 actions in the subworkfows to fill in 2 different Item List but my query is not bringing anything because I only get examples for the cases where we have parent and child

select
{DCNCOL:466} as {DCNCOL:462},
{DCNCOL:467} as {DCNCOL:463},
{DCNCOL:468} as {DCNCOL:464},
{DCNCOL:469} as {DCNCOL:465}

from WFElements
join WFElementDetails
on WFD_ID=DET_WFDID
where DET_WFDID = {WFCONCOL:3295} (form field in the subworkflow where I save the ID from the parent)
and DET_WFCONID ={WFCON:3192}


Second issue is that, even trying to save the ID from each subworkflow in the item list

select ​​{WFCONCOL:3301} as DET_ID, WFD_ID as {DCNCOL:493} (column in the item list)
from wfelements
where {WFCONCOL:3295} = {WFD_ID} (form field saving the Parent ID)
and WFD_Dtypeid = {DT:120}
and isnull({WFCONCOL:3301}, '') <> ''



Third issue is that, if the parent gets cancelled, I need to move all the subworkflow for the Cancel step. For this I was trying to use the action Move Workflow but in the Data tab, probably something is not correct as I'm using
select {WFCONCOL:3295} as WFD_ID (parent ID in the parallel workflow)


I thought about changing to Child instead of Parallel but I'm not sure if it would fix my issues.

Does anyone faced something similar'
Thank you!

MVP

Hi Andreia,

Let me summarize what you are doing:
You have an item list from which workflows will be started.
Each created workflow stores the item list row id in the field "DET_ID" (WFCONCOL:3301" and the id of the parent workflow in field "Parent ID" {WFCONCOL:3295}
The second statement should store the created workflow ID in the item list. As far as I can tell it looks fine.

Did you check whether the correct values are stored in the correct fields? That's my only guess here.

I'm not sure what the first statement should do. As far as I understand it, it copies data from one column to another of the same row or maybe from one item list in the workflow to another. In the later case though I wonder to which row it should be copied. Why are you using the DB column of the Partner Id?

The move workflow action should work just fine with a fixed path id, at least if you can make sure, that the subworkflows are in the same step. :)

Changing from parallel to child won't help you. The main difference for your problems would be that you would query another Column. :)


Best regards.
Daniel

In reply to: Daniel Krüger (Cosmo Consult)

Hi Andreia,

Let me summarize what you are doing:
You have an item list from which workflows will be started.
Each created workflow stores the item list row id in the field "DET_ID" (WFCONCOL:3301" and the id of the parent workflow in field "Parent ID" {WFCONCOL:3295}
The second statement should store the created workflow ID in the item list. As far as I can tell it looks fine.

Did you check whether the correct values are stored in the correct fields? That's my only guess here.

I'm not sure what the first statement should do. As far as I understand it, it copies data from one column to another of the same row or maybe from one item list in the workflow to another. In the later case though I wonder to which row it should be copied. Why are you using the DB column of the Partner Id?

The move workflow action should work just fine with a fixed path id, at least if you can make sure, that the subworkflows are in the same step. :)

Changing from parallel to child won't help you. The main difference for your problems would be that you would query another Column. :)


Best regards.
Daniel

Hi Daniel,

Well! I gave up and changed everything for Child behavior. That fixed a lot of my problems however I still have two because normally you update the parent with the Child Information but I want to do the other way around.

Did you ever tried to Move the Child for another step from the Parent one?

What I want to accomplish is, if the parent gets cancelled, all the child's get cancelled and updated with the cancellation notes but in the Move workflow I'm having some issues. In the parent I save the Instance ID from each child in the item list column.
I've tried using that field, copying those columns for another field and using it (technical field) but I'm not able to do this.

Another thing is, I need to update 2 item list in the parent once the child get's completed.
I was trying to use a business rule for the action execution condition but again, not working! lol

My Business rule looks like this:
if exists (
select 1 from WFElementDetails
where DET_WFDID={DCNCOL:493} and WFD_STPID = {BRP:27}
)
select 1 else
select 0

The idea is to insert the step Completed on the child side and the ID that I saved in the item list on the parent.

Not sure if you have any ideas for this. Probably I will have to ask on the support.

Thank you!

MVP
In reply to: Andreia Correia

Hi Daniel,

Well! I gave up and changed everything for Child behavior. That fixed a lot of my problems however I still have two because normally you update the parent with the Child Information but I want to do the other way around.

Did you ever tried to Move the Child for another step from the Parent one?

What I want to accomplish is, if the parent gets cancelled, all the child's get cancelled and updated with the cancellation notes but in the Move workflow I'm having some issues. In the parent I save the Instance ID from each child in the item list column.
I've tried using that field, copying those columns for another field and using it (technical field) but I'm not able to do this.

Another thing is, I need to update 2 item list in the parent once the child get's completed.
I was trying to use a business rule for the action execution condition but again, not working! lol

My Business rule looks like this:
if exists (
select 1 from WFElementDetails
where DET_WFDID={DCNCOL:493} and WFD_STPID = {BRP:27}
)
select 1 else
select 0

The idea is to insert the step Completed on the child side and the ID that I saved in the item list on the parent.

Not sure if you have any ideas for this. Probably I will have to ask on the support.

Thank you!

Hi Andreia,

Here are my two queries for the move workflow action

Moving multiple workflows which may be in different steps:
The case checks in which step the workflow is and selects the appropriate path for this step.
select
WFD_ID,
case WFD_STPID
when {ST:382} then {PH:576}
when {ST:383} then {PH:578}
end as PATH_ID
from WFElements
where WFD_WFDID = {WFD_ID}
and WFD_ISFinish = 0

Moving the parent workflow with a fixed path:
select {1677} as WFD_ID
I just noticed, that you are referring to a database column instead of using the value from the current workflow instance itself. Maybe this is a general problem with your SQL statements? When you want to use values from the current workflow instance you should simply use the Values tab instead of the Objects tab to reference database columns. In most cases you only need to do this, when you want to access data from another workflow. Ok, sometimes this is true for item lists to, but it depends on the context. :)

Moving multiple workflows which may be in different steps


Why are you using an execution condition?
Is the parent workflow waiting for the completion of the sub workflow?
In this case the path transition will only be triggered if every sub workflow is finished/ the condition to continue is matched. It won't be triggered when only a single sub workflow is finished. This is probably the case, why you want to move the parent workflow, so that it gets triggered.

Best regards,
Daniel