Method, system and computer program product for analysis of simulation results

A method of analyzing simulation results of a model, the method comprising: obtaining a process model including model elements including tasks, non-reusable sub-processes, and called reusable sub-processes; assigning a unique identifier to each model-element; generating unique model-element-proxies for all model-elements except for model elements corresponding to a model-reusable-sub-process or a model element contained by a model-reusable-sub-process; generating unique model-element-proxies for model-reusable-sub-processes and model-elements contained by model-reusable-sub-processes; associating each generated model-element-proxy with a corresponding model-element; executing simulation of the process model and persisting for each element instance data produced during simulation, the instance data including an element instance identifier and a corresponding model-element-proxy identifier; querying persisted simulation data for information using model-element-proxy identifiers.

TRADEMARKS

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates to computer simulation, and particularly to using model-element-proxies to facilitate efficient analysis of simulation results.

2. Description of Background

Computer simulation of processes is widespread. Existing products, such as the WebSphere Business Modeler from IBM, allow users to simulate business processes. In the WebSphere Business Modeler, business process is modeled as a collection of tasks, non-reusable sub-processes, and calls to reusable processes with a defined execution sequence specified by connections and control structures. Each of non-reusable sub-processes may, in turn, contain tasks, other non-reusable sub-processes, and calls to reusable processes. A reusable process can be called from multiple places in the main process, any of the main process' non-reusable sub-processes and any of the main process' called reusable processes.

To further describe process modeling done in WebSphere Business Modeler and similar products, reference is made toFIG. 1where an exemplary model is depicted. The model includes a process P1that includes a call to reusable sub-process P0(later referred to as call-to-P0i). Tasks T1, T2are implemented in process P1. Process P1also includes sub-process P2, which includes another call to reusable sub-process P0(later referred to as call-to-P0j). Tasks T3and T4are implemented in sub-process P2. Reusable sub-process P0includes tasks Tx1, Tx2and Tx3. Arrows connecting tasks/processes indicate flow of execution.

During simulation, when a given task/process is reached the instance of this task/process is created and then executed. To avoid ambiguity, elements defined in a business process (such as P1, P0, T3, T4, etc.) will be referred to as model-elements (model-tasks, model-processes), while elements created during simulation run will be referred to as element instances (task instances, process instances). Each task and process instance is uniquely identified by its own identifier, and contains a reference (such as model-element identifier) to its model-element.

When model-process P1is simulated, two process instances of model-sub-process P0are created (one created through call from P1instance and one by a call from P2instance), and corresponding task instances of model-tasks Tx1, Tx2, Tx3are created in both P0instances. Let's consider the example aggregated and percolated cost analysis report in Table 1 below. In this analysis each sub-process' cost is an aggregation of costs of all tasks and sub-processes it ultimately contains. In other words, cost is added across a sub-process level and then percolated up the containment hierarchy. It is important to notice there are two rows referring to P0model-sub-process (as P0i, and P0j), each with an aggregated cost value corresponding to P0model-sub-process instance owned by a different super-process (which later is referred as P0in two different contexts). Accurately accounting for the costs of P0process instances and the associated tasks instances is difficult. The difficulty arises in identifying whether P0instance was created through a call from P1instance or from P2instance. (And similarly, in identifying whether Tx1, Tx2, Tx3instances were instantiated in P0process instance resulting from a call issued from P1or P2instance.) If aggregated and percolated cost analysis is performed on a single process instance, an algorithm simply traversing a containment tree should give acceptable performance. However, if analogous analysis is to be done for costs aggregated across multiple P1instances, the traversing algorithm is going to perform very poorly. (Importantly, if RDBMS was to be used to persist simulation results, there is no simple, non-recursive SQL query that could produce the above analysis if for each task/process instance all that is given is its costs, its containment data, and information on its corresponding model-task/process.)

Similarly, execution path identification algorithm that uses only containment and model-element information associated with task/process instances must traverse run-time instance containment tree for each instance of reusable process (or any of its tasks) and thus cannot be very efficient.

