WF ProgramExists

Steffen Schloenvoigt steffen.schloenvoigt at googlemail.com
Thu Oct 14 05:57:37 EDT 2010


Hmm no, but you could try to use FM 'SAP_WAPI_WORKITEM_RECIPIENTS' and check
if the result is empty...

Best regards,
Steffen Schlönvoigt

2010/10/13 Sample, Rick <Rick.Sample at graybar.com>

>  Update,
>
> I figured out how to update the WI_TEXT with some code in
> CL_SWL_ADM_COMMAND-WITEXT_CHANGE.
>
>
>
> Now, I would like to change this WI_TEXT on failure of the role res.
> Example, if
>
> role res fails, set the WI_TEXT to "Error, bla bla bla you received this
> because could not find next agent… "
>
> 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,
>
> etc. Then, execute the Decision task (which executes the role res again)
> and send to last agent.
>
>
>
> Question: Is there a flag in Work Item container that is set if role fails?
>
>
>
>
>
>
>
>
> *From:* Sample, Rick
> *Sent:* Wednesday, October 13, 2010 8:53 AM
> *To:* SAP Workflow Users' Group
> *Subject:* WF ProgramExists
>
>
>
> Hi all,
>
>
>
> I have a need for a WF "Program Exit" to dynamically change the Task Text
> at runtime.
>
>
>
> Currently, if I need to change a task text at runtime, I create a container
> element and
>
> place it in the WI_TEXT. I then have a background task determine what the
> task text should be and
>
> pass it in before the Decision step is executed. Kludgy, but it works and
> fairly simple to understand.
>
>
>
> Now, I want to dynamically change this value using a Program Exit.
>
>
>
> So I added the SAP standard CL_SWF_TST_PE_GETDESCRIPTION class to a new
> task and
>
> it gets the Desc text and sets a container. Fine.
>
> Next, I modified this class to just get/set a Work Item container. This
> also works fine.
>
>
>
> Now, I tried to get this to change the Task Text with this new container
> element but no luck.
>
> This changes the container element, but does not change the Work Item text.
>
>
>
> Anyone use these WF program exits?
>
> Any thoughts, examples, assistance is greatly appreciated.
>
>
>
>
>
> ==================================
>
> METHOD change_cont_element.
>
>
>
>   DATA:
>
>    container TYPE REF TO if_swf_cnt_container,
>
>    lh_wihandle TYPE REF TO if_swf_run_wim_internal,
>
>    l_exception TYPE REF TO cx_swf_cnt_container,
>
>    l_wiid TYPE sww_wiid.
>
>
>
>   BREAK-POINT ID zexits.
>
>
>
>   l_wiid = me->m_ctx->get_workitem_id( ).
>
>
>
>   TRY.
>
>       lh_wihandle = cl_swf_run_wim_factory=>find_by_wiid( l_wiid ).
>
>       container = lh_wihandle->get_wi_container( ).
>
>     CATCH cx_swf_run_wim.
>
>   ENDTRY.
>
>
>
>   TRY.
>
>       CALL METHOD container->element_get
>
>         EXPORTING
>
>           name = 'ZWI_TEXT'.
>
>
>
>       CALL METHOD container->element_set
>
>         EXPORTING
>
>           name             = 'ZWI_TEXT'
>
>           value            = 'New_Text'
>
>         IMPORTING
>
>           exception_return = l_exception.
>
>
>
>     CATCH cx_swf_tst_introspection_error.
>
>     CATCH cx_swf_cnt_container.
>
>   ENDTRY.
>
>
>
> ENDMETHOD.
>
>
>
>
>
>
> *Rick Sample* | SAP Workflow Analyst/Developer
> 11885 Lackland Road | Maryland Heights, MO 63146 | Office (314) 573-5822 |
> Mobile (314) 952-2273 | rick.sample at graybar.com
> www.graybar.com - *Works to Your Advantage*
>
> [image: Graybar® works to your advantage] <http://www.graybar.com/>
>
>
>
>
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20101014/026f37ac/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 1548 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20101014/026f37ac/attachment.gif


More information about the SAP-WUG mailing list