Show TOC

Subscribing to Notification TypesLocate this document in the navigation structure

You can subscribe to the following notification types:

  • Short notification, containing only text and a link to the specific work item sent.

  • Full payload notification, containing the extended work item details.

To subscribe to the notification types:

  1. Open a REST client or any other application that allows posting a request to the exposed OData service.

  2. Subscribe to the Workflow step by posting a request to the following URL:

    http://<Host name:port>/sap/opu/odata/IWWRK/WFSERVICE/SubscriptionCollection

  3. Post the request as shown in the following example:

    content-type: application/atom+xml
    Content-Length: 634 
    X-Requested-With: XMLHttpRequest 
    X-CSRF-Token: krVmAnoj48a0mn36shLKRA== 
    
    
    <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap="http://www.sap.com/Protocols/SAPData">
    <atom:author>
    <atom:name>USERNAME</atom:name>  
    </atom:author>
    <atom:title>Subscription to Workflow</atom:title>
    <atom:updated>2012-01-01T10:10:10Z</atom:updated>
    <atom:content type="application/xml">
    <m:properties>
    <d:ID>1</d:ID>
    <d:deliveryAddress>http://<server>:<port>/additional directory/</d:deliveryAddress> 
    <d:persistNotifications m:Type="Edm.Boolean">false</d:persistNotifications> 
    <d:collection>WorkflowTaskCollection</d:collection> 
    <d:filter m:null="true" /> 
    <d:select>*</d:select> 
    </m:properties>
    </atom:content>
    </atom:entry>
    
     
    Note

    The main editable fields in the code are:

    • Delivery address

      Note

      The Delivery address must be the same address as that used in the process of creating a type G RFC destination. If the address is different, the notification is not sent to the user.

    • Select — You must enter'*' to subscribe the user to the full notification or Empty to subscribe the user to the short notification.

  4. Press Send.

Subscription Management Service

You can also subscribe to notifications using the Subscription Management service. For more information on the Subscription Management service, see the Subscription and Notification Flow - OData Channel section.

To subscribe to a Workflow service, add the /IWWRK/RT_WF_SUB_USR role template to the authorizations of the user executing the subscription.

The example below shows how to subscribe a role to a Workflow service using the Subscription Management service.

Request
POST /IWBEP/SUBSCRIPTIONMANAGEMENT/SubscriptionCollection HTTP/1.1
Host: <host>:<port>
accept: application/atom+xml
content-type: application/atom+xml
Content-Length: 634
X-Requested-With: XMLHttpRequest
X-CSRF-Token: krVmAnoj48a0mn36shLKRA== 
 
<?xml version="1.0" encoding="utf-8"?>
<atom:entry xml:base="http://ldcigkq.wdf.sap.corp:50080/sap/opu/odata/IWBEP/SUBSCRIPTIONMANAGEMENT/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<atom:content type="application/xml">
<m:properties>
<d:ID>1</d:ID>
<d:CreatedBy/>
<d:TechnicalServiceName> /IWWRK/WFSERVICE</d:TechnicalServiceName>
<d:TechnicalServiceVersion>0001</d:TechnicalServiceVersion>
<d:DeliveryAddress>http://10.52.21.245:8000/alerts/</d:DeliveryAddress>
<d:PersistNotifications>false</d:PersistNotifications>
<d:Collection>WorkflowTaskCollection</d:Collection>
<d:Filter/>
<d:Select>*</d:Select>
<d:ChangeType>created</d:ChangeType>
<d:Principal>SAP_ASR_EMPLOYEE</d:Principal>
<d:PrincipalType>ROLE</d:PrincipalType>
<d:BaseUrl/>
</m:properties>
</atom:content>
</atom:entry>