Skip to Content
Jul 22, 2019 at 02:43 PM

Issue using ParForEach block in workflow template


Hi there

I am having some issues setting up dynamic/parallel approval in a workflow template, every time I get one bit working I seem to find another issue and I'm hoping there are some experts here who can help.

I've knocked together a quick diagram of what my workflow needs to do, but to summarise:

My workflow starts when an invoice item is price blocked, and it uses multiple account assignment (this bit is OK);

I have created a new task to find all of the approvers based on the account assignment, and then fill a table called ApproverTable in the workflow container (again, all fine, in my example it finds two approvers). At this stage I capture the number of approvers and set a container variable called Counter to the number of approvers (so, again this is 2 in my example);

Then for each entry in ApproverTable, it should send a decision step to the financial approver who decides whether to approve or reject the price variance. To achieve this I have used a block step, set it to ParForEach, and on the Parallel Processing tab I have entered my multiline elemenet as ApproverTable (I am getting a task per approver);

If the approver rejects the variance, it should send an email to the requestor and loop back to the start (seems OK);

If the approver accepts the variance, they click Approve. At this stage I am using a container operation and subtracting 1 from the value in Counter;

I have a loop until step that checks if the value of Counter is equal to zero. If so, the price block is removed.

The issue I have is that the Counter never seems to get to zero when I use it in the block. It's as if the counter is 2 in each step, and so it's always 1 at the loop until check. I then end up in an endless loop, whereby it just restarts back at requester reviews bit...

Does anyone have any idea where I might be going wrong please?