{
"MessageGuid": "AFq478Bblxi4wCjBcDb_G0vAGGZG",
"CorrelationId": "AFq478Bmn-aPieAWVy0mMGPLWsjx",
"ApplicationMessageId": 0000000123,
"ApplicationMessageType": null,
"LogStart": "/Date(1522069440003)/",
"LogEnd": "/Date(1522069440200)/",
"Sender": null,
"Receiver": null,
"IntegrationFlowName": "IntegrationFlow_AdapterData_FAILED_PROCESSING",
"Status": "FAILED",
"AlternateWebLink": "https://sandbox.api.sap.com:443:443/itspaces/shell/monitoring/MessageDetails/%7B%22messageGuid%22%3A%22AFq478Bblxi4wCjBcDb_G0vAGGZG%22%7D",
"IntegrationArtifact": {
"Id": "IntegrationFlow_AdapterData_FAILED_PROCESSING",
"Name": "Integration Flow with Adapter Data - FAILED PROCESSING",
"Type": "INTEGRATION_FLOW"
},
"LogLevel": "INFO",
"CustomStatus": "FAILED",
"TransactionId": "636260297acc487198a65955d3648c49",
"PreviousComponentName": "CPI_cpisbsa1",
"LocalComponentName": "CPI_cpisbsa1",
"OriginComponentName": null,
"CustomHeaderProperties": {
"__deferred": {
"uri": "https://sandbox.api.sap.com:443:443/cpi/api/v1/MessageProcessingLogs('AFq478Bblxi4wCjBcDb_G0vAGGZG')/CustomHeaderProperties"
}
},
"MessageStoreEntries": {
"__deferred": {
"uri": "https://sandbox.api.sap.com:443:443/cpi/api/v1/MessageProcessingLogs('AFq478Bblxi4wCjBcDb_G0vAGGZG')/MessageStoreEntries"
}
},
"ErrorInformation": {
"__deferred": {
"uri": "https://sandbox.api.sap.com:443:443/cpi/api/v1/MessageProcessingLogs('AFq478Bblxi4wCjBcDb_G0vAGGZG')/ErrorInformation"
}
},
"AdapterAttributes": {
"__deferred": {
"uri": "https://sandbox.api.sap.com:443:443/cpi/api/v1/MessageProcessingLogs('AFq478Bblxi4wCjBcDb_G0vAGGZG')/AdapterAttributes"
}
},
"Attachments": {
"__deferred": {
"uri": "https://sandbox.api.sap.com:443:443/cpi/api/v1/MessageProcessingLogs('AFq478Bblxi4wCjBcDb_G0vAGGZG')/Attachments"
}
},
"Runs": {
"__deferred": {
"uri": "https://sandbox.api.sap.com:443:443/cpi/api/v1/MessageProcessingLogs('AFq478Bblxi4wCjBcDb_G0vAGGZG')/Runs"
}
}
}
&$select=IntegrationArtifact
Event toNotification(String flowId, def messages, Message message) {
String flowName = messages[0].IntegrationArtifact.Name.toString()
String flowType = messages[0].IntegrationArtifact.Type.toString()
String currentTimeFrameStart = getStringHeader(message, CURRENT_TIME_FRAME_START_HEADER_NAME)
String currentTimeFrameEnd = getStringHeader(message, CURRENT_TIME_FRAME_END_HEADER_NAME)
//Added --------------
//The flow sends aggregated results therefore all failed guids/idocs will need to be aggregated as well
StringBuilder applicationMessageIds = new StringBuilder("")
//Loop through messages and get the details
for(mess in messages) {
if(mess.ApplicationMessageId.toString()){
applicationMessageIds.append(";" + mess.ApplicationMessageId.toString())
} else {
applicationMessageIds.append(";" + mess.MessageGuid.toString())
}
}
//Added --------------
return new Event(
//You can modify eventType too!
eventType: "CPIIntegrationFlowExecutionFailure",
resource: new Resource(
resourceName: flowName,
resourceType: flowType
),
severity: "INFO",
category: "NOTIFICATION",
subject: "CPI Integration Flow '${flowName}': Execution Failure",
body: "There were '${messages.size()}' failures for the '${flowName}' integration flow within the time frame starting from '${currentTimeFrameStart}' and ending at '${currentTimeFrameEnd}'. ",
tags: [
'cpi:IntegrationArtifact.Id': flowId,
//Added --------
'Details': applicationMessageIds.toString()
//Added --------
]
)
}
class Event {
String eventType
Resource resource
String severity
String category
String subject
String body
Map tags
}
{tags.Details}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
7 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
2 |