The present invention generally relates to enterprise computer systems and methods and more particularly to systems, methods and computer program products for facilitating bulk create, update, delete (CUD) database operations for table inheritance in an enterprise resource planning system operating on a specially programmed computer server.
In today's technological environment, it is common for enterprises such as business organizations, schools, charitable organizations and government organizations to deploy private computer networks—intranets—to securely share such organization's information or network operating system within that organization. The term “intranet” is used in contrast to “internet”, which is a network between and among individuals and organizations, the most common of which is the global, public Internet. That is, an intranet is a network within an enterprise which sometimes refers only to an internal (private) website, but may be a more extensive part of the enterprise's information technology (IT) infrastructure. For example, in many enterprises, an employee may work from home and gain access to the enterprise via a portal requiring additional security hurdles such as synchronous keys for entry. An enterprise intranet may host multiple private websites and constitute an important component and focal point of internal communication with, and collaboration among, individual computer users associated/affiliated with the enterprise (e.g., students within a university, co-workers within a company, members of a governmental department or the like).
As individual computer users associated/affiliated with the enterprise perform various computer-based activities while logged into the intranet, these users may utilize enterprise resource planning (ERP) client/server systems as provided by the enterprise. One such system known as the Dynamics® AX 2009 ERP system available from Microsoft Corporation of Redmond, Wash. provides a database query server and associated application object server among other features. These are routinely accessed by a client, for example, to query the database for data contained in tables. The database may comprise a plurality of related tables of data, for example, related to everyday activities of the enterprise. A member of the enterprise may perform a query of the database for data that may be located in what are known as inheritance tables. Such tables may have a root table or a source table which may have associated tables or target tables with similar data and the like with similar data in an inheritance connection or inheritance hierarchy. For example, to perform a request, for example, to do one of create, update or delete data from one table of an inheritance table connected to a plurality of data inheritance tables having similar data, a known enterprise resource planning system may perform such operations individually and not in bulk.
In known enterprise systems, a create, update or delete data request may be processed each time a request is executed. For example, a change-based event or CUD event typically involves establishing a relationship between a plurality of identified tables and rules set up by users in an EventCUD table. A program module which may be referred to as an Alerts module logs changes to all tables where users have set up rules in the EventCUD table. When the CUD event processor is invoked, it processes any CUD records found in the EventCUD table by matching them to user's rules in the EventRule table.
This process can cause degradation in performance of the ERP system as a whole. For example, in the instance of inheritance tables, similar change, update and delete operations must be run several times to create (insert), update or delete data in connected inheritance tables. The same request may be executed on the database each time the request for one of a create, an update or a delete is run. In the case of a typical enterprise structure involving a client (making a CUD request), a server and a database, making the same request may lead to expensive network calls, time and resource consumption impacting the ERP system as a whole.
Class polymorphism may be described as a feature of certain programming languages such as C++, X++ and C# among other languages whereby a derived class inherits from a base class and so gains all the properties and events of the base class. This feature is known but not presently exploited for bulk CUD operations for table inheritance. C++ is believed to be the first programming language to introduce class polymorphism. X++ is an object language known from the Dynamics AX ERP system introduced above.
Fundamentally, there is a need in the art for providing for bulk processing of create, update and delete operations for table inheritance to avoid the degradation in performance so that the bulk processing of CUD requests may result in more efficient ERP system operation. Also, table inheritance, when one table may be the parent of another table and so on, may cause repetitive requests of the same tables and the same or similar request processes may need to be performed to complete CUD operations for table inheritance. Bulk processing of table inheritance CUD requests is needed to improve efficiency.
Thus, it may be known to provide a unique single table CUD request, however, what are needed are systems, methods and computer program products for adapting existing processes for bulk CUD database operations for table inheritance using class polymorphism.
This summary is provided to introduce a selection of concepts. These concepts are further described below in the Detailed Description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is this summary intended as an aid in determining the scope of the claimed subject matter.
The present invention meets the above-identified needs by setting up a run-time request system, method and computer program product for providing for bulk create, update and delete (CUD database operations for table inheritance using class polymorphism supported by, for example, such languages as C++, X++ and C# and other object-oriented and, potentially, non-object-oriented languages.
In an embodiment, an application object server (AOS) comprises an X++ (or, for example, a C#) parser-compiler, a kernel instance (having an X++ interpreter) and a data access layer for accessing a database whereby a plurality of associated tables of table inheritance may be created (data inserted), updated and/or deleted in bulk operations. The kernel instance of the application object server further supports cursors as will be described herein. A “cursor” may represent an instance of a table in a SQL (structured query language) select statement or a table inheritance hierarchy. Herein, “insert” will be used as a term of art to incorporate any request for creation of data or insertion of data into tables, especially, inheritance tables of an inheritance table hierarchy. The application object server may also comprise a record identification generator coupled to the data access layer. The data access layer of the application object server may comprise a table permissions framework and a structured query language server data provider. These structures of the application object server provide a system architecture for supporting bulk CUD database operations for table inheritance.
In a related embodiment, table inheritance data may be inserted, updated and deleted in a bulk operation by creating a temporary table referred to herein as a temporary or scratch table for the purpose of the bulk insert, update and delete request processing. The scratch table may have properties of being able to update fields in a source table and a target table and can specify filters from a base hierarchy such as a table inheritance hierarchy seamlessly. The kernel of the AOS may split the single table inheritance X++ CUD statement into multiple structured query language (SQL) statements for each target table in a table inheritance hierarchy, for example, a hierarchal relationship among tables having similar data fields. Such a CUD X++ statement request or statement may also contain fields from base tables in a where tree. As a result, an X++ CUD statement for table inheritance may not be simply split into multiple SQL statements. An application developer writing X++ code in the Dynamics AX ERP system may write CUD X++ statements for a table inheritance hierarchy such that the filter condition (where tree) may contain fields across table inheritance. The filter condition, on the other hand, cannot guarantee return of the same result as individual update/delete operations on a target table because of the filter condition. Consequently, a two pass-operation may be performed whereby, in a first pass, the kernel, of an application object server (AOS), issues a set-based insert statement into the temporary or “scratch” table, inserts a single column with the value of a unique key or Surrogate key (also referred to herein as RecID or record identifier in the context of Dynamics AX) of all rows that meet the specified filter criteria. The kernel of the AOS then issues, for example, actual delete/update statements on target tables of the inheritance table hierarchy, i.e. into all target tables joined to the SQL temporary table on the Surrogate key.
In a related embodiment within Dynamics AX, the process involves a Surrogate Key of a root inheritance hierarchy inserted into a “scratch” table that may have the name SysSetbasedHelper or system set-based helper table and the surrogate key may have the name CandidateRecID or candidate record identifier which identify inheritance table rows that satisfy the filter criteria. The parent table may insert a candidate row's Record Identifier into the temporary or scratch table (system set-based helper table). The temporary table then deletes the candidate row's data in a Child table using table inheritance Record Identifier propagation. Now, the temporary table returns to the Parent Table to delete the candidate row's data in the Parent table using table inheritance Record Identifier propagation. The temporary table now has served its purpose of performing bulk CUD database operations for table inheritance.
Further features and advantages of the present invention, as well as the structure and operation of various embodiments of the present invention, are described in detail below with reference to the accompanying drawings.
The features and advantages of the present invention will become more apparent from the detailed description set forth below when taken in conjunction with the drawings in which like reference numbers indicate identical or functionally similar elements.
The present invention is directed to systems, methods and computer program products for facilitating bulk insert, update and delete database operations for table inheritance in an enterprise resource planning (ERP) system wherein an object-oriented language, such as X++ or C# supports polymorphism. Firstly, we will provide an overview of bulk CUD database operations for table inheritance. During the overview, hardware figures
Bulk insert, update and delete database operations for table inheritance in an enterprise resource planning (ERP) system is supported by a process described briefly as follows:
X++ supports bulk CUD operation whose syntax appears similarly to that below—
In Update, there is typically an update statement, update_record or similar statement to update a record set in a table where there is a Setting of target field to new values in accordance with a Where, that is, filters on fields from the table. With the present invention, when a target table is part of table inheritance, then, the target table may have one or more fields from different tables to Update. The “ . . . ” of the Setting list simply represents that the update request may comprise several tables, several target fields and several new values to update beyond those identified above under Update.
In Delete, there may simply be a Delete_from or related statement or request from a client that will be applied to a table in accordance with a Where filter which filters on fields from the table to delete from. For Insert, the process involves an Insert_into or related operation, typically, where a table and a plurality of target fields 1 . . . n are identified. Following the Insert_into, there is a SELECT or related process of fields 1 . . . n selecting data from a source table (sourcetable) and applying a filter according to Where which filters on fields from the source table. Altogether, Update sets a value to a new value, Delete simply deletes and Insert may insert into selected fields from a source table, all according to a Where filter criteria.
In order to not sacrifice performance for table inheritance, X++ (and C++, C# and other object oriented languages) also may support bulk CUD operations for table inheritance. In the above example, the table can be a derived table in a table inheritance hierarchy which can update fields from the same table or from the base hierarchy and can specify filters from the same table or from the base hierarchy seamlessly. Since each backend structured query language (SQL) statement allows just one target table for a CUD operation, the Microsoft Dynamics AX kernel 525 (
A simple example may illustrate the process further with reference to the table tree of
The following section describes bulk delete support for table inheritance. The update support is similar and omitted for sake of brevity. Below is a delete_from example:
delete_from DirOrganization
where DirOrganization.OrgNumber==VAL(OrgNumber) &&
DirOrganization. PartyNumber==VAL(PartyNumber)
In the above, the delete_from starts with DirOrganization table 276 of
So, a kernel 525 of an application object server will first issue an insert statement to insert a Surrogate Key of inheritance root which satisfies the filter criteria as follows:
Generated SQL Statement by a Microsoft Dynamics Ax 2012 SQL tempDB Framework:
The INSERT INTO identifies a temporary or scratch table, for example, “System Set-based helper” table for the operation and identifies Candidate Record Identifier as the surrogate key. Temporary or scratch table generation is generated randomly, that is, a name “System Set-base helper” or other name may be randomly generated. On the other hand, once generated, the temporary or scratch table name may be unique.
The SELECT process looks for record identifier and shows FROM DirPartyTable 278 (
Now, the kernel 525 may issue a delete statement for each cursor 528 from a concrete cursor to inheritance root to delete only marked records. This is achieved by specifying a join between a current table and an inheritance root on RecID while filtering only records with marked RecID (Record Identifier) from the inheritance root as shown below. A last delete statement will operate on an inheritance root table to simply remove rows with the marked RecID.
So as per the above, DELETE FROM operates on DirOrganization table 276 (
The syntax of a fictitious Insert X++ statement for BulkInsert for table inheritance is shown below
Where fictitious table1 table's definition is as below
Referring briefly again to
As indicated above, the first statement inserts candidate rows from a source table into a temporary or scratch table. The second statement inserts into derived table(s) (DirPerson 282 and DirPartyTable 278) from mapped source table fields. In SELECT for DirPerson, note that 0 as a RelationType because DirPerson 282 is the concrete table. The kernel 525 is automatically populating values for table inheritance linkage through RelationType in each of DirPerson table 282 and DirPartyTable 278. The third statement inserts into inheritance root from mapped source table fields. The kernel 525 is populating values for table inheritance linkage through RelationType 281 (DirPerson table 282) and through RelationType 281 InstanceRelationsType 279 (DirParty table 278). The kernel 525 Update operations 200 may likewise be seen in
Referring now to
Intranet enterprise requests, queries and database system 100 includes a plurality of users 104 (shown as users 104a-d in
In various embodiments, client device 104 may be configured as a desktop 104a, a laptop 104b, a PDA 104c, a tablet or mobile computer 104d, an intelligent communications device or the like. Device 104, in order to access private network 106 may typically have to identify a user name and password, if not, enter further security information such as a secret key or fingerprint data to access network 106. In accordance with an embodiment of a method of dynamically querying or making a CUD request of an enterprise database, a user may access a database 118 by user name and password, the user name and password being utilized by any of servers 108, 110 and 112 to access an application object server 116 or application object server 116 may be obtained directly by a client for in turn structuring the query/request to database 118 as will be briefly described with reference to
As users of client devices 104 log into an organizational/enterprise intranet 106, they perform various computer-based tasks while logged into the organization/enterprise's intranet 106. All these data may be categorized into categories, for example: data and commands associated with setting up a process for inventory control or other activity involving inserting, updating and deleting data in tables joined by conditions or as objects in an inheritance table hierarchy. With reference to
Referring now to
In an alternate embodiment to
In an alternate embodiment, an intranet administrator would have access to configuration, status and data retrieval servers 118 via a web service-based application programming interface (API) (e.g., Simple Object Access Protocol (SOAP) or RESTful). In such an embodiment, the intranet administrator may enforce privacy laws and business rules based on access credentials. For example, an unprivileged user might be allowed to create, update or delete some data being accessed within intranet 106, while an authorized user (a manager or director or owner of a work queue) may transmit CUD requests for more restricted data and have additional authority for record management.
An example of a computer system 300 is shown in
Computer system 300 includes one or more processors, such as processor 304. The processor 304 may be connected to a communication infrastructure 306 (e.g., a communications bus or network). Various software aspects are described in terms of this exemplary computer system. After reading this description, it will become apparent to a person skilled in the relevant art(s) how to implement the invention using other computer systems and/or architectures. Computer system 300 may represent a client device 104 possessed by an organization/enterprise member. Computer system 300 may similarly represent a server 108, 110, 112, 114 or 116 or database 118 as introduced in
Database server 118 may be an SQL or other database server responsible for maintaining for example documents, organization charts, inventory data and the like for an enterprise. As such, as a document may be processed such as a purchase requisition, rules and parameters and conditions and the like may be retrieved by application object server 116 for use in bulk CUD database operations for table inheritance. While organization tables have been used by way of example in
Computer system 300 can include a display interface 302 that forwards graphics, text and other data from the communication infrastructure 306 (or from a frame buffer not shown) for display on the display unit 330. A display interface may be what a user sees on any one of client devices 104. A user may type or click or use other form of data or command entry to input data/commands for CUD operations to a dynamic database access system of the present invention.
Computer system 300 also includes a main memory 308, preferably random access memory (RAM) and may also include a secondary memory 310. The secondary memory 310 may include, for example, a hard disk drive 312 and/or a removable storage drive 314, representing a floppy disk drive, a magnetic tape drive, an optical disk drive, etc. The removable storage drive 314 reads from and/or writes to a removable storage unit 318 in a well known manner. Removable storage unit 318 represents a floppy disk, magnetic tape, optical disk, etc. which is read by and written to by removable storage drive 314. As will be appreciated, the removable storage unit 318 includes a computer usable storage medium having stored therein computer software and/or data.
In alternative aspects, secondary memory 310 may include other similar devices for allowing computer programs or other instructions to be loaded into computer system 300. Such devices may include, for example, a removable storage unit 322 and an interface 320. Examples of such may include a program cartridge and cartridge interface (such as that found in video game devices), a removable memory chip (such as an erasable programmable read only memory (EPROM), or programmable read only memory (PROM)) and associated socket and other removable storage units 322 and interfaces 320, which allow software and data to be transferred from the removable storage unit 322 to computer system 300.
Computer system 300 may also include a communications interface 324. Communications interface 324 allows software and data to be transferred between computer system 300 and external devices. Examples of communications interface 324 may include a modem, a network interface (such as an Ethernet card), a communications port, a Personal Computer Memory Card International Association (PCMCIA) slot and card, etc. Software and data transferred via communications interface 324 are in the form of non-transitory signals 328 that flow over communications media 122, 124, 130, 132, 140 and so on which may be electronic, electromagnetic, optical or other signals capable of being received by communications interface 324. These signals 328 are provided to communications interface 324 via a communications path (e.g., channel) 326. This channel 326 carries signals 328 and may be implemented using wire or cable, fiber optics, a telephone line, a cellular link, an radio frequency (RF) link and other communications channels as explained above.
In this document, the terms “computer program medium” and “computer usable medium” are used to generally refer to media such as removable storage drive 314, a hard disk installed in hard disk drive 312 and signals 328. These computer program products provide software to computer system 300. The invention is directed to such computer program products.
Computer programs (also referred to as computer control logic) are stored in main memory 308 and/or secondary memory 310. Computer programs may also be received via communications interface 324. Such computer programs, when executed, enable the computer system 300 to perform the features of the present invention, as discussed herein. In particular, the computer programs, when executed, enable the processor 304 to perform the features of the present invention. Accordingly, such computer programs represent controllers of the computer system 300.
In an embodiment where the invention is implemented using software, the software may be stored in a computer program product and loaded into computer system 300 using removable storage drive 314, hard drive 312 or communications interface 324. The control logic (software), when executed by the processor 304, causes the processor 304 to perform the functions of the invention as described herein.
Referring to
Referring to
Referring further to
Referring further to
As will be apparent to one skilled in the relevant art(s) after reading the description herein, the computer architectures shown in
In yet another embodiment, the invention is implemented using a combination of both hardware and software and communications media may be wireless, wired or other form of communication recognizing any need for security of data of the enterprise.
While various aspects of the present invention have been described above, it should be understood that they have been presented by way of example and not limitation. It will be apparent to persons skilled in the relevant art(s) that various changes in form and detail can be made therein without departing from the spirit and scope of the present invention. Thus, the present invention should not be limited by any of the above described exemplary aspects, but should be defined only in accordance with the following claims and their equivalents.
In addition, it should be understood that the figures in the attachments, which highlight the structure, methodology, functionality and advantages of the present invention, are presented for example purposes only. The present invention is sufficiently flexible and configurable, such that it may be implemented in ways other than that shown in the accompanying figures. For example, the systems, methods and computer program products for facilitating the querying of data of a database in an intranet environment may be also applicable to other networks such as internets.
Further, the purpose of the foregoing Abstract is to enable the U.S. Patent and Trademark Office and the public generally and especially the scientists, engineers and practitioners in the relevant art(s) who are not familiar with patent or legal terms or phraseology, to determine quickly from a cursory inspection the nature and essence of this technical disclosure. The Abstract is not intended to be limiting as to the scope of the present invention in any way.