We have a main workflow and around 20 child workflows. The main workflow has a switch control and based on a certain evaluation, one of the child workflow is called.
Each of these child workflow returns a workflow status
Due to this, the list has got 20 columns added to it to show the status of each workflows.
Is there a way we can have the main workflow capture the workflow status of the child workflows and display it against the workflow status of the main?
Solved! Go to Solution.
As long as the result name is the same you can set the workflow status by inserting a "set workflow status" operation and set it based on the result of the workflow using a set condition or a state machine if you have a lot of possibilities (just set the state to whatever the outcome should read). If its a dynamically changing value though, I don't think that's possible, not without a huge amount of work. May not actually be viable. You'd also have to set each of those possible outcomes.
I'd actually like to know if there is a away to do this. I have a set of workflows that run for various corporate divisions and since they're all named exactly the same its hard to know which workflow is running for each division. I was thinking I could do something like this and put a workflow status that had the name of the division in it so I'd know which was which, but it was such a huge list of possible divisions plus others could be added later and there was no way to account for that, so i skipped out on it and just put the status in the log on start.
Edit: Actually I just thought of a possible simpler way for you...
If you want it in the list as a column, you can just create a custom column, hide all the others and just update the item's column based on the result. Then it would show in the list. The only down side would be there wouldn't be a direct link to the workflow, but you could just leave the 'completed' in there after the column and the user could click that.
If all you want to do is reflect the statuses of the child workflows within the "Master" list, I would pass through the List Id from the master to the child workflows and subsequently use an update item action at the appropriate points where you have the "set Workflow status" actions, defining the Master list as the target and where the List item id equals that which you have passed through from the master workflow.
There are a couple of ways in which you can pass the item id through to the child workflows. You can utilise the Store and retrieve data actions or the AssociatedData method.
I went with the 'simpler way' you mentioned above and it served the purpose.
I created a new column in the list, replaced all my 'Set Workflows Status' with 'Update Item' in the child workflows and this looks good for now.