Skip to Content
author's profile photo Former Member
Former Member

Passing Custom Container element by using WF with Classes

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 04, 2012 at 02:50 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 04, 2012 at 02:10 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.