cancel
Showing results for 
Search instead for 
Did you mean: 

missing "RESERVED" BPM-Tasks from my Substitute in Taskcollection BPM OData

demetrius_pfoo
Explorer
0 Kudos

Hello,

i'm developing a Integration-scenario with BPM-Tasks. Therfore i'm using the ODATA-REST Service.

The access to the Taskcollection shows me all my BPM-Tasks.

Now a second User activated me as his substitute. I expected that my TaskCollection shows me all the Tasks of my substitute, but he just delivered me the tasks that are in statuts "READY". The Tasks which are in status "RESERVED" were not shown in the TAskCollection.

Has anybody an idea, what i have to do for getting all Task in every status.

this is my request for the TaskCollection:

http://xxx:99999/bpmodata/tasks.svc/TaskCollection?$orderby=CreatedOn%20desc&$filter=Status%20ne%20%...

There is one more Problem with the TaskCollection:

The propertie "SubstitutedUser" is always initial, even when the Task is from the Subsituted User by activated substitutionrule.

I'm thankfull for every idea.

Regards

Demetrius P.

Accepted Solutions (0)

Answers (3)

Answers (3)

demetrius_pfoo
Explorer
0 Kudos

Hello Andre,

i have a further question to the BPM-Odata-Service.

Is the function CreateSubstitutionRule one of the supported functionalities in the BPM-Service?

My Request I'm sending is like that:

http://czt:52600/bpmodata/tasks.svc/CreateSubstitutionRule?SAP__Origin=‘CZT_CZT_26‘&BeginDate=‘2014-...

Is something wrong with that?

regards

Demetrius Pfoo

AndreH
Employee
Employee
0 Kudos

Hello Demetrius,

as of SP12 (released this week) the BPM OData Service supports the TaskCollection. The management of Substitution Rules (Create, Delete, etc.) is not yet supported, but planned for the next SPs.

Please keep in mind to close this question once it is answered.

Thank you and Best Regards,

Andre

demetrius_pfoo
Explorer
0 Kudos

Hello Andre,

thank you for your reply. That is unfortunately not the answer i hoped for 😉

Than i have question for claiming a task. I'm always getting the same error:

Befor sending the POST-Request I fill the Header with a X-CSRF-token and the coockies. Here is my code and my URL i'm sending with the client-request. I have tested the same URL with the CHROME Postman and there it works fine:

Can you say me what i'm doing wrong?

URL-Request in "path": http://host:porthttp://czt.rz.sys.aok.de:52600/bpmodata/tasks.svc/Claim?&%26InstanceID=%27bpm%253A%252F%252Fbpm.sap..../bpmodata/tasks.svc/Claim?InstanceID='bpm%3A%2F%2Fbpm.sap.com%2Ftask-instance%2F0218e66cd9a511e3c1f8...