Thus, there is a need in the art for a technique to efficiently identify context of task/process instance creation. Among others, this technique must allow for calculation of costs incurred within a reusable process instantiated in any context without the need to traverse main process instance containment tree.

SUMMARY OF THE INVENTION

The shortcomings of the prior art are overcome and additional advantages are provided through the provision of a method of analyzing simulation results of a model, the method comprising: obtaining a process model including model elements including tasks, non-reusable sub-processes, and called reusable sub-processes; assigning a unique identifier to each model-element; generating unique model-element-proxies for all model-elements except for model elements corresponding to a model-reusable-sub-process or a model element contained by a model-reusable-sub-process; generating unique model-element-proxies for model-reusable-sub-processes and model-elements contained by model-reusable-sub-processes; associating each generated model-element-proxy with a corresponding model-element; executing simulation of the process model and persisting for each element instance data produced during simulation, the instance data including an element instance identifier and a corresponding model-element-proxy identifier; querying persisted simulation data for information using model-element-proxy identifiers.

TECHNICAL EFFECTS

As a result of the summarized invention, technically we have achieved a solution which eliminates the need to traverse process instance containment tree for analyses that require information on task/process instance creation context. This solution provides means to efficiently calculate various costs and revenues incurred for instances of reusable processes instantiated in various calling contexts and to efficiently identify execution path taken in an overall process instance.

DETAILED DESCRIPTION OF THE INVENTION

Embodiments of the invention relate to simulation of processes and analysis of simulation results. The simulation is typically executed on a general-purpose computer executing a computer program in response to code stored on a computer program product. The code includes instructions enabling the computer to perform the functions described herein.

The following illustrates some advantages of using model-element-proxies in the implementation where RDBMS is employed as a simulation results persistence mechanism with SQL used as a query language. The given example deals with calculation of aggregated cost values which is just one of possible applications. Conceptually, the same advantages (i.e., elimination of recursion or some expensive pre-processing) are to be realized regardless of persistence mechanism or query method.

The following example illustrates the example's model structure without using a diagram. The containment hierarchy of the model ofFIG. 1may be represented as shown in Table 2, where indentation indicates containment of one task within another.

All model-tasks and model-processes must have unique identifiers assigned. Let's notice that P1does not contain P0directly; rather, it contains calling mechanisms (call-to-P0under P1, and under P2) that refer to P0. If information about process model's model-tasks and model-processes is to be stored in RDBMS, it may be put into the MODEL table containing the following attributes: SIMULATION_ID which identifies the simulation run, TASK_NAME which contains the model-task name and MODEL_TASK_ID which uniquely identifies model-tasks. For the process model outlined above, entries in MODEL table might be as shown in Table 3 below.

For the argument's sake let's assume that, on task instance termination, the simulation emits an event that contains the SIMULATION_ID which identifies the simulation run, PROCESS_ID which identifies the top process instance to which terminated task instance belongs, TASK_ID which uniquely identifies the task instance (assigned at run-time), MODEL_TASK_ID which identifies model-task corresponding to the task instance, PARENT_ID which identifies the instance of the process that contains the task, COST which specifies cost occurred on the task instance. It is understood that embodiments are not dependent on any particular mechanism of reporting instance specific simulation data (e.g., costs) as long as such a mechanism exists. For the process model outlined earlier, entries in a TERMINATION table that is used to store task instance termination attributes, referring to instances of model-task Tx1are shown in Table 4 below.

