Hi Expert ,
I have requirement to trigger the workflow by manually for the old incident in EHSM. Then I have created the program to trigger the workflow for the old INCIDENT . But i got error in the first step of my workflow (Start Processing Method ).
My code :
data : lv_ret type sy-subrc,
lt_msglines type table of swr_messag,
ls_msglines type swr_messag,
lt_mstr type table of swr_mstruc,
ls_mstr type swr_mstruc.
data: lv_objtype type sibftypeid,
lv_event type sibfevent,
lr_event_parameters type ref to if_swf_ifs_parameter_container,
lv_title_event type char80,
lv_date_time type char15,
lv_incident_reporter type char12,
lv_location1 type char16,
vehicle_details type char15.
lv_objtype = 'CL_EHHSS_PCO_INC_LC'.
lv_event = 'CREATED'.
call method cl_swf_evt_event=>get_event_container
exporting
im_objcateg = cl_swf_evt_event=>mc_objcateg_cl
im_objtype = lv_objtype
im_event = lv_event
receiving
re_reference = lr_event_parameters.
" Pass Title
try.
call method lr_event_parameters->set
exporting
name = 'TITLE'
value = 'Test Title'.
catch cx_swf_cnt_cont_access_denied .
catch cx_swf_cnt_elem_access_denied .
catch cx_swf_cnt_elem_not_found .
catch cx_swf_cnt_elem_type_conflict .
catch cx_swf_cnt_unit_type_conflict .
catch cx_swf_cnt_elem_def_invalid .
catch cx_swf_cnt_container .
endtry.
" Pass Date and time
try.
call method lr_event_parameters->set
exporting
name = 'START_TIMESTAMP'
value = '15.06.2015 10.28.00'.
catch cx_swf_cnt_cont_access_denied .
catch cx_swf_cnt_elem_access_denied .
catch cx_swf_cnt_elem_not_found .
catch cx_swf_cnt_elem_type_conflict .
catch cx_swf_cnt_unit_type_conflict .
catch cx_swf_cnt_elem_def_invalid .
catch cx_swf_cnt_container .
endtry.
"Pass Incident ID
try.
call method lr_event_parameters->set
exporting
name = 'ID'
value = '00000000000000001703'.
catch cx_swf_cnt_cont_access_denied .
catch cx_swf_cnt_elem_access_denied .
catch cx_swf_cnt_elem_not_found .
catch cx_swf_cnt_elem_type_conflict .
catch cx_swf_cnt_unit_type_conflict .
catch cx_swf_cnt_elem_def_invalid .
catch cx_swf_cnt_container .
endtry.
data: lv_key type char32,
re_event type ref to if_swf_evt_event.
lv_key = '9C8E9923D08C1EE68CDC60519C93B885'.
try.
call method cl_swf_evt_event=>get_instance
exporting
im_objcateg = cl_swf_evt_event=>mc_objcateg_cl
im_objtype = lv_objtype
im_event = lv_event
im_objkey = lv_key
* im_event_container = lr_event_parameters
receiving
re_event = re_event.
catch cx_swf_evt_invalid_objtype .
catch cx_swf_evt_invalid_event .
endtry.
try.
call method cl_swf_evt_event=>raise
exporting
im_objcateg = cl_swf_evt_event=>mc_objcateg_cl
im_objtype = lv_objtype
im_event = lv_event
im_objkey = lv_key
im_event_container = lr_event_parameters.
catch cx_swf_evt_invalid_objtype .
catch cx_swf_evt_invalid_event .
endtry.
commit work.
Could you please correct my code if i pass any wrong container value or Missed any logic to trigger the workflow .
Workflow error screen shot.
Image may be NSFW.
Clik here to view.
Thanks,'
Pasumpon Karuppaiah