<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Issue using ParForEach block in workflow template in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989126#M4497147</link>
    <description>&lt;P&gt;So I took the block step out, and instead used the Misc tab on the decision step, and set the end condition to be &amp;amp;COUNTER&amp;amp; = 0.&lt;/P&gt;&lt;P&gt;If all the approvers approve the task, it works fine. If one of them rejects it, the loop starts again (as it should do), but as soon as one of the users clicks approve, the other task gets logically deleted - presumably because my counter is now equal to zero.&lt;/P&gt;&lt;P&gt;I tried to change the workflow again so that I set the value of COUNTER inside the loop, but when I do this it just gets stuck in an endless loop, and it keeps going round and round regardless how many times I click approve.&lt;/P&gt;&lt;P&gt;Any further suggestions please?&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jul 2019 12:08:17 GMT</pubDate>
    <dc:creator>jamespallett</dc:creator>
    <dc:date>2019-07-23T12:08:17Z</dc:date>
    <item>
      <title>Issue using ParForEach block in workflow template</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaq-p/11989118</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;
  &lt;P&gt;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.&lt;/P&gt;
  &lt;P&gt;I've knocked together a quick diagram of what my workflow needs to do, but to summarise:&lt;/P&gt;
  &lt;P&gt;My workflow starts when an invoice item is price blocked, and it uses multiple account assignment (this bit is OK);&lt;/P&gt;
  &lt;P&gt;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);&lt;/P&gt;
  &lt;P&gt;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);&lt;/P&gt;
  &lt;P&gt;If the approver rejects the variance, it should send an email to the requestor and loop back to the start (seems OK);&lt;/P&gt;
  &lt;P&gt;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;&lt;/P&gt;
  &lt;P&gt;I have a loop until step that checks if the value of Counter is equal to zero. If so, the price block is removed.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1709479-example-workflow.png" /&gt;&lt;/P&gt;
  &lt;P&gt;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...&lt;/P&gt;
  &lt;P&gt;Does anyone have any idea where I might be going wrong please?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 14:43:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaq-p/11989118</guid>
      <dc:creator>jamespallett</dc:creator>
      <dc:date>2019-07-22T14:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using ParForEach block in workflow template</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989119#M4497140</link>
      <description>&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;  Try to  modify like this way. Instead  of Counter , take a Boolean  container element .    Replace the Container operation step after Approve with  setting the Boolean conterner element with X . &lt;/P&gt;&lt;P&gt;In the loop until step, check Boolean contaner element = X .&lt;/P&gt;&lt;P&gt;Please  do this, and let us know.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anjan&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 07:38:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989119#M4497140</guid>
      <dc:creator>anjan_paul</dc:creator>
      <dc:date>2019-07-23T07:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using ParForEach block in workflow template</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989120#M4497141</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;At first, what I understood is if one of the parallel steps has been approved and then you would like to close the other approver step. Instead of block step the step which is used to capture the action of the end-user I would make use of the multi-line container element which is located under the Miscellaneous tab. Here you also get the same behavior what you were trying to achieve. However, comparing with the block step in this approach you have a possibility to define the end condition. This is more or less like the same behaviour that we define for the fork step where we end up defining the end condition.  So if any one of the work-items action is approved then complete the other work-items.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan Bhamidipati&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 07:45:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989120#M4497141</guid>
      <dc:creator>bpawanchand</dc:creator>
      <dc:date>2019-07-23T07:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using ParForEach block in workflow template</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989121#M4497142</link>
      <description>&lt;P&gt;Hi Anjan&lt;/P&gt;&lt;P&gt;I thought about using a boolean at first, but the block should only be removed if all of the users approve the tasks. Or is the boolean checked per approval task? Sorry, have no workflow experience so I am trying to muddle my way through! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 07:54:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989121#M4497142</guid>
      <dc:creator>jamespallett</dc:creator>
      <dc:date>2019-07-23T07:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using ParForEach block in workflow template</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989122#M4497143</link>
      <description>&lt;P&gt;Hi Pavan&lt;/P&gt;&lt;P&gt;Sorry, the block should only be removed once all of the approvers have agreed the price-variance.&lt;/P&gt;&lt;P&gt;Unfortunately the costs could be split many ways, so I don't know until runtime how many approvers there will be. Looking at the table RBCO (account assignment for incoming invoices), there are a lot of examples in the production environment where there are more than two users...&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 07:57:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989122#M4497143</guid>
      <dc:creator>jamespallett</dc:creator>
      <dc:date>2019-07-23T07:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using ParForEach block in workflow template</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989123#M4497144</link>
      <description>&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;I forgot to include the screenshot in the above reply.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1708504-wf.png" /&gt;&lt;/P&gt;&lt;P&gt;Oh yeah, I completely agree with you only if all the work-item are approved then you would like to move ahead otherwise you would still send the work-item back to the list of the user. My idea was to play around with the end condition of the step rather complicating the definition with a block step.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan Bhamidipati&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 08:06:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989123#M4497144</guid>
      <dc:creator>bpawanchand</dc:creator>
      <dc:date>2019-07-23T08:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using ParForEach block in workflow template</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989124#M4497145</link>
      <description>&lt;P&gt;Thanks for the screenshot, Pavan.&lt;/P&gt;&lt;P&gt;Oddly enough I have been following the blog post from Anjan who has also offered some help:&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2013/06/06/dynamic-multilevel-approval-workflow-using-block-step/"&gt;https://blogs.sap.com/2013/06/06/dynamic-multilevel-approval-workflow-using-block-step/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I did try and change my workflow to use the Misc. tab, but didn't see the end condition there. I'll give it another try, anything to get it working at this stage, I've made 41 copies of the invoice to test it so far... &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 08:21:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989124#M4497145</guid>
      <dc:creator>jamespallett</dc:creator>
      <dc:date>2019-07-23T08:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using ParForEach block in workflow template</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989125#M4497146</link>
      <description>&lt;P&gt;The exit condition needs to be defined for the approval task, inside the processing block. You should realize that task start and exit conditions are handled by the workflow runtime like all other conditions, see the documentation for SWWCOND. I have always chosen to programmatically complete all tasks rather than waiting for the condition to be evaluated. The challenge with the workflow runtime is that it is asynchronous, you never know in which order the tasks get executed and when.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 11:53:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989125#M4497146</guid>
      <dc:creator>SamuliKaski</dc:creator>
      <dc:date>2019-07-23T11:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using ParForEach block in workflow template</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989126#M4497147</link>
      <description>&lt;P&gt;So I took the block step out, and instead used the Misc tab on the decision step, and set the end condition to be &amp;amp;COUNTER&amp;amp; = 0.&lt;/P&gt;&lt;P&gt;If all the approvers approve the task, it works fine. If one of them rejects it, the loop starts again (as it should do), but as soon as one of the users clicks approve, the other task gets logically deleted - presumably because my counter is now equal to zero.&lt;/P&gt;&lt;P&gt;I tried to change the workflow again so that I set the value of COUNTER inside the loop, but when I do this it just gets stuck in an endless loop, and it keeps going round and round regardless how many times I click approve.&lt;/P&gt;&lt;P&gt;Any further suggestions please?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 12:08:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989126#M4497147</guid>
      <dc:creator>jamespallett</dc:creator>
      <dc:date>2019-07-23T12:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using ParForEach block in workflow template</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989127#M4497148</link>
      <description>&lt;P&gt;Just to say that using the suggestion from Pavan, I have managed to get it working...&lt;/P&gt;&lt;P&gt;When I get the list of approvers, I set the container variable &amp;amp;COUNTER&amp;amp; to the number of approvers found.&lt;/P&gt;&lt;P&gt;I have then removed the block step and used the Dynamic Parallel Processing option on the User Decision task instead. In the end condition, I have set:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;amp;COUNTER&amp;amp; = 0

