Home > Forum > General > How to modify sub-workflow fields

How to modify sub-workflow fields
0

Hi Everyone,

I want to change some field values on a sub-workflow but from a main workflow level.

Example:
I have a main workflow with 3 sub-workflows. When some user choose a path on the main workflow I want to modify some fields in the sub-workflows.
Is there any action to achieve it?

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

Hi Darek,

the action 'Update related workflow instance' with 'Element selection mode' SQL query should do what you want:
https://community.webcon.com/posts/post/the-update-related-workflow-instance-action/81

Best regards,
Daniel

Hi Daniel,

Yes, I saw this article but I still don't know how to configure the action properly.
I wrote a sql 'select' statment and 'test' button shows that the statment is ok but the workflow form gives me an error: 'Exception of type 'WebCon.WorkFlow.Base.BusinessLogic.ElementManagement.Exceptions.DocumentNotExistsException' was thrown.'

Do you have some example how to configure the action?

MVP
In reply to: Marek

Hi Daniel,

Yes, I saw this article but I still don't know how to configure the action properly.
I wrote a sql 'select' statment and 'test' button shows that the statment is ok but the workflow form gives me an error: 'Exception of type 'WebCon.WorkFlow.Base.BusinessLogic.ElementManagement.Exceptions.DocumentNotExistsException' was thrown.'

Do you have some example how to configure the action?

Hi Darek,

I did some simple test and didn't have any issue. I created a process with a field, instantiated a parent workflow with three sub-workflows and updated the field in each sub-workflow with the action.

I attached an image of the configuration and another one before/after executing the action on the parent workflow.

According to the history a save action is executed on the sub-workflows.

So in general it works fine but there's some issue in your case. As I understand the exception one workflow does not exist/is not accessible.
A few ideas what you can look at:
- I'm not sure whether this is relevant but are all returned sub-workflow ids workflows of the selected process (1)
- Did you tick the check box whether the user's privileges are checked (2), I haven't checked which kind of exception is thrown.
- Is there some action defined on the "Upon instance saving" action?

Best regards,
Daniel

Did you know that with WEBCON you can automate virtually any process? Even baking cookies 🍪
 
Speaking of cookies: we use the ones that are essential for our website to function properly, as well as additional ones that help us customize our content to your preferences. If you don’t mind cookies, click Accept. If you want to learn more, explore settings.
Settings