Product Lifecycle Management Blogs by SAP
Dive into product lifecycle management news, learn about digitalizing PLM for the digital supply chain, and stay informed with product updates from SAP.
cancel
Showing results for 
Search instead for 
Did you mean: 
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:

  1. Notifying Supervisors on certain Events in a Production/Process Order

  2. Requesting release of Process/Production Orders

  3. Notifying other departments

  4. 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.

Adaptive Card Designer

Prerequisites:


In order to get started with the initial Integration please refer to blog by kevin.hunter3:
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


With this done you can check for the messages in your Teams channel.



Summary:



  1. Do preparation of teams integration.

  2. Create a custom Service to mention people

  3. Adjust the schema to your requirements

  4. 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:
3 Comments