我无法让ProtonCEP根据缺席规则创建事件。
EPA" MissingQueueDataRule"应该创建一个事件" MissingQueueData"如果没有类型的事件" QueueContextUpdate" (事件的entityID不重要)是在过去的时间间隔(30秒)内收到的。
日志中没有明显的错误。
{
"epn": {
"events": [
{
"name": "Device",
"createdDate": "Thu Nov 12 2015",
"attributes": [
{
"name": "datacount5",
"type": "Integer",
"dimension": 0,
"description": "The certainty that this event happen (value between 0 to 1)"
}
]
},
{
"name": "Queue",
"createdDate": "Thu Nov 12 2015",
"attributes": [
{
"name": "name",
"type": "String",
"dimension": "0"
},
{
"name": "volume",
"type": "Integer",
"dimension": "0"
}
]
},
{
"name": "DeviceContextUpdate",
"createdDate": "Thu Nov 12 2015",
"attributes": [
{
"name": "datacount5m",
"type": "Integer",
"dimension": 0,
"description": "The certainty that this event happen (value between 0 to 1)"
},
{
"name": "entityId",
"type": "String",
"dimension": "0"
},
{
"name": "entityType",
"type": "String",
"dimension": "0"
},
{
"name": "lastupdate",
"type": "Date",
"dimension": "0"
},
{
"name": "activationdate",
"type": "Date",
"dimension": "0"
},
{
"name": "efficiencyratio",
"type": "Double",
"dimension": "0"
}
]
},
{
"name": "QueueContextUpdate",
"createdDate": "Thu Nov 12 2015",
"attributes": [
{
"name": "volume",
"type": "Integer",
"dimension": "0"
},
{
"name": "entityId",
"type": "String",
"dimension": "0"
},
{
"name": "entityType",
"type": "String",
"dimension": "0"
}
]
},
{
"name": "QueueVolumeHigh",
"createdDate": "Wed Jan 27 2016",
"attributes": [
{
"name": "Certainty",
"type": "Double",
"defaultValue": "1",
"dimension": 0,
"description": "The certainty that this event happen (value between 0 to 1)"
},
{
"name": "OccurrenceTime",
"type": "Date",
"dimension": 0,
"description": "No value means it equals the event detection time, other option is to use one of the defined distribution functions with parameters"
},
{
"name": "ExpirationTime",
"type": "Date",
"dimension": 0
},
{
"name": "Cost",
"type": "Double",
"dimension": 0,
"description": "The cost of this event occurrence. Negative if this is an opportunity"
},
{
"name": "Duration",
"type": "Double",
"defaultValue": "0",
"dimension": 0,
"description": "Used in case the this event occur within an interval"
},
{
"name": "AffectedEntity",
"type": "String",
"dimension": "0"
},
{
"name": "AffectedEntityType",
"type": "String",
"dimension": "0"
},
{
"name": "EventType",
"type": "String",
"dimension": "0"
},
{
"name": "EventSeverity",
"type": "String",
"dimension": "0"
},
{
"name": "AffectedEntityVolume",
"type": "Integer",
"dimension": "0"
}
]
},
{
"name": "MissingQueueData",
"createdDate": "Wed Jan 27 2016",
"attributes": [
{
"name": "Certainty",
"type": "Double",
"defaultValue": "1",
"dimension": 0,
"description": "The certainty that this event happen (value between 0 to 1)"
},
{
"name": "OccurrenceTime",
"type": "Date",
"dimension": 0,
"description": "No value means it equals the event detection time, other option is to use one of the defined distribution functions with parameters"
},
{
"name": "ExpirationTime",
"type": "Date",
"dimension": 0
},
{
"name": "Cost",
"type": "Double",
"dimension": 0,
"description": "The cost of this event occurrence. Negative if this is an opportunity"
},
{
"name": "Duration",
"type": "Double",
"defaultValue": "0",
"dimension": 0,
"description": "Used in case the this event occur within an interval"
},
{
"name": "EventSeverity",
"type": "String",
"defaultValue": "\"Warning\"",
"dimension": "0"
}
]
}
],
"epas": [
{
"name": "CriticalQueueVolumeRule",
"description": "Emit a QueueVolumeHigh with Severity=Critical if any Queue volume > 1000",
"createdDate": "Wed Jan 27 2016",
"createdBy": "Pedro",
"epaType": "All",
"context": "CriticalQueueVolumeComb",
"inputEvents": [
{
"name": "QueueContextUpdate",
"filterExpression": "QueueContextUpdate.volume>1000",
"consumptionPolicy": "Consume",
"instanceSelectionPolicy": "First"
}
],
"computedVariables": [],
"evaluationPolicy": "Immediate",
"cardinalityPolicy": "Single",
"internalSegmentation": [],
"derivedEvents": [
{
"name": "QueueVolumeHigh",
"reportParticipants": false,
"expressions": {
"OccurrenceTime": "QueueContextUpdate.DetectionTime",
"Duration": "0",
"AffectedEntity": "QueueContextUpdate.entityId",
"AffectedEntityType": "QueueContextUpdate.entityType",
"EventType": "\"QueueVolumeHigh\"",
"EventSeverity": "\"Critical\"",
"AffectedEntityVolume": "QueueContextUpdate.volume"
}
}
]
},
{
"name": "MissingQueueDataRule",
"description": "Detect when the scripts stop working and sending queue data",
"createdDate": "Wed Jan 27 2016",
"epaType": "Absence",
"context": "MissingQueueDataWindow",
"inputEvents": [
{
"name": "QueueContextUpdate",
"alias": "Q1",
"consumptionPolicy": "Consume",
"instanceSelectionPolicy": "First"
}
],
"computedVariables": [],
"evaluationPolicy": "Deferred",
"cardinalityPolicy": "Single",
"internalSegmentation": [],
"derivedEvents": [
{
"name": "MissingQueueData",
"reportParticipants": false,
"expressions": {
"Certainty": "1.0",
"Duration": "0",
"EventSeverity": "\"Warning\""
}
}
]
}
],
"contexts": {
"temporal": [
{
"name": "Always",
"createdDate": "Wed Jan 27 2016",
"type": "TemporalInterval",
"atStartup": true,
"neverEnding": true,
"initiators": [],
"terminators": []
},
{
"name": "CriticalQueueVolumeWindow",
"description": "Start when queue volume > 1000, ends in 30seconds",
"createdDate": "Wed Jan 27 2016",
"createdBy": "Pedro",
"type": "TemporalInterval",
"atStartup": false,
"neverEnding": false,
"initiators": [
{
"initiatorType": "Event",
"initiatorPolicy": "Ignore",
"name": "QueueContextUpdate",
"condition": "QueueContextUpdate.volume>1000"
}
],
"terminators": [
{
"terminatorType": "Event",
"terminatorPolicy": "First",
"terminationType": "Terminate",
"name": "QueueContextUpdate",
"condition": " QueueContextUpdate.volume<500"
},
{
"terminatorType": "RelativeTime",
"terminationType": "Terminate",
"relativeTime": "300000"
}
]
},
{
"name": "MissingQueueDataWindow",
"createdDate": "Wed Jan 27 2016",
"type": "TemporalInterval",
"atStartup": false,
"neverEnding": false,
"initiators": [
{
"initiatorType": "Event",
"initiatorPolicy": "Add",
"name": "QueueContextUpdate"
}
],
"terminators": [
{
"terminatorType": "RelativeTime",
"terminationType": "Terminate",
"relativeTime": "10000"
}
]
}
],
"segmentation": [
{
"name": "QueueID",
"description": "Treat objects as distinct based on entityID",
"createdDate": "Wed Jan 27 2016",
"createdBy": "Pedro",
"participantEvents": [
{
"name": "QueueContextUpdate",
"expression": "QueueContextUpdate.entityId"
},
{
"name": "QueueVolumeHigh",
"expression": "QueueVolumeHigh.AffectedEntity"
}
]
}
],
"composite": [
{
"name": "CriticalQueueVolumeComb",
"createdDate": "Wed Jan 27 2016",
"temporalContexts": [
{
"name": "CriticalQueueVolumeWindow"
}
],
"segmentationContexts": [
{
"name": "QueueID"
}
]
}
]
},
"consumers": [
{
"name": "DeviceReport",
"createdDate": "Thu Nov 12 2015",
"type": "File",
"properties": [
{
"name": "filename",
"value": "/usr/share/tomcat/webapps/sample/SentinelMonitor_DeviceReport.txt"
},
{
"name": "formatter",
"value": "json"
},
{
"name": "delimiter",
"value": ";"
},
{
"name": "tagDataSeparator",
"value": "="
},
{
"name": "SendingDelay",
"value": "1000"
}
],
"events": [
{
"name": "Device"
}
]
},
{
"name": "QueueReport",
"createdDate": "Thu Nov 12 2015",
"type": "File",
"properties": [
{
"name": "filename",
"value": "/usr/share/tomcat/webapps/sample/SentinelMonitor_QueueReport.txt"
},
{
"name": "formatter",
"value": "json"
},
{
"name": "delimiter",
"value": ";"
},
{
"name": "tagDataSeparator",
"value": "="
},
{
"name": "SendingDelay",
"value": "1000"
}
],
"events": [
{
"name": "Queue"
}
]
},
{
"name": "DeviceContextUpdateReport",
"createdDate": "Thu Nov 12 2015",
"type": "File",
"properties": [
{
"name": "filename",
"value": "/usr/share/tomcat/webapps/sample/SentinelMonitor_DeviceContextUpdateReport.txt"
},
{
"name": "formatter",
"value": "json"
},
{
"name": "delimiter",
"value": ";"
},
{
"name": "tagDataSeparator",
"value": "="
},
{
"name": "SendingDelay",
"value": "1000"
}
],
"events": [
{
"name": "DeviceContextUpdate"
}
]
},
{
"name": "QueueContextUpdateReport",
"createdDate": "Thu Nov 12 2015",
"type": "File",
"properties": [
{
"name": "filename",
"value": "/usr/share/tomcat/webapps/sample/SentinelMonitor_QueueContextUpdateReport.txt"
},
{
"name": "formatter",
"value": "json"
},
{
"name": "delimiter",
"value": ";"
},
{
"name": "tagDataSeparator",
"value": "="
},
{
"name": "SendingDelay",
"value": "1000"
}
],
"events": [
{
"name": "QueueContextUpdate"
},
{
"name": "QueueVolumeHigh"
},
{
"name": "MissingQueueData"
}
]
}
],
"producers": [],
"name": "SentinelMonitor"
}
}
答案 0 :(得分:1)
问题是您的EPA正在使用的时间上下文的发起者是您要查找的QueueContextUpdate
事件。由于此事件未到达,因此不会启动上下文......并且EPA根本不活动...
为了测试,我建议将时间上下文的发起者更改为At Startup
并尝试再次运行。
稍后,您需要确定此时间上下文的正确定义是什么,以及什么是正确的启动器。也许您想将此时间上下文设置为Sliding Time Window
类型?