or &amp;amp;ITEMREJECTED&amp;amp; = X&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If the user clicks approve, I subtract 1 from &amp;amp;COUNTER&amp;amp;; else if they click reject, I have set the variable &amp;amp;ITEMREJECTED&amp;amp; to X. After the approve/reject step I have added a new condition that checks if &amp;amp;ITEMREJECTED&amp;amp; is equal to X, then:&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;If true, I trigger the event to start the workflow again, but for the same invoice item; or&lt;/LI&gt;&lt;LI&gt;If false, I release the block on the invoice item.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I've included a new diagram in case this helps anyone else who may be stuck with a similar scenario.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1709513-workflow.png" /&gt;&lt;/P&gt;&lt;P&gt;I have tested it this afternoon and if a user clicks reject, the current workflow ends and starts a new one (which is effectively what the loop was doing but in the same workflow). Thanks everyone for their input!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 14:11:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989127#M4497148</guid>
      <dc:creator>jamespallett</dc:creator>
      <dc:date>2019-07-23T14:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Issue using ParForEach block in workflow template</title>
      <link>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989128#M4497149</link>
      <description>&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;Appreciate the effort and helping others with the idea and the solution you provided.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2019 06:26:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/issue-using-parforeach-block-in-workflow-template/qaa-p/11989128#M4497149</guid>
      <dc:creator>bpawanchand</dc:creator>
      <dc:date>2019-07-24T06:26:39Z</dc:date>
    </item>
  </channel>
</rss>

