The problem we’re facing is that if one of the lines throws an error, the PO shouldn’t be approved.
I tried to solve the problem by creating two Process variable to store the error number. The idea is to pass the value of the sub-workflow variable to the master workflow variable and use it to check for errors. If the value is zero, then approve the PO. If it is not zero don’t approve it.
You have to merge it back up, honestly this is a giant pain in the butt… The way I’ve handled this is to create a UD Record where I insert the errors (at the subworkflow level) using the WorkFlowID as the unique identifier.
Then at the end of the workflow you can query that UD record and get the errors.
HOwever if you want to do without that, you could merge them back up. That means your Subworkflow needs to be “merged back” into a Dataset which contains your errors