Hi, i'm trying to modify one of our existing workflows and i'm hoping for a bit of assistance. We have a multi-step invoice approval process in which a series of users approve invoices which route from folder to folder dependent on various conditions being met. The accounts team has asked to add a 'check amounts' feature which sums the GL code amounts that have been assigned and compares them to the invoice total. If the 2 amounts don't match, the invoice does not carry on until they are corrected. I've got the GL sum portion complete, and I've set up a conditional decision where if the amounts match, the invoice moves forward as it should, but if the amounts don't match, a stamp is applied as a warning; the accounts approval field is changed from Approved back to Pending, and then I added a Wait for Entry Change, with the conditions being that the sum of the GLs match the Invoice Amount, and the Accounts Approval Field is set to Approved. The stamp applies as it should when the amounts don't match and the Business Process stops - but when I correct the amounts so that they now equal each other and change the Accounts Approval field from Pending to Approved, the business process does not start up again. What am I missing here? Thanks!
Question
Question
Wait condition are met, but the workflow is not restarting
Replies
Hi Althea,
Your problem appears to be that you're not working with refreshed data in that you're not running another check of the invoice amount against your Sum of GL Amount token after the change has been made. One approach to this that might help would be to put the Wait activity into a Repeat loop. As below, the Wait is based solely on the "Accounts Review" field being changed from Pending to Approved. The Repeat Condition is set to check whether the Invoice Amount still doesn't equal the Sum of GL Amounts. If they equal, the workflow continues, if they don't it resets the Approval field back to Pending again and goes back to the wait state:
Cheers,
Mike
Without being able to see the beginning of your workflow I would take a look at your calculation step. Could you be using token in the equation that are pulled earlier in the workflow that would cause the total to never match?
Your GL Sum Calculation does not get run again as it's farther up the workflow, and does not get rerun again during the wait time. To be able to maintain the workflow as it is, I would move the GL Sum Calculation outside of this Workflow and have it be on it's own, the starting rule would watch for a change in the Fields that are being calculated, if there was a change it would run the GL Calc and assign that value to the field. They your wait in this Workflow would just be watching for the 3 fields in the metadata and not reliant on a calculation in this workflow.
These all sound promising! Thanks - I'll give each a try and see which solves my problem!!
Hi Althea, how did you get on?
Hi Michael, thanks for following up! After fighting with it for several days, I think I've got it working, but not quite the way I had hoped. I did add a repeat condition based around the accounts approval being changed from 'pending' to 'approved', but I found that if I tried to add a recalculate GL sum and compare to Invoice amount process in the no branch to ensure the invoice could not move on until the GL sums matched, no matter what I did, the workflow was calculating the GL amounts from prior to the amounts being corrected, so the workflow was stuck in a permanent loop. What I've done to solve my predicament works, but it's a safety-net rather than a guarantee. The accountant will have one opportunity to correct the GL amounts - but there is no recalculation and comparison after she does, so she'll need to be sure they are actually correct! My completed solution is attached. Thank you so much for your assistance.
Hi Althea,
I've had a cancelled appointment so ran up a quick model of your workflow. Steve's suggestion would probably be cleaner, but I've taken your workflow from above and duplicated the Retrieve GL Data and GL Sum Calculation activities in the Repeat activity and it appears to meet your requirements if I've understood them correctly.
Here's the basic template I set up:
The GL Sum Calculation tokens hold the total of the three GL Amount fields. In my scenario, the workflow kicks off when the Accounts Review field is changed to Approved. The workflow is below, I tested with changes to the GL Amounts fields as well as the Invoice Total field and ran through multiple incorrect amounts to make sure it kept looping until they all matched correctly.
Cheers,
Mike