Code:

     

    DATA: path TYPE string,
      errortext TYPE string, "used for error handling
      subrc  TYPE sysubrc,
      l_str_subrc TYPE string,
      dummy TYPE string,
      l_wrk_message TYPE bapiret2,
      l_token TYPE string,
      l_instance TYPE string,
      l_origin TYPE string.

      client->refresh_request(    ).


    " setzen POST-Methode---------------------------
    client->request->set_method( if_http_request=>co_request_method_post ).

    "erst den absoluten Teil generieren lassen
    client->create_abs_url(
      EXPORTING
        path        = '/bpmodata/tasks.svc/Claim?'
      RECEIVING
        url         =     path
    ).

   CONCATENATE path  'InstanceID=''' i_instance_id '''&SAP__Origin=''' i_sap_origin '''' into path.

    cl_http_utility=>set_request_uri( request = client->request
     uri  = path ).


    "x-crsf-token auslesen und setzten für die Post-Methode

    l_token = client->response->get_header_field( me->co_csrf_token ).

    DATA: lt_cookies TYPE tihttpcki,
          lw_coockies LIKE LINE OF lt_cookies.
    client->response->get_cookies(
      CHANGING
        cookies = lt_cookies    " Cookies
    ).

    LOOP AT lt_cookies INTO lw_coockies.
      client->request->set_cookie(
       EXPORTING
         name    lw_coockies-name   " Name des Cookies
         value   lw_coockies-value   " Wert des Cookies
     ).
    ENDLOOP.

    client->request->set_header_field(
      EXPORTING
        name  me->co_csrf_token   " Name des Header-Feldes
        value l_token   " Wert des Header-Feldes
    ).
    client->request->set_header_field(
      EXPORTING
        name  'Content-Type'   " Name des Header-Feldes
        value 'application/atom+xml'   " Wert des Header-Feldes
    ).


    client->send(
*    EXPORTING
*      timeout                    = CO_TIMEOUT_DEFAULT    " Timeout von Antwortwartezeit
      EXCEPTIONS
        http_communication_failure = 1
        http_invalid_state         = 2
        http_processing_failed     = 3
        http_invalid_timeout       = 4
        OTHERS                     = 5
    ).
    IF sy-subrc <> 0.
      l_wrk_message-type = sy-msgty.
      l_wrk_message-id   = sy-msgid.
      CALL METHOD client->get_last_error
        IMPORTING
          code    = subrc
          message = errortext.
      l_str_subrc = subrc.
      CONCATENATE 'Receive-Fehler:(' 'Code:' l_str_subrc '):' errortext INTO l_wrk_message-message SEPARATED BY space.
      APPEND l_wrk_message TO t_message.
      EXIT.
    ENDIF.


    client->receive(
      EXCEPTIONS
        http_communication_failure = 1
        http_invalid_state         = 2
        http_processing_failed     = 3
        OTHERS                     = 4
    ).
    IF sy-subrc <> 0.
      l_wrk_message-type = sy-msgty.
      l_wrk_message-id   = sy-msgid.
      CALL METHOD client->get_last_error
        IMPORTING
          code    = subrc
          message = errortext.
      l_str_subrc = subrc.
      CONCATENATE 'Receive-Fehler:(' 'Code:' l_str_subrc '):' errortext INTO l_wrk_message-message SEPARATED BY space.
      APPEND l_wrk_message TO t_message.
      EXIT.

    ELSE.
      xmlstring = client->response->get_data( ).
    ENDIF.

regards

Demetrius

demetrius_pfoo
Explorer
0 Kudos

oh sorry, a copy and paste mistake at the request.

this is the correct request:

http://host:port/bpmodata/tasks.svc/Claim?InstanceID='bpm%3A%2F%2Fbpm.sap.com%2Ftask-instance%2F0218...

AndreH
Employee
Employee
0 Kudos

Hello Demetrius,

the URL you posted is correct and should work. Is it exactly the same URL as sent by your application? Have you already checked the server logs? What is described there? How does the logged URL look like?

Best Regards,

Andre

demetrius_pfoo
Explorer
0 Kudos


Hello Andre,

yes, that is exactly the same URL. Here a screenshot of "path" from the debugger:

The logviewer just shows me a info that i logged in correctly at our NW-System.

That is the only log I found in the log viewer in the view "Systems logs and traces":

Do you have an idea why the POST-URL is not logged?

Could it be that the the HTTP_CLIENT convert the URL in a other character set or something?

Regards

Demetrius

AndreH
Employee
Employee
0 Kudos

Hello Demetrius,

could you please have a look at the developer traces as described in the BPM OData Service Troubleshooting?

Best Regards,

Andre

demetrius_pfoo
Explorer
0 Kudos


Hello Andre,

i can not find any log in the devolper Trace. I even dont get a log id in the Response of the URL Request. I just get the message i posted.

Regards

Demetrius

AndreH
Employee
Employee
0 Kudos

Hello Demetrius,

it seems that there is something wrong with the URL. You already mentioned the URL coding/conversion of chars. Coding and decoding of URLs is not always obvious as there are many tools involved doing some automatic conversions. Please check again your application whether there is some automatic coding/decoding done. This would explain the erroneous URL.

Best Regards,

Andre

AndreH
Employee
Employee
0 Kudos

Hello Demetrius,

with the current version of the BPM OData Service (SP 11) we support only selected functionalities of the OData Service tasks.svc. This includes claiming a BPM Task and accessing the metadata of a BPM Task. The functionalities you are trying to use (e.g. general access to the TaskCollection) goes beyond these features and is currently not supported. Since we cannot guarantee the stability of these functionalities (the interface and the behavior might change as long as it is not officially supported), I would strongly recommend you to wait until we officially support these features. This is already in our queue. We will also come with a detailed documentation and blog posts, once these functionalities are officially available for you. Check the SAP Service Market Place regularly for the next SP(s).

Best Regards,

Andre

demetrius_pfoo
Explorer
0 Kudos

Hallo Andre, 

to my first question again:

Do you now in which Support Package the function of the TaskCollection will be supported?

And whats about the missing Task from the Substitute? Will this be part of the supported TaskCollection or do we have to write an new idea in the Market Place?

regards

Demetrius