A SYSTEM AND METHOD FOR DEFINING A PROCESS STRUCTURE FOR PERFORMING A TASK

Abstract: A system and method for defining a process structure for performing a task is disclosed. The system comprises a computer, having a data storage memory, a keyboard for inputting data and a screen. A user inputs a first process definition which comprises a verb word and an object word defining the task for which a structure is to be created. The user is then able to define subsequent process definitions which are a predicted consequence of executing the first process definition or a predicted constituent step in executing the first process definition. By analysing each process definition at each stage a complete process structure for performing the task can be built up and refined. The user is also able to specify particular object words falling within the meaning of the object word of a particular process definition which can be called up in tabular form on the screen, overwriting the display of process definitions in the process structure.

Description: A SYSTEM AND METHOD FOR DEFINING A PROCESS STRUCTURE FOR PERFORMING A TASK FIELD OF THE INVENTION This invention relates to a system for and a method of creating or modelling a process structure such that the steps necessary in performing a task can be identified and/or refined, and the performance of the process steps in the task can be monitored. BACKGROUND OF THE INVENTION Methods are known which enable the user to analyse a system structure in order to establish where in the sequence of system steps hold-ups may occur. Examples of these are GANT charts or PERT software which provide an analysis based on critical path analysis. They do not provide any guidance to the user on how to begin identifying the steps in the task. In performing a task it is very often the case that a large amount of time is wasted performing unnecessary steps or concentrating on relatively unimportant or simple steps while avoiding, or spending too little time on, steps that warrant the greater attention. It is human nature to spend a lot of time and attention on those steps in the performance of a task that are more interesting or reflect the strengths of the particular operative. If those strengths coincide with the steps requiring the most detail the result is likely to be satisfactory. However, when a task is multi-disciplinary in nature or slightly outside the experience of the operative, the operative either tends to concentrate on his or her relative strengths or is unable to define where the greater effort should be expended. It is possible to address this by using a multi- disciplinary team, but this still requires an ability to identify the significant areas for which a team member is warranted. In the execution of a large and complex task this may be a necessary aspect of the identification of a task-step and its performance. However, on a smaller scale or at the initial stages of defining the steps in a task this can involve a heavy drain on employee time at a stage when the task concerned may not justify such input. The person defining a task could usefully use a tool that would assist him or her in taking a logical course through the identification and definition of the steps themselves necessary in performing a particular task. Furthermore, when a task has been set up it is useful, often essential, to monitor the progress of a task according to the status of each task step. Thus, it would also be advantageous for the user to have a tool that would enable him or her to track the progress of a task and its constituent steps. According to one aspect of the present invention there is provided a system for creating a process structure for performing a task, the system comprising: a computing device; data storage means for storing data accessed by the computing device; means for inputting data connected with the computing device; and display means for displaying data also connected with the computing device, the computing device being arranged to receive from the user through the means for inputting data a first process definition, comprising a verb word or words and an object word or words, which defines the task or a step in the task, and to require the user to input through the means for inputting data a second process definition in response to receiving the first process definition, which would be a predicted consequence of executing the first process definition. According to a second aspect of the invention there is provided a system for creating a process structure for performing a task, the system comprising: a computing device; data storage means for storing data accessed by the computing device; means for inputting data connected with the computing means; and display means for displaying the data also connected with the computing device, the computing device being arranged to receive from the user through the means for inputting data a first process definition, comprising a verb word or words and an object word or words, which defines the task or a step in the task, and to require the user to input through the means for inputting data a second process definition, in response to receiving the first process definition, which would be a predicted constituent step in executing the first process definition. According to a third aspect of the invention there is provided a system for creating a process structure for performing a task, the system comprising: a computing device; data storage means for storing data accessed by the computing device; means for inputting data connected with the computing device; and display means for displaying the data also connected with the computing device, the computing device being arranged to receive from the user through the means for inputting data a first process definition, comprising a verb word or words and an object word or words, which defines the task or a step in the task, and to require the user to specify particular object words falling within the meaning of the object word of the first process definition. The invention also extends to a method of creating a process structure for performing a task on computer, the method comprising: inputting a first process definition comprising a verb word or words and an object word or words, defining the task or a step in the task; and requiring the user to input a second process definition which would be a predicted consequence of executing the first process definition. The invention also embraces a method of creating a process structure for performing a task on computer, the method comprising: inputting a first process definition comprising a verb word or words and an object word or words, defining the task or step in the task; and requiring the user to input a second process definition which would be a predicted constituent step in executing the first process definition. The invention also extends to a method of creating a process structure for performing a task on computer, the method comprising: inputting a first process definition comprising a verb word or words and an object word or words, defining the task or step in the task; and requiring the user to specify particular object words, being instances of the object word of the first process definition. Also according to the present invention there is provided a system for creating a process structure for performing a task, the system comprising: a computing device; data storage means for storing data accessed by the computing device; means for inputting data connected with the computing means; and display means for displaying data also connected with the computing device, the computing device being arranged to receive from the user through the means for inputting data process definitions, comprising at least one verb word and at least one object word, each process definition defining a step in the task which is made up of a plurality of stages, culminating in a process definition of the task, the computing means further being operable to store data associated with one process definition at least one of the stages in the task. The invention enables the process structure to be identified or developed by addressing how the task steps are to be undertaken as a constituent part of a process structure. The invention also enables a user to refine a process by addressing by the task steps are undertaken as a constituent part of the process structure defining routine. The database and process structure are developed automatically and are dynamically adjustable, as the user responds to selected prompts from the computing means. Preferably, the object word or words of the constituent process definition(s) in the stage before the said one process definition are arranged by the computing means in a retrievable data display. Thus, the invention allows information windows to be associated with any or all of the processes in a modelled task. These may be in the form of a standard information window specifying checklist entries, such as process completed/not completed and the date of completion. However, the processes can also be used in a customised information window to represent the preceding steps in the modelled task at which various data on the task can be displayed for assessment and analysis. Preferably, the invention is arranged optionally to construct an information window for each process in the modelled task. For example, for a given process the invention may be arranged to generate a column header in an associated information window for each of the processes in the model stage immediately preceding that of the given process. Preferably, the data display is in tabular form. For example, the object word or words of the associated constituent process definitions of the preceding stage are arranged as column headings and specified objects of the said one process definition are arranged as row headings. While most data will be associated with the said constituent process definitions, it is desirable that the computing means are also arranged to accept further object words in the arrangement of the data display. The computing means may be arranged to create a constituent process definition when an object word or words is added by the user to the data display. Preferably, the computing means are arranged to inhibit the creation of a constituent process definition when an object word or words is added to the data display at the option of the user. In a particular form, the invention comprises a system for modelling a process structure for performing a task, the system comprising: computing means; data storage means accessed by the computing means; means for inputting data to the computing means; and display means operably connected with the computing means for displaying prompts and data inputted through the inputting means and from the computing means, the computing means being arranged selectively to display on the display means a prompt for a first process definition requiring a verb word or words and an object word or words input through the data inputting means by a user, and to require the user to select a further input prompt from the computing means requiring the user to input a second process definition which would be a consequence of executing the first process definition or which would be a constituent step in executing the first process definition to create a series of stages in the task model culminating in a model for performing the task, or to require the user to specify a particular object word or words, which are instances of the object word of the first process definition, the computing means further being operable to generate a retrievable tabular data display, associated with one process at one stage, in which the constituent object word or words of the process definition(s) in the stage before the said one process definition are arranged as column headings and specific objects of the said one process are arranged as row headings. The invention represents a simple way of planning and controlling work. By way of the basic prompts the user is able to take small steps in the definition of the task structure in areas where his or her experience is lacking or to define or establish a step between process definitions that is larger where experience is sufficient not to require shepherding through a plurality of intermediate, more basic, steps. Thus, each process structure for performing a task can be defined logically yet reflecting the level and areas of experience of the user. The process structure or model developed is, therefore, uniquely fitted to the user who has been guided through the important considerations in response to the prompts of the system. The need to monitor steps in a task where the user has less experience is automatically catered for by the use of the more detailed stages. Preferably, the computing means are arranged to require the addition of a second or subsequent stage of processes in order across the display means. For example, the requirement for a second process definition which would be a consequence of executing the first process definition (a WHY? prompt) is ordered in one direction across the display means and the requirement for a second process definition which would be a preparatory step in executing the first process definition (a HOW? prompt) is ordered in the opposite direction across the display means. The requirements for these process definitions are considered mutually opposing. Thus, by ordering the process definitions in opposite directions in response to the two requirements, a transparent task model is created which can be constructed in greater or lesser detail at each stage to reflect the experience of the user. For the sake of good order it is preferable that the development of a task model or process structure progresses across the display means from a fundamental task process through the various process stages leading to the basic initialising processes. This progression is desirably from right to left of the display means but could equally well be from left to right or in either direction up and down the display means. Preferably, the computing means are arranged to order process definitions at the same task stage level in parallel across the display means. This can result in each step at the same level supporting separate sequences of process definitions. The requirement of the computing means for the user to specify particular object words falling within the meaning of the object word of the first process definition can be arranged to appear on the display means as an overlaid image or window in which more detailed examples of specific objects according to the object type can be listed. By utilising the particular form of the invention defined above the user is able to build a task model in either direction. For example, the initial identification of a task will lead the user to construct a model based on responses to the HOW? prompt and to define specific objects in the model where necessary. The user is also optionally able to determine the value of the task, or a step in the task, by working backwards in response to the WHY? prompt. The invention may include calculator verbs in response to which the computing means are arranged to perform arithmetic processes on values, stored in the data storage means, of objects arranged in a task stage. This will be in respect of objects which relate to numerical values of objects, such as amounts of money or numbers of objects. Preferably, the computing means are arranged to create a text sub-file and/or document headers in response to a command from the means for inputting data for a process, the text sub-file being displayable on the display means in response to a command from the user transmitted via the data inputting means. The documents indicated by the headers can be written in a text processing language associated with the computing means and accessed through the task model. In this way, the user can use the underlying database structure of the computing means to access other files relating to a particular object. The computing means may also be arranged to generate difficulty ratings from weightings provided by the user via the data inputting means associated with each process in a task model. For example, the weighting can be numerical value assignable by the user. The invention provides a means of selecting a process object whereby the selected object is an instance of the process, thus defining a separate current process comprising the original process verb and the selected object. How or why tasks can be associated with a process that has a relationship with an object whereby the how or why tasks specifically relate to the separate current process and further object breakdowns of that object process only. How or why tasks may be inherited by a current process that has a relationship with an object, whereby the how or why tasks of higher level objects of the process object relationship are applied to the current process in addition to the how and why tasks that are separately associated with the current process. A how process may be compounded whereby the how process objects are associated with the selected objects of the preceding why process which itself may be compounded. A process may include chainbreaking whereby the how process objects are only associated with the object of that process irrespective of any compounding. Objects in what and information windows may be inherited whereby objects displayed are those related to higher level objects of the why process object together with those related to the why process object. BRIEF DESCRIPTION OF THE DRAWINGS The invention can be put into practice in various ways some of which will now be described by way of example with reference to the accompanying drawings, in which: Fig.l is a schematic block diagram of a computer system on which the invention can be installed; Fig.2 is a basic display screen of one embodiment of the invention; Fig.3 is a display screen in which the start of a task model is formed; Fig. is a display screen of a more complete task model; Fig.5 is a display screen of a detail of a refined task step; Fig.6 is a display screen of an overlaid window in which objects in a task step process are specified; Fig.7 is a display screen of an overlaid window as in Fig. 6 with the Tool Button depressed and the Tool Bar opened; Fig.8 is a display screen of an overlaid window as in Fig. 7 with an object expanded to two additional levels; Fig.9 is a display screen of an overlaid window as in Fig. 7 with an object expanded to two additional levels; Fig.10 is a display screen of an overlaid window as in Fig. 6 with one specific object focused into; Fig.11 is a display screen of an overlaid window as in Fig. 6 with an object from that window selected into the Process Selection Field; Fig. 12 is a display screen of two overlaid windows indicating association of objects; Fig. 13 is a display screen of an overlaid window as in Fig. 6; Fig. 14 is a display screen of two overlaid windows indicating object inheritance; Fig.15 is a display screen of an overlaid window indicating All mode; Fig.16 is a display screen of an overlaid window indicating All mode Select and De-select; Fig.17 is a display screen of an overlaid window indicating Normal mode: Fig. 18 is a display screen of an overlaid window with process boxes indicating compounding of objects; Fig. 19 is a display screen of an overlaid window with process boxes indicating process and object Chain- break; Fig. 20 is a display screen of process boxes in How mode indicating a How process dependant upon a PSF setting; Fig. 21 is a display screen of process boxes in Why mode indicating a Why process dependant upon a PSF setting; Fig. 22 is a display screen of an information window for a process; Fig. 23 is a display screen of an information window and calculation processes for a process; Fig. 24 is a display screen of a weighted task model indicating the degree of difficulty of the processes; Fig. 25 is a display screen of part of a task model; and Fig. 26 is an entity relation diagram for the described embodiment of the invention. DETAILED DESCRIPTION OF A PREFERRED EMBODIMENT The major elements of the system are shown in block form in Figure 1. The elements are utilised by a user 10 and include a keyboard 12 through which data is inputted by the user to a computer 14. Data is displayed by the computer on a monitor display screen 16. As will be apparent to the skilled person, the computer will have associated with it a memory 18 for storing data. In the following there are references to a 'cursor' which will be appreciated by the skilled person as references to a mark indicating the area on a screen that is 'current' in which or to which an action or function is addressed. A cursor can be moved about a screen by a 'mouse' . Action or execution switches are incorporated in the mouse. The cursor could be moved by conventional keystrokes such as the up/down/left/right keys on a conventional QWERTY wordprocessing keyboard. Conventional execution of commands or functions on a keyboard is effected by striking, for example, the 'RETURN' or 'SPACE' key or 'clicking' the mouse. For the sake of clarity, the movement of the cursor and the execution of a command or function is to be taken as the result of such movement of the cursor in a conventional manner by the mouse or keyboard and mouse switch actuation (clicking) or key strokes. The process of moving to an area of the screen where a specific feature is indicated and its execution is to be taken to be the above and is often referred to in what follows as 'selection' . Similarly, the mouse can be used to 'capture' an icon or character displayed on the screen. The captured item can then be 'dragged' around the screen to be positioned where the user requires it. These will be well known operations to the skilled person. The user 10 is charged with the job of defining how to go about performing a particular task in an efficient manner. An aspect of the present invention is the concept of an object, tangible or intangible, which can be defined. Examples are a report to be written, a sale to be made, a customer to be serviced. Any object can be broken down into categories and further sub-categories, as required by the user, by selecting a WHAT? icon. An object might be employees, a category of employee might be salespeople and a sub-category of salespeople might be an individual salesperson by name. Associated with an object is a verb to create a verb/object pair ("a process") either encompassing the overall task to be performed or a step on the way to achieving it. Having established a task in the form of a verb/object process, as defined above, that the user wishes to manage as a model in the system, the user may choose between the icons HOW? and WHY? Taking HOW?, it will be appreciated that the user is required to think, on an on-going basis, about what should be the next step, specific to the current step, or one of the steps at a step level or stage, previously defined. Eventually, a task model is developed, including a hierarchy of intermediate processes at different task stages. Each process is a step in a stage of the task model. WHY? can be considered as the reverse direction of HOW? In effect addressing HOW? leads to the beginning or initialising steps of a task, whereas WHY? can be used to refine the process steps in the task by working towards the fundamental task process. A significant amount of time is often wasted in the performance of a task when effort is expended disproportionately on minor, unimportant or even irrelevant processes. Hence being able to work towards the task process by addressing the question WHY? is designed to be a refining tool in creating the task model. A specific example will now be described. The system is run on a personal computer based on an INTEL 486DX/30MHz microprocessor supported by a 4 Mbyte memory and a VGA monitor display. The computer is loaded with Microsoft Windows 3.1 and DOS 5 (or later versions) operating software, as well as a program for executing the system according to the invention. In this case the program of the system of the present invention has to be compatible with the Windows and DOS operating software. The generation of such a program will largely be a matter of routine development to the skilled software programmer. The skilled person will also be aware that the elements of the invention can be implemented in any suitable software language. In the case of the invention the C++ programming language is used. Appendices A and B list some of the source code associated with the underlying concept behind the invention. This will be referred to in more detail below. Once the system program is installed through the Microsoft Windows Program Manager it is possible to call up on the screen of the VGA monitor the process sheet shown in Figure 2. The screen display comprises a title bar 20, a menu bar 22 and a button bar 24. To create a model the option 'File' is selected from the menu bar 22. This allows the user to specify an existing file by name or to create a new model. The invention will be illustrated by creating a new model. The result of this will be a field screen which is largely blank except for a process entry box 26. To define what is initially thought to be the overall task process to be modelled, it is necessary to input to the entry box 26 the object which can be a physical entity or an abstract concept and, above that, a verb defining what it is that is to be done to the object. It is possible to move between verb and object region of the box 26 by depressing the TAB key on the keyboard. Figure 3 illustrates the screen display of the hypothetical task process comprising the verb 'set up' applied to the object 'business' . To take the model towards inclusion of all the necessary constituent processes of the task the cursor is simply moved to the left of the existing process and the mouse clicked or the 'return' key on the keyboard struck. A further entry box 26' appears on the screen immediately to the left of the 'set up business' process. This is the HOW? mode. The system is arranged to default on start-up to the HOW? mode. It is left by selecting the WHY? or WHAT? modes from the button bar 24. Similarly, the HOW? mode is entered by selecting the HOW? from the button bar 24. In response the user is free to define a verb/object process that he or she feels is a constituent step in executing the basic task. In this case the preparatory process is 'build a business plan' . The model is developing from right to left across the screen in response to the HOW mode. Following on from the second stage, Figure 4 shows a series of processes identified by the user as being necessary steps in developing the task model. In the HOW? mode the associated steps in adjacent stages in the developing task model are linked by arrows pointing from right to left (i.e. away from the original task process and towards the initialising processes) and the legend 'HOW' . It will be seen that each stage in the task model comprises a vertical column of parallel processes. All the processes in a stage are considered necessary in achieving the process to which they are indicated as being linked (by the 'AND' between them) in the stage immediately to the right. In the case of a user experienced in setting up business plans the definition of each detailed aspect of a business plan can be narrowed down to fewer defined processes, enabling the user to manage the building of the business plan according to experience. It is likely that an experienced person will be able to make do with less steps if they are confident of the processes to be undertaken or to avoid detailed recitation of processes in a task step. A user requiring more guidance is able to put in more stages and more detailed processes in order to help them identify the processes involved and to decide on which are actually necessary or in need of modification. The example is expanded further with additional processes as shown in Figure 4. As mentioned above, the opposite of HOW? is WHY? The system according to the invention allows the user to work back from a particular process in order that the relevance of that process in the task model is clearly ascertained. By allowing the user to concentrate on exactly why a process in a task model is there will assist in keeping the model efficient and directed to the task. In Figure 4 there is a process 'develop financial plan' . Now the user can select the WHY mode from the button bar 24. The user in this example can then work backwards, asking the question WHY? to define for the model the relevance of this process. This is illustrated in Figure 5 in which the basic task processes of 'build a business plan' and 'secure finances' appear. The WHY? mode is effected by moving the cursor to the right of the process 'develop financial plan' . Again, the blank entry box will appear, requiring the user to consider the reasons for the process being included in the model. To add entry boxes in the same task stage, the cursor is moved downwardly and a new blank entry box is called up by clicking the mouse or striking the 'TAB' key on the keyboard. These processes serve to justify (or otherwise) the presence of the process 'develop a financial plan' . Justification will be associated with the weight attached to the additional answers to the question WHY? Thus, by moving the cursor relative to a process the questions HOW? and WHY? can be addressed and a plurality of processes built in to a particular task stage. At any stage in the model it may be necessary to define more specifically the object of a process. Figure 6 illustrates the on-screen display generated when the WHAT? icon is selected from the button bar 24 for a particular process over which the cursor is positioned. In this case, the process is to establish a product concept. Once the WHAT? window is overlaying the task model screen it is possible for the user to input, via the keyboard, a list of objects: in this case product concepts to which the process concerned relates. Thus, for those processes in the task where it is necessary to specify different items under the same object definition the system is arranged to provide an optional inventory to which relevant items can be added to taken away, the WHAT? window has an associated Tool Bar as illustrated in Figure 7. The Tool Bar 34 has a set of tool buttons that activate specific functions as described below. The Tool Bar is opened and closed by clicking on the tool icon 32 and lowering/raising the button respectively. Any item appearing in the inventory as a result of a WHAT? enquiry can be made the subject of a further WHAT: enquiry. Figure 8 illustrates this in relation to the "talking tree" object item in the inventory "WHAT product concept?" The indented list of sub-items under "talking tree" lists the inventory of languages. Indented lists are opened or closed by clicking on the Tool Bar What 38 and Not What 40 buttons respectively. WHAT? lists may be indented to as many levels as the user wishes. Figure 9 illustrates a "French" object of the "Talking Tree" object expanded to show the currently entered French dialects 42. In addition to the indented lists as illustrated in Figure 9, the user may focus upon a specific object layer within a WHAT? list, as illustrated in Figure 10. To focus on an object and its further breakdown, the user moves the cursor to the required object in the list, in this case "Talking Tree", and clicks on the Focus button 48. The WHAT? window is re-displayed, with "What Talking Tree?" in the title bar 46 and the list of objects and indented objects restricted to a breakdown of "Talking Tree" 44. The user may changed the context of the process model by promoting an object from the object inventory to the Process Selection Field (PSF) . In so doing the user changes the context of all information displayed to the left of the process with the PSF selection. An example of PSF selection is illustrated in Figure 11, where "Talking Tree" has been promoted to the PSF 52. The user promotes an object to the PSF by highlighting the required object 50 and clicking on the Tool Bar Select button 54. The user clicks on the De-select button 56 to remove an object context from the PSF. Object context changes using a process PSF control the inventory of WHAT? displays. Figure 12 illustrates the object "Electric Car" 58 promoted to the PSF of process "Establish Product Concept". The WHAT? display opened for process "Identify Requirements" shows the inventory of "Requirements" 60 which are relevant to the "Product Concept" "Electric Car". The object inventory that is displayed when there is a PSF for a process to the right is also dependant upon the object inventory of any objects that are more senior in the object hierarchy than the PSF object. This behaviour is Object Inheritance and is illustrated in Figures 13 and 14. In Figure 13 the object "Financial Support" 62 is entered into the inventory of process "Identify Requirements" with the process to the right being "Establish Product Concept" 64 with no PSF selection. The "Requirement" "Financial Support" is therefore associated with "Product Concept" and the complete inventory of objects for "Product Concept" . Figure 14 illustrates "Electric Car" promoted to the PSF of "Establish Product Concept" and its associated WHAT? ___ __ . . ,. 22 inventory for process "Identify Requirements" associated with "Product Concept" "Electric Car", as originally illustrated in Figure 12, now includes "Financial Support" as part of the inventory, because "Financial Support" has been inherited from "Product Concept" ("Electric Car" is a part of the WHAT? inventory of "Product Concept"). All objects within the inventory of objects can be displayed, irrespective of context, by setting the WHAT? display into All mode. Figure 15 illustrates the WHAT? inventory for process "Identify Requirements" in All mode, and shows all of the objects that exist in the inventory irrespective of context. To change a WHAT? display from normal to All mode the user clicks on the Tool Bar All button 70. To re-display the normal (non- All) mode for the WHAT? display, the user clicks (and raises) the same All button 70. When a WHAT? display is in All mode, a box icon to the right of each object in the display indicates whether or not the object has context with the process to the right. Objects with context have a tick in the box 72, whilst objects without context do not have a tick in the box 74. The user may create or remove the relationship of an object with the process to the right by using the All mode Select and De-Select. All mode Select and De-Select are illustrated in Figures 16 and 17. The "Requirement" "Aluminium Body" in Figure 16 is removed from relationship with "Product Concept" "Electric Car" by highlighting the object "Aluminium Body" and clicking on the Tool Bar De-Select button 78. The "Requirement" "Energy Shortage" is put into relationship with "Product Concept" "Electric Car" by highlighting the object "Energy Shortage" and clicking on the Tool Bar Select button 76. Figure 17 shows the results of the above relationship changes. The WHAT? display for "Identify Requirements" has been changed to normal mode by clicking and raising the Tool Bar All button 86 and "Requirement" "Aluminium Body" is no longer displayed in the inventory whereas "Requirement" "Energy Shortage" is displayed in the inventory. Relationship dependency upon the process and/or process PSF selection to the right is termed Compounding. Compounding continues as you move to the left through a process model in How mode. Figure 18 illustrates compounding further to the left. The process "Establish Product Concept" has "Electric Car" promoted to the PSF. The process "Identify Requirements" has "Energy Shortage" promoted to the PSF. W now have the compounding "Electric Car Energy Shortage" 92. The process to the left of "Identify Requirements", "Assess Probability", has a PSF selection and WHAT? inventory of "60%". This illustrates that "Electric Car Energy Shortage" has a "Probability" "60%", showing that the "Probability" "60%" is compounded with "Energy Shortage" which is compounded with "Electric Car" . Compounding can be stopped by Chain-breaks upon processes. When a process is a Chain-break it signifies that further dependencies to the left start compounding from that process. Figures 18 and 19 illustrate Chain- breaks and Normal processes. To set a process as Chain- break, clicked the Normal button 88 is clicked or pressed. The button 88 now displays the word Chain- break. The set a Chain-break process back to Normal, the same button (currently displaying the word Chain-break 94) is pressed and the button now displays the word Normal. The button 88/94 will display Chain-break or Normal, dependant upon which mode is set for a process, for each process as it is selected in he process model. Figure 19 shows the process "Identify Requirements" 98 set as a Chain-break and shows the process "Assess Probability" with a PSF entry and WHAT? inventory of "30%". Under these (Chain-break) circumstances, the "Probability" "30%" is associated with "Requirements" "Energy Shortage" irrespective of what context is set for the process "Establish Product Concept". Processes with PSF selections can have How? or Why? process relationships that are only related to the process with its PSF selection. Figure 20 illustrates a PSF process with a How process relationship. The process "Identify Climate Changes" 100 is only a How? of "Identify Requirements" when the object "Energy Shortage" is selected into the PSF of "Identify Requirements" 102. Figure 21 illustrates a PSF process with a Why? process relationship. The process "Manage Finances" is only a Why? of "Manage Actions" when the object "Financial" is selected into the PSF of "Manage Actions" . Note that inheritance also applies to process relationships - in Figure 20 the process "Assess Probability" remains as a How? of the process "Identify Requirements" with the PSF selection "Energy Shortage" because the process "Assess Probability" is associated with the process "Identify Requirements" and the PSF selection "Energy Shortage" is part of the inventory of the process "Identify Requirements" . Selection of the Info button generates an information window in which the row headings are of the sub-objects of the current process as with the information template. However, the column headings are automatically derived from the objects of the constituent processes in the stage below (to the left of) the current process. As associated processes are added or taken away, the columns in the information window will change accordingly. As processes are added to the model, the information window for a particular process will automatically generate column headings which will be taken from the object words of the constituent associated processes in the next model stage along in the HOW? direction. By this a tabular illustration of the status of a process can be called up in which the status of the preceding process objects can be laid out. Figure 22 illustrates the relationships between processes and information window column headings. By selecting the required object the relevant information window will be displayed. It is found that users can construct task models by blending construction using the process structure and the information window. The invention automatically creates a process box on the constituent level with which the information window is associated for any column heading added to the information window. Thus, a process object added to the template is revealed as a process box in the task model but without a verb attached to it. This missing verb can be added at the option of the user to the task model. Also at the option of the user the invention allows for deletion of such a process box added through the template if the user does not wish it to appear in the task model displayed. The system may also provide pre-prepared templates for day-to-day usage not necessarily associated with any task model, such as an address list of relevant people. For example, a standard process 'contact people' can be installed in the system which has associated with it an information template for listing essential data on regularly contacted people. It must be borne in mind that this is not a process necessarily a part of a task model, but can be called up independently. Similarly, a diary facility can also be installed as a separate routine not linked to a task model or process. As part of a task model, and illustrative of the flexibility of the system to differing skill requirements, there is a 'Calc' button on the button bar 24 which will allow the user to construct processes in the task model for calculating figures. Figure 23 illustrates the task model displayed when calculations have been set up for the process "Develop Financial Plan" . The steps in the calculation have been set up as task processes. The calculations represent important data in the steps of the task model. The calculations are applied to the objects in the associated information window illustrated in Figure 23. Numerical data is entered for the objects on which the calculation is to be performed and the result is displayed automatically under the 'Profit' row heading in the information window. Thus, the information window provides a spreadsheet calculation facility in respect of the 'Calc' processes automatically arranged in tabular form in the information window. Calculations can be performed on rows, columns and specific cells within information windows. Additionally the user can select from pre-defined numerical and financial functions that can be used within calculations. 174 27 To review the task model in detail or as an overview, the options mean item has a FEEDBACK button which, when selected, allows the option of either detailed or general feedback on the task model. The detailed view provides a diagnostic on the completeness and logic of the task model, a time based overdue section that highlights processes of the task where, in conjunction with a date- based objective in the action window, no due date has been set or the date has been overrun. Also a comparison can be called up in the detailed feedback mode of the actual achievement of objectives with the targets set. In the overview mode the feedback is displayed as illustrated in Figure 24 by selecting the OPTIONS menu item on the menu bar 22. Each process is now annotated with a red triangle containing a number reflecting the difficulty of performing the process. The number can be assigned from any convenient range for example 0 to 99. The higher the number, the greater the degree of difficulty associated with the particular process. The weightings are then used by the system as it looks through a model for any of the processes listed. The number of instances of each condition that is found is then multiplied by the weighting to arrive at a total score for this condition. If the user selects detail mode for the feedback the information is displayed for the user condition by condition. In the overview mode, with the triangles displayed, then the total of all conditions for a process is computed to be a number between 0 and 99. While models can be created by the user from a blank screen it is also possible to load the system with pre¬ written models for well-known and identified tasks. This may be acquired as part of the system or as a separate file to be loaded onto the existing system. It will be noted that parallel processes in the same task stage are linked by the word 'AND' which is a logical AND indicating all the processes in that stage need to be satisfied before their associated process in the next stage above to the right can be completed. Of course the logical AND can be replaced with logical OR or THEN to indicate alternative processes and sequential processes, respectively. It is likely that a particular user will reuse various key object and verb words and phrases in different task models. The system maintains all such words and phrases so that they can be retrieved from a dictionary. An object dictionary maintains a record of all objects together with their sub-objects, if any. An object can exist in many different models and different levels within models. Thus, wherever a particular object is used the subsequent HOW? steps will be those from the highest level, i.e. nearest the fundamental task process which is being modelled. This also applies to calculations which, therefore, need only be defined once and then used again in different models or in different parts of the same model. This has the consequence of allowing information or text that has been associated with an object to be retrieved in association with wherever that object is recited in a task model or in whichever task model the object is subsequently displayed. Thus, the invention also provides a cross referenced database between models. A verb dictionary maintains a record of all the verbs and „„.- . 2174 29 the processes in which they are used. The process dictionary maintains a record of all processes and where they are used. To modify a loaded task model, the cursor is moved to a position at the stage in the model at which the modification is to take place. This may be to add steps or to supplement a step already existing in the model. In the latter case the cursor is moved within the vertical area beneath an existing step in the model where the supplementary process is to appear. Figure 25 illustrates the addition of the process 'achieve sales target' to the task model. In this case various other processes depending from this new process have also been added by means of the HOW? mode and parallel processes in each stage are added as described above using downward movement of the cursor. In the event that a process is inserted into any task model that has an entry in the reference dictionary, the system can be arranged automatically to add these processes as well. Referring to the Entity Relation Diagram of Figure 17 and Appendices A and B, the invention is also described in relation to extracts of its source code. All entity references are made using UPPERCASE. Appendix A is a C++ class for managing movement around the display - What, how, why window. Appendix B is a C++ class for creation of the 1st order, and 2nd order OBJECTS. The appendices set down the key principles of the logical design in terms of the data structure and associated processing. 001 1st and 2nd Order Relationships 1. 1st order relationship is used to denote and store the relationship between any process OBJECT and each of its immediate how processes. 2. 2nd order relationship is used to denote and store the set of all the 1st order relationships for a process. and, as an Information Window is simply another way of viewing a part of a task model: 3. A row within an Information Window is a 2nd Order relationship. 4. Each column within an Information Window is a 1st Order relationship between that column and the leftmost column (the what list) . 005 Process 1. The process is captured as a verb phrase and noun phrase. 2. Store the verb phrase as an OBJECT of OBJECT CATEGORY (2nd order) and the user entered text as an OBJECT TEXT instance. 3. Store the noun phrase as an OBJECT of CATEGORY (object primitive) . Create an OBJECT TEXT instance for this OBJECT PRIMITIVE in order to store the text entered by the user. 4. Create an OBJECT of CATEGORY (2nd order) and connect this as a child of the OBJECT defined in 2 above using the OBJECT INHERITANCE relationship. 5. Create an OBJECT of CATEGORY (1st order) and create an OBJECT ASSOCIATION between this and the noun phrase created in 3 above. 6. Finally, create a relationship between the OBJECTS created in 4 & 5 above using the OBJECT ASSOCIATION entity. 010 How connection When a how process is entered by the user, perform 005 for this process then make the how connection as follows 1. Create an OBJECT (1st order) that has separate OBJECT ASSOCIATIONS between this and (1) the 005/4 OBJECT for this how process (the child process) (2) the 005/3 OBJECT for the process to which the how process is to be connected (the parent process) 2. Connect 010/1 to the 005/4 for the parent process 3. If this is not the first how process then connective logic will have been entered by the user i.e. And, Or, Then (AOT) . Store the connector by creating an OBJECT CHARACTERISTICS (AOT) entity for the 010/1 OBJECT. 020 Why connection A why connection is simply a how connection looked at in reverse. Therefore firstly perform 005 for the why process that the user has entered. Then perform 010 but using the process that the user has entered as the parent process and the current process as the child process. 030 What lists When an object is added to the what list by the user: 1. Create an OBJECT (PRIMITIVE OBJECT) for the noun phrase entered. This is the same routine as 005/3 2. Create an OBJECT INHERITANCE relation with 030/1 as the child and the what is OBJECT as the parent 3. If the entered OBJECT' is further broken down using the what command then create further OBJECT INHERITANCE relations with 030/1 as the parent and the further OBJECTS as the children 4. ....and so on for any further breakdowns the user may enter. 040 Impact of THEN logic Definitions 010 and 020 are applied when the user has entered connectors AND or OR. The logic however differs slightly when a THEN connector is entered. The difference is as follows -. 1. The OBJECT defined in 010/1 (1) is replaced with the object created in 010/1. Information Window 050 Displaying the Information Window The information window is an extension of the what list which represents the Y-axis (rows) . The X-axis (columns) are created either as a default set by the system or, as specifically instructed by the user (see define outputs) . The default window columns are computed as follows : 1. Retrieve the OBJECT (2nd ORDER) for the current process 2. Retrieve the 005/3 for 050/1 3. Walk the OBJECT INHERITANCE relation for 050/2 and display each instance as the what list 4. Now walk the OBJECT ASSOCIATIONS for 050/1 to find each OBJECT (1st ORDER) with which 050/1 is associated 5. For each OBJECT (1st ORDER) found, walk the OBJECT ASSOCIATIONS again to find the 010/1(1) OBJECT 6. For each 010/1(1) OBJECT that is of CATEGORY (2nd ORDER) walk the OBJECT ASSOCIATION again to find the 005/5 OBJECT. For each 005/5 OBJECT walk the OBJECT ASSOCIATION again to find the 005/3 OBJECT. This OBJECT and its associated OBJECT TEXT instance represents a column header. 060 Defining Outputs The user can override the default information window using the Define Output function: 1. If a deletion of a default column is indicated, then flag this within the data structure by creating an appropriate CHARACTERISTICS instance 2. If an additional column is indicated, store the text entered as an OBJECT of CATEGORY (OBJECT PRIMITIVE) in the same manner as 005/3 3. For these additional columns, also create an OBJECT (1st ORDER) as in 010/1 except that the 010/1(1) OBJECT is replaced with the OBJECT created in 060/2 above. note, use CHARACTERISTICS to indicate that this user defined column object is not a how process and should not be displayed 070 Rows The leftmost column is the what list for the current process and definition 030 applies. For any row to which the user makes a column entry: ' l. Create an OBJECT (1st ORDER) for each level of the what hierarchy that the user has navigated to get to this row. 2. For each of these 1st ORDERS create separate OBJECT ASSOCIATIONS between the 1st ORDER and: (1) the 030/1 OBJECT for the row (2) the 070/2 OBJECT created at the level above. If the level above is the process object then use the appropriate 005/3 OBJECT 3. The 070/1 OBJECT at the lowest level (the row required) represents the process object for this row, i.e. a compound object. 4. Now create an OBJECT (2nd ORDER) for the row and create an OBJECT ASSOCIATION between this and 070/3 3 *. 5. Now create an OBJECT INHERITANCE instance between this 2nd ORDER and 005/4 for the current process 6. For any column entry that the user wishes to make check cardinality - 080 7. For each column entry create an OBJECT (PRIMITIVE OBJECT) if it does not already exist and an OBJECT INHERITANCE relationship with the column entry as the child, and the column header as the parent. 8. Then for each column entry, create an OBJECT (1st ORDER) and create separate OBJECT ASSOCIATIONS between this and : (1) 070/7 (2) 070/3 9. Connect 070/8 into 070/4. 075 Selecting rows in the task model window The user can also create rows using the information window. A row is equivalent to a parent process and its immediate how processes. Selection of sub objects into the process selection field is exactly equivalent to entering into the appropriate columns within the related information window. 078 WHAT versus SELECT The WHAT command is used to navigate an OBJECT INHERITANCE structure into increasing levels of detail. When the required OBJECT is identified, the SELECT command indicates that this OBJECT and any related 'children' within the OBJECT INHERITANCE network are connected into the current association. With reference to 070 and 075, this applies to any column within a row and any process selection field. 080 Cardinality The Define Output window allows the user to define cardinality. Specification of a minimum relationship and a maximum relationship is allowed. Each of these is specified in the form l:n, where n is an integer or the word 'many' . The minimum relationship allows the user to specify a column as mandatory or optional. Also the user can specify that a column entry must already exist as a sub-object of the column header. If the user has specified ONLY as the logic connector (stored as a characteristic) , then the processes either side of this connector are mutually exclusive and entry on both sides of this connector, within the same row, must be prohibited. 090 Structural Sequence The sequence of entry to the database is important in the following circumstances: 1. In OBJECT INHERITANCE the sequence should reflect the user entry sequence 2. IN OBJECT ASSOCIATION, when used in routine 050 and 070, the sequence between columns and associated row entries must be maintained when navigating the associated OBJECT INHERITANCE The button bar 24 also bears two symbols of a happy face and a sad face. These can be used when the task model is being set up to signify whether the user is confident or not of an identified process. The faces can be 'dragged' when selected by the mouse to any area on the screen. The system is defined in terms of an on-screen display bearing verb/object processes and windowed fields overlaying the basic task model for the purposes of temporary display, but it will be appreciated that other configurations and arrangements of the task model are possible. For example, the process steps of the task model may progress up or down the display. Other peripheral facilities may also be included in the system, such as the daily diary. The diary may be linkable to processes in one or more models on the system so that a diaried event may be used to alert the user, to a deadline, for example. Similarly, the system has a pre- installed telephone, fax and address list template which is accessed through the standard process 'contact people' by selecting the Action button when the cursor is in the box denoting the 'contact people' process. The template appears and can be scrolled to the appropriate person or organisation. Selecting the Action button again will bring up the input template bearing the relevant details. In compliance with the statute, the invention has been described in language more or less specific as to structural and functional features. It is to be understood, however, that the invention is not limited to the specific features shown, since the means of construction and method herein disclosed comprise only a preferred form of putting the invention into effect. Other modifications and other variations of the apparatus and method will occur to those of ordinary skill in the art. Accordingly, the foregoing description is to be interpreted in an illustrative, and not in a limitative sense and the invention is claimed in any of its forms or modifications with the legitimate, valid scope of the appended claims appropriately interpreted in accordance with the doctrine of equivalents. APPENDIX A // SSource: C: \log cal\code\gnd/RCS/MOVEMENT.H, v $ // SRevision: 1.2 S // SDate: 1993/10/05 14:03:45 $ // (c) 1993 Logical Water - J. R . Shannon ftifndef _raovement_ ♦define _movement_h class LWGridWindow; class LWGridMovement ( public: LWGridMovement ( WGridWindow* _gπd) ; virtual -LWGridMovement ( ) ; // — void Left(TMessages) ; void Rιg t(TMessages) ; void Up(TMessagei) ,* void DownfTMessagei) ; protected: void GetCurrentCelldntS _x, ints _y, LWGrιdCell*S _cell) ; LWGridCell* getAbove(int _x, int _y, LWGridCell* _cell) ; LWGridCell* getBelo (mt _x, int _y LWGridCell* _cell) ; LWGridCell* getLeft nt _x, int _y, LWGridCell* _cell); LWGridCell* getRigh dnt _x, int _y, LWGridCell* cell); void UpFromProcess (void) ,- void DownFromProcess ( oid) ,* void LeftFromProcess (void) ; void Rig tFromProcess (void) ; void UpFromEmptyProcessdnt , int _y, LWGridCell* _cell); void DownFromEmptyProcess(mt X, mt _y, LWGridCell* _cell); void LeftFromEmptyProcess nt _x, int _y, LWGridCell* _cell); void RightFromEmptyProcess nt _x int _y, LWGridCell* _cell); void UpFromVConnector (void) ; void DownFromVConnector(void) ; void LeftFromHConnector(void) ; void Rig tFro HConnector(void) ,* // void LoseEmptyProcess (int _x, int _y, LWGridCell* _cell, BOOL _setCurrent -= FALSE); void S iftCellsRigh dnt _λ, mt _y, LWGridCell* _cell, int _level - 0); void ShiftCellsLef fint _.x, mt _y, LWGridCell* _cell, int _level = 0); void S iftCellsUp nt _λ, int _y, LWGridCell* cell); // void S uffleHowC ildrenDowndnt _x, int _y, LWGridCell* cell, int _px, int _py, LWGridCell* _pcell, int _pd) ; void ShuffleWhyC ildrenDowndnt _x, int _y, LWGridCell* _cell, int _px, int _py, LWGridCell* _pcell, mt _pα), t ShuffleChildrenUpdnt _.:, int _y, LWGridCell* cell); // int ropProcess (mt _sx, int _sy, LWGridCell* _scell, intf. _dx, ints _dy, CurrentType _dt) ; void HandleApresDropdnt _sx, int _sy, LWGridCell* _scell, int _dx, int _dy, CurrentType _dt) ; void HandleVerticalMovednt _dx, mt _dy, CurrentType _dt, LWGridCell* dcell, int _sy) ; void HandleLeftMovednt _dx, mt _dy, CurrentType _dt, LWGridCell* dcell, mt _sx, int _sy, LWGridCell* _scell); void HandleRightMovednt _dx, int _dy, CurrentType _dt, LWGridCell* dcell, int _sx, int _sy, LWGridCell* scell); pr_v_L<* : LWGndW_ndo-._ grid; »endιt // SSource: C: \loqical .code .gnd/RCS/movemen .cpp, v S i f SRevision: 1.2 S // SDate: 1993/10/05 14:03:45 S / / // (c) 1993 Logical Water - J. R.Shannon idefme C_NO_IOSTREAM Iinclude <CDLιst.h> Kinclude <CStrιng.h> .include <CVector.h> imclude "qs.h" ((pragma hdrstop Kinclude "display. " static const char RCSιd(| = "$Id: movement.cpp, v l . Z 1993/10/05 14:03: .5 jason Exp jason $ " ; // inline void Beep(void) ( MessageBeep(-l) , ) // void LWGridMovement: :UpFromProcess (void) I t x, y; LWGridCell* cell; GetCurrentCelKx, y, cell); if (cell->IsEmpty () ) I UpFromEmptyProcess (x, y, cell) ; ) else ( LWGridCell* above « getAbove (x, , cell) ; if (above == 0) ( if (cell->IsOb * ιectlve() ) ( LWGridCell* empty = grid.end.GetNewGndCell ( ) ; empty->SetSouthLιnk(0) ; empty->SetOb 3 ectιve ( ) ; cell->SetNorthLm.:<-l) ; grid. grid. IncSurround σ (:■:, y-1 ) ; grid. gnd.AddCell (>:, y-1, empty) ; arid.cpxSetCurrent (x, y-1 , ::, y, 0, c Process, FALSE) ; I else if (cell->GetMode( ) == gmHow ii ' cell->Chec):East ( ) __ 'cell- >Chec South( ) __ !cell->CheckNorth( ) ) { Beep ( ) ; I else if (cell->Get.Mode ) == πmWhy _,r. 'cell ->Chec):We.*.r. ( ) f. ι. ' ce 11 - >CheckSouth( ) && ' cell->CheckNorthl ) ) ( BeepO; ) eise ( I πl p.:, ; >', pd; l.W'.ririOI i * pre* 11 ; ee J -- ■( .**LM df ( ) - ■ - gmliow " iirid.qria . Loca ellowl rr-nt ( :', y, cell, px, py, pcell, |)d) : grid. rid. Lo ateWhyl'arent. Ix, y, cell, px, py, pcell , pd) ; if (pcell) // found a parent.' ( grid. J.ose urrent. () ; ,/ and any displayed rluldr.n I hope... i!11-.-Get Model ) -- πmllow " • Chut 11 eHouChildienDown I y., y, cell, px, py, pcell, pd) ShutfleWhyChildrenUownlz, y, cell, pκ, py, pcell, pd) ; ) I else ( if (above->IsOb 3 ectιve ( ) ) I grid.SetCurrent(x,y-1,cell->North() ) ; ) else ( grid.SetCurren lx, y-1, cell->North( ) , ctVConnector) ; ) ) ) ) void LWGridMovement: :DownFromProcess(void) ( mt x, y; LWGridCell* cell; GetCurrentCelllx, y, cell); if (cell->IsEmpty() ) I DownFromEmptyProcess(x, y, cell) ; 1 else I LWGridCell* below = getBelowfx, y,cell) ; if (below == 0) ( if (cell->IsOb * )ectιve() ) I LWGridCell* empty = grid.grid.GetNewGridCell() ; e_πpty->SetNorthLmk(0) ; empty->SetOb 3 ectlve() ,* cell->SetSouthLιnk(-l) ; grid.grid.IncSurrounding(x, y+1) ; grid. rid.AddCelKx,y+1,empty) ; grid.SetCurren lx, y+1,0,ctProcess, FALSE) ,* I else if (cell->GetMode() — gmKow 4t !cell->C_.eckEast() 44 icell- >CheckSouth() 44 !cell->Chec)_ orth( ) ) ( BeepO; ) else if (cell->GetMode() ~ gmWhy tt !cell->CheckWes () it !cell- >CheckSouth() 44 !cell->Chec)_ ort () ) i Bee ( ) ; I else ( LWGridCell* empty = grid.grid.GetNewGridCell() ; empty->SetNorthLink(0) ; cell->SetSouthLιnk(-l) ; grid.grid.IncSurrounding(x,y+1) ; grid.grid.AddCelKx, y+1,empty) ; gπd.cpxSetCurrentlx, y+1,x, y,0,ctProcess, FALSE) , * ) ) else ( if (cell->IsOb 3 ectιve() ) ( gr id. SetCur ren (x, y+1, cell- >South ( ) ) ; ) else ( grid.SetCurrent l x, y, cell->South ( ) . ctVConnector ) ,- ) ) ) I void LWGridMovement: :LeftFromProcess(void) I int x, y; LWGridCell* cell; GetCurrentCelllx, y, cell) , * if (cell->IsE_npty() ) I LeftFromEmptyProcess Ix, y, cell) ; I else I LWGridCell* left = getLeft Ix, ,cell) ; if |cell->GetMode( ) == αmHow) I if (left) I gπd.SetCurrent(x, y, 0,ctHConnector) ; I else i LWGridCell* empty = grid. rid.GetNewGridCellI ) ; empty->SetEastLink(0) ; cell->SetWestLιnk(-l) ; grid.grid.IncSurrounding (x+1, y) ; grid.grid.AddCell(x+l,y,empty) ; gπd.SetCurrent(x+l, y, 0,ctProcess, FALSE) ; ) ) else I if (cell->IsOb 3 ectιve() ) ( Beep(I ; 1 else I if (left) ( grid.SetCurrentιx+1, y, cell->West( ) , ctHConnector) ; ) else ( mt px, py, pd; LWGridCell* pcell; grid.grid.LocateWhyParentl , y.cell, px,py,pcell,pd) ; if (pcell) grid.SetCurrent(px,py,pd) ; else Bee () ; ) void LWGridMovement: : ightFromProcess IvoidI I int x, y; LWGridCell* cell; GetCurrentCelllx, y, cell); if lcell->IsEmpty( ) ) I RightFromEmptyProcesstx,y,cell) ; ! else ( LWGridCell* right = getRight(x,y,cell); if (cell->GetMode() == gmHow) ( if (cell->IsOb 3 ectιve( ) ) ( Beep( ) ; I else I if (right) I grid.ΞetCurrent(x-1, y, cell->East( ) .ctHConnector) ; ) else ll; eHowParent(x, y,cell, px,py,pcell,pd) , nt(px,py,pd) ; Beep() ; else ( if (right) ( grid.SetCurrent(x, y, 0,ctHConnector) ; ) else ( LWGridCell* empty - grid.grid.GetNewGridCell() , e*npty->SetWestLmk(0) ; cell->SetEastLιn (-1) ; grid.grid.IncSurroundmg(x-l, y) ; grid.grid.AddCell(x-l, y,empty) ; grid.SetCurrent(x-1, y, 0,ctProcess, FALSE) ; void LWGridMovement::UpFromEmptyProcess(int _x, int _y, LWGridCell* cell) ( // If there's text that's been entered for this empty process, // but not yet entered, enter it and this then becomes a normal // process. if (grld.CheckEmptyEdιtComplete(_x, _y, _cell)) I return; ) LWGridCell* above = getAbove (_x,_y,_cell) ; if (above ~ 0) I Beep() ; ) else ( //mt north = _cell->North() ; LoseEmptyProcess (_x, _y, _cell, TRUE); I ) void LWGridMovement: :DownFromEmptyProcess (mt _x, int _y, LWGridCell* _cell) ( // If there's text that's been entered for this empty process, // but not yet entereα. enter it and this then becomes a normal // process. if (gπd.CheckEmptyEdιtComplete(_x, _y, _cell)) I return; ] LWGridCell" below = getBelow(_x,_y,_cell) ,* if (below == 0) ( BeepI ) ; ) else I //int south = _cell->South() ; LoseEmptyProcess (_>:, _y, _cell, TRUE); I ) void LWGridMovement : : Lef tFromEmptyProcess l int _x, int _y, LWGridCell* _cell ) ( // If there's text that's been entered for this empty process, // but not yet entered, enter it and th s then becomes a normal // process. if (grιd.CheckEmptyEdιtCompleLe(_x, _y, _cell)) I return; //LWGridCell* left = getLef (_x,_y,_cell) ; LoseEmptyProcess (_ , _ • /, _cell, TRUE); ) void LWGridMovement : .- RightFromEmptyProcess (mt _x, int _ , LWGridCell * _cell ) I // If there's text that's been entered for this empty process, // but not yet entered, enter it and this then becomes a normal // process. if (gnd.CheckEmptyEditComplete (_x, _y, _cell) ) I return; ) //LWGridCell* right = getRight(_x,_y,_cell) ; LoseEmptyProcess (_x, _y, _cell, TRUE); I // void LWGridMovement: -.UpFro VConnector(void) I int x, y; LWGridCell* cell; GetCurrentCelllx, y, cell); // If we're on a vertical connector, then we -just set the // current process to the one we're already on, but set // the current type to ctProcess rather than the current // ctVConnector grid.SetCurrentlx, y, 0, ctProcess); I void LWGridMovement : : DownFr omVConnector I void ) ( int x, y; LWGridCell* cell; GetCurrentCelllx, y, cell); // Is there a cell below this one? Bloody well should be... if (cell->CheckSouthLmk() ) I LWGridCell* below = grid.grid.GetCell(x, y+1, cell->South( ! ) ; if (below) I grid.SetCurrentlx, y+1, cell->South() ) ; I 1 else I Beep( ) ; ) . / void LWGridMovement: : Le tFromHConnectorIvoid) ( int x, y; LWGridCell* cell; GetCurrentCelllx, y, cell); if (grid.mode == gm hyl and..t'LCurrentl. , •/, 0, ctProcess, FALSE); else ll (cell->CheckWestLιnk( ) ) ( // If in How mode, then move onto the process box // to the left. LWGridCell' left = grid.grid.GetCell (x+1, y, cell-^Wes ( ) I , if (left) I grid.SetCurrentlx+1, y, cell->West( ) , ctProcess, FALSE), I Beept ) ; void LWGridMovement : : RιghtFroπ_HConnector (void) ( t x , y; LWGridCell* cell.* GetCurrentCelllx, y, cell); if (cell->GetMode() ==■ gmHow) grid.SetCurrentlx, y, 0, ctProcess, FALSE); else if (cell->CheckEastLιnk() ) I // If in Why mode, then move onto the process box // to the right. LWGridCell* right = grid. rid.GetCell (x-1, y, cell->EastI ) ) ; if (right) ( grid.SetCurrent(x-1, y, cell->East( ) , ctProcess, FALSE); I ) else Beep( ) , * ) void LWGridMovement: :Shu fleWhyChildrenDown(int _x, int _y, LWGridCell* _cell, int _px, int _py, LWGridCell* _pcell, int _pd) ( // The new empty process box is to be inserted at (_x,_y) and // the current occupant and the ones below it are to be moved // down one row. // // Move to the lowest process box in the child list (under _x,_y) t cx = _x; int cy = _y; LWGridCell* ccell = _cell; // get the old link to the northern cell, if any int oldNorth - ccell->North() ; while (ccell 44 ccell->CheckSouthLιnk() ) ( ccell = grid.grid.GetCell(cx, ++cy, ccell->SouthI) ) ; I while (ccell 44 cy >= _y) I ccell->ClearWestLmk() ; grid.grid.DeleteCell(cx, cy, ccell); // remove grid.grid.IncSurroundmg(cx, cy+1) ; gπd.grid.AddCelKcx, cy+1, ccell); LWGridCell* cur - ccell; // Resolve the south link of the cell above... if (ccell->CheckNorthLιn () ) ( ccell = grid.grid.GetCell (cx, cy - 1, ccell->North( ) ) ; if (ccell) if (cy '= _y) ccell->SetSouthLink(0) ; // coz it IS else ccell->Setsoutt_Lιnk(-l) ; I else ccell = 0; // no more above this one' cur->3etNorthLιnk(-l) ; // coz it will be 0 // Move current process locator one down to follow moved current cell if Igrid.currentProcess.x == cx 44 grid.currentProcess .y »» cy) grid.curreπtProcess. y++; grid.RenderProcessBox (cx, cy + 1, cur); cy—; LWGridCell* empty - grid.grid.GetNewGridCell( ) ; // The parent only gets linked to the new cell if t's // on the same row, otherwise we can assume that the shuffle // was to allow a cell to be inserted somewnere other than // at the top of a list of children. if (__py «-= _y) I _pcell->SetEastLιnk(-l) ; // link to empty cell below current grιd.RenderProcessBox(_px, _py) ; empty->SetWestLιnk(_pd) ; 1 else empty->Set_NorthLιnk(oldNorth) ; // Insert a blank cell at _x,_y - resolve west link for parent, // and east/south links for new the child. empty->SetSouthLιnk(0) ; grid. rid.IncSurroundmg(_x, _y) ; gr d.grid.AddCell(_x, _y, empty); // Add the empty cell grιd.SetCurrent(_x, _y); // And give it currencv ) void LWGridMovement: :ShuffleHowChildrenDownlint _\, int _y, LWGridCell* _cell, int _px, t _py, LWGridCell* _pcell, int _pd) I // The new empty process box is to be inserted at (_.\,_y) and // the current occupant and the ones below it are to be moved // down one row. // // Move to the lowest process box in the child list (under _x,_y) int CX ^ ( - ιnt cy = _y; LWGridCell* ccell = _cell; // get the old link to the northern cell, if any int oldNorth = ccell->North() ,* while (ccell 44 ccell->CheckSouthLιn..() ) ( ccell = grid.grid.GetCell (cx, ++cy, ccell->Soυt () ) ; ) while (ccell 44 cy >= _y) 1 ccell->ClearEastLmk( ) ; grid.grid.DeleteCell (cx, cy, cceill; // remove grid.gπd.IncSurroundingfcx, cy+i ■ . grid.grid.AddCell (cx, cy+1, ccell ) ; LWGridCell* cur = ccell; // Resolve the south link of the cell above... if (ccell- * *CheckNorthLιnk() ) I ccell = grid.grid.GetCell (cx, cy - 1, ccell->North( ) ) ; if (ccell) if (cy '= _y) ccell->SetSouthLιnk(0) , // coz it IS else ccell->SetSouthLin (-1) , I else ccell = 0; // no more above tr.i . on 1 cur->SetNorthLιnk(-l) ; // Move current process locator one down to follow moved current cell if (grid.currentProcess.x == cκ 4 grid.currentProcess.y == cy) grid.currentProcess.y++; grid.Rende ProcessBo (cx, cy + 1 , cur), cy—; ) LWGridCell* empty = grid.qrid.GetNewGridCell I ) , // The parent only gets linked to the new c*ll if it' . // on the same row, otherwise we can assume that the shuffle // was to allow a cell to be inserted somewhere other than // at the top of a list of children. c__pty cell fcclc*.. else empty->SetNorthLιnk (oldNorth) ,* en_Dtv->SetSout____x____<0) ; grid. rid.IncSurrounding! x, y); grid.grid.AddCell(_x, _y, empty) // Add the empty cell grid.SetCurrent(_x, _y.<" // And give it currency J LWGridMovement: :LWGridMovement(LWGridWindow* grid) : gπd(*_grιd) I I void LWGrioMovement: : GetCurrentCell (mti _x, mti _y, LWGnαCel 'i _cexi ) void LWGridMovement : : et (TMessagei ) I switch (qrid.CurrentType) I case ctNone: // None? case ctVConnector: // Can't move left off a vertical connector Beep( ) ; break case ctProcess: LeftFromProcess( ) ; break; case ctHConnector: LeftFromHConnector () ; break; I I void LWGridMovement: :Rιght(TMessaget) I switch (grid.CurrentType) I case ctNone: // None? case ctVConnector: // Can't move πqht off a vertical connector Beep( ) ; break; case ctProcess: RightFromProcess() ; break; case ctHConnector: RightFromHConnector( ) ; break; ) ) void LWGr dMovement: :Up(TMessagei) I switch (grid.CurrentType) ( case ctNone: // None? case ctHConnector: // Can't move up off a horizontal connector Beep( ) ; break; case ctProcess: UpFromProcess ( ) ; break; case ctVConnector: UpFromVConnector() ; break; I ) void LWGridMovement: :Down(TMessage&) ( switch (grid.CurrentType) I case ctNone: // None? case ctHConnector: // Can't move down off a horizontal connector Beep( ) ; break; case ctProcess: DownFromProcess () ; break; case ctVConnector: DownFromVConnector( ); break; ) // LWGridCell* LWGridMovemen : :getAbove(mt x, int _y, LWGridCell* _cell) ( LWGridCell* res = 0; if (_cell->CheckNorthLmkI ) ) res = grid.grid.GetCell(_x, _y-l. _cell->North( ) ) ; return res; ) LWGridCell* LWGridMovement: :getBelow(mt _:*, t _y, LWGridCell* _cell) I LWGridCell* res = 0; if (_cell->CheckSouthLιn I ) ) res = grid.grid.GetCell(_x, _y+l, _cell->South( ) ) ; return res; I LWGridCell* LWGridMovement: :getLeftI inr _x, int _y, LWGridCell' _cell) I LWGridCell* res = 0; if (_cell->CheckWestLιnk() ) res ' = grid.grid.GetCell(_x+l, _y, _cell- WestI ) ) ; return res; ) LWGridCell* LWGridMovement: :getRιqhtIint _x, mt _y, LWGridCell* _cell) I LWGridCell* res = 0; if (_cell->CheckEastLιnk() ) res = grid. rid.GetCel (_x-l, _y, _cell- East( I ) ; return res; I // vo d LWGridWindow: -.WMLeft(TMessagei Msg) ( Left(Msg) ; ) void LWGridWindow: :WMRιght (TMessages Msq) I Right(Msg) ; A void LWGridWindow: :WMUp(TMessagei Msgl ( Up(Msg); void LWGridWindow: :WMDown(TMessage& Msg) I DownIMsg) ; ! void LWGridWindow: :WMOrιgιn(TMessage«) ResetToOb 3 ectιves ( ) ; 1 // void LWGridMovement: : LoseEmptyProcess (int int _y, LWGridCell* _cell, BOOL _setcurrent) 1 int elink = _cell->Eas I) ; int wlink = _cell->West() ; mt slink = _cell->South( ) ; mt nlink = _cell->North() ; if (_cell->GetMode( ) == gmHow) if (_cell->CheckWestLmk() 44 _cell->CheckEastLιnk() ) ( // 1 grid.CurrentType = ctNone; grid.grid.DeleteCell(_x, _y, _cell); // remove empty cell LWGridCell* wcell = grid.grid.GetCell(_x+l, _y, wlink); // get cell to west ShiftCellsRight(_x, y, _cell); // shift it and ones below it to the right grid. rid.FreeGridCell (_cell) ; wcell->SetEastLιnk(elιnk) ; // set link to empt 's parent LWGridCell* ecell = grid.grid.GetCell (_x-l, _y, elink); // get empty's parent ecell->SetWestLmk(0) ; // set empty's parent's link to west cell grid.currentProcess.x = _x-l; grid.currentProcess .y = _y; if (_setcurrent) grid.SetCurrent I _.\- l , _yl ; grid. enderProcessBo (_x-l, _y) ; return; 1 else if (_cell->CheckSouthLιnk( ) 44 _cell->CheckEastLιnk( ) ) 1 // 2 grid.CurrentType = ctNone; grid.grid.DeleteCell (_x, _y, _cell); // remove empty cell LWGridCell* scell = grid.grid.GetCell (_x, _y+l, slmk); // get cell to south if (scell) scell->ClearNorth ( ) ; ShιftCellsUp(_x, _y, _cell); // shift it and ones below it up grid. rid. reeGridCell (_cell) ; scell ->SetEastLιnk(elink) ; // set link to empty's parent LWGritiCell* ecell -- grid. rid.GetCell (_x- , _y, e1_n ) ; // get. empty's parent ecell->SetWestLmk(0) ; // set empty's parent's link to west cell grid.currentProcess .x grid.currentProcess.y if (_setcurrent) grid.SetCurrent (_x, grιd.RenderProcessBox( _y) ; return; 1 else if (_cell- CheckEastLιnk( ) ) I // 3 grid. CurrentType = ctNone; grid.grid.LieleteCell (_x, _y, cell) , // 3 ust remove empty grid.grid.FreeGridCell( cell) ; LWGridCell* ecell - grid. rid.GetCell (_x-l, y, elink) ; // get empty's parent ecell->ClearWestLιn () ; ecell->ClearWest(); g id.currentProcess.x = _ * .-l; grid.currentProcess.y = _y; if (_setcurrent) grιd.setCurrent(_x-l, _y) ; gπd.RenderProcessBox(_x-l, _y) ; return; ) else If (_cell- >Oτ__ _-<_^t____rι ( ) && cell-XIteckEast Lin ( ) ) κ ι ι \ ~ grid.CurrentType - ctNone; grid.grid.DeleteCell(_x, _y, _cell); cell LWGridCell* ecell - grid. rid.GetCell (_x-l, _y, elink); east ShιftCellsLeft(_x, _y, _cell); ones below t to the left grid.grid. reeGridCell(_cell) ; ecell->SetWestLιnk(wlιnkl ; empty's parent LWGridCell* wcell = grid.grid.GetCell (_x+l, _y, wlink); parent wcell->SetEastLink(0) ; parent's link to east cell grid.currentProcess.x = _x+l; grid.currentProcess.y = _y; if (_setcurrent) grid.SetCurrent (_x+l, _y) ; grιd. RenderProcessBox (_x+l , _y) ; return; 1 else if (_cell->CheckWestLmk ( ) 44 cell->CheckSouthLmk ( ) ) I // 5 grid. CurrentType = ctNone; grid. grid . DeleteCell (_x, _y, _cell ) ; // remove empty cell LWGridCell* scell = grid.grid.GetCell (_.*., _y+l, slink); // get cell to south if (scell) scell->ClearNorth() ; ShιftCellsUp(_x, _y, _cell) ; // shift it and ones below it up grid.grid.FreeGridCell(_cell) ; scell->SetWestLιnk(wlmk) ; empty's parent LWGridCell* wcell = grid.grid.GetCell ( parent wcell->SetEastLmk(0) ; parent's link to east cell grid.currentProcess.x *- _x; grid.currentProcess.y = _y; if (_setcurrent) grid.SetCurrent (_x, _y) ; grid.RenderProcessBox(_x+l, _y) ; return; 1 else if (_cell->CheckWestLιnk( ) ) I // 6 grid.CurrentType = ctNone; grid.grid.DeleteCell (__, _y, _cfll ) ; ^ u*3 remove eniriLy LWGridCell* wcell = grid.grid.Gef. -J 1 I y, w] i n) ) ,- / / qcl . .ιι*,r ' ' parent grid.grid. reeGridCell (_cell) ; wcell->ClearEastLιnk( ) ; wcell->ClearEast() ; grid.currentProcess.x = _x+l; grid.currentProcess.y = _y; grid.RenderProcessBox(_x+l, _• ) ; if (_setcurrent) grid.SetCurrent(_x-ιl, _y); grid.RenderProcessBox(_x+l, _y) ; return; i f (_cell->CheckNorthLιnk ( ) ] I / ,' 7 grid.CurrentType = ctNone; grid.grid.DeleteCell(_x, _y, _cell); LWGridCell* scell = grid.grid.GetCell(_x, _y+l, slink); if (scell) scell->ClearNorth() ; ShιftCellsUp(_x, _y, _cell); grid.grid.FreeGridCell (_cell) ; if (scell) scell->SetNorthLιnk(nlιnk) ; LWGridCell* ncell = grid.grid.GetCell(_x, _y-l, nlink) ; if (scell) ncell->SetSouthLmk(0) ; else nceU->Cle_-rScu1______-r_ (); ncell->ClearSouth() ; ) grid.currentProcess.x = _x; grid.currentProcess.y « scell ? _y : _y-l; if (_setcurrent) gπd.SetCurrent(_x, scell ? _y : _y-l); grid.RenderProcessBox(_x, _y-l) ; return; 1 else if (_cell->CheckSouthLιnk() 44 _cell->IsOb 3 ectιve() ) ( // 8 grid.CurrentType - ctNone; grid. rid.DeleteCell (_x, _y, _cell); // just remove empty LWGridCell* scell = grid.grid.GetCell |_x, _y+l, slink); // get empty's parent grid.grid.FreeGridCell(_cell) ; scell->ClearNorthLink() ; scell->ClearNorth() ; grid.currentProcess.x = _x; grid.currentProcess.y = _y+l; if (_setcurrent) grid.SetCurrent(_x, _y+l); return; ) ) LWGridMovement : -. ShiftCellsUp dnt _x, int _y, LWGridCell* _cell ) ( // Move the cells from (_x, y+1) onwards up one position LWGridCell* current - _cell; BOOL first = TRUE; int sth = current->South() ; for (;;) ( LWGridCell* below; if (current->CheckSouthLιnk( ) ) below = grid. rid.GetCell(_x, _y+l, sth) ; else break; grid.grid.DeleteCell(_>:, _y+l, below); grid.grid.IncSurrounding(_x, _y); grid.grid.AddCell (_κ, _y, below); sth = below->South( ) ; if (below->CheckSouthLιnk() ) below->SetSouthLιnk(-l) ; if (f_rst == FALSE) below->SeLNorthLink(0) ; //else it ( 'below->CheckNorthLιnk( ) ) // below->ClearNorth() ; grιd.RenderProcessBox(_x, _y) ; current = below; first = FALSE; _y++; ) ) void LWGridMovement: :S!ιιfLCellsLef (int r., int _y, LWGridCell* _cell, int _level) ( // Move the cells from (_x-l, y) leftwards one position LWGridCell* current; if (_cell) current = grid.grid.GetCell (_x-l, _y, _cell->East( ) ) ; else current = grid.grid.GetCell(_x-l, _y, _level); BOOL first = TRUE; while (current) ( grid.grid.DeleteCell (_x-l, _y, current); grid. rid. IncSurroundιng(_x, _y) ; __ grid.grid.AddCell(_x, _y, current); LWGridCell* below = 0; if (current->checkSouthLιnk( ) ) ( below = grid.grid.GetCell(_x-l, _y+l, current->South( ) ) ; current->SetSouthLιnk(-1) ; ) if (first == FALSE) current->SetNorthL nk(0) ; grιd.RenderProcessBox(_x, _y); current -» below; first = FALSE; _y++; ) ) void LWGridMovement: :ShιftCellsRιght( t _x, int _y, LWGridCell* _cell, int _levell ( // Move the cells from (_x+l, y) rightwards one position LWGridCell* current; if (_cell) current = grid.grid.GetCell(_x+l, _y, _cell->WestI) ) ; else current = grid.grid.GetCell(_x+l, _y, _level); BOOL first = TRUE; while (current) ( grid. r d.DeleteCell(_x+l, _y, current); grid.grid. IncSurrounding(_x, _yI ; grid.grid.AddCell (_x, _y, current).- LWGridCell* below = 0; if (current->CheckSouthLιnk() ) below __ grid.grid.GetCell (_x+1, _y+l, αιrren1_->__out_h()); current->SetSouthLιnk(-l) ; I if (first == FALSE) current->SetNorthLink(0) ; grid.RenderProcessBox(_x, _y) ; current = below; first ■* FALSE; // mt WGr j rlMovement : : DropProcess ( int _sx, int _sy, LWGr idCell * _ .ccl l , ι nU4 _d/., int i _αy, CurrentType _dt ) I ,'/ V.e can assume that the source and destination locations are within // t e same How/Why chain. If not, then something has screwed up and this // cannot be expected to work. grld.r.LopEdirs I ) ; i f G t ro destination I.WGπdCelJ • dest « ■ grid.grid.GetCell(_dx, _dy) ; MType* parent = 0; Process* current -* 0; MNwk* next = 0; MNwk* prior = 0; int gmode = dest->GetMode( ) ; mt insflag = 0; int ob 3 col = 0; if (_dt *== ctAbove) next = dest->getProcess( ) .Rel; else I if (dest->CheckSouthLιnk() ) I_W__r__c ____C___e_______l!** below = grid.grid.GetCell ( dx, dy+1, dest_->Sout ()); iff ((below) — — next = below->getProcess ( ) .Rel; ) ) f (_dt == ctVConnector) prior = dest->getProcess I) .Rel; else ( f (dest->CheckNorthLink() I ( LWGridCell* above = grid.grid.GetCell (_dx, _dy-l, dest->NorthI ) ) ; if (above) prior = above->qetProcess ( ) .Rel; I ) if (dest->IsOb 3 ectιve( ) ) ob 3 col = 1; else ll; == grtiHow ? grid.grid.LocateHowParent(_dx, _dy, dest, px, py, pcell, pd) : grid.grid.LocateWhyParent(_dx, _dy, dest, px, py, pcell, pd) ; if (pcell) parent = pcell->getProcessI) .Proc; ) if (_dt == ctHConnector) insflag = 1; MType* sourcepareπt = U; MNwk* sourcechild = 0; I int px, py, pd; LWGridCell* pcell; _scell->GetMode ( ) =- gmHow ? grid.grid. ocateHowParent(_sx, _sy, _scell, px, py, pcell, pdl : grid.grid.LocateWhyParent(_sx, _sy, _scell, px, py, pcell, pd); if (pcell) sourceparent = pcell->qetProcess ( ) .Proc; ) sourcechild = _*_cell->getProcess ( ) .Rel; int rι " j = πd.database-XJpd errocess(parent, current, prior, next, gmode, insflag, ob 3 col, sourceparent, sourcechild) ; if (res == 0) ( // if it worked, then we need to update the grid to show it... llancilι.-ΛpresI_ropl_:.κ, _sy, _scell, _dx, _dy, _dt) ; I *_lse SUBSTITUTE SHEH (RULE 26) ( grid.DatabaseError (res); ) return 0; ) void LWGridMovement: :HandleApresDrop(int _sx, int _sy, LWGridCell* _scell, int _dx, int _dy, CurrentType _dt) ( LWGridCell* dcell = grid.grid.GetCell(_dx, _dy) ; if (dcell == 0) grιd.ResetToOb 3 ectιves ( ) ; if (dcell->GetMode() == gmHow) I if (_sx >» _dx 44 _dt != ctHConnector) ( HandleVerticalMove(_dx, _dy, _dt, dcell, _sy); ) else if (_sx <= _dx) I HandleLeftMove(_dx, _dy, _dt, dcell, _sx, _sy, _scell) ; 1 I else ( if (_sx <= _dx 44 _dt '= ctHConnector) I HandleVerticalMove(_dx, _dy, _dt, dcell, _sy) ; ) else if (_sx >= _dx) I HandleRightMove(_dx, _dy, _dt, dcell, _sx, _sy, _scell); . ) ) void LWGridMovement : -. HandleVerticalMove (int _dx, mt _dy, CurrentType _dt, LV.'GridCell* dcell, int _sy) < int px, py, pd; LWGridCell* pcell; int mode » dcell->GetMode( ) ; mode == gmHow ? grid.grid.LocateHowParent(_dx, _dy, dcell, px, py, pcell, pd) : grid.grid. ocateWhyParent(_dx, _dy, dcell, px, py, pcell, pd); if (pcell) ( grid.LoseCurrent( ) ; grid.grid.RemoveChildren(px, py, pcell, (pcell--*GetMode I ) — σmHowi ? TRt'ϊ. : FALSE); grid.GenerateChildrenlpx, py, pcell); grid.RenderProcessBox (px, py, pcell); if (_dt == ctVConnector) grid.SetCurrent(_dx, _sy < _dy ? _dy : _dy+l); else if (_dt == ctAbove) grid.SetCurren (_dx, _dy) ; else if (_dt == ctHConnector) if (mode «== gmHow) qπd.SetCurrent(_dx+l, _sy < _dy ? _dy : _dy+l); else grid.SetCurrent(_dx-l , _sy < _dy ? _dy : _dy+l); 1 else gπd.Rese ToOb 3 ectιves ( ) ; ) void LWGridMovement: :HandleLettMove I int _dκ, mt _dy, CurrentType _ot, LWGrιαCι'11* dcell, int _sx, int _sy, LWGridCell* _scell) I CStack MNwfc"> relStack; grid. oseCurren (FALSE) ; relStack.push(dcell ->getProcess ( ) .Rel) ; // Move back up this process's chain until we hit the riqht ost process. // Push parent Rels onto the stack as we qo so wf- can get back to // the dx,dy later on. if ιcell->CheckNorthLιnk ( ) ) ( y— ,* dep = cell->North ( ) ; cell = grid. qrid. GetCelKx, y, dep) ; ) else if (cell->Chec)_EastLιnk ( ) ) ( dep - ce__l->East( ) , cell = grid.grid.GetCell(x, y, dep); relStack.push(cell->getProcess( ) .Rel) ; I else break; 1 if (cell ii cell->HasChιldren() ) ( grid. rid.RemoveChιldren(x. y, cell, cell->GetMode( ) == gmHow ? TRUE FALSE) ; // Rebuild the children and wander back down to the destination // cell... grid.SetCurrentlx, y, dep); relStack. op(); while (relStack) I X++; if (cell->CheckWestLιnk()) ( dep = cell->West(); cell = grid.grid.GetCell (x, y, dep); MNwk* target = relStack.pop() ; while (cell->getProcess() .Rel '= target) I f (cell->CheckSouthLιnk() ) ( y++; dep - cell->South ( ) ; cell = grid. qrid.GetCelKx, y, dep) ; 1 else break; I if (cell->getProcess ( ) . Rel ~ target) grid.SetCurrent(x, y, dep, ctProcess, FALSE); ) else break,* ) void LWGridMovement: :HandleRιghtMove(mt _dx, int _dy, CurrentType _dt, LWGridCell* dcell, int _sx, int _sy, LWGridCell* _scell) ( CStack<MM *> relStack; grid.LoseCurren (FALSE) ; relStack.push(dcell->getProcess () .Rel) ; // Move back up this process's chain until we hit the rightmost process. // Push parent Rels onto the stack as we go so we can get back to // the dx,dy later on. grid.grid.GetCell (x, y) ; if (cell) I for (;;) ( if (cell->CheckNorthLιnk() ) I y--; dep = cell->North(); cell = grid.grid.GetCell(x, y, dep); else if (cell->CheckWestLιnk() ) X-H-; I dep = cell-)West(); cell *• grid.grid.GetCell (x, y, dep); relstack.push!cell->getProcess() .Rel) ; ) else break; ) if (cell 44 cell->HasChιldren() ) ( grid. rid.RemoveChildren(x, y, cell, cell->GetMode( ) == gmHow ? TRUE : FALSE); //Rebuild the children and wander back down to the destination // cell. . . grid.SetCurrent lx, y, dep) ; relStack . op ( ) ; while (relStack) I x — ; if (cell->CheckEastLmk() ) . dep = cell->East() ; cell •» grid.grid.GetCelKx, y, dep); MNwk* target = relStack.pop() ; while (cell->getProcess ( ) .Rel '= target) ( if (cell->CheckSouthLιnk( ) ) I y++; dep = cell->South( ) ; cell = grid.grid.GetCelKx, y, dep); 1 else break; ) if (cell->getProcess( ) -Rel == target) grid.SetCurrentlx, y, dep, ctProcess, FALSE); ) else brea ; APPENDIX B 55 // SSource: D:\logιcal\code\dbase/RCS/LWDBASE.CPP,v S // SRevision: 1.13 S // SDate: 1993/09/24 14:57:04 S // // (C) 1993 by LOGICAL WATER // Source file for LWRELATION Functions // LWBASE Functions // LWVERB Functions // LWOBJECT Functions note: In this CLASS, 'Type 1 refers to 'Object' // Date last updated : 17/08/93 within the ER model // Notes : #mclude "lwdb.h" //LWRELATION CLASS FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\ LWRelation: :LWRelatιon( ) //MType Category = 1 for 2nd Ord Rela ions ( // 4 for 1st Ord Relations RelFlag = 0; int LWRelation: :GetlOrd(MType* Rell) I MNwk *MNRecl; if (Rell->Category '= 4) ( return -1; ) MNRecl = Rell->PTA[0]; RetRell.Rel - Rell; //Put pased 1st ord as parent. RetRell.Parent = MNRecl->PTypeU) ,* //Put 1st ord 1st TA child Type RetRell.Child •= MNRecl->PNext(0]->PType(l] ; //Put 1st ord 2nd TA child Type return 0; I MType* LWRelation: :GetlOrd(αnt VersNo, long int TypeKey) I return PLWTp->GetType(4, VersNo, TypeKey); int LWRelation: -.GetlOrd(MType* TAlst, MType* TA2nd) ( MNwk *MNRecl - TAlst->PTAf1] ; while (MNRecl '= NULL) f if (MNRecl->PNext(0) '= NULL 44 MNRecl->PNext(0)->PType[l * == TA2nd 44 MNRecl->PType(0)->Category •== 4) 1 break; I MNRecl = MNRecl->PNext(l); ) if (MNRecl == NULL) ( return -1; ) RetRell.Rel - MNRecl->PType[0) ; //Put TA parent type as parent RetRell.Parent = MNRecl->PType(1) ; //Put 1st ord 1st TA child Type RetRell.Child = MNRecl->PNext(0]->PType[l] ; //Put 1st ord 2nd TA child Type return 0; I int LWRelation: :GetlOrdlst(MType* Target) MType *MRecl; if (Target->PTA[11 NULL) I MRecl = Target->PTA(U->PType(0] ; 1 else I return -1; I f (MRecl->Category '= 4) I return GetlOrdDir (Target, MRecl, 0); RetRell.Rel = MRecl; RetRell. arent = RetRell .Rel->PTA[0!->PType[11 ; RetRell.Child - RetRell .Rel->PTA(OJ->PNext(0)->PType(l] ; return 0; ) int LWRelation: :GetlOrdDιr (MType* Target, MType* DirChRel, int Dir) 1 MNwk *MNRecl = NULL; MType "MRecl = DirChRel; while (MRecl '= NULL) ( if (MRecl->PTA[0) '= NULL) ( if (MRecl->PTA[0)->PType[l) == Target) I f (Dir *-= NEXT) I MNRecl = MRecl->FTA(0)->PNext(ll; else ( MNRecl = MRecl->PTA[0]->PPnor[1] ; ) ) if <MRecl->PTA.O)->PNext(0] '= NULL 44 MRecl->PTA(0)->PNext[0)->PType(l) — Target) I if (Dir == NEXT) ( MNRecl = MRecl->PTA[0)->PNext(0)->PNext(l]; 1 else ( MNRecl ■=- MRecl->PTA(0)->PNext(0]->PPπor(l); ) ) ) if (MNRecl == NULL) ( return -1; ) if (MNRecl->PType[0] -.-Category == 4) ( break; ) MRecl = MNRecl->PType(0] ; MNRecl » NULL; I RetRell.Rel = MNRecl->PTyperθ] ; RetRell.Parent = RetRell.Rel->PTAI0)->PType[l); RetRell.Child = RetRell.Rel->PTA[0)->PNext[01 ->PTypelll ; return 0; ) MType" LWRelation: :AddIOrd(MType* TAlst, MType" TA2nd, MType 'PriorTAC, MType *NextTA2, t Mode) ( MType *MRecl; MNwk *MNRecl, *MNRec2 = NULL; if (RelFlag '= 0) ( return 0; ) MRecl = PLWTp->AddTypetO, 4); //Create 1st Order Relation if (PLWTp->IsTypeError I ) ) //(Category 4) ( RelFlag = 2; return NULL; ) MNRecl = PLWTA->AddNw) » (MRecl, TAlst, NULL, NULL);//Add a TA record with parent of if (PLWTA->lsNwkError I i ) //new Type, child ot TAlst and no I //prior position for parent or ch Id PLWTp- DelType(NULL, NULL, NULL, MRecl); //Type RelFlag = 3; //If error delete created Type, .I'L return NULL; //flag and return I If (Mode '=• -1) //If How or Why rocc-s-i P.-] - 1 //For How Get last rel [or TA/nd tor MNRec2 = TA2nd->PTA(1J ; //prior in relationship while (MNRec2 '= NULL 44 MNRec2->PNexti 1) '= NULL) //For Why Gt-t rπl that m_il.cl.c-. I //prior/next ii either paraπu-t ,-r i *. -.e if (Mode = • = WHY 44 MNRec2->PType[0i->PTA(ll->PType(i. ] -= PriorTAZI I break; ) if (Mode -- WHY 44 MNRec2->PType(0)->PTA|ll->PTypel0] == NextTA2) I MNRec2 = MHRec2- j-pprjor[1) ; break; I MNI'e i " MNRec.'-^PNeκtl 1 ) ; PLWTA->AddNwk<MRecl, TA2nd, MNRecl, MNRec2); //Add an TA record with parent of new i (PLWTA-MsNwkError I ) ) //Type, child of TA2nd and prior ! //parent of previously created TA and PLWTp->DelType(NULL, NULL, NULL, MRecl); //no previous child PLWTA->DelNwk(NULL, MNRecl); //If error delete created Type and RelFlag = 3; //first created TA, set flag and return NULL; //return I return MRecl; J int LWRelation: -.DellOrd(MType* RelType) I if (RelFlag != 0) ( return -1; ) if (RelType->Category != 4) //If the target Type is not a 1st { //order relation set error flag and RelFlag - ■* ; //return return -1; ) PLWTA->DelNwk(NULL, RelType->PTA(0] ->PNext|0] ); //Delete the 2 TA records 4 Type record PLWTA->DelNwk(NULL, RelType->PTA[0] ) ; //(Note check for special case 10R for PLWTp->DelType(NULL, NULL, NULL, RelType) ; return 0; MType* LWRelation: :Get20rd(mt VersNo, long int Typek'e ( return PLWTp->GetType (1, VersNo, TypeKey); MType* LWRelation: :Get20rd(int VersNo, MType* Verb, MType* Ob 3 )//Gets a 20R for the ( //requested Verb, Ob 3 ect and VersNo WorfcStack = new CS a <MNwk*>; //Create work stack MType 'MRecl, *MRec2 = NULL; MNwk *MTI1; if |Verb->PTI[0] != NULL) 1 WorkStack->push (Verb->PTI (01 ) ; //Push Verb first TI onto stack ) while ( 'WorkStack- * *ιsEmpty( ) ) //Loop while stack not empty ( MTU = WorkStack->pop(); //Pop from stack and check 20R MRecl = MTIl->PType[l. ; //object for match with param object If (MRecl->PTA(0) != NULL //If match set NRec2 and break Si MRecl->VersNo == VersNo 44 MRecl->PTA|0]->PType(l]->PTAlO" '= NULL 44 MRecl->PTA(0]->PType(l]->PTA(0]->PTypell == 0b 3 ) ( MRec2 = MRecl; break; ) if (MTIl->PNext[0) '= NULL) //If popped TI lias a next push ( //onto stack WorkStack->push(MTIl->PNext(0) ) ; I If (MTIl->PType(l]->PTI[0J ' = NULL) //If popped TI's Child Type has ( //a child TI push onto stack Workstack->push(MTIl->PType(l)->PTIfι.) ). ) delete WorkStack; //Delete wor>- stack return MRec2; 1 mL LWRelation: :Get20rdDιr(MType* Rel:., MNwk l.irTΛ, int ModR, int Dir) I //Got IJ.-.'t oorr pprr_ioorr,, HHOOWW oorr WHY relation de); //after/beiore irTA, for 20R Rel2 //Mode ', Model must be 0 « 1 or 1 4 0 MTA1 = Rel2->PTA(Model ; //Dependant upon Dir and whether DirTA ! //has rf valu<_, set MTA1 to either the c-lst- I f 1 s t TΛ tor the relation or the TA I //Ix-fore / after DirTA il (Uir --= NEXT) MTΛ1 I.trTA-X'NextlMode) ; ) MTAl DιrTA->PPrιor(Mode) , I 1 if (MTAl == NULL //Check for valid relationships (see I) MTAl->PType(Model) == NULL //directly below for explanation! II MTAl->PType[Model]->PTA(Mode) == NULL I I (Mode =- 0 44 MTAl->PTypelModell->PTAIMode]- * >PNext(Mode] == NULL)) return -1; I if (Mode == 0) //Set Type variable to TA-Ctuld Type- { //Parent TA-Next Parent TA-Child Type MRecl = MTAl->PType(l]->PTA(0)->PNext(0]->PTypeU);//ιf mode 0 ) else I MRecl = MTAl->PType[0]->PTA(l]->PType(0] //Set Type variable to TA-Parent Type- I //Child TA-Parent Type if mode 1 if (Mode == 0 44 MRecl == NULL) //If Mode 0 (HOW) and MRecl == null 1 //then it is 2θRs 1st "empty" relation return -1; RetRel2.RelTA = MTAl; //Set return relationship to new current if (MRecl->Category ' II //If type not a 2nd Ord Rei set verb to //null set RelChild to MRecl (1st Ord RetRel2.Verb = NULL; //Rel or Object) RetRel2.RelChιld = MRecl, else I MTU = MRecl-.»PTI[l) ; //Otherwise loop 'up' TI r.ierarcπy unt while (MTIl->PType [0] -"-Category •*■ //verb found & put into verb _ set ( //RelChild to 2nd Ord Rel MTU = MTIl->PType{0)->PTItl); ) RetRel2.Verb *■ MTIl->PType[0] ; RetRel2. elChild = MRecl; 1 return 0; I MType* LWRelation: :Get20rdHWParent(MNwk* ProcTA, int Mode) ( return ProcTA->PType(Mode) ; ) MType* LWRelation: :Get20rdSubDιr (MType* Rel2, MNwk* DirTI, int Dir) I MNwk *MTI1; //Dir = 0 for next, 1 for _π : If (DirTI == NULL) I MTI1 = Rel2->PTI[0] //Dependant upon Dir ana - • netht.r DirTI ) //has a value, set MTI1 _. either the else //lst TI for the relatior. or the Tl ( //before / after DirTI If (Dir == NEXT) ( MTI1 DirTI->PNext(0) ; ) else ( MTI1 = DιrTI->PPrjor|.j) ) I if (MTI1 '= NULL) / return MTT_ ->PType I I ) , ) return NULL; ) 1 MType* LWRelation..(,<.•L2Urd hι Id'.(Re) (MNwl • Ir-lcliild, jnL Mode) i // rf How mode check that relationship s not empty first if (Mode == 0) ( if (RelClι ld->PType[J)->PTA[0)->PNext(0) == NULL) ( return NULL; ) return RelChιld->PType11) ->PTA[0)->PNext(0) ->PType(1) ; ) if (Mode == 1) I return RelChιld->PType(0]->PTA(l|->PTypef01 ; ) return NULL; ) MType* LWRelation: :Add 2 Ord(int VersNo, MType* Verb, MType* Ob j ) ( MType *MRecl, *MRec2; if (RelFlag • •> 0) ( return NULL; I MRecl - PLWTp->AddType(VersNo, 1); //Create 2nd ord relation type lf (PLWTp->IsTypeError() ) //If error set flag and return I RelFlag = 6; return NULL; MRec2 = AddlOrd(Ob-), NULL, NULL, NULL, -1); //Create a 1st ord rel type for if (RelFlag '= 0) //parameter object. If error del ( //2nd ord rel and return null PLWTp->DelTypelNULL, NULL, NULL, MRecl); return NULL; PLWTA->AddNw (MRecl, MRec2, NULL, NULL), //Add new TA record for 20R and f (PLWTA->IsNwkError ( ) ) //10R RelFlag = 12; return NULL; Connect20rdToTI (Verb, Obj, MRecl); //Connect 2nd ord rel to verb in if (RelFlag '= 0) //TI structure. If error remove t //lst ord from 2nd ord and delete DelFrom20r (MRecl, MRec2->PTA[ l] ) ; //lst and 2nd ord relations and DellOrd(MRec2) ; //return null PLWTp->DelType(NULL, NULL, NULL, MRecl); return NULL; return MRec_ ; ) int LWRelation: :Del20rd(MType* Target, int VersNo, MType* Verb, //Deletes a 20R MType* Obj, int ForceFlag) //and its lORs and any associated I //lORs for 20Rs it participates in MType *MRecl; MNwk "MNRecl, *MNRec.?, * if (RflFlan '= 0) ( return -1; ) if ITarαet ' '= NULL) I MRecl = Target; I else ( f ((MRecl Get20rd(VersNo, Verb, Obj)) == NULL) I return -1; If (HasΞubs (MRecl) //If the target 2nd ord has sub /-._ ForceFlag == 0) //relations (in TI structure) and ( //for e lag is not set set flag RcJFJ.!_ι - I; //and return -J; r i-1 ur11 - 1 ; I nι»120rdTI (MRecl , NULL, NULL, NULL); //Delete TI connection for target if (I'-.-JI -aq '= 0) { return -1; | //If error return -1 MNI.c-'.-l - MRec_->PTA10) ; while (MNRPCJ '= NULL) //Loop around 2nd ord relation TA ( //set deleting its lORs t Nwk records Dcllυrd(M7.R cJ-:-PType(l) ) ; //Delete the 10R if (RelFLag '- 0) ( return -1; ) //If error return -1 MNRC-C2 - MNRecl; MNRecl - MNRecl -->PNext[01 ; I'LWTΛ- ' lK'lNw. (NULL, MNRer.2) ; //Delete the lOR/ZOR Nwk record l I (!'l,_ITΛ-^l*.NWkl.rror () ) //in target TA set ( //If error set flag and return return -1 ; MNRecl = MRecl->PTA(1 J; while (MNRecl '= NULL) '/Loop around ?ORs where MRecl ( //participates and remove MRecl Get20rdDιr (MRecl, NULL, 1, 0) , //from them f (RetRel2.RelChild '= NULL) DelFrom20rd(RetRel2.RelChild, RetRel2.RelTA->PType(0| ->PTA(1] I ; if (RelFlag '« 0) { return -1; I ) MNRecl = MRecl->PTA[l); I PLWTp->DelType(NULL, NULL, NULL, MRecl); //Delete the 2nd ord rel. if error if (PLWTp->IsTypeError () ) //set error flag and return -1 ( RelFlag = 8; return -1; ) return 0; ) MNwk* LWRelation: :AddTo20r (MType* Target, MType* Obj, MNwk* Prior, MNwk* Next, MType* NewRel, int Mode) I MType *MRecl, *MRec2 = NULL, *MRec3 = NULL; MNwk *MNRecl = NULL; if (RelFlag •= 0) I return NULL; ) if (Next '= NULL) I MRec2 = Get20rdChιldOfRel (Next, Mode); I if (Prior != NULL) ( MRec3 = Get20rdChιldOfRel ( Prior, Mode); ] MRecl = AddlOrdlOb , NewRel, MRec2, MRec3, Mode) ; //Create a lst ord between the if (RelFlag '.= 0) ( return NULL; 1 //target 20R Object and the Child 20R if <IsEmpty20r (Target) ) //If the tarσet 2nd ord does not . //have relations then delete the DellOrd (RetRell . el) ; //'dummy' relation with Ob + null if (RelFlag '= 0) ( return NULL; ) //in it PLWTA->DelNwk(NULL, Target->PTA[0] ) ; if (PLWTA->IsNwkError() ) I RelFlag = 11; return NULL; I ) if (Mode -» HOW //If the prior or next, type parameter 44 Prior != NULL I I Next ' *= NULL) //is not null and is HOW mode find I //the TA record for the prior or next MNRecl = Target->PTA[Model ; while (MNRecl '= NULL) ( f (Prior '- NULL 44 MNRecl == Prior) I break; ) if (Next '= NULL 44 MNRecl == Next) MNRecl MNP.ecl->PPπor (Mode ) ; break; MNRecl = MNRecl->PNext(Mode) ; I 1 if (Mode == WHY) ( NNPecl ' T,ιrσet-,-rTA[01 : while IMNReci ' - HULL (.4 MNRe l - PNe.:t [OJ '- NU L) I MNRecl •= MNRecl->PNeκt[0) ; I I MNRecl = PLWTA->AddNwk(Targ.-l, MRecl, MNRecl, N LLl ; //Add rι.-w TΛ r coπl lor tarαc-t ll (PLWTA->IsNwkError () ) ,ιπ^j pas?><-r> n.-wri-) <ι I correct ( , / (MNRecl ) pos t n RelFlag = 12; return NULL; return MNRecl; m l LW c J d l i on : : I ■■ ■ ) From;.'Ord ( MType * Ta ro- - t , MNwl * . ■ ■• I FeJ l MType 'MRecl, *TargetObj; MNwk *MNRecl, • if (RelFlag < = 0) | return -1; ) TargetObj = Target->PTA|0) ->PType]l) ->PTA[0]->PType[1] MNRecl = Target->PTA[0); while (MNRecl <= NULL) //Get to DelRel TA position I //in Target TA set if (MNRecl == DelRel) ( break; ) MNRecl MNRecl->PNextI01 1 if (MNRecl == NULL) //If DelRel not found m set I //set flag and return RelFlag = 13; return -1; I DellOrd(MNRecl->PType[l) ); //Delete the 10R if (RelFlag '= 0) ( return -1; //If error return -1 PLWTA->DelNwk(NULL, MNRecl); //Delete the Delrel relationship if (PLWTA->IsNwkError () ) //in target TA set I //If error set flag and return RelFlag = 14, * return -1; ) if (Target-. * *PTA[0) NULL) //If target 2nd ord no longer has TAs; I MRecl = AddlOrdfTargetObj, NULL, NULL, NULL, -1) .-//Create a lst ord rel type for if (RelFlag '= 0) //parameter object. If error ( //return return -1; I PLWTA->AddNw (Target, MRecl, NULL, NULL) ; //Add lst ord rel to 2nd ord if (PLWTA->IsNwkError( ) ) //rel. If error delete lst ord ( //rel and return null RelFlaα = 15; DellOrd(MRecl) ; PLWTp->DelType(NULL, NULL, NULL, MRecl); return -1; I I return 0; ) void LWRelation: :Connect20rdToTI (MType* Verb, MType* Target, MType* New20rd) I MNwk *MTI1, *MTI2 = NULL, *MTI3 = NULL; MType "MRecl; if (RelFlaσ '- 0) ( return; I MTI1 = Verb->PTIfOJ; while (MTU '= NULL) //Walk the TI set for the verb ( //lookinq for a parent or child MRecl = MTIl->PType[l)->PTA{0 * ->PType[l] ->PTAI0)->PType[l); if (PLWObj->IsChιldOb (MRecl, Target)) //of the target object (Object ( //function IsCh dlObj is called MTI2 = MTU; //to do the comparison in the MTI1 = MTIl->PType(l)->PTI[0); //Object TA structures). If a continue; //parent of the target is found ) //store in variable and go down if (PLW0bj->IsChιldObj (Target, MRecl)) //one level in loop to the //'parents' children. If a child MTI3 = MTU; //is found break out of loop. break; //If at end of verb set end loop MTU MTIl-->PNeκt(01; f (MTI2 -- NULL) //If no parents found set parent I //variable to verb MRecl = Verb; 1 el *. I MP-.cl = MTI2->PType(U; I Pl.WTI->AddNwk(MRecl, New20rd, NULL, NULL) ; //Ad new TI with parent variable if IPLWTI->IsNwkError() ) //as parent and new 2ord as child I //If error set flag and return -l. * ]_n, - 5; rut urn; (MTI? NULL //Loop around child level and for 44 PLWOb ->IsChιldObj (Target, MTI3->PType [ 1 ] ) ) //each child ; - ( //delete the childs current TI rec MRecl - MTI3->PType(l ) ; //with its currewnt parent. If error PLWTI->DelNwk(NULL, MTI3); //set flag and return if (PLWTI->IsNwkErrorl ) ) { RelFlag = 5; return; PLWTI->AddNwk(New20rd, MRecl, NULL, NULLI ; //Add a new TI record with new 2ord if (PLWTI->IsNwkError() ) /fas parent and child as child ( //if error set error flaα RelFlag = 5; ) MTI3 = MTI3->PNext[0); ) t LWRelation: :Del20rdTI (MType* Tarqet, mt VersNo, MType" Verb, MType* Obj) I MType *MRecl, *MRec2, *MRec3; MNwk *MNRecl, *MNRec2; if (RelFlag \= 0) ( return -1; ) if (Target != NULL) MRecl = Target; I else I if ((MRecl = Get20rd (VersNo, Verb, Obj) ) NULL) I return -1; I MNRecl - MRecl->PTI(0); MNRec2 = MRecl->PTI[1], • MRec2 = MRecl->PTI [1J ->PTvpe[0] while (MNRecl != NULL) //Loop round Tarqet TI set (lst I //level children) and disconnect MRec3 = MNRecl->PType[l); //each child from target and connect PLWTI->DelNwk(NULL, MNRecl); //to targets parent by deleting and if (PLWTI->IsNwkError() ) //and creating TI records. If an error < //on any disconnection or connection RelFlag = 9; //set error flag and return return -1; PLWTI->AddNwk(MRec2, MRec3, NULL, NULL); if (PLWTI->IsNwkError ( ) ) I RelFlag = 10; return -1; ) MNRecl = MRecl->PTI|0) ; I PLWTI->DelNwk(NULL, MNRec2) ; //Deict≤ the TI connection between f (PLWTI->IsNwkError () ) //targets parent ano target. II error I //set flag and return RelFlag = 10; return -1; ) return 0; 1 long int LWRelation: : I≤ManyRel (MType* PType) I long int l = 0; MNwk "MNRecl ' PType -.-I'TΛI 1 ) ; while (MNRecl ' = NULL) //W.il • i In- ■ hi Id •* ,. ' |.-r In- I JΠII- I I //Tyr-*"- urn l l .-ικi, ■. Kt i no i. -i loπo l += 1; //integer count. ; .Luin J IKJ uteqer MNRecl = MNRecl->PNeκt. ( 1 ) ; //count 1 return 1; BOOL LWRelation: : I_.Empty..Ord(MType* Target) I if (Tarqet->PTA|0| -- NULL) //I I 2nd Ord has no Λs t.hι-ιι it. \ //bei q created Jiid l. i'i ι.- 1 on- I: return FALSE; //s'-tun wi h nul l - In Id ι.etlOrd(Targr.-t->PTAfιι| - -PTypι*| 1 I f <;-.{. !_; • _ ord lor _nd oro I. -it TΛ i l (I-'*.tl'.--_ .Child - - NUl.l.i .'.' 1 ,* -.-iil.l -it I ..I or-j : -. riu I I ' !:■ ■ //is empty, setup 2nd ord and return return TRUE; //true, otherwise return false I return FALSE; void LWRelation: :ResetRelFlag( ) I RelFlag = 0; //Reset the Relation error flag plus PLWTp->ResetFlag( I ; //all other flags potentially effected PLWTA->ResetFlag( ) : //by this class PLWTI->ResetFlag( ) ; // SSource: D:Mogical\code\dbase/RCS/LWDBASE.11, v S // SRevision: 1.9 S // SDate: 1993/09/21 22:58:59 $ // // (C) 1993 by LOGICAL WATER // Class definitions for Database classes ,7 LWRELATION // LWBASE / / LWVERB // LWOBJECT // Date last updated : 1T/08/93 (flfndef LWDBASE_H ♦define LWDBASE l // Classes \\ class LWRelation I private: mt RelFlag; CStack MNwk*> *Wcr.-.Stack; public: MRell RetRell; MRel2 RetRel2; LWRelation!) ; MType* GetlOrddnt VersNo, long int TypeKey); int GetlOrd(MType* Rell); mt GetlOrd(MType* TAlst, MType* TA2nd); int GetlOrdlst (MType* Target); int GetlOrdDir (MType* Target, MType" DirChRel, int Dir); MType* AddlOrd(MType* OAlst, MType* OA2nd, MType *PrιorTA2, MType *NextTA2, int Mode = -1); int DellOrd (MType* RelType); MType* Get20rd(ιnt VersNo, long int TypeKey); MType* Get20rd(ιnt VersNo, MType* Verb, MType* Ob. I ; int Get20rdDιr (MType* Rel2, MNwk* DirTA, mt Moαe, int ϋir) ; MType* Get20rdHWParent(MNwk* ProcTA, int Mode); MType* Get20rdSubDιr (MType* Rel2, MNwk' DirTI, int Dirl ; MType* Get20rdParent (MType* Pel2); MType* Get20rdChιldOtRel (MNwk* RelChild, mt Mod& < ; MType* AddϊOrddnt VersNo, MType* Verb, MType* Ob;,); int Del20rd (MType* Tarqet, int VersNo, MType* .-.rb, MType' Ob ] , int ForceFlag); MNwk* AddTo20rd (MType* Target, MType' Ob 3 , MNwk* Prior, MNwk* Next, Mrype* NewRel, t Moαe); nt DelFromZOrd (MType* Target, MNwk* DelRel); void Connect20rdToTI (MType* Verb, MType* Target, MType* New20rd); int Del20rdTI (MType* Target, int VersNo, MType* Verb, MType" Ob]); long int IsManyRel (MType* PType); BOOL IsEmpty20rd (MType* Target); void ResetRelFla ( I ; MNwk* G t20rdRel ( long int RelKey) I return PLWTA .r_et..wk(RelKey) ; I BOOL Ha-..".li --, IMTyp<--' Trfrej.-ε) I it (Tarqet - ,-1'THO] '- NULL) Ireturn TRUE; I else I return FALSE; I I; HOOL li.SublM yp.-* Target) I f (Target.- -I'TI (1] ' -- NULLI (i.rucn TRUE; I i-lse (r.-.urn IfALSE; ! I; ι ι, l J.-Rc-lError ( ι if (RelFlag ' "I I r. uπi TRUE; I el e Ireturn FALSE; I ). I;

Claims: WE CLAIM : 1. A system for creating a process structure for performing a task, the system comprising: a computing device; data storage means for storing data accessible by the computing device; means for inputting data connected with the computing device; and display means for displaying data also connected with the computing device, the computing device being arranged to receive from the user through the means for inputting data a first process definition, comprising at least one verb word and at least one object word, which process definition defines the task or a step in the task, the computing means further being arranged to require the user to input through the means for inputting data a second process definition, in response to receiving the first process definition, which is a predicted consequence of executing the first process definition. 2. The system of claim 1 in which the computing device is operable to generate a display of the process definitions on the display means, the process definitions in one of the steps of the task being arranged in a line and the lines of process definitions in a step progressing across the display means. 3. The system of claim 2 in which the progression of the steps in the task extends horizontally across the display means. 4. The system of claim 3 in which the steps progress from left to right . 5. The system of claim 1 in which the means for inputting data include a keyboard. 6. A system for creating a process structure for performing a task, the system comprising: a computing device; data storage means for storing data accessible by the computing device; means for inputting data connected with the computing device; and display means for displaying data also connected with the computing device, the computing device being arranged to receive from the user through the means for inputting data a first process definition, comprising at least one verb word and at least one object word, which process definition defines the task or a step in the task, the computing means further being arranged to require the user to input a second process definition, in response to the first process definition, which is a predicted constituent step in executing the first process definition. 7. The system of claim 6 in which the computing device is operable to generate a display of the process definitions on the display means, the process definitions in one of the steps of the task being arranged in a line and the lines of process definition in a step progressing across the display means. 8. The system of claim 7 in which the progression of the steps in the task extends horizontally across the display means . 9. The system of claim 8 in which the steps progress from right to left. 10. The system of claim 6 in which the computing device is arranged to retrieve a predetermined process definition from the data storage means, which process definition is a constituent step in executing the second process definition entered from the keyboard by the user. 11. A system for creating a process structure for performing a task, the system comprising: a computing device; data storage means for storing data accessible by the computing device; means for inputting data connected with the computing device; and display means for displaying data also connected with the computing device, the computing device being arranged to receive from the means for inputting data a first process definition, comprising at least one verb word and at least one object word, which process definition defines the task or a step in the task, the computing means further being arranged to require the user to specify particular object words falling within the meaning of the object word of the first process definition. 12. The system of claim 11 in which the computing device are responsive to a command input through the data inputting means to create a retrievable data display associated with the object words falling within the meaning of the at least one object word of the first process definition. 13. The system of claim 12 in which the data display is in tabular form, the computing device being arranged to overwrite the process definitions on the display means with the data display in response to a command from the data inputting means . 14. A system for modelling a process structure for performing a task, the system comprising: computing means; data storage means accessible by the computing means; means for inputting data connected with the computing means; and display means also connected with the computing means for displaying prompts and data inputted through the inputting means and from the computing means, the computing means being arranged selectively to display on the display means at prompt for a first process definition requiring at least one verb word and at least one object word and put through the data inputting means by a user, and to require the user to select a further input prompt from the computing requiring the user to input a second process definition which is a predicted consequence of executing the first process definition or which is a predicted constituent step in executing the first process definition to create a series of stages in the task process structure or to require the user to specify a particular object word or words which fall within the meaning of the object of the first process definition, the computing means further being operable to generate a retrievable tabular data display associated with one process at one stage, in which the object word or words of the constituent process definition in the stages before the said one process definition are arranged as column headings and specific objects of the said one process definition arranged as row headings. 15. A method of creating a process structure on computer for performing a task, the method comprising: inputting a first process definition, comprising at least one verb word and at least one object word, which process definition defines the task or a step in the task; and requiring the user to input a second process definition which is a predicted consequence of executing the first process definition. 16. The method of claim 15 including generating a display of the process definition on the display means, the process definitions in one of the steps in the task being arranged in a line and the lines of process definition in a step progressing across the display means. 17. The method of claim 16 in which the steps in the task are displayed progressing horizontally across the screen. 18. The method of claim 17 in which the steps progress from left to right. 19. A method of creating a process structure on computer for performing a task, the method comprises: inputting a first process definition, comprising at least one verb word and at least one object word, which process definition defines the task or a step in the task; and requiring the user to input a second process definition which is a predicted constituent step in executing the first process definition. 20. The method of claim 19 including generating a display of the process definition on the display .means, the process definitions in one of the steps in the task being arranged in a line and the lines of process definitions in a step progressing across the display means. 21. The method of claim 20 in which the progression of the steps in the task progress horizontally across the display means. 22. The system of claim 21 in which the steps progress from left to right. 23. The method of claim 19 including retrieving a predetermined process definition which is a constituent step in executing the first process definition entered from the keyboard by the user. 24. A method of creating a process structure on computer for performing a task, the method comprising: inputting a first process definition, comprising at least one verb word and at least one object word, which process definition defines the task of a step in the task; and requiring the user to specify particular object words, the object words being instances of the object word of the first process definition. 25. The method of claim 24 including creating a retrievable data display associated with the object words which are instances of the object word of the first process definition in response to a command input through the data inputting means. 26. The method of claim 24 in which the computing means overwrite the process definitions on the display means with the data display in tabular form in response to a command from the data inputting means.

Inventors: DAVIES TREVOR BRYAN, DAVIES, TREVOR, BRYAN
Applicants: DAVIES TREVOR BRYAN, LOGICAL WATER LIMITED, DAVIES, TREVOR, BRYAN
Application year: 1994
Main classification: G06F17
IPC codes: G06F9, G06Q10