Product Information
SAP Digital Manufacturing: Notify workers via Microsoft Teams Integration
This blog enables you to notify workers via Teams using the powerful extensibility capabilities of SAP Digital Manufacturing as well as the Business Technology Platform.
To achieve this I am making use of the @mention capabilities of MS Teams.
This is only a simple example on how to use the Format cards in Microsoft Teams in order to mention users. It can be expanded to cover Use cases such as:
- Notifying Supervisors on certain Events in a Production/Process Order
- Requesting release of Process/Production Orders
- Notifying other departments
- Many more
Furthermore the Cards can be used to enhance the Look of messages.
Please refer to Format cards in Microsoft Teams
This example uses the default schema for “User mention in Incoming Webhook with Adaptive Cards” according to this Microsoft Teams Documentation. The schema definition can be expanded to fit your individual customer requirements.
Prerequisites:
In order to get started with the initial Integration please refer to blog by Kevin Hunter:
Integrating Microsoft Teams with SAP Digital Manufacturing Cloud
Setup:
Create a Service:
- Select Add
- Select New Service
- Make the following entries
- Add Body Schema:
- Content Type: application/json
- Data Type: Structure
- Schema: Define Inline Schema
Paste the following:
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"attachments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"contentType": {
"type": "string"
},
"content": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"body": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"text": {
"type": "string"
}
}
}
},
"$schema": {
"type": "string"
},
"version": {
"type": "string"
},
"msteams": {
"type": "object",
"properties": {
"entities": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"text": {
"type": "string"
},
"mentioned": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
},
"required": [
"type",
"attachments"
]
}
- Click Save
- Click Create for the Service
Use the Service in a Production Process:
The following is a simple example to test the functionality:
- Script Task:
$output.attachments=[
{
"contentType":"application/vnd.microsoft.card.adaptive",
"content":{
"type":"AdaptiveCard",
"body":[
{
"type":"TextBlock",
"text":"Hi <at>Firstname Lastname</at>"
}
],
"$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
"version":"1.0",
"msteams":{
"entities":[
{
"type":"mention",
"text":"<at>Firstname Lastname</at>",
"mentioned":{
"id":"firstname.lastname@examplemail.de",
"name":"Firstname Lastname"
}
}
]
}
}
}
]
- Define the output parameter of the script as your newly created schema. Make sure to select the attachmentsSchema within
- Make the following entries in the MicrosoftTeamsMention Block:
- Deploy and Test
Summary:
- Do preparation of teams integration.
- Create a custom Service to mention people
- Adjust the schema to your requirements
- Use the Service in you Production Processes
Thanks for reading. If you have any further questions let me know in the comments.
Relevant community resources: