Skip to content

Commit

Permalink
Made monitoring links in alert mails tenant aware
Browse files Browse the repository at this point in the history
  • Loading branch information
codebude committed Oct 9, 2019
1 parent ee6a851 commit a60cc80
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion IFlow/Source/META-INF/MANIFEST.MF
Expand Up @@ -3,7 +3,7 @@ SAP-RuntimeProfile: iflmap
Bundle-SymbolicName: Webbrowser_to_CPI_SystemMonitor_RealcoreDashboard
; singleton:=true
Bundle-Name: Webbrowser_to_CPI_SystemMonitor_RealcoreDashboard
Bundle-Version: 1.0.28
Bundle-Version: 1.0.31
Bundle-ManifestVersion: 2
SAP-ArtifactTrait:
SAP-NodeType: IFLMAP
Expand Down
Expand Up @@ -4149,7 +4149,7 @@
<value>ctype::FlowstepVariant/cname::GatewayRoute/version::1.0.0</value>
</ifl:property>
</bpmn2:extensionElements>
<bpmn2:conditionExpression id="FormalExpression_SequenceFlow_193480_1570536908275" xsi:type="bpmn2:tFormalExpression">${header.SAP_DatastoreEntryFound} != 'false'</bpmn2:conditionExpression>
<bpmn2:conditionExpression id="FormalExpression_SequenceFlow_193480_1570594550480" xsi:type="bpmn2:tFormalExpression">${header.SAP_DatastoreEntryFound} != 'false'</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="SequenceFlow_193478" name="no" sourceRef="ExclusiveGateway_193477" targetRef="ServiceTask_193432">
<bpmn2:extensionElements>
Expand Down Expand Up @@ -4182,7 +4182,7 @@
<value>ctype::FlowstepVariant/cname::GatewayRoute/version::1.0.0</value>
</ifl:property>
</bpmn2:extensionElements>
<bpmn2:conditionExpression id="FormalExpression_SequenceFlow_193484_1570536908275" xsi:type="bpmn2:tFormalExpression">${property.mplQuery.get('endDate').toString().endsWith('59:59.999')} = 'true'</bpmn2:conditionExpression>
<bpmn2:conditionExpression id="FormalExpression_SequenceFlow_193484_1570594550481" xsi:type="bpmn2:tFormalExpression">${property.mplQuery.get('endDate').toString().endsWith('59:59.999')} = 'true'</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="SequenceFlow_193486" name="no" sourceRef="ExclusiveGateway_193483" targetRef="CallActivity_193457">
<bpmn2:extensionElements>
Expand Down Expand Up @@ -4836,7 +4836,7 @@
</ifl:property>
<ifl:property>
<key>propertyTable</key>
<value>&lt;row&gt;&lt;cell id='Action'&gt;Create&lt;/cell&gt;&lt;cell id='Type'&gt;expression&lt;/cell&gt;&lt;cell id='Value'&gt;${body}&lt;/cell&gt;&lt;cell id='Default'&gt;&lt;/cell&gt;&lt;cell id='Name'&gt;cacheAlertCertResponse&lt;/cell&gt;&lt;cell id='Datatype'&gt;java.lang.String&lt;/cell&gt;&lt;/row&gt;</value>
<value>&lt;row&gt;&lt;cell id='Action'&gt;Create&lt;/cell&gt;&lt;cell id='Type'&gt;constant&lt;/cell&gt;&lt;cell id='Value'&gt;{{SAP_CPI_HOST}}&lt;/cell&gt;&lt;cell id='Default'&gt;&lt;/cell&gt;&lt;cell id='Name'&gt;tenantHostname&lt;/cell&gt;&lt;cell id='Datatype'&gt;&lt;/cell&gt;&lt;/row&gt;&lt;row&gt;&lt;cell id='Action'&gt;Create&lt;/cell&gt;&lt;cell id='Type'&gt;expression&lt;/cell&gt;&lt;cell id='Value'&gt;${body}&lt;/cell&gt;&lt;cell id='Default'&gt;&lt;/cell&gt;&lt;cell id='Name'&gt;cacheAlertCertResponse&lt;/cell&gt;&lt;cell id='Datatype'&gt;java.lang.String&lt;/cell&gt;&lt;/row&gt;</value>
</ifl:property>
<ifl:property>
<key>headerTable</key>
Expand Down Expand Up @@ -5091,7 +5091,7 @@
<value>ctype::FlowstepVariant/cname::GatewayRoute/version::1.0.0</value>
</ifl:property>
</bpmn2:extensionElements>
<bpmn2:conditionExpression id="FormalExpression_SequenceFlow_193621_1570536908277" xsi:type="bpmn2:tFormalExpression">${property.numAlertMails} &gt; '0'</bpmn2:conditionExpression>
<bpmn2:conditionExpression id="FormalExpression_SequenceFlow_193621_1570594550485" xsi:type="bpmn2:tFormalExpression">${property.numAlertMails} &gt; '0'</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="SequenceFlow_193660" name="yes" sourceRef="ExclusiveGateway_193659" targetRef="CallActivity_193634">
<bpmn2:extensionElements>
Expand All @@ -5108,7 +5108,7 @@
<value>ctype::FlowstepVariant/cname::GatewayRoute/version::1.0.0</value>
</ifl:property>
</bpmn2:extensionElements>
<bpmn2:conditionExpression id="FormalExpression_SequenceFlow_193660_1570536908277" xsi:type="bpmn2:tFormalExpression">${property.numAlertRules} &gt; '0'</bpmn2:conditionExpression>
<bpmn2:conditionExpression id="FormalExpression_SequenceFlow_193660_1570594550486" xsi:type="bpmn2:tFormalExpression">${property.numAlertRules} &gt; '0'</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="SequenceFlow_193662" name="no" sourceRef="ExclusiveGateway_193659" targetRef="CallActivity_193668">
<bpmn2:extensionElements>
Expand Down Expand Up @@ -5605,7 +5605,7 @@
<value>ctype::FlowstepVariant/cname::GatewayRoute/version::1.0.0</value>
</ifl:property>
</bpmn2:extensionElements>
<bpmn2:conditionExpression id="FormalExpression_SequenceFlow_193718_1570536908278" xsi:type="bpmn2:tFormalExpression">${header.CamelHttpMethod} = 'POST'</bpmn2:conditionExpression>
<bpmn2:conditionExpression id="FormalExpression_SequenceFlow_193718_1570594550489" xsi:type="bpmn2:tFormalExpression">${header.CamelHttpMethod} = 'POST'</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="SequenceFlow_193711" name="GET" sourceRef="ExclusiveGateway_193710" targetRef="CallActivity_193696">
<bpmn2:extensionElements>
Expand All @@ -5622,7 +5622,7 @@
<value>ctype::FlowstepVariant/cname::GatewayRoute/version::1.0.0</value>
</ifl:property>
</bpmn2:extensionElements>
<bpmn2:conditionExpression id="FormalExpression_SequenceFlow_193711_1570536908278" xsi:type="bpmn2:tFormalExpression">${header.CamelHttpMethod} = 'GET'</bpmn2:conditionExpression>
<bpmn2:conditionExpression id="FormalExpression_SequenceFlow_193711_1570594550489" xsi:type="bpmn2:tFormalExpression">${header.CamelHttpMethod} = 'GET'</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="SequenceFlow_193705" sourceRef="CallActivity_193703" targetRef="EndEvent_193694"/>
<bpmn2:sequenceFlow id="SequenceFlow_193716" sourceRef="CallActivity_193714" targetRef="EndEvent_193713"/>
Expand Down Expand Up @@ -5898,7 +5898,7 @@
<value>ctype::FlowstepVariant/cname::GatewayRoute/version::1.0.0</value>
</ifl:property>
</bpmn2:extensionElements>
<bpmn2:conditionExpression id="FormalExpression_SequenceFlow_193658_1570536908286" xsi:type="bpmn2:tFormalExpression">${header.SAP_DatastoreEntryFound} != 'false'</bpmn2:conditionExpression>
<bpmn2:conditionExpression id="FormalExpression_SequenceFlow_193658_1570594550493" xsi:type="bpmn2:tFormalExpression">${header.SAP_DatastoreEntryFound} != 'false'</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="SequenceFlow_193657" sourceRef="CallActivity_193583" targetRef="CallActivity_193684"/>
<bpmn2:sequenceFlow id="SequenceFlow_193728" sourceRef="CallActivity_193727" targetRef="CallActivity_193684"/>
Expand Down
Expand Up @@ -27,6 +27,7 @@ def Message processData(Message message) {
//only process active rules
if (rule.active){
if (rule.ruletype.equals("message")){
def tenantHostname = message.getProperty("tenantHostname")
//Check all messages for matches
def matchingMsgs = []
new JsonSlurper().parseText(message.getProperty("cacheAlertMplResponse")).d.results.each { msg ->
Expand All @@ -39,7 +40,7 @@ def Message processData(Message message) {
if (matchingMsgs.size() > 0) {
def mailText = "Dear operator(s),<br/><br/>during the alert check for message between ${message.getProperty("alertLastRunBeginDate")}(UTC) and ${message.getProperty("alertLastRunDateNew")}(UTC) there was a problem found in the interface \"${rule.artifact_id}\".<br/><br/><u>The matching alert rule is:</u> ${rule.name}<br/><u>The user alert text is:</u> ${rule.alert_receiver_body}<br/><br/><u>The following ${matchingMsgs.size()} messages are affected:</u><br/><ul>"
matchingMsgs.each { msg ->
mailText += "<li><a href=\"https://p0401-tmn.hci.eu1.hana.ondemand.com/itspaces/shell/monitoring/Messages/%7B%22artifact%22:%22${rule.artifact_id}%22%7D\">${msg.id}</a> (Iflow-ID: ${msg.name})</li>"
mailText += "<li><a href=\"https://${tenantHostname}/itspaces/shell/monitoring/Messages/%7B%22artifact%22:%22${msg.name}%22%7D\">${msg.id}</a> (Iflow-ID: ${msg.name})</li>"
}
mailText += "</ul>"
rule.put("mailtext",mailText)
Expand Down

Large diffs are not rendered by default.

Binary file modified Webfrontend/dist/index.html
Binary file not shown.
2 changes: 1 addition & 1 deletion Webfrontend/dist/index_base64.txt

Large diffs are not rendered by default.

Binary file modified Webfrontend/dist/staticContent.groovy
Binary file not shown.

0 comments on commit a60cc80

Please sign in to comment.