cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Custom Container element by using WF with Classes

devrajsinghr
Active Participant
0 Kudos

Hi All,

I am facing a strange issue, which is mentioned below.

I am triggering a WF using a Custom class, where I have defined an Event and in the event triggering Method I am using below code.

I want to pass a custom container element to WF, which is WC_STATUS. but I can't find the value in log.

  DATA :  l_container TYPE REF TO if_swf_ifs_parameter_container,

          l_event     TYPE REF TO if_swf_evt_event,

          lv_status(1) TYPE c.

  lv_status = 'A'.

 

*---- raise the event; use instance method (example)

      CALL METHOD cl_swf_evt_event=>get_instance

        EXPORTING

          im_objcateg        = me->za_mpor-catid

          im_objtype         = me->za_mpor-typeid

          im_event           = im_event

          im_objkey          = me->za_mpor-instid

        RECEIVING

          re_event           = l_event.

     l_container = l_event->get_event_container( ).

          CALL METHOD l_container->set

            EXPORTING

              name  = 'WC_STATUS'

              value = lv_status.

      l_event->raise( ).

      COMMIT WORK.

Another varient of program I have used is below

DATA: l_event_parameters TYPE REF TO if_swf_ifs_parameter_container,

       lv_status(1) TYPE c.

*- begin of local data

  lv_status = 'A'.

TRY.

*--- get the event container that is used to transport the event parameters

CALL METHOD cl_swf_evt_event=>get_event_container

EXPORTING

im_objcateg = 'CL' "category for classes

im_objtype = me->za_mpor-typeid  "the classname

im_event = im_event  " “event that will be triggerd

RECEIVING

re_reference = l_event_parameters.

*--- set the values of the parameters

CALL METHOD l_event_parameters->set

EXPORTING

name = 'WC_STATUS' "the name of the event parameter

value = lv_status. "the value

*--- raise the event

CALL METHOD cl_swf_evt_event=>raise

EXPORTING

im_objcateg = 'CL'   "“category for classes

im_objtype = me->za_mpor-typeid " “the classname

im_event = im_event " “the event name

im_objkey = me->za_mpor-instid         "“the obj.-key (instid)

im_event_container = l_event_parameters. "the event params

*--- start the receivers (tRFC)

COMMIT WORK.

CATCH cx_swf_evt_exception. "“except. while raising the event

CATCH cx_swf_cnt_container. "“except. while setting event params

ENDTRY.

any suggestions?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi.  You must check:

1. Event parameter 'wc_status' actually exist for triggering event

2. Binding between event container and workflow container is correctly defined

devrajsinghr
Active Participant
0 Kudos

1 - WC_status does exist in the parameter.

2 - This is a custom variable and can't be bind to event and wf container.

Answers (1)

Answers (1)

anjan_paul
Active Contributor
0 Kudos

Hi,

Check you mention WC_STATUS. Please check your container parameter it is in small letter like wc_status or something WC_staus.

You container element must be all capital letter as you mention

devrajsinghr
Active Participant
0 Kudos

Hi Anjan,

Thanks for your reply,

I have maintained the same name both the said, As well I have created a parameter in EVENT WC_STATUS but still I can,'t see any thing in log.