WF ProgramExists

Sample, Rick Rick.Sample at graybar.com
Wed Oct 13 09:53:09 EDT 2010


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<mailto:rick.sample at graybar.com>
www.graybar.com<http://www.graybar.com/> - Works to Your Advantage

[cid:image001.gif at 01CB6AB4.07DEF1A0]<http://www.graybar.com/>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20101013/bf0983bf/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 1548 bytes
Desc: image001.gif
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20101013/bf0983bf/attachment.gif


More information about the SAP-WUG mailing list