Hmm no, but you could try to use FM &#39;SAP_WAPI_WORKITEM_RECIPIENTS&#39; and check if the result is empty...<div><br></div><div>Best regards,</div><div>Steffen Schlönvoigt<br><br><div class="gmail_quote">2010/10/13 Sample, Rick <span dir="ltr">&lt;<a href="mailto:Rick.Sample@graybar.com">Rick.Sample@graybar.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">









<div lang="EN-US" link="blue" vlink="purple">

<div>

<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Update,</span></p>

<p class="MsoNormal"><span style="font-size:12.0pt;color:black">I figured out how
to update the WI_TEXT with some code in CL_SWL_ADM_COMMAND-WITEXT_CHANGE.</span></p>

<p class="MsoNormal"><span style="font-size:12.0pt;color:black"> </span></p>

<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Now, I would like
to change this WI_TEXT on failure of the role res. Example, if </span></p>

<p class="MsoNormal"><span style="font-size:12.0pt;color:black">role res fails,
set the WI_TEXT to &quot;Error, bla bla bla you received this because could not
find next agent… &quot;</span></p>

<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Right now, I have
to execute the role res in a background task just to figure out if next agent
is found, set the message if not, </span></p>

<p class="MsoNormal"><span style="font-size:12.0pt;color:black">etc. Then,
execute the Decision task (which executes the role res again) and send to last
agent. </span></p>

<p class="MsoNormal"><span style="font-size:12.0pt;color:black"> </span></p>

<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Question: Is
there a flag in Work Item container that is set if role fails? </span></p>

<p class="MsoNormal"><span style="font-size:12.0pt;color:black"> </span></p>

<p class="MsoNormal"><span style="font-size:12.0pt;color:black"> </span></p>

<p class="MsoNormal"><span style="font-size:12.0pt;color:black"> </span></p>

<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">

<div>

<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">

<p class="MsoNormal"><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt"> Sample, Rick <br>
<b>Sent:</b> Wednesday, October 13, 2010 8:53 AM<br>
<b>To:</b> SAP Workflow Users&#39; Group<br>
<b>Subject:</b> WF ProgramExists </span></p>

</div>

</div><div><div></div><div class="h5">

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

<p>Hi all,</p>

<p> </p>

<p>I have a need for a WF &quot;Program Exit&quot; to
dynamically change the Task Text at runtime. </p>

<p> </p>

<p>Currently, if I need to change a task text at runtime, I
create a container element and </p>

<p>place it in the WI_TEXT. I then have a background task
determine what the task text should be and</p>

<p>pass it in before the Decision step is executed. Kludgy,
but it works and fairly simple to understand. </p>

<p> </p>

<p>Now, I want to dynamically change this value using a
Program Exit. </p>

<p> </p>

<p>So I added the SAP standard CL_SWF_TST_PE_GETDESCRIPTION
class to a new task and </p>

<p>it gets the Desc text and sets a container. Fine. </p>

<p>Next, I modified this class to just get/set a Work Item
container. This also works fine. </p>

<p> </p>

<p>Now, I tried to get this to change the Task Text with
this new container element but no luck. </p>

<p>This changes the container element, but does not change
the Work Item text.</p>

<p> </p>

<p>Anyone use these WF program exits? </p>

<p>Any thoughts, examples, assistance is greatly
appreciated.</p>

<p> </p>

<p> </p>

<p>==================================</p>

<p>METHOD change_cont_element.</p>

<p> </p>

<p>  DATA:</p>

<p>   container TYPE REF TO if_swf_cnt_container,</p>

<p>   lh_wihandle TYPE REF TO if_swf_run_wim_internal,</p>

<p>   l_exception TYPE REF TO
cx_swf_cnt_container,</p>

<p>   l_wiid TYPE sww_wiid.</p>

<p> </p>

<p>  BREAK-POINT ID zexits.</p>

<p> </p>

<p>  l_wiid = me-&gt;m_ctx-&gt;get_workitem_id( ).</p>

<p> </p>

<p>  TRY.</p>

<p>      lh_wihandle =
cl_swf_run_wim_factory=&gt;find_by_wiid( l_wiid ).</p>

<p>      container =
lh_wihandle-&gt;get_wi_container( ).</p>

<p>    CATCH cx_swf_run_wim.</p>

<p>  ENDTRY.</p>

<p> </p>

<p>  TRY.</p>

<p>      CALL METHOD
container-&gt;element_get</p>

<p>        EXPORTING</p>

<p>         
name = &#39;ZWI_TEXT&#39;.</p>

<p> </p>

<p>      CALL METHOD
container-&gt;element_set</p>

<p>        EXPORTING</p>

<p>         
name             = &#39;ZWI_TEXT&#39;</p>

<p>        
 value            =
&#39;New_Text&#39;</p>

<p>        IMPORTING</p>

<p>         
exception_return = l_exception.</p>

<p> </p>

<p>    CATCH cx_swf_tst_introspection_error.</p>

<p>    CATCH cx_swf_cnt_container.</p>

<p>  ENDTRY.</p>

<p> </p>

<p>ENDMETHOD.</p>

<p> </p>

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

<p class="MsoNormal"><span style="font-size:8.0pt;color:#3399CC"><br>
</span><b><span style="font-size:8.0pt;color:black">Rick Sample</span></b><span style="font-size:8.0pt;color:#3399CC"> </span><span style="font-size:8.0pt;color:black">| </span><span style="font-size:8.0pt;color:#3399CC">SAP Workflow
Analyst/Developer<br>
11885 Lackland Road</span><span style="font-size:8.0pt;color:black"> | </span><span style="font-size:8.0pt;color:#3399CC">Maryland Heights, MO 63146 </span><span style="font-size:8.0pt;color:black">| </span><span style="font-size:8.0pt;color:#3399CC">Office (314) 573-5822</span><span style="font-size:8.0pt;color:black"> | </span><span style="font-size:8.0pt;color:#3399CC">Mobile
(314) 952-2273</span><span style="font-size:8.0pt;color:black"> | </span><span style="font-size:8.0pt;color:#3399CC"><a href="mailto:rick.sample@graybar.com" target="_blank">rick.sample@graybar.com</a>
<br>
<a href="http://www.graybar.com/" target="_blank">www.graybar.com</a>
- <i>Works to Your Advantage</i> <br>
<br>
</span><a href="http://www.graybar.com/" target="_blank"><span style="font-size:8.0pt;text-decoration:none"><img border="0" width="72" height="30" src="cid:image001.gif@01CB6ABF.B1A1CD60" alt="Graybar® works to your advantage"></span></a></p>


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

<p> </p>

</div></div></div>

</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>
</div>