WF ProgramExists

Vera, Guillermo Guillermo.Vera at realtech.com
Wed Oct 13 10:47:21 EDT 2010


Hi Rick , 
 
Try to use methods if_swf_run_wim~get_wi_header and lh_wihandle->set_wi_header inside the exit class ( i use a copy of CL_SWF_TST_PE_GETWORKFLOWID , it think it may run Ok with a copy of CL_SWF_TST_PE_GETWORKITEMID , both uses the event  name swrco_event_after_creation) .

Somethig like that:
 
data : WIheader type SWWWIHEAD.

CALL METHOD lh_wihandle->if_swf_run_wim~get_wi_header
  receiving
    re_wiheader = WIheader
    .
concatenate TEXTOWORKITEM wiheader-wi_text into wiheader-wi_text.

CALL METHOD lh_wihandle->set_wi_header
  EXPORTING
    im_wiheader = WIheader
 
 I hope this works for you.
 
regards
 
G.

________________________________

De: sap-wug-bounces at mit.edu en nombre de Sample, Rick
Enviado el: mié 13/10/2010 15:53
Para: SAP Workflow Users' Group
Asunto: 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 <mailto:rick.sample at graybar.com>  
www.graybar.com <http://www.graybar.com/>  - Works to Your Advantage 

  <http://www.graybar.com/> 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20101013/6b90482c/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/6b90482c/attachment.gif


More information about the SAP-WUG mailing list