The table above illustrates data that may be recorded on termination event of model-task Tx1instances. If a database query is used to calculate aggregated cost of all Tx1model-task instances that belong to P0instances regardless of how P0instance was created, the query adds up the costs for entries in TERMINATION table where MODEL_TASK_ID=11. This is a routine database query. If there is a need to calculate aggregated cost of all instances of model-tasks Tx1that belong to an instance of P0model-process that was created by the call from an instance of P1process-model (in the context P1/call-to-P0i/P0/Tx1), then for each event, its grand parent event (e.g., the event twice removed from the current event) must be checked for association with P1. For example, for each event referring to Tx1model-task (MODEL_TASK_ID=11), the event that refers to its parent must be checked (by definition this parent event must refer to P0model-process and thus its MODEL_TASK_ID=10) if its parent (and a grand parent of the initial event) in turn refers to call-to-P0i(that has MODEL_TASK_ID=4 and is associated with P1). Only then cost in the termination event referring to Tx1model-task may be included in the P1/call-to-P0i/P0/Tx1aggregated cost. In general, with events/tables defined as above, a simple SQL query that calculates aggregated cost value of a task instance contained in an instance of a reusable sub-process in the given context cannot be formulated. Either SQL query must use recursion or some expensive pre-processing must be done to determine the cost incurred in model-task Tx1instances that resulted from a call issued from a model-process P1instance.

To alleviate the problem of traversal of process instance containment tree to acquire information on task/process instance creation context, unique model-element-proxies are generated for all model-tasks and all model-non-reusable-sub-processes that are not contained in model-reusable-sub-processes; furthermore unique model-element-proxies are also generated for each context in which reusable sub-processes are used. Thus if process model contains two calls to the same model-reusable-process, then there are two proxies corresponding to the model-reusable-process itself, and to each of the model-tasks, model-non-reusable-processes it contains. For example, for P0model-element there are two proxies created; one for P0called from P1(by call-to-P0iand listed under TASK_NAME as P0i) and the other for P0called from P2(by call-to-P0jand listed under TASK_NAME as P0j). Similarly, there are two proxies for each of Tx1, Tx2, Tx3tasks that belong to P0.

For the example model outlined above, if model-element-proxies were to be stored in a PROXY table, entries in this table may be as shown in Table 5 below. MODEL_TASK_IDs are the same as those shown in Table 3. TASK_NAME column with indentation indicating containment was added to aid visualization. PROXY_TASK_IDs are defined as described in the preceding paragraph.

FIG. 2illustrates how element instances relate to model-element-proxies and how model-element-proxies, in turn, relate to model-elements. Tx3model-task, its model-element-proxies and its instances are depicted inFIG. 2for sake of illustration, but it is understood that all model-elements contained in the process model may be assigned model-element-proxies

Entries in the revised TERMINATION table referring to instances of model-task Tx1from the process model outlined above, are shown below in Table 6. For the invention to work simulation engine must be aware of and able to report which proxy-meta-element corresponds to a given instance, which must be the case if the revised TERMINATION table is to be populated as show below.

If a database query (e.g., SQL) is used to calculate aggregated cost of all Tx1task instances that belong to P0instances regardless of the context in which P0was created, all that is needed is to add up all cost in a table resulting from a join of the PROXY table (Table 5) and the revised TERMINATION table (Table 6) on PROXY_TASK_ID and specify MODEL_TASK_ID=11 in the where clause. As the model task identifier is 11 for both model tasks Tx1iand Tx1j, this query provides the total cost for all calls to task Tx1.

If a database query is needed to determine the aggregated cost of all Tx1task instances that belong to P0instances that were created through a call directly from P1(in the context P1/call-to-P0i/P0/Tx1), then knowing that PROXY_TASK_ID=6 represents context P1/call-to-P0i/P0/Tx1, a query needs only to add up costs in all events containing PROXY_TASK_ID=6. There is no need for recursion in SQL or some other expensive processing.

Thus, model-element-proxies generated for model-tasks and processes allow for very significant performance improvement and much simpler algorithm design for any aggregated analysis analogous to cost analysis described above.

In alternate embodiments, input/output model-element-proxies may be used in developing more efficient and simpler set of algorithms dealing with identification of execution paths, critical/shortest path analyses, etc.

The embodiments described above are independent of any particular method of persistence or analysis. For example, model-element-proxies can simplify processing and improve performance regardless whether XML-to-flat-file or RDBMS is used for persistence, and whether XPath or plain SQL or java with SQL, or other techniques, are used for implementation of analysis algorithms.