<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.5450.4" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=329580320-10112010><FONT face=Arial 
color=#0000ff size=2>I think this could help you,&nbsp;&nbsp;&nbsp;&nbsp; <A 
href="http://help.sap.com/saphelp_sm32/helpdata/en/83/8b973945bfa500e10000000a114084/content.htm">http://help.sap.com/saphelp_sm32/helpdata/en/83/8b973945bfa500e10000000a114084/content.htm</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=329580320-10112010><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=329580320-10112010><FONT face=Arial 
color=#0000ff size=2>specifically&nbsp;(2&nbsp; c.)&nbsp; triggering 
event&nbsp;and a check funtion module to filter document 
type,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=329580320-10112010><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=329580320-10112010><FONT face=Arial 
color=#0000ff size=2>Regards,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=329580320-10112010><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=329580320-10112010><FONT face=Arial 
color=#0000ff size=2>David M.</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=es dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>De:</B> sap-wug-bounces@mit.edu 
[mailto:sap-wug-bounces@mit.edu] <B>En nombre de 
</B>Joe_Toledo@capgroup.com<BR><B>Enviado el:</B> Miércoles, 10 de Noviembre de 
2010 08:38 a.m.<BR><B>Para:</B> SAP Workflow Users' Group<BR><B>Asunto:</B> Re: 
Race condition in a workflow<BR></FONT><BR></DIV>
<DIV></DIV><FONT face=sans-serif size=2>Good morning,</FONT> <BR><BR><FONT 
face=sans-serif size=2>Perhaps you've already considered this, but since the 
approval workflow requires that the image be linked first then:</FONT> 
<BR><BR><FONT face=sans-serif size=2>- have the approval workflow be a 
continuation of the archivelink workflow (i.e. a sub-flow)</FONT> <BR><FONT 
face=sans-serif size=2>- or have the first workflow (image link) raise an event 
at the completion of that workflow and have the approval workflow wait for that 
event before it continues.</FONT> <BR><BR><FONT face=sans-serif size=2>I hope 
this helps.</FONT> <BR><BR><FONT face=sans-serif size=2>Regards,</FONT> <BR>
<TABLE align=center>
  <TBODY>
  <TR>
    <TD bgColor=#efefef>
      <DIV align=center><A href="mailto:Joe_Toledo@capgroup.com"><FONT 
      face=Arial color=blue size=1><U>Joe Toledo</U></FONT></A><FONT face=Arial 
      size=1> | The Capital Group Companies<BR>Location: IRV | Extension: 55417 
      | Outside: 949-975-5417<BR>E-mail: joat@capgroup.com<BR>[ Mailing: 
      </FONT><A 
      href="http://maps.yahoo.com/py/maps.py?BFCat=&amp;Pyt=Tmap&amp;newFL=Use+Address+Below&amp;addr=15260+Valley+Oak.&amp;csz=92618&amp;Country=us&amp;Get%A0Map=Get+Map"><FONT 
      face=Arial color=blue size=1><U>15260 Valley Oak.</U></FONT></A><FONT 
      face=Arial size=1> IRV-M-3E Irvine, CA 92618 USA 
]</FONT></DIV></TR></TBODY></TABLE><BR><BR><BR><BR>
<TABLE width="100%">
  <TBODY>
  <TR vAlign=top>
    <TD><FONT face=sans-serif color=#5f5f5f size=1>From:</FONT> 
    <TD><FONT face=sans-serif size=1>michael.mcley@daimler.com</FONT> 
  <TR vAlign=top>
    <TD><FONT face=sans-serif color=#5f5f5f size=1>To:</FONT> 
    <TD><FONT face=sans-serif size=1>sap-wug@mit.edu</FONT> 
  <TR vAlign=top>
    <TD><FONT face=sans-serif color=#5f5f5f size=1>Date:</FONT> 
    <TD><FONT face=sans-serif size=1>11/10/2010 06:28 AM</FONT> 
  <TR vAlign=top>
    <TD><FONT face=sans-serif color=#5f5f5f size=1>Subject:</FONT> 
    <TD><FONT face=sans-serif size=1>Race condition in a workflow</FONT> 
  <TR vAlign=top>
    <TD><FONT face=sans-serif color=#5f5f5f size=1>Sent by:</FONT> 
    <TD><FONT face=sans-serif 
