TWI326840B - Event processing method and system based on event driven programming - Google Patents
Event processing method and system based on event driven programming Download PDFInfo
- Publication number
- TWI326840B TWI326840B TW95148960A TW95148960A TWI326840B TW I326840 B TWI326840 B TW I326840B TW 95148960 A TW95148960 A TW 95148960A TW 95148960 A TW95148960 A TW 95148960A TW I326840 B TWI326840 B TW I326840B
- Authority
- TW
- Taiwan
- Prior art keywords
- program
- event
- result
- thread
- function
- Prior art date
Links
Landscapes
- Stored Programmes (AREA)
Description
1326840 - 九、發明說明: 【發明所屬之技術領域】 本發明係有關於一種事件處理方法,且特別有關於一 * 種事件驅動導向之事件處理方法。 ' 【先前技#ί】 在軟體程式開發的過程中,為了降低軟體開發的複雜 • 度,都會應用一些開發架構(Design-Pattern ),使得開發 人員能夠快速建構系統,並能夠有效率地進行維護。目前 較被廣泛使用的軟體開發架構如「模型-介面-控制器 (Model-View-Controller,MVC )」,則是為了釐清整體 架構所衍生出來的開發架構。該架構將系統之實做面分為 三大面向,即模型面(Model)、介面(View)與控制器 (Controller)等。 第1圖係顯示MVC的架構示意圖。模型物件110提供 • 資料上之控制,介面物件130提供介面之顯示,而控制器 物件150為控制模型物件110與介面物件130間之溝通。 各個物件有各自之功能領域,使得開發人員可清楚地建構 出系統軟體架構。然而,MVC架構可提供高度穩定之資料 來源。但缺點是其控制器層與介面層必須隨著模型層之變 動修改而必須經常的變動,使得在系統維護上會較複雜困 難。此外,當兩不同領域透過MVC架構實做時,將會混 和了兩不同領域之資訊處理邏輯,使得開發人員不容易分 辨兩領域邏輯架構,亦會使得在系統維護上更加複雜,並 0987-A21895TWF(N2);P65950026;alexchen 5 1326840 „ 且不具有彈性,往後維護上如需再附加一不同領域,則需 花費更多之時間進行更新。 因此,本發明提供了一種事件驅動導向之事件處理方 法與系統,其能夠有效地整合並且實做、混和不同之應用 _ 領域,同時提供高度之彈性,讓使用者可輕易地修改商業 • 邏輯。本發明之方法與系統更提供一程式邏輯元件,可提 升程式模組之重複可用性,大大降低系統開發人員撰寫重 複之程式,且快速地建構與維護系統。 【發明内容】 基於上述目的,本發明實施例揭露了一種事件驅動導 向之事件處理方法。自一外部系統取得一事件,並且判斷 接收該事件之一程序引擎否已執行初始化。若未初始化, 則根據該事件讀取一預先定義之程序命令定義,並取得對 應該程序命令定義之複數個程序描述器。若已初始化,則 藉由該程序引擎判斷對應該事件之至少一程序命令是否包 • 含在該程序命令定義中。若對應該事件之該程序命令已包 含在該程序命令定義中,則根據該程序命令定義判斷對應 該事件之至少一輸入參數是否正確。若該輸入參數正蜂, 則藉由該程序引擎讀取對應該輸入參數之至少一程序描述 器,同時初始化一背景物件。該背景物件初始化完成後, 藉由該程序引擎讀取對應該事件之至少一程序描述器,以 取得該程序描述器中之至少一程序。初始化該程序描述器 之該程序中之一初始線程,以依序取得該初始線程中之函 數集合定義,並執行該函數集合定義中之每一函數。當執 0987-A21895TWF(N2);P65950026:alexchen 6 1326840 行完所有線程之函數集合定義中之每一函數後,將執行結 果儲存在該背景物件中,並且回傳給該外部系統。 本發明實施例更揭露了一種事件驅動導向之事件處理 系統,包括一元件模組、一程序命令定義模組與一程序引 擎。該使用者介面用以觸發一事件。該元件模組包括複數 個邏輯元件與動態執行腳本。該程序命令定義模組更包括 一命令定義模組與複數個程序描述器。該命令定義模組包, 括複數個預先定義之程序命令定義,且每一程序命令定義 包括複數個程序命令。該等程序描述器之每一程序描述器 包括複數個程序,且每一程序分別對應一程序命令定義中 之一程序命令。該程序引擎取得一使用者介面觸發之事件, 根據該事件自命令定義模組取得對應且以可擴展標記語言 (XML)描述之程序命令與程序,並且自該元件模組取得 對應之邏輯元件,以根據該程序命令對該程序執行所需之 邏輯操作。 【實施方式】 為了讓本發明之目的、特徵、及優點能更明顯易懂, 下文特舉較佳實施例,並配合所附圖示第2圖至第4圖, 做詳細之說明。本發明說明書提供不同的實施例來說明本 發明不同實施方式的技術特徵。其中,實施例中的各元件 之配置係為說明之用,並非用以限制本發明。且實施例中 圖式標號之部分重複,係為了簡化說明,並非意指不同實 施例之間的關聯性。 本發明實施例揭露了一種事件驅動導向之事件處理方 0987-A21895TWF(N2):P65950026;alexchen 7 1326840 處理程序的位置,其包括複數個預先定義之執行程序,且 每一執行程序係以可擴展標記語言(Extensible Markup Language,XML )的方式描述。藉由可擴展標記語言 (XML),使得系統開發人員可動態地編輯執行程序,提 供極大的彈性依據需求隨時修改執行程序。命令定義模組 221與程序描述器223間的關係如附件2所示。命令定義 模組221中定義了一般系統軟體中之所有相關的事件清 單,透過該清單可取得所需執行之程序描述器。每一程序 描述器中詳細定義了每一事件進入系統時所需執行的程 序。以下再分別詳述命令定義模組221與程序描述器223 的功能。 命令定義模組221主要定義系統中可執行的事件清單 及各事件的屬性。根據該事件清單,系統開發人員可明確 地檢視出系統中所有可執行的事件,以及每一事件的處理 型態。該事件清單係利用可擴展標記語言(XML)來描述, 其描述結構如附件3所示,而該結構中之各參數描述分別 記載於表1〜表5中。 表11326840 - IX. DESCRIPTION OF THE INVENTION: TECHNICAL FIELD OF THE INVENTION The present invention relates to an event processing method, and more particularly to an event-driven guided event processing method. [Previous technology #ί] In the process of software program development, in order to reduce the complexity of software development, some development architecture (Design-Pattern) is applied, enabling developers to quickly build the system and maintain it efficiently. . At present, the more widely used software development architecture, such as "Model-View-Controller (MVC)", is to clarify the development architecture derived from the overall architecture. The architecture divides the system into three major aspects: Model, View, and Controller. Figure 1 shows a schematic diagram of the architecture of MVC. The model object 110 provides • data control, the interface object 130 provides a display of the interface, and the controller object 150 controls communication between the model object 110 and the interface object 130. Each object has its own functional area, allowing developers to clearly construct the system software architecture. However, the MVC architecture provides a highly stable source of information. However, the disadvantage is that the controller layer and the interface layer must be changed frequently as the model layer changes, making the system maintenance more complicated and difficult. In addition, when two different fields are implemented through the MVC architecture, the information processing logic of two different fields will be mixed, making it difficult for developers to distinguish the logical architecture of the two domains, and it will make the system maintenance more complicated, and 0987-A21895TWF (N2); P65950026; alexchen 5 1326840 „ and not flexible, it takes more time to update if you need to add a different field to the maintenance. Therefore, the present invention provides an event-driven event processing. Method and system, which can effectively integrate and implement different applications, and provide a high degree of flexibility, so that the user can easily modify the business logic. The method and system of the present invention further provide a program logic component. The method can be used to improve the repetitive availability of the program module, and the system developer can write a repetitive program and quickly construct and maintain the system. SUMMARY OF THE INVENTION The present invention discloses an event-driven event processing method based on the above object. Obtain an event from an external system and determine to receive the event Whether a program engine has performed initialization. If not initialized, a predefined program command definition is read according to the event, and a plurality of program descriptors corresponding to the program command definition are obtained. If initialized, the program engine is initialized Determining whether at least one program command corresponding to the event is included in the program command definition. If the program command corresponding to the event is included in the program command definition, determining at least one of the corresponding events according to the program command definition If the input parameter is correct, the program engine reads at least one program descriptor corresponding to the input parameter, and initializes a background object. After the background object is initialized, the program engine reads Obtaining at least one program descriptor corresponding to the event to obtain at least one program in the program descriptor. Initializing one of the initial threads of the program in the program descriptor to sequentially obtain the function set definition in the initial thread, And execute each function in the function set definition. When executing 0987-A21895TWF(N2); P6595 0026: alexchen 6 1326840 After each function in the function set definition of all threads is completed, the execution result is stored in the background object and transmitted back to the external system. The embodiment of the present invention further discloses an event-driven guide. The event processing system includes a component module, a program command definition module and a program engine. The user interface is used to trigger an event. The component module includes a plurality of logic components and a dynamic execution script. The group further includes a command definition module and a plurality of program descriptors. The command defines a module package, including a plurality of predefined program command definitions, and each program command definition includes a plurality of program commands. Each program descriptor includes a plurality of programs, and each program corresponds to one of the program command definitions. The program engine obtains a user interface trigger event, and according to the event, the command definition module obtains a corresponding program command and program described in Extensible Markup Language (XML), and obtains a corresponding logic component from the component module. Perform the required logical operations on the program according to the program command. DETAILED DESCRIPTION OF THE INVENTION In order to make the objects, features, and advantages of the present invention more comprehensible, the preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. The present specification provides various embodiments to illustrate the technical features of various embodiments of the present invention. The arrangement of the various elements in the embodiments is for illustrative purposes and is not intended to limit the invention. The repeated reference numerals in the embodiments are intended to simplify the description and do not imply the relationship between the different embodiments. The embodiment of the present invention discloses an event-driven event handler 0987-A21895TWF(N2): P65950026; alexchen 7 1326840 processing program location, which includes a plurality of predefined execution programs, and each execution program is extensible Description of the way of the Extensible Markup Language (XML). With Extensible Markup Language (XML), system developers can dynamically edit executive programs, providing great flexibility to modify executables at any time. The relationship between the command definition module 221 and the program descriptor 223 is as shown in Annex 2. Command Definition Module 221 defines a list of all relevant events in the general system software, through which the program descriptors for execution can be obtained. Each program descriptor defines in detail the procedures that each event needs to execute to enter the system. The functions of the command definition module 221 and the program descriptor 223 are separately detailed below. The command definition module 221 mainly defines a list of events executable in the system and attributes of each event. Based on this list of events, system developers can clearly view all executable events in the system, as well as the processing type of each event. The event list is described using Extensible Markup Language (XML), the description structure of which is shown in Annex 3, and the description of each parameter in the structure is described in Tables 1 to 5, respectively. Table 1
Procedure 屬性 Name 執行程序名稱,即事件名稱,為 系統中之主要關鍵值(Key Value),其為唯一值。 executeType 執行程序之型態為何,本架構中 定義兩種執行型態,一為程序 0987-A21895TWF(N2);P65950026:alexchen 9 1326840 (Porcedure ),另一為流程 (Workflow )。程序(Porcedure ) 為一般事件的程序’而流程 (Workflow )則為工作流程型 態,其指非同步完成的工作程 序。 location 執行程序之定義位置。 表2Procedure Property Name The name of the executing program, the name of the event, is the key value in the system (Key Value), which is a unique value. executeType The type of execution program, two execution types are defined in this architecture, one is program 0987-A21895TWF(N2); P65950026: alexchen 9 1326840 (Porcedure), and the other is Workflow. The program (Porcedure is a program for general events) and the workflow (Workflow) is a workflow type, which refers to a work program that is not synchronized. Location The location where the program is defined. Table 2
Procedure/input_ 主要定義執行程序中,必須輸入之參數,其參數型態 與其他屬性清單°_ 表3Procedure/input_ mainly defines the parameters that must be entered in the execution program, its parameter type and other attribute list °_ Table 3
Procedure/input/arg_ 此節點為定義一輸入參數之相關屬性。Procedure/input/arg_ This node is a related attribute that defines an input parameter.
Procedure/oiitput_ 此節點主要定義執行程序中,將輸出之參數清單。Procedure/oiitput_ This node mainly defines a list of parameters that will be output in the executor.
Name 參數中之名稱,其於每一輸入或輸 出節點中必須為關鍵值。 Type 參數物件之型態。 condition 參數物件條件,其可定義是否為必 要條件(Required )或非必要 (Optional)。 表4 0987-A21895TWF(N2);P65950026;alexchen 1326840 表5 Procedure/output/arg 輸出參數之定義 ο 屬性 Name 此節點定義輸出之參數名稱,與輸 入之參數值同。 Type 輸出參數之物件型態。 程序描述器223主要定義每一事件所應執行之程序描 述,藉由本發明之程序描述可建立欲執行之主要電腦線程 (Thread)的架構,並透過元件模組230中的邏輯元件與 動態執行腳本(Script)來處理程序描述。 為了提供開發人員之可讀性與未來擴充性,本發明實 施例之事件處理方法與系統利用可擴展標記語言(XML) 來描述執行程序,以增加系統開發與維護上之彈性。可擴 展標記語言(XML)的格式如附件4與附件5所示,其中 所包含各參數描述分別記載於表6〜表12中 表6The name in the Name parameter, which must be a key value in each input or output node. Type The type of the parameter object. Condition A parameter object condition that defines whether it is a required condition or a non-essential (Optional). Table 4 0987-A21895TWF(N2); P65950026;alexchen 1326840 Table 5 Procedure/output/arg Definition of Output Parameters ο Attribute Name This node defines the parameter name of the output, which is the same as the input parameter value. Type The object type of the output parameter. The program descriptor 223 mainly defines a program description that should be executed for each event. The program description of the present invention can establish an architecture of a main computer thread (Thread) to be executed, and dynamically execute the script through the logic elements in the component module 230. (Script) to handle the program description. In order to provide developers with readability and future scalability, the event processing method and system of the embodiments of the present invention utilize Extensible Markup Language (XML) to describe the execution program to increase the flexibility of system development and maintenance. The format of Extensible Markup Language (XML) is shown in Attachment 4 and Attachment 5, and the descriptions of each parameter included in Table 6 to Table 12 are respectively shown in Table 6.
Procedure_ 定義執行程序主體。_ _^2_Procedure_ Defines the main body of the executor. _ _^2_
Procedure/event_ 執行由外部觸發之初始線程(thread )程序定義,該 觸發事件中包含至少一個線程定義。_ 表8Procedure/event_ executes an externally triggered initial thread (thread) program definition that contains at least one thread definition. _ Table 8
Procedure/event/thread 0987-A2i895TWF(N2);P65950026;alexchen 1326840 執行之線程 程序與結果,因此本線程中將包括所f執行之邏輯控 制(funCtl〇n)與執行結果(results)之定義。Procedure/event/thread 0987-A2i895TWF(N2); P65950026;alexchen 1326840 Execution of the thread program and result, so this thread will include the definition of the logic control (funCtl〇n) and execution result (results) executed by f.
在每-線程中,可針對邏輯控制定義—至多個函數。 本發明中之函數,係指程式邏輯之片段,例如,計算 搜尋貝料庫貝料、計算匯率、計算時間週期等可元 件化之程式片段’以形成本發明中之函數。本發明中 之函數集合’將預設建立數個函數集合(此—減集 合將於元件模組230中說明),則可透過組合方式, 進行商業邏輯之組合,例如,計算資料庫中某客戶之 所有訂單加總。此時可透過兩函數來達成所要求之執 行程序(如附件6所示),其—為自元件模組23〇中 取得查詢函數,查詢出該客戶之所有訂單。接下來可 檢查是否有加總函數,如無,則可透過客製化撰寫加 總之函數。透過以此方式描述執行程序僅 輯元件化,使得程式邏輯可一再使用,提== 使用率。此外,當執行程序因需求需進行變動維護時, 也輕易地進行修改。例如’當需加入新系統模組時, 則可直接於線程函數中加入新模組之函數,大大地提 升系統的維護性,也增加系統的~5〇^峰〇 _表9In each-thread, you can define - to multiple functions for logical control. A function in the present invention refers to a segment of program logic, for example, a computational search for a block of material, a calculation of an exchange rate, a calculation of a time period, etc., to form a functional segment of the present invention. The set of functions in the present invention will pre-establish a set of functions (this-decrement set will be described in the component module 230), and then a combination of business logics can be performed in a combined manner, for example, calculating a customer in the database. All orders are added. At this point, the required execution procedure can be achieved through two functions (as shown in Annex 6), which is to obtain the query function from the component module 23〇 and query all the orders of the customer. Next, you can check if there is a total function. If you don't have one, you can write a summation function through customization. By describing the execution program in this way only componentization, the program logic can be used repeatedly, raising == usage. In addition, when the execution program needs to be changed and maintained due to demand, it is also easy to modify. For example, when a new system module needs to be added, the function of the new module can be added directly to the thread function, which greatly improves the maintainability of the system, and also increases the system's ~5〇^峰〇_表9
Procedure/event/thread/function 線程之函數定義’其function定義範例如附件7所示 示。本發明中之函數定義可具有兩種二二種為beanshell 0987-A21895TWF(N2):P65950026:alexchen 1326840Procedure/event/thread/function Thread function definition' Its function definition is shown in Annex 7. The function definition in the present invention can have two kinds of two kinds as beanshell 0987-A21895TWF(N2): P65950026: alexchen 1326840
與class。如範例中之第一個函數定義所示,該函數為 beanshell之執行方式,beanshell是一種可執行腳本 (script)之工具,透過beanshell之函數,直接於函 數定義中處理簡單之邏輯。而範例中之第二個函數則 為spring函數,此一函數為執行開發人員撰寫之程式 邏輯元件,該程式邏輯元件可自Component Pool中取 得’或系統開發人員自行撰寫,本發明中建立一函數 實做介面(interface) ’以供開發人員實做程式邏輯 之撰寫。 ___表 10 _With class. As shown in the first function definition in the example, this function is the way the beanshell is executed. The beanshell is a scriptable tool that handles simple logic directly from the function definition through the beanshell function. The second function in the example is the spring function. This function is the program logic component written by the developer. The logic component of the program can be obtained from the Component Pool' or written by the system developer. A function is built in the present invention. Real interface (interface) for the developer to write the logic of the program. ___Table 10 _
Procedure/event/thread/results _ 此節點為線程之執行結果集合,其結果集合定義如附 件8所不。此結果集合中可包含多個有條件的結果 (_lt )與至少一個無條件之結果 (unconditional-result),以下分述之。 結果(result)係表示有條件的線程結果,盆所表示的 節點下將包含條件集合(咖_叫。祕集合中包 個條件運算函數,並可於條件集合中設定集 合型怨為翩或QR,㈣斷财 果。條件運算函數與函數類似,可^山数之連#、口 —實做出來。本發明針對條件運: *所農義的」錄2進入結果(resul°Procedure/event/thread/results _ This node is the thread's execution result set, and the result set definition is as shown in Annex 8. This result set can contain multiple conditional results (_lt) and at least one unconditional-result, which are described below. The result (result) indicates the conditional thread result. The node represented by the basin will contain the condition set (Cay_Call. The secret set contains a conditional operation function, and can set the set type blame or QR in the condition set. (4) Broken fruit. The conditional operation function is similar to the function, and can be made by the number of the mountain number, and the mouth is actually made. The invention is directed to the conditional operation: * The result of the 2nd entry of the agricultural term (resul°)
做介面,以依據特定需求而產生運數定義一貫 結果如回傳為「真(TRUE) π㉞輯兀件。執盯 0987-A21895TWF(N2):P65950026;alexchen 1326840 為-1,則結束線程),如回傳為「偽(FALSE )」貝1J 不予以執行。 無條件結果(unconditional-result)之節點係定義當所 有條件是結果皆無法執行時,則將執行此一結果定 義。當執行時則直接進入節點屬性'"step 〃所定義之 線程中。_ __表 11_Make an interface to generate consistent results based on specific requirements, such as returning to TRUE π34. Obeying 0987-A21895TWF(N2): P65950026; alexchen 1326840 is -1, then ending the thread) If the return is "false (FALSE)", 1J will not be executed. The unconditional-result node definition defines this result when all conditions are unsuccessful. When executed, it goes directly to the thread defined by the node attribute '"step 〃. _ __Table 11_
Procedure/threads_ 除初始化線程外之所有線程集合。此一節點中將包含 一至多個線程定義。_ _表 12_Procedure/threads_ A collection of all threads except the initialization thread. This node will contain one or more thread definitions. _ _Table 12_
Procedure/thread_ 線程定義,其定義同於 Procedure/initial-Thread/thread 之定義。_ 程序引擎210為本發明之系統核心,其主要任務為接 收來自外部系統250所輸入的事件205並處理之。在本發 明實施例中,為了讓程序引擎210可依據不同事件執行不 同之程序,以命令(Command )方式提供不同事件的識別 碼。命令識別碼如同命令定義模组221中所定義的事件名 稱。程序引擎210在接收事件205後,依據先前所定義的 程序命令定義與程序描述器設定,進行載入、初始化並執 行相關函數。 藉由程序引擎210,則僅需修訂命令定義模組與程序 描述器等程序結構,並據以產生客製化的程式元件,如此 0987-A21895TWF(N2);P65950026:alexchen 14 1326840 可大大地降低系統開發時程,並且提升系統開發與維護之 彈性。 元件模組230為邏輯元件集合。本發明利用元件模組 230中的邏輯元件,提供如新增、刪除、修改、查詢等物 件,並於程序描述器223中編輯所欲處理之邏輯處理程 序。也就是說,透過組裝之方式,將相關的邏輯元件組合 起來,以產生所需的邏輯處理程序。此外,如欲處理商業 邏輯程序無法透過預設邏輯處理元件之組合來達成,本發 明更定義了一邏輯元件介面,以實現客製化操作。 第3A、3B圖係顯示本發明實施例之事件驅動導向之 事件處理方法的步驟流程圖。 參考第2圖與第3A、3B圖,當程序引擎210接收來 自外部系統250或使用者介面260所觸發之事件205與對 應的輸入參數後,檢查其是否已執行初始化(步驟S301 )。 若未執行初始化,則程序引擎210讀取先前所定義的程序 命令定義,且依序載入對應之程序描述器(步驟S302), 然後將所有系統内之事件定義存入記憶體中。接著,若已 執行初始化,則程序引擎210檢查輸入的事件命令是否已 定義於程序命令定義模組220之命令定義模組221中(步 驟S303 )。若未定義,則回應一錯誤訊息給該外部系統250 或使用者介面260,即將該事件視為錯誤例外(步驟S304)。 若已定義,則程序引擎210再依據命令定義模組221 中所定義的輸入參數規格,判斷外部所輸入之參數是否正 確(步驟S305)。若外部輸入參數錯誤,則回應一錯誤訊 0987-A2i895TWF(N2);P65950026:alexchen 15 1326840 息,即將該事件視為錯誤例外(步驟S3〇4)。若外部輸入 參數正確,則程序引擎210讀取對應該輸入參數的程序描 述器(步驟S306 ) ’同時初始化—背景物件(InstanceProcedure/thread_ Thread definition, which is defined the same as Procedure/initial-Thread/thread. The program engine 210 is the core of the system of the present invention, and its main task is to receive and process the event 205 input from the external system 250. In the embodiment of the present invention, in order to allow the program engine 210 to execute different programs according to different events, the identification codes of different events are provided in a Command manner. The command identifier is like the event name defined in the command definition module 221. After receiving the event 205, the program engine 210 loads and initializes and executes the correlation function according to the previously defined program command definition and program descriptor settings. With the program engine 210, only the program structure such as the command definition module and the program descriptor is revised, and the customized program components are generated accordingly, so that 0987-A21895TWF(N2); P65950026: alexchen 14 1326840 can be greatly reduced. System development timeline and enhance the flexibility of system development and maintenance. The component module 230 is a collection of logic components. The present invention utilizes logic elements in the component module 230 to provide objects such as add, delete, modify, query, etc., and edits the logic processing program to be processed in the program descriptor 223. That is to say, by assembling, the relevant logic elements are combined to produce the required logic processing program. In addition, if the business logic program cannot be processed through a combination of preset logic processing elements, the present invention further defines a logic element interface to implement a customized operation. 3A and 3B are flowcharts showing the steps of the event-driven event processing method of the embodiment of the present invention. Referring to Figures 2 and 3A, 3B, when the program engine 210 receives the event 205 triggered by the external system 250 or the user interface 260 and the corresponding input parameters, it checks whether it has performed initialization (step S301). If initialization is not performed, the program engine 210 reads the previously defined program command definitions, and sequentially loads the corresponding program descriptors (step S302), and then stores the event definitions in all systems into the memory. Next, if initialization has been performed, the program engine 210 checks whether the input event command is defined in the command definition module 221 of the program command definition module 220 (step S303). If not defined, an error message is sent to the external system 250 or user interface 260, which is considered an error exception (step S304). If it is defined, the program engine 210 determines whether the externally input parameter is correct according to the input parameter specification defined in the command definition module 221 (step S305). If the external input parameter is wrong, it will respond with an error message 0987-A2i895TWF(N2); P65950026: alexchen 15 1326840, which will be regarded as an error exception (step S3〇4). If the external input parameters are correct, the program engine 210 reads the program descriptor corresponding to the input parameters (step S306)' while initializing - the background object (Instance)
Context)(步驟 S307 )。該背景物件(Instance c〇ntext) 為程序引擎210執行每一程序時的背景資訊,其中包括執 行程序的使用者(Actor)、所執行之程序描述器與執行程 序中之執行結果變數等。此背景物件(Instance c〇ntex〇Context) (step S307). The instance object (Instance c〇ntext) is the background information when the program engine 210 executes each program, including the Actor of the execution program, the executed program descriptor, and the execution result variables in the execution program. This background object (Instance c〇ntex〇
將存在於每一程序中之每一函數,使得各個函數皆可取得 程序的背景資訊。 有關執行程序之實施流程如第4圖所示。對於資訊系 統而言’使用者填寫表單後(步驟S4CU),根據該使用者 表單建立表單物件(步驟S402)與建立通知物件(步驟 S403 ),然後判斷使用者設定(步驟S4〇4),以決定要先 發送郵件通知(步驟S405 )再執行程序(步驟S4〇6),或 不發送郵件通知而直接執行程序(步驟S4〇6)。建立表單 與通知物件之邏輯處理可透過元件模組23〇中之預設新增 物件邏輯元件進行處理’而發送郵件通知同樣之 可透過元件模組230中之發送郵件邏輯元件處理之。 背景物件(Instance Context)初始化完成後,程序引 擎210讀取對應該事件的程序描述器以取得所需的程序 (㈣S308),然後初始化程序描迷器中的初始線程 UnmaHad)(步驟S309) ’以依序取得線程中的函 數集合定義並執行函數集合定義中> > <母一函數(步驟 S310)。母一函數定義可能為邏輯亓生 吁7^件或動態執行腳本 0987-A21895TWF(N2):P65950026;alexchen 16 1326840 (script)。若函數定義為邏輯元件,則程序引擎210至元 件模組230中取得相對應的元件物件,初始化該元件並且 傳入函數定義_所定義之各項參數。若函數定義為動態執 行腳本,則程序引擎210初始化該腳本引擎,輸入腳本與 各項參數並執行之。 將每一函數的執行結果存放於該背景物件(Instance Context)中(步驟S311 )。依序執行各個函數完畢後,程 序引擎210讀取該初始線程中之結果定義(results),並 判斷條件集合中之條件式執行結果是否可執行(步驟 S312)。若不可執行,即所有相關條件結果都不能符合, 則取得該條件集合中之無條件式執行結果(步驟S313), 然後進入下一階段的線程,以根據該無條件式執行結果之 線程識別碼取得之對應線程描述執行所有線程(步驟 S314、步驟S315)。若條件集合中之條件式執行結果可執 行,即符合該相關條件,則進入下一線程或離開線程(步 驟S314)。接著,程序引擎210依據執行結果之線程識別 碼取得描述器中相對應的線程描述,並且執行所有線程(步 驟S315),直至結束所有線程(步驟S316)。所有線程執 行完畢後,程序引擎210自該背景物件(Instance Context) 中取得執行結果,並回傳至外部系統250或使用者介面 260,以完成事件之處理(步驟S317)。 本發明實施例之事件驅動導向的事件處理方法與系統 係以系統事件導向,提供系統開發人員可快速地並且具有 彈性地建構系統軟體,也提供了高度的彈性,可讓開發人 0987-A21895TWF(N2);P65950026;alexchen 1326840 員動態地增加系統功能或輕易地增加不同領域之功能模 組。 本發明更提供一種記錄媒體(例如光碟片、磁碟片與 抽取式硬碟等等),其係記錄一電腦可讀取之權限簽核程 式,以便執行上述之事件驅動導向的事件處理方法。在此’ 儲存於記錄媒體上之權限簽核程式,基本上是由多數個程 式碼片段所組成的(例如建立組織圖程式碼片段、簽核表 單程式碼片段、設定程式碼片段、以及部署程式碼片段), 並且這些程式碼片段的功能係對應到上述方法的步驟與上 述系統的功能方塊圖。 雖然本發明已以較佳實施例揭露如上,然其並非用以 限定本發明,任何熟習此技藝者,在不脫離本發明之精神 和範圍内,當可作各種之更動與潤飾,因此本發明之保護 範圍當視後附之申請專利範圍所界定者為準。Each function that will exist in each program allows each function to obtain background information about the program. The implementation process for executing the program is shown in Figure 4. For the information system, after the user fills in the form (step S4CU), the form object is created according to the user form (step S402) and the notification object is created (step S403), and then the user setting is determined (step S4〇4) to It is decided to transmit the mail notification first (step S405) and then execute the program (step S4〇6), or directly execute the program without transmitting the mail notification (step S4〇6). The logic for creating the form and the notification object can be processed by the preset new item logic element in the component module 23, and the mail notification is sent to the same mailable logic element in the transmissive component module 230. After the initialization of the Instance Context is completed, the program engine 210 reads the program descriptor corresponding to the event to obtain the required program ((4)S308), and then initializes the initial thread UnmaHad in the program descriptor (step S309). The function set definition in the thread is sequentially obtained and executed in the function set definition >>< parent-function (step S310). The parent-function definition may be a logical one or a dynamic execution script 0987-A21895TWF(N2): P65950026; alexchen 16 1326840 (script). If the function is defined as a logical component, the corresponding component object is retrieved from the program engine 210 to the component module 230, the component is initialized, and the parameters defined by the function definition_ are passed. If the function is defined as a dynamic execution script, the program engine 210 initializes the script engine, enters the script and various parameters and executes it. The execution result of each function is stored in the Instance Context (step S311). After the execution of each function in sequence, the program engine 210 reads the result definitions in the initial thread and determines whether the conditional execution result in the condition set is executable (step S312). If not executable, that is, all the relevant condition results are not met, the unconditional execution result in the condition set is obtained (step S313), and then the thread of the next stage is entered to obtain the thread identification code according to the unconditional execution result. All threads are executed corresponding to the thread description (step S314, step S315). If the conditional execution result in the condition set is executable, i.e., the relevant condition is met, then the next thread is left or the thread is left (step S314). Next, the program engine 210 acquires the corresponding thread description in the descriptor in accordance with the thread identification code of the execution result, and executes all the threads (step S315) until all the threads are ended (step S316). After all threads have been executed, the program engine 210 retrieves the execution result from the Instance Context and passes it back to the external system 250 or the user interface 260 to complete the processing of the event (step S317). The event-driven event processing method and system of the embodiment of the present invention is based on system event guidance, and provides system developers with rapid and flexible construction of the system software, and also provides a high degree of flexibility, allowing the developer 0987-A21895TWF ( N2); P65950026; alexchen 1326840 members dynamically add system functions or easily add functional modules in different fields. The present invention further provides a recording medium (e.g., a disc, a platter and a removable hard disk, etc.) which records a computer readable license signing method for performing the above event driven guided event processing method. Here, the permission signing program stored on the recording medium is basically composed of a plurality of code segments (for example, creating an organization chart code segment, signing a form code segment, setting a code segment, and deploying a program). The code segment), and the function of these code segments corresponds to the steps of the above method and the functional block diagram of the above system. While the present invention has been described above by way of a preferred embodiment, it is not intended to limit the invention, and the present invention may be modified and modified without departing from the spirit and scope of the invention. The scope of protection is subject to the definition of the scope of the patent application.
0987-A21895TWF(N2);P65950026:alexchen 18 1326840 【圖式簡單說明】 第1圖係顯示MVC的架構示意圖。 第2圖係顯示本發明實施例之事件驅動導向之事件處 理系統的架構示意圖。 第3A、3B圖係顯示本發明實施例之事件驅動導向之 事件處理方法的步驟流程圖。 第4圖係顯示第3圖之執行程序的步驟流程圖。0987-A21895TWF(N2); P65950026: alexchen 18 1326840 [Simple description of the diagram] Figure 1 shows the architecture of MVC. Figure 2 is a block diagram showing the structure of an event-driven event processing system in accordance with an embodiment of the present invention. 3A and 3B are flowcharts showing the steps of the event-driven event processing method of the embodiment of the present invention. Figure 4 is a flow chart showing the steps of the execution procedure of Figure 3.
【主要元件符號說明】 110〜 模型物件 130〜 介面物件 150〜 控制器物件 200〜 事件驅動導向的事件處理系統 205〜 事件 210〜 程序引擎 220〜 程序命令定義核組 221〜 命令定義模組 223〜 程序描述器 230〜 元件模組 240〜 資料模型模組 250〜外部系統 260〜 使用者介面 0987-A21895TWF(N2);P65950026;alexchen 19[Description of main component symbols] 110~ Model object 130~Interface object 150~ Controller object 200~ Event-driven event processing system 205~ Event 210~ Program engine 220~ Program command definition core group 221~ Command definition module 223~ Program Descriptor 230~ Component Module 240~ Data Model Module 250~ External System 260~ User Interface 0987-A21895TWF(N2); P65950026; alexchen 19
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW95148960A TWI326840B (en) | 2006-12-26 | 2006-12-26 | Event processing method and system based on event driven programming |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW95148960A TWI326840B (en) | 2006-12-26 | 2006-12-26 | Event processing method and system based on event driven programming |
Publications (2)
Publication Number | Publication Date |
---|---|
TW200828115A TW200828115A (en) | 2008-07-01 |
TWI326840B true TWI326840B (en) | 2010-07-01 |
Family
ID=44817558
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW95148960A TWI326840B (en) | 2006-12-26 | 2006-12-26 | Event processing method and system based on event driven programming |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI326840B (en) |
-
2006
- 2006-12-26 TW TW95148960A patent/TWI326840B/en not_active IP Right Cessation
Also Published As
Publication number | Publication date |
---|---|
TW200828115A (en) | 2008-07-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Ganesh et al. | Openerp/odoo-an open source concept to erp solution | |
Rademakers | Activiti in Action: Executable business processes in BPMN 2.0 | |
US11392393B2 (en) | Application runtime configuration using design time artifacts | |
JP5021193B2 (en) | Declarative representation of an extensible workflow model | |
US8910117B2 (en) | Customizing and performing policy in version control | |
CA2986106C (en) | Techniques for configuring a generic program using controls | |
CN102037447A (en) | Notificaton-based constraint set translation to imperative execution | |
US20080301628A1 (en) | Semantic interpretation of software models for generating user interfaces | |
CN109876445B (en) | High-decoupling guiding method and system based on behavior tree | |
CN102810057A (en) | Log recording method | |
US8584144B2 (en) | Determining the processing order of a plurality of events | |
US20080263531A1 (en) | Automatic runtime control binding | |
CN104735111B (en) | Make the method for unified interface realization ESB using WEBSERVICE | |
US7444618B2 (en) | Automatic generation of batch programs with identification, insertion of invariables, declarative statements and variables with the use of place-marks | |
MX2008003417A (en) | Declaratively defined control actions. | |
TWI326840B (en) | Event processing method and system based on event driven programming | |
Mani et al. | Using user interface design to enhance service identification | |
CN103488534A (en) | Method for enabling business logic layer to feed back control information to presentation layer | |
Soni | Full stack angularJS for java developers: Build a full-featured web application from scratch using angularJS with spring RESTful | |
US20060064671A1 (en) | Creating and using a building block | |
US20060206862A1 (en) | Data processing system for integrating two program frameworks | |
US20140033089A1 (en) | Integration of transactional actions into analytical reports | |
Musch | Design Patterns mit Java | |
JP2007094453A (en) | Program development support system, program development support method and program | |
Ruiz Rabasseda | Creating a unity framework for Scriptable Object Driven Development (SODD) |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees |