2012-02-27 116 views
1

我正在編寫一個引發活動的應用,類似於Phil Windley的personal data manager application的工作方式。但是,如果我嘗試使用任何事件域但explicit,事件不會傳播。以下規則適用於explicit作爲域,但不適用於driverreg在沒有明確使用KRL的情況下舉辦活動

rule driver_info_submit { 
    select when web pageview ".*" 
    pre { 
     driver_name = "Joe Driver"; 
     driver_phone = "111-555-1212"; 
     msg = << 
      Current driver info: #{ent:driver_name}, #{ent:driver_phone} 
     >>; 
    } 
    notify("Started", msg); 
    fired { 
     raise explicit event new_driver_data with driver_name=driver_name and driver_phone=driver_phone; 
    } 
} 

// Save driver name 
rule save_driver_name { 
    select when explicit new_driver_data 
    pre { 
     driver_name = event:param("driver_name") || ent:driver_name; 
     driver_phone = event:param("driver_phone") || ent:driver_phone; 
    } 
    noop(); 
    always { 
     set ent:driver_name driver_name; 
     set ent:driver_phone driver_phone; 
     raise explicit event driver_data_updated; 
    } 
} 

rule driver_info_updated { 
    select when explicit driver_data_updated 
    { 
     notify("Driver name", ent:driver_name); 
     notify("Driver phone", ent:driver_phone); 
    } 
} 

它似乎不是應用程序是否部署的問題,因爲我已經嘗試過這兩種方式。我錯過了什麼?

回答

相關問題