getCEPEngineSubMonitor

Syntax

getCEPEngineSubMonitor(engine, subEngineName, monitorName)

Details

Returns the sub-monitors spawned by the specified monitor within a CEP engine.

If the specified monitor is an initial (non-spawned) monitor, the function returns all sub-monitors it has spawned. If it is already a sub-monitor, the function only returns the monitors directly spawned from it (i.e., one level below).

Parameters

engine is an engine object or name.

subEngineName is a STRING scalar indicating the name of the CEP sub-engine.

monitorName is a STRING scalar indicating the monitor name.

Returns

A dictionary where the keys are monitor names and the values are the corresponding monitor instances.

Examples

class mainMonitor:CEPMonitor{      
    ordersTable :: ANY  
    def mainMonitor(){
        ordersTable = array(ANY, 0)  
    }
    
    def updateOrders(event) {
        ordersTable.append!([event.trader, event.market, event.code, event.price, event.qty])
    }
   
    def onload(){
        addEventListener(updateOrders, 'Orders',,'all') 
    }
}

class Orders{
    eventTime :: TIMESTAMP 
    sym :: STRING
    val0 :: INT
    val1 :: FLOAT
    val2 :: DOUBLE
    def Orders(s,v0,v1,v2){
        sym = s
        val0 = v0
        val1 = v1
        val2 = v2
        eventTime = now()
    }
}

dummy = table(array(TIMESTAMP, 0) as eventTime, array(STRING, 0) as eventType, array(BLOB, 0) as blobs)
try{dropStreamEngine("cep1")}catch(ex){}
engine=createCEPEngine("cep1",<mainMonitor()>,dummy,Orders,,'eventTime',,,"sym")

appendEvent(`cep1,Orders("a000", 3, 3.0, 30.0))

getCEPEngineStat('cep1').subEngineStat["subEngineName"]

monitors = getCEPEngineMonitor('cep1', 'a000', 'mainMonitor')