size=1>sap-wug-bounces@mit.edu</FONT></TR></TBODY></TABLE><BR>
<HR noShade>
<BR><BR><BR><FONT face=sans-serif size=2><BR>Wuggers,</FONT><FONT 
size=3><BR></FONT><FONT face=sans-serif size=2><BR>I have set up a new workflow 
for the approval of parked invoices. &nbsp;Only invoices for specific types of 
purchase orders (service) get parked for approval. &nbsp;It seems I have a race 
condition that was not detected during user testing. &nbsp;The race is between 
the start of the approval workflow and the scanned document association with the 
SAP invoice. &nbsp;Some more details...</FONT><FONT size=3><BR></FONT><FONT 
face=sans-serif size=2><BR>1. When an invoice for a service PO arrives, 2 
processes are kicked off simultaneously:<BR>a) the invoice approval 
workflow<BR>b) the association of the scanned document (archivelink) with the 
SAP invoice object.<BR>2. Sometimes the scanned document association completes 
first, in which case an entry in the AdHoc objects container item is made, and a 
hyperlink to the scanned document appears in the subesquent work items in the 
invoice approval workflow. &nbsp;<BR>3. Other times the approval workflow starts 
before the association completes and no scanned documents are found -&gt; no 
hyperlink in the work items.<BR>4. The approvers require the link to the scanned 
document so they can review the vendor invoice before approval.</FONT><FONT 
size=3><BR></FONT><FONT face=sans-serif size=2><BR>I was wondering if anyone 
else has seen a similar problem and what was done to correct. &nbsp;Some things 
I thought about:<BR>1. Triggering the workflow off the BUS2089.ASSIGNED event 
(this event is generated when an association is made between the archivelink 
document and the SAP object) - this probably is not a good idea as all invoices 
generate this event, but not all invoices go thru the approval workflow.<BR>2. 
Including a wait step for the BUS2089.ASSIGNED event - probably not a good idea 
as the workflow could hang in those cases where this event is already generated 
when the approval workflow starts<BR>3. Create a loop to test the adhoc objects 
container element for entries and loop until there is one - this would probably 
work, but it seems a little, well..., kludgey.</FONT><FONT 
size=3><BR></FONT><FONT face=sans-serif size=2><BR>Can anyone give me some 
advice on correcting this issue? &nbsp;Your help is appreciated.</FONT><FONT 
size=3><BR></FONT><FONT face=sans-serif size=2><BR></FONT>
<P><FONT color=#808000 size=4><B>Michael McLey</B></FONT><FONT color=#808000 
size=3><BR>MBUSI - IT Parts &amp; Administration </FONT><FONT color=#808000 
size=2><BR>Mercedes-Benz US International, Inc.<BR>1 Mercedes Drive</FONT><FONT 
color=#808000 size=3> </FONT><FONT color=#808000 size=2><BR>Vance, AL 
35490</FONT><FONT color=#808000 size=3> </FONT><FONT color=#808000 
size=2><BR>PHONE: &nbsp;(205) 462 - 5239</FONT><FONT color=#808000 size=3> 
</FONT><FONT color=#808000 size=2><BR>EMAIL: &nbsp; 
michael.mcley@daimler.com</FONT><FONT color=#808000 size=3> &nbsp; </FONT><FONT 
face=sans-serif color=#808080 size=2><BR>If you are not the intended addressee, 
please inform us immediately that you have received this e-mail in error, and 
delete it. We thank you for your cooperation. </FONT><TT><FONT 
size=2>_______________________________________________<BR>SAP-WUG mailing 
list<BR>SAP-WUG@mit.edu<BR></FONT></TT><A 
href="http://mailman.mit.edu/mailman/listinfo/sap-wug"><TT><FONT 
size=2>http://mailman.mit.edu/mailman/listinfo/sap-wug</FONT></TT></A><TT><FONT 
size=2><BR></FONT></TT>
<P></P></BODY></HTML>