Professional Documents
Culture Documents
4 Sample Requests. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Use this guide to implement your own OData task provider for My Inbox, which is based on the task consumption
model (TCM).
Prerequisites
Context
If you want to receive and execute all your tasks directly in My Inbox, you can now implement your own TCM-
compliant OData service, reachable via a URL, and connect it to your back-end system.
For more information about the TCM, see Task Consumption Model (TCM) [page 5].
Note
If your provider is ABAP based, then it is more efficient to implement it as described in this SCN article .
If your provider is not ABAP based, then we recommend to implement it via the TCM-compliant OData service
as described in this document.
Procedure
1. As a basis for the implementation, take a look at the TCM metadata xml document in SAP Note 2304317 .
2. Implement the minimal set of entities and their mandatory properties to manage tasks from My Inbox.
Task and TaskSupports
TaskDescription
TaskDefinition
UIExecution
For a brief description of the mandatory entities and properties and how they are represented in My Inbox,
see Mandatory Entities and Properties [page 6].
Note
The listed properties of the entities in the tables are by no means complete. For a complete list of entities
and properties, see the TCM metadata xml document in SAP Note 2304317 .
3. Optional: Implement optional entities, function imports, and complex types to support additional My Inbox
features.
DecisionOptions as optional properties (function imports) of the TaskDefinition entity
CustomAttribute and CustomAttributeDefinition
UserInfo
Comment
Attachment
SubstitutionRule and SubstitutionProfile
For a brief description of the optional entities and properties and how they are represented in My Inbox, see
Optional Entities and Properties [page 9].
Note
The listed properties of the entities in the tables are by no means complete. For a complete list of entities
and properties, see the TCM metadata xml document in SAP Note 2304317 .
4. Implement requests.
For sample requests that you can use with a TCM service, see Sample Requests [page 14].
For error handling methods, see HTTP status codes [page 17].
5. Conduct the following testing activities:
a. Test your implemented OData service.
b. After connecting your OData service to Task Gateway, test your My Inbox with the connected OData
service.
Related Information
The task consumption model is a standard format for describing (workflow) tasks and related entities.
The TCM enables you to harmonize (workflow) tasks across multiple applications and solutions, and makes them
interoperable. It is a standard OData service definition that you must comply with as a task provider.
The TCM is implemented by the Task Gateway Service. For more information, see Task Gateway Service.
This section gives an overview of the mandatory entities with their mandatory properties, a brief description, and
how they are represented in My Inbox.
This graphic shows how the mandatory entities are related to each other:
Note
The listed properties of the entities in the following tables are by no means complete. For a complete list of
entities and properties, see the TCM metadata xml document in SAP Note 2304317 , or refer to the Task
Gateway Service documentation.
Note
The property SAP_Origin is a mandatory property for TCM all entities. You must set it as NA for all entities. It
was introduced in order for the Task Gateway system to differentiate between tasks from different provider
systems. The value NA is automatically replaced by the Gateway before providing the information to My Inbox.
Note
All properties of all entities that are language-dependant, are only exposed in the current language of the
session. The language can be identified by the http headers Accept-Language: en or SAP-Language: E in the
http requests.
Table 1:
Task Represents a task instance based on the TaskDefinition Entry in task list on the left
hand side, with subject (for ex
ample: Approve leave
request from John
Smith) and other information.
The user can open the task de
tails from here.
Table 2:
TaskDescription Translatable long text of a task that can include HTML code Detail view of a task on the
right hand side, with additional
information on the task, repre
sented in tabs.
InstanceID The unique ID of the task description UI entity For example TD000001A
Table 3:
TaskDefinition Definition of a task, in order to sort and filter them, and to display at Options Sort, Filter, and Group,
represented as buttons with
tributes; possibility to define categories of tasks in order to group
icons, in footer bar on the bot
them
tom left.
Note
My Inbox expects a TaskDefinition only, when the current user has a task instance with the respective task
definition in the inbox or outbox.
UIExecution Represents the link to the task application UI: Open Task button in footer bar
on the bottom right, or if con
External UI to another application with static URL in a new
figured, automatically shown in
browser window
the detail view of a task.
Intent-based URL for UIs that are activated on the SAP Fiori front-
end server
For more information, see Configuring Navigation in the SAP Fiori
Launchpad documentation.
InstanceID The unique ID of the task execution UI entity For example TUIEx000001
GUI_Link The URL to navigate to, when opening the task execution UI
This table gives an overview of the optional entities with their mandatory properties,a brief description, and how
they are represented in My Inbox.
Note
The listed properties of the entities in the following tables are by no means complete. For a complete list of
entities and properties, see the TCM metadata xml document in SAP Note 2304317 , or refer to the Task
Gateway Service documentation.
Note
The property SAP_Origin is a mandatory property for TCM all entities. You must set it as NA for all entities. It
was introduced in order for the Task Gateway system to differentiate between tasks from different provider
systems. The value NA is automatically replaced by the Gateway before providing the information to My Inbox.
Note
All properties of all entities that are language-dependant, are only exposed in the current language of the
session. The language can be identified by the http headers Accept-Language: en or SAP-Language: E in the
http requests.
Table 5:
DecisionOptions (func Decisions, which the user can execute anytime, without display Possible decision options (e.g.
tion import) ing the task in the detail view. Based on the implementation of Approve and Reject), repre
these decisions, specific buttons are displayed. sented as buttons in the footer
bar on the bottom left.
Table 7:
CustomAttribute Task-specific information that describes the values for a task, Information tab
InstanceID The key of the task to which the custom attribute value belongs For example TCA000001
Table 8:
tion
Each task entity has a task definition ID as a foreign key to navi
gate to a task definition entity. Custom attribute definitions are
metadata about the additional information pertaining to the task
instance environment.
TaskDefinitionID The foreign key to navigate to a task definition entity For example TDefID000001
Table 9:
UserInfo Information about the user, such as first name, last name, phone Information tab
Address The address of the user including Street, StreetNumber, City, For example
Table 10:
Comment Comments about a specific task, created by any user who can Comment tab, listing all com
ments (for example, by creator
view the task
Please approve my leave re
quest.)
Note
Comments can be read-
only, or directly created in
My Inbox if the functionality
is implemented.
InstanceID The ID of the task to which this comment belongs For example T000001.
Table 11:
Attachment Documents or pictures, attached by the creator or processor Attachments tab, listing all at
tachments
Note
Attachments can be read-
only, or directly created in
My Inbox if the functionality
is implemented.
InstanceID The ID of the task to which this attachment belongs For example T000001.
SystemInfo Represents the task provider system. Each provider will return Information about task pro
vider in the detail view of a task
one single SystemInfo entity.
at the top center
Table 13:
SubstitutionRule Represents a substitution, either a general one, or for a specific Manage my Substitutes button
in the bottom right, and the re
time range.
spective option to define sub
stitutes
User The ID of the substitute user who will work on the current user's For example User0000028.
BeginDate The date when this rule starts being valid For example 2015-10-01.
EndDate The date when this rule stops being valid For example 2016-10-31.
Table 14:
SubstitutionProfile Specific profile according to which a substitution takes place; Option within Manage my
Substitutes to define specific
groups types of tasks according to function
taks that are to be executed by
the substitute
Profile The key of the substitution profile representing a group of task For example SP000001.
Table 15:
ProcessingLog History of actions that have been executed on the task, with de Task History tab (for example
Employee X has created a
tailed information
leave request.)
InstanceID The ID of the task to which the processing log belongs For example T000001.
OrderID The ID of the order of the processing log For example PL00001
This sections provides some sample requests that you can use with a TCM service.
Start application
Table 16:
Method Sample Request
GET TaskCollection?$skip=0&$top=1000&$orderby=CreatedOn%20desc&$filter=((Status%20eq%20%27READY
%27%20or%20Status%20eq%20%27RESERVED%27%20or%20Status%20eq%20%27IN_PROGRESS
%27%20or%20Status%20eq%20%27EXECUTED%27))&$inlinecount=allpa
TaskCollection(SAP__Origin='NA',InstanceID='<to be replaced>')
TaskCollection(SAP__Origin='NA'',InstanceID='<to be replaced>')/Description
TaskCollection(SAP__Origin='NA',InstanceID='<to be replaced>')/CustomAttributeData
TaskCollection(SAP__Origin='NA'',InstanceID='<to be replaced>')/UIExecutionLink
DecisionOptions?SAP__Origin='NA''&InstanceID='<to be replaced>'
TaskCollection(SAP__Origin='NA'',InstanceID='<to be replaced>')/Attachments/$count
TaskCollection(SAP__Origin='NA'',InstanceID='<to be replaced>')/Comments/$count
TaskCollection(SAP__Origin='NA',InstanceID='<to be replaced>')/ProcessingLogs/$count
TaskCollection(SAP__Origin='NA'',InstanceID='<to be replaced>')/TaskObjects/$count
Tasks
Table 17:
Sort TaskCollection?$skip=94&$top=5&$orderby=CreatedByName%20asc&$fil
ter=((Status%20eq%20%27READY%27%20or%20Status%20eq%20%27RE
SERVED%27%20or%20Status%20eq%20%27IN_PROGRESS%27%20or%20Status
%20eq%20%27EXECUTED%27))&$inlinecount=allpages
Table 18:
/TASKPROCESSING;mo;v=2/UserInfoCollection(SAP__Origin='NA',Unique
Name='FRITSCHE')/$value
Substitution
Table 19:
/TASKPROCESSING;mo;v=2/UserInfoCollection(SAP__Origin='NA',Unique
Name='MIUSER7')/$value
Substitute For
Attachments
Table 20:
If an error occurs while processing the received service request, the TCM OData service returns a suitable error
response along with a corresponding HTTP status code.
Table 21:
HTTP status code Description
403 (Forbidden) The user who sent the request is not authorized to access the
requested data, or to perform the requested action.
405 (Method Not Allowed) The action to be executed is not supported by the OData serv
ice.
406 (Not Acceptable) The requested object cannot be returned in the specified for
mat according to the accept headers.
500 (Internal Server Error) An error occurred while processing the request.
501 (Not Implemented) The OData service does not support the requested operation.
Coding Samples
Any software coding and/or code lines / strings ("Code") included in this documentation are only examples and are not intended to be used in a productive system
environment. The Code is only intended to better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and
completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, unless damages were caused by SAP
intentionally or by SAP's gross negligence.
Accessibility
The information contained in the SAP documentation represents SAP's current view of accessibility criteria as of the date of publication; it is in no way intended to be a
binding guideline on how to ensure accessibility of software products. SAP in particular disclaims any liability in relation to this document. This disclaimer, however, does
not apply in cases of wilful misconduct or gross negligence of SAP. Furthermore, this document does not result in any direct or indirect contractual obligations of SAP.
Gender-Neutral Language
As far as possible, SAP documentation is gender neutral. Depending on the context, the reader is addressed directly with "you", or a gender-neutral noun (such as "sales
person" or "working days") is used. If when referring to members of both sexes, however, the third-person singular cannot be avoided or a gender-neutral noun does not
exist, SAP reserves the right to use the masculine form of the noun and pronoun. This is to ensure that the documentation remains comprehensible.
Internet Hyperlinks
The SAP documentation may contain hyperlinks to the Internet. These hyperlinks are intended to serve as a hint about where to find related information. SAP does not
warrant the availability and correctness of this related information or the ability of this information to serve a particular purpose. SAP shall not be liable for any damages
caused by the use of related information unless damages have been caused by SAP's gross negligence or willful misconduct. All links are categorized for transparency
(see: http://help.sap.com/disclaimer).