cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to write workflow container in WF Exit

EnnoWulff
Active Contributor
120

Hey there!

In a workflow definition I added my own multi-line Container that I want to use in a form task. I set the flags IMPORT and EXPORT alternating with always the same effect.

I have added a workflow exit in a task by adding my class in tab programming exits.

This exit will be called several times: before, while and after processing the work item.

at event BEF_EXEC Before Execution I can set values to the wf container with the following code:

 

 

 

DATA(wf_container)         = im_workitem_context->get_wf_container( ).
CASE im_event_name.
  WHEN swrco_event_before_execution.
    lt_mydata = VALUE #( ( field1 = '01' field2 = '02' ) ).
    TRY.
        wf_container->set(
            name       = 'ZMYDATA'
            value      = lt_mydata  ).
      CATCH ...
    ENDTRY.
 ENDCASE.

 

 

 

But: at event AFT_EXEC After Execution I get the exception CX_SWF_CNT_CONT_ACCESS_DENIED

The exception is raised in CL_SWF_CNT_CONTAINER->IF_SWF_CNT_ELEMENT_ACCESS_1~ELEMENT_SET_VALUE_REF which indicates that the container element is only readable and maybe because "element exists locally"?

But why is it possible to set the element value at BEF_EXEC?

 

**** element exists locally.
    IF <element>-props O swfcn_p_read_only.
      cx_element_ro l_elem_ro me name.
      cx_exception_return l_elem_ro.
    ENDIF.

 

Any ideas what I am doing wrong?

Thanks 
~Enno

Accepted Solutions (1)

Accepted Solutions (1)

EnnoWulff
Active Contributor

The problem was that I used a different table definition when writing the container. The container defined in the workflow had a different structure.

Writing the the wrong table into the container worked perfectly; no errors. But when transferring the workitem container back to the workflow container, the type mismatch was detected. I did not see any error somewhere. I recognized by chance that I was using the wrong table structure. After using the correct structure, it worked properly.

Answers (0)