TCM Provider Implementation Guide
TCM Provider Implementation Guide
4 Sample Requests. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
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].
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 15].
For error handling methods, see HTTP status codes [page 18].
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:
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.
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 file in SAP Note 2304317 , or refer to the Task Gateway
service documentation on SAP Help Portal.
Note
The property SAP_Origin is a mandatory property for all TCM 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 system 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:
TaskSupports (complex
The TaskSupports entity transforms the information about
type)
which features of the different Task Gateway entities are sup
ported by the different task providers.
Table 7:
InstanceID The key of the task to which the custom attribute value belongs For example TCA000001
Table 8:
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
number, address, and so on
Table 10:
Comment Comments about a specific task, created by any user who can
Comment tab, listing all com-
view the task ments (for example, by creator
“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.
TAttach000001A.
Table 13:
User The ID of the substitute user who will work on the current user's For example User0000028.
tasks when the substitution rule becomes active.
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:
Profile The key of the substitution profile representing a group of task For example SP000001.
types for which the substitution rule is applied
Table 15:
ProcessingLog History of actions that have been executed on the task, with de
Workflow Log side bar (For ex
tailed information ample, “Employee X has cre
ated a leave request.”)
InstanceID The ID of the task to which the processing log belongs For example T000001. OrderID
Table 16:
WorkflowLog History of workflows for a task, with detailed information For example, Richard
Wilson created the
task on 06/14/2017 at
10:46 AM
InstanceID The ID of the task to which the workflow log belongs For example T000001.
EventOrder The order in which the events have been processed for a work- For example,John Miller
flow
created the task and af-
terwards Denise Smith
completed the task”
ReferenceInstanceID The ID of the task instance for which the event has been trig Not visible in the UI
gered
PerformedBy The unique ID of the agent who performed the action on the For example, ID000001
work item
PerformedByName The name of the agent who performed the action on the work For example, Donna Moore
item started the task
Timestamp Indication when the event was logged For example, 06/14/2017 at
10:46 AM
Description Description text of the work item For example, Approve leave
request for Julie
Armstrong
Country: USA
City: Palo Alto
SupportsNavigation Flag that determines whether the user can click the description For example, there is available
link to Approve leave
request for Julie
Armstrong
ResultType Nature for the outcome of the work item. For example: Negative (displayed
in Red), Positive (displayed in
Green), Neutral (displayed in
Black)
CreationTimestamp Indication when the workflow was initiated For example, Michael Adams
06/13/2017 at 14:00
EndTimestamp Indication by when the workflow should be completed. For example, Due on
For a completed task, it will be the completion time of the task. 06/15/2017 at 09:20 AM
PerformedByDetails Navigate to UserInfo entity. This entity provides information For example,
related to the user details for the event.
John Miller
Contact Details
Mobile: +1 610-661-
1000
Phone: +1 610-661-1000
Email:
john_miller@[Link]
m
Company
Name:XXXX
This sections provides some sample requests that you can use with a TCM service.
Start application
Table 17:
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 18:
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 19:
/TASKPROCESSING;mo;v=2/UserInfoCollection(SAP__Origin='NA',Unique
Name='FRITSCHE')/$value
Substitution
Table 20:
View Substitution
POST SubstitutionRuleCollection
Rule
SubstitutionProfileCollection
/TASKPROCESSING;mo;v=2/UserInfoCollection(SAP__Origin='NA',Unique
Name='MIUSER7')/$value
Add Substitution
SearchUsers?SAP__Origin='NA'&SearchPattern='miuser3'&MaxResults=100
Rule
SubstitutionProfileCollection
Substitute For
Attachments
Table 21:
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 22:
HTTP status code Description
400 (Bad
Request) The syntax of the sent request is invalid.
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 willful 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: [Link]