<div dir="ltr"><div>Hi Volker,</div><div><br></div><div>First of all I would like to recommend you another SCN blog post, that gives good coverage of the subject:</div><div> &quot;A grown-up Singleton concept for Workflow instances (3 step approach)&quot;</div>
<div> by Florin Wach  </div><div> <a href="http://scn.sap.com/community/bpm/business-workflow/blog/2013/05/05/the-super-singleton-concept-for-workflow-instances-3-step-approach">http://scn.sap.com/community/bpm/business-workflow/blog/2013/05/05/the-super-singleton-concept-for-workflow-instances-3-step-approach</a></div>
<div><br></div><div>I think that your approach is similar to step 1 in the post.</div><div>According to the post, this approach might fail in a highly concurrent environment, because there is always some non-zero time interval from the moment you call SAP_WAPI_START_WORKFLOW to the moment, when the started workflow becomes visible through SAP_WAPI_WORKITEMS_TO_OBJECT.</div>
<div>So you probably should examine your environment and consider taking further steps.</div><div><br></div><div>When I once had a similar requirement. It was a workflow that brought some custom business object to functional administrators for correction in case of occasional customizing errors. The likelihood of errors happening simultaneously was very low, also it would not have been a big problem if an administrator got some object twice. So, the simplicity of &#39;step 1&#39; approach seemed definitely the right choice.</div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 3, 2014 at 4:29 PM, Wegert, Volker <span dir="ltr">&lt;<a href="mailto:volker.wegert@helios-kliniken.de" target="_blank">volker.wegert@helios-kliniken.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="DE" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span lang="EN-US">Hello,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I have a scenario which is slightly related to
<a href="http://scn.sap.com/community/bpm/business-workflow/blog/2013/02/25/more-common-mistakes-made-by-workflow-beginners" target="_blank">
http://scn.sap.com/community/bpm/business-workflow/blog/2013/02/25/more-common-mistakes-made-by-workflow-beginners</a>, item 16: I have two workflows that operate on the same business object (represented by an OO class in this case, not a BOR object type).
 Both workflows are ad-hoc workflows, there is no system event that triggers the workflows. I need to ensure that for each individual business object only one workflow instance of these two workflow definitions is running at any given time. Since there is not
 event linkage, I can’t use a check function module for this. <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">The workflows are started using a simple generated form to enter the key of the business object. I have extended that form with some validation procedures – check that the business object key is valid and so on. My naïve
 approach to tackle the new issue would be to call SAP_WAPI_WORKITEMS_TO_OBJECT with SELECTION_STATUS_VARIANT = 0003 and my two task IDs in TASK_FILTER, then check if there are any items returned – or am I missing something there?<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">  Volker<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">________________________________________________<br>
<b>HELIOS IT Service GmbH</b><br>
IT<br>
<br>
Volker Wegert<br>
Teamleiter SAP i.s.h.med - Entwicklung Konzern</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"><u></u><u></u></span></p>
<table border="0" cellspacing="1" cellpadding="0" width="408" style="width:306.0pt">
<tbody>
<tr>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><br>
Telefon:<br>
Mobil:<br>
E-Mail:</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"><u></u><u></u></span></p>
</td>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><br>
+49 30 9401-17338<br>
+49 152 54777467<br>
</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"><a href="mailto:volker.wegert@helios-kliniken.de" target="_blank"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:blue">volker.wegert@helios-kliniken.de</span></a></span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"><u></u><u></u></span></p>

</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"><br>
</span><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">Schwanebecker Chaussee 50 - 13125 Berlin<br>
Haus 211<br>
<br>
</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"><br>
</span><b><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">Geschäftsführer:</span></b><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"> Dirk Herzberger</span><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><br>

</span><b><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">Sitz der Gesellschaft:</span></b><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"> Berlin</span><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><br>

</span><b><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">Handelsregister:</span></b><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"> AG Berlin Charlottenburg, HRB 101458 B</span><u></u><u></u></p>

<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>

<br>_______________________________________________<br>
SAP-WUG mailing list<br>
<a href="mailto:SAP-WUG@mit.edu">SAP-WUG@mit.edu</a><br>
<a href="http://mailman.mit.edu/mailman/listinfo/sap-wug" target="_blank">http://mailman.mit.edu/mailman/listinfo/sap-wug</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Egor Malov